Code clean up for BGE world mist, background and global ambient color.
Move mist render update to BlenderWolrdInfo
Details
Diff Detail
Event Timeline
| source/gameengine/Converter/BlenderWorldInfo.cpp | ||
|---|---|---|
| 58–60 | I personally wouldn't put these in member variables, you never know when some code is added that might make these change dynamically, generally I wouldn't copy that kind of state around when I can avoid it. | |
| source/gameengine/Converter/BlenderWorldInfo.cpp | ||
|---|---|---|
| 58–60 | UpdateBackGround() and UpdateWorldSettings() is called every frame (necessary if we have multiple scenes running). | |
| source/gameengine/Converter/BlenderWorldInfo.cpp | ||
|---|---|---|
| 58–60 | It actually wont be that slow to do the calls. Modern processors and compilers handle functions calls pretty well these days. Having the drawtype fixed at construction is particularly problematic, as this does change during execution for shadows. | |
| source/gameengine/Ketsji/KX_KetsjiEngine.cpp | ||
| 313 | Do we really need to call into BlenderWorldInfo this much? Can we not just call one update that handles all the bf_gpu calls once per frame per scene? | |
| source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp | ||
| 219 | Are these being called for GLSL mode too? Does GLSL mode use fixed function fog? If not, we should avoid fixed function calls that we don't need. I guess by moving them here we at least avoid calling them every frame, but can we be sure that these state variables are not being screwed up by someone? | |
| source/gameengine/Converter/BlenderWorldInfo.cpp | ||
|---|---|---|
| 58–60 | OK. I will change that. | |
| source/gameengine/Ketsji/KX_KetsjiEngine.cpp | ||
| 313 | Yes the four calls are are necessary. Actually the are only per frame per scene.
| |
| source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp | ||
| 219 | Yes text objects has no material and without the text will not display with fog. | |
Overall looks good. Just some minor cleanup needed to BlenderWorldInfo.h.
| source/gameengine/Converter/BlenderWorldInfo.h | ||
|---|---|---|
| 36 | I see no need to include KX_KetsjiEngine.h or RAS_IRasterizer.h. | |
| 41 | The KX_KetsjiEngine nor the RAS_IRasterizer forward declarations appear to be used anywhere. Also, I don't know if the use of const is correct in a forward declaration. | |