aboutsummaryrefslogtreecommitdiff
path: root/Gem/develop
diff options
context:
space:
mode:
authorTravis CI <zmoelnig@travis-ci.umlaeute.mur.at>2015-10-08 08:03:09 +0000
committerTravis CI <zmoelnig@travis-ci.umlaeute.mur.at>2015-10-08 08:03:09 +0000
commit45fcf2c76989b901db89d1e69444e0202349d06f (patch)
tree229376a5f4b369fd6d9252a18b7241fc2b1e6a18 /Gem/develop
parent8f7b5d21bc0d71049445289d83c36fbd4dd2799a (diff)
Gem a4d9bc89797fec9b1b4f0278431e3d30315b414c linux/amd64
built 'master:a4d9bc89797fec9b1b4f0278431e3d30315b414c' for linux/amd64
Diffstat (limited to 'Gem/develop')
-rw-r--r--Gem/develop/include/Gem/Gem/ContextData.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/Gem/develop/include/Gem/Gem/ContextData.h b/Gem/develop/include/Gem/Gem/ContextData.h
index 74804da..94f51b3 100644
--- a/Gem/develop/include/Gem/Gem/ContextData.h
+++ b/Gem/develop/include/Gem/Gem/ContextData.h
@@ -53,6 +53,7 @@ template<class ContextDataType = int>
//////////
// Constructor
+ /* coverity[uninit_member] we track the un-initialization ourselves */
ContextData(void) : m_haveDefaultValue(false) {;}
ContextData(ContextDataType v) : m_haveDefaultValue(true), m_defaultValue(v) {;}
@@ -66,9 +67,9 @@ template<class ContextDataType = int>
*
* @usage ContextData<GLenum>m_fun; m_fun=GL_FUNC_ADD;
*
- * @pre We are in a draw process.
+ * @pre We have a valid context.
* @note Should only be called from the draw function.
- * Results are un-defined for other functions.
+ * Results are un-defined if there is no valid context
*/
virtual operator ContextDataType()
{
@@ -78,17 +79,19 @@ template<class ContextDataType = int>
/**
* assigns a value to the correct context
*
- * @pre We are in a draw process.
+ * @pre We have a valid context.
* @note Should only be called from the draw function.
- * Results are un-defined for other functions.
+ * Results are un-defined if there is no valid context
*/
virtual ContextDataType&operator = (ContextDataType value)
{
/* simplistic approach to handle out-of-context assignments:
* assign the value to all context instances
+ * and use it as default value for future contexts
*/
if(INVALID_CONTEXT==getCurContext()) {
doSetAll(value);
+ m_defaultValue=value; m_haveDefaultValue=true;
}
return (*getPtrToCur()=value);
@@ -120,7 +123,7 @@ template<class ContextDataType = int>
/**
* Returns a pointer to the correct data element in the current context.
*
- * @pre We are in the draw function.
+ * @pre We have a valid context.
* @post Synchronized.
* @note ASSERT: Same context is rendered by same thread each time.
*/