// Hydra: now returns false if the ORIGINAL shader could not be activated // (missing texture, or incorrect shader script), true otherwise // the shader is still activated in all cases. bool CShader::Activate(){ Try_Activate(); if ( !m_pTexture ) { m_pTexture = QERApp_Texture_ForName2( SHADER_NOTEX ); RegisterActivate(); return false; } return true; }
void CShader::Activate() { Try_Activate(); if (!m_pTexture) { // use the shadernotex.jpg //++timo TODO: detect shadernotex.jpg not found and give an error message! m_pTexture = QERApp_Texture_ForName2( "textures/radiant/shadernotex" ); RegisterActivate(); } }
void CShader::CreateColor( const char *name ){ // parse sscanf( name, "(%g %g %g)", m_vColor, m_vColor + 1, m_vColor + 2 ); m_strTextureName = name; setName( "color" ); // create the qtexture_t qtexture_t *q1 = QERApp_Texture_ForName2( SHADER_NOT_FOUND ); // copy this one qtexture_t *q2 = new qtexture_t; memcpy( q2, q1, sizeof( qtexture_t ) ); strcpy( q2->name, m_strTextureName.GetBuffer() ); VectorCopy( m_vColor, q2->color ); m_pTexture = q2; }