diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2011-03-07 22:14:17 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2011-03-07 22:14:17 +0300 |
commit | c39a109dae3a704480bcb84e6a3c9f9a3d584f9f (patch) | |
tree | b9da8447c602ea32e366247631235b4f60ae3806 /source | |
parent | aa6c975fa8efcec7893d721ebbc7db6a0d5f4214 (diff) |
BGE internal cosmetic changes - Replacing hardcoded values with new defines
---------------------------------------------------------------------------
The Rasterizer code was relying in the values defined on TF_ DNA files. I'm working in the recode of TexFace, bringing the options to the material panel and ran into those cases. They are hard to spot and add a lot of the "magic" effect to the code. Hardcoded values are at least easy to spot. We (still) have a few defines duplicated, relying on each other (a flag previously defined in the code is checked later on but using a different define (although with same value. (e.g. TF_BMFONT and RAS_RENDER_3DPOLYGON_TEXT). It's hell =)
I'm adding some comments to help on that.
Things will be revamped anyways, but it's nice to keep the code a bit more coherent before the real feature commit. That's all, thanks for listening.
Diffstat (limited to 'source')
-rw-r--r-- | source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/Rasterizer/RAS_IRasterizer.h | 6 |
3 files changed, 6 insertions, 4 deletions
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index dfaf079f36f..9d0597051ad 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -172,7 +172,7 @@ void KX_PolygonMaterial::DefaultActivate(RAS_IRasterizer* rasty, TCachingInfo& c cachingInfo = GetCachingInfo(); - if ((m_drawingmode & 4)&& (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED)) + if ((m_drawingmode & RAS_IRasterizer::KX_TEX)&& (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED)) { Image *ima = (Image*)m_tface->tpage; GPU_update_image_time(ima, rasty->GetTime()); diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index e8c0a73813e..47f1dcb412a 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -241,7 +241,7 @@ bool RAS_IPolyMaterial::UsesLighting(RAS_IRasterizer *rasty) const else if(rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID); else if(rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW); else - dolights = (m_drawingmode & 16)!=0; + dolights = (m_drawingmode & RAS_IRasterizer::KX_LIGHT)!=0; return dolights; } diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index f76799953a1..305e2bca756 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -71,7 +71,7 @@ public: /** */ enum { - RAS_RENDER_3DPOLYGON_TEXT = 16384 + RAS_RENDER_3DPOLYGON_TEXT = 16384 /* TF_BMFONT */ }; /** * Drawing types @@ -106,7 +106,9 @@ public: /** */ enum { - KX_TWOSIDE = 512, + KX_TEX = 4, /* TF_TEX */ + KX_LIGHT = 16, /* TF_LIGHT */ + KX_TWOSIDE = 512, /* TF_TWOSIDE */ KX_LINES = 32768 }; |