diff options
Diffstat (limited to 'source/gameengine/Ketsji/BL_Shader.cpp')
-rw-r--r-- | source/gameengine/Ketsji/BL_Shader.cpp | 50 |
1 files changed, 17 insertions, 33 deletions
diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index f6f9a29b0e2..57d0fe4140f 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -846,8 +846,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, getFragmentProg ,"getFragmentProg( )" ) KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } if(mShader==0) { PyErr_Format(PyExc_TypeError, "invalid shader object"); @@ -877,8 +876,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()") KX_PYMETHODDEF_DOC( BL_Shader, setSampler, "setSampler(name, index)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; @@ -900,7 +898,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setSampler, "setSampler(name, index)" ) //else // spit("Invalid texture sample index: " << index); } - Py_Return; + Py_RETURN_NONE; } return NULL; } @@ -919,8 +917,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setNumberOfPasses, "setNumberOfPasses( max-pass ) KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; @@ -945,8 +942,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" ) KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; float array[2]={ 0,0 }; @@ -970,8 +966,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)") KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; float array[3]={0,0,0}; @@ -996,8 +991,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ") KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) ") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; float array[4]={0,0,0,0}; @@ -1021,8 +1015,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) " KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; int value=0; @@ -1046,8 +1039,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" ) KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; int array[2]={ 0,0 }; @@ -1071,8 +1063,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)") KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; @@ -1096,8 +1087,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ") KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) ") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; int array[4]={0,0,0, 0}; @@ -1120,8 +1110,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) " KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or list3 or list4) )") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char*uniform = ""; PyObject *listPtr =0; @@ -1190,8 +1179,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or lis KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( int (list2 or list3 or list4) )") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char*uniform = ""; PyObject *listPtr =0; @@ -1263,8 +1251,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix4, "setUniformMatrix4(uniform-name, mat-4x4, transpose(row-major=true, col-major=false)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } float matr[16] = { @@ -1306,8 +1293,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3, "setUniformMatrix3(uniform-name, list[3x3], transpose(row-major=true, col-major=false)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } float matr[9] = { @@ -1347,8 +1333,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3, KX_PYMETHODDEF_DOC( BL_Shader, setAttrib, "setAttrib(enum)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } int attr=0; if(PyArg_ParseTuple(args, "i", &attr )) { @@ -1368,8 +1353,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setAttrib, "setAttrib(enum)" ) KX_PYMETHODDEF_DOC( BL_Shader, setUniformDef, "setUniformDef(name, enum)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; |