diff options
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Converter/BL_BlenderDataConversion.cpp | 14 | ||||
-rw-r--r-- | source/gameengine/Ketsji/BL_Material.cpp | 14 | ||||
-rw-r--r-- | source/gameengine/Ketsji/BL_Material.h | 2 |
3 files changed, 15 insertions, 15 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 07f37d5a6e2..f861b105ba3 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -613,11 +613,11 @@ static bool ConvertMaterial( material->flag[i] |= ( mat->game.alpha_blend & GEMAT_ALPHA )?USEALPHA:0; material->flag[i] |= ( mat->game.alpha_blend & GEMAT_ADD )?CALCALPHA:0; - if (material->img[i]->flag & IMA_REFLECT) + if (material->img[i]->flag & IMA_REFLECT) { material->mapping[i].mapping |= USEREFL; - else - { - mttmp = getImageFromMaterial( mat, i ); + } + else { + mttmp = getMTexFromMaterial(mat, i); if (mttmp && (mttmp->texco & TEXCO_UV)) { /* string may be "" but thats detected as empty after */ material->mapping[i].uvCoName = mttmp->uvname; @@ -634,9 +634,9 @@ static bool ConvertMaterial( continue; } - mttmp = getImageFromMaterial( mat, i ); - if ( mttmp ) { - if ( mttmp->tex ) { + mttmp = getMTexFromMaterial(mat, i); + if (mttmp) { + if (mttmp->tex) { if ( mttmp->tex->type == TEX_IMAGE ) { material->mtexname[i] = mttmp->tex->id.name; material->img[i] = mttmp->tex->ima; diff --git a/source/gameengine/Ketsji/BL_Material.cpp b/source/gameengine/Ketsji/BL_Material.cpp index 461a8c51a52..393d00223e0 100644 --- a/source/gameengine/Ketsji/BL_Material.cpp +++ b/source/gameengine/Ketsji/BL_Material.cpp @@ -10,14 +10,14 @@ #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" -MTex* getImageFromMaterial(Material *mat, int index) +MTex* getMTexFromMaterial(Material *mat, int index) { - if (!mat) return 0; - - if (!(index >=0 && index < MAX_MTEX) ) return 0; - - MTex *m = mat->mtex[index]; - return m?m:0; + if (mat && (index >= 0) && (index < MAX_MTEX)) { + return mat->mtex[index]; + } + else { + return NULL; + } } BL_Material::BL_Material() diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index 0383c0891b6..be66e2ec84d 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -174,7 +174,7 @@ enum BL_MappingProj // ------------------------------------ //extern void initBL_Material(BL_Material* mat); -extern MTex* getImageFromMaterial(Material *mat, int index); +extern MTex* getMTexFromMaterial(Material *mat, int index); // ------------------------------------ #endif |