diff options
author | Thomas Szepe <HG1_public@gmx.net> | 2015-03-23 23:36:08 +0300 |
---|---|---|
committer | Thomas Szepe <HG1_public@gmx.net> | 2015-03-23 23:36:08 +0300 |
commit | 2affbb437bd3cbf3e1a502bd65a5eefb64a92b9b (patch) | |
tree | 2403ce2b95eb97249251d24ca035d389864c307f /source/gameengine/Converter | |
parent | 38321faa8d111ec51ebdeb7f2e939062d5e080a1 (diff) |
BGE: Multitexture world (mist, ambient) fix
This patch fix the existing word API for mist and global ambient lighting.
Add deprecated message to disableMist()
Add setUseMist(enable).
Reviewers: dfelinto, campbellbarton, moguri
Reviewed By: moguri
Subscribers: solarlune, jta, brecht
Projects: #bf_blender:_next
Differential Revision: https://developer.blender.org/D148
Diffstat (limited to 'source/gameengine/Converter')
-rw-r--r-- | source/gameengine/Converter/BlenderWorldInfo.cpp | 41 | ||||
-rw-r--r-- | source/gameengine/Converter/BlenderWorldInfo.h | 6 |
2 files changed, 20 insertions, 27 deletions
diff --git a/source/gameengine/Converter/BlenderWorldInfo.cpp b/source/gameengine/Converter/BlenderWorldInfo.cpp index 75beb5d0e0e..28e42c1cc63 100644 --- a/source/gameengine/Converter/BlenderWorldInfo.cpp +++ b/source/gameengine/Converter/BlenderWorldInfo.cpp @@ -69,21 +69,10 @@ BlenderWorldInfo::BlenderWorldInfo(struct Scene *blenderscene, struct World *ble { if (blenderworld) { m_hasworld = true; - - // do we have mist? - if ((blenderworld->mode) & WO_MIST) { - m_hasmist = true; - m_miststart = blenderworld->miststa; - m_mistdistance = blenderworld->mistdist; - copy_v3_v3(m_mistcolor, &blenderworld->horr); - } - else { - m_hasmist = false; - m_miststart = 0.0; - m_mistdistance = 0.0; - zero_v3(m_mistcolor); - } - + m_hasmist = ((blenderworld->mode) & WO_MIST ? true : false); + m_miststart = blenderworld->miststa; + m_mistdistance = blenderworld->mistdist; + copy_v3_v3(m_mistcolor, &blenderworld->horr); copy_v3_v3(m_backgroundcolor, &blenderworld->horr); copy_v3_v3(m_ambientcolor, &blenderworld->ambr); @@ -174,6 +163,11 @@ void BlenderWorldInfo::setBackColor(float r, float g, float b) m_backgroundcolor[2] = b; } +void BlenderWorldInfo::setUseMist(bool enable) +{ + m_hasmist = enable; +} + void BlenderWorldInfo::setMistStart(float d) { m_miststart = d; @@ -184,17 +178,16 @@ void BlenderWorldInfo::setMistDistance(float d) m_mistdistance = d; } -void BlenderWorldInfo::setMistColorRed(float d) -{ - m_mistcolor[0] = d; -} - -void BlenderWorldInfo::setMistColorGreen(float d) +void BlenderWorldInfo::setMistColor(float r, float g, float b) { - m_mistcolor[1] = d; + m_mistcolor[0] = r; + m_mistcolor[1] = g; + m_mistcolor[2] = b; } -void BlenderWorldInfo::setMistColorBlue(float d) +void BlenderWorldInfo::setAmbientColor(float r, float g, float b) { - m_mistcolor[2] = d; + m_ambientcolor[0] = r; + m_ambientcolor[1] = g; + m_ambientcolor[2] = b; } diff --git a/source/gameengine/Converter/BlenderWorldInfo.h b/source/gameengine/Converter/BlenderWorldInfo.h index 2ac2d70b5d1..6c67681c3bc 100644 --- a/source/gameengine/Converter/BlenderWorldInfo.h +++ b/source/gameengine/Converter/BlenderWorldInfo.h @@ -67,11 +67,11 @@ public: float getMistColorBlue(); void setBackColor(float r, float g, float b); + void setUseMist(bool enable); void setMistStart(float d); void setMistDistance(float d); - void setMistColorRed(float d); - void setMistColorGreen(float d); - void setMistColorBlue(float d); + void setMistColor(float r, float g, float b); + void setAmbientColor(float r, float g, float b); #ifdef WITH_CXX_GUARDEDALLOC |