[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35390] trunk/blender/source/gameengine: BGE internal cosmetic changes - Replacing hardcoded values with new defines
Dalai Felinto
dfelinto at gmail.com
Mon Mar 7 20:14:17 CET 2011
Revision: 35390
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35390
Author: dfelinto
Date: 2011-03-07 19:14:17 +0000 (Mon, 07 Mar 2011)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
trunk/blender/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
trunk/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h
Modified: trunk/blender/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_PolygonMaterial.cpp 2011-03-07 18:05:41 UTC (rev 35389)
+++ trunk/blender/source/gameengine/Ketsji/KX_PolygonMaterial.cpp 2011-03-07 19:14:17 UTC (rev 35390)
@@ -172,7 +172,7 @@
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());
Modified: trunk/blender/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
===================================================================
--- trunk/blender/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp 2011-03-07 18:05:41 UTC (rev 35389)
+++ trunk/blender/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp 2011-03-07 19:14:17 UTC (rev 35390)
@@ -241,7 +241,7 @@
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;
}
Modified: trunk/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h
===================================================================
--- trunk/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h 2011-03-07 18:05:41 UTC (rev 35389)
+++ trunk/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h 2011-03-07 19:14:17 UTC (rev 35390)
@@ -71,7 +71,7 @@
/**
*/
enum {
- RAS_RENDER_3DPOLYGON_TEXT = 16384
+ RAS_RENDER_3DPOLYGON_TEXT = 16384 /* TF_BMFONT */
};
/**
* Drawing types
@@ -106,7 +106,9 @@
/**
*/
enum {
- KX_TWOSIDE = 512,
+ KX_TEX = 4, /* TF_TEX */
+ KX_LIGHT = 16, /* TF_LIGHT */
+ KX_TWOSIDE = 512, /* TF_TWOSIDE */
KX_LINES = 32768
};
More information about the Bf-blender-cvs
mailing list