[Bf-blender-cvs] [49aa7b1] master: BGE: Fix color used as background in VideoTexture.

Quentin Wenger noreply at git.blender.org
Wed Jun 24 13:03:47 CEST 2015


Commit: 49aa7b1261a45e5e290c12ebc35ef15687971556
Author: Quentin Wenger
Date:   Wed Jun 24 12:52:54 2015 +0200
Branches: master
https://developer.blender.org/rB49aa7b1261a45e5e290c12ebc35ef15687971556

BGE: Fix color used as background in VideoTexture.

Now we use color converted (if we do a color management) by the setter for background color in VideoTexture (ImageRender & ImageMirror).

Reviewers:panzergame

===================================================================

M	source/gameengine/Ketsji/KX_WorldInfo.cpp
M	source/gameengine/Ketsji/KX_WorldInfo.h
M	source/gameengine/VideoTexture/ImageRender.cpp

===================================================================

diff --git a/source/gameengine/Ketsji/KX_WorldInfo.cpp b/source/gameengine/Ketsji/KX_WorldInfo.cpp
index 8678b05..111d81c 100644
--- a/source/gameengine/Ketsji/KX_WorldInfo.cpp
+++ b/source/gameengine/Ketsji/KX_WorldInfo.cpp
@@ -100,9 +100,9 @@ void KX_WorldInfo::setBackColor(float r, float g, float b)
 	}
 }
 
-const float *KX_WorldInfo::getBackColor(void) const
+const float *KX_WorldInfo::getBackColorConverted() const
 {
-	return m_backgroundcolor;
+	return m_con_backgroundcolor;
 }
 
 void KX_WorldInfo::setMistType(short type)
diff --git a/source/gameengine/Ketsji/KX_WorldInfo.h b/source/gameengine/Ketsji/KX_WorldInfo.h
index 0e8fe3c..22851d3 100644
--- a/source/gameengine/Ketsji/KX_WorldInfo.h
+++ b/source/gameengine/Ketsji/KX_WorldInfo.h
@@ -88,7 +88,7 @@ public:
 	void setMistIntensity(float intensity);
 	void setMistColor(float r, float g, float b);
 	void setBackColor(float r, float g, float b);
-	const float *getBackColor() const;
+	const float *getBackColorConverted() const;
 	void setAmbientColor(float r, float g, float b);
 	void UpdateBackGround();
 	void UpdateWorldSettings();
diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp
index 2f85122..0850995 100644
--- a/source/gameengine/VideoTexture/ImageRender.cpp
+++ b/source/gameengine/VideoTexture/ImageRender.cpp
@@ -109,7 +109,7 @@ void ImageRender::setBackground (float red, float green, float blue, float alpha
 void ImageRender::setBackgroundFromScene (KX_Scene *scene)
 {
 	if (scene) {
-		const float *background_color = scene->GetWorldInfo()->getBackColor();
+		const float *background_color = scene->GetWorldInfo()->getBackColorConverted();
 		copy_v3_v3(m_background, background_color);
 		m_background[3] = 1.0f;
 	}




More information about the Bf-blender-cvs mailing list