diff options
author | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-06-16 01:05:25 +0300 |
---|---|---|
committer | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-06-16 01:05:25 +0300 |
commit | 6d634467104fc53701d77c7aeb1382a3c198b6d2 (patch) | |
tree | 9212fe9e63a148caa45a79b3c72e532ac35e50df /source/gameengine/VideoTexture/ImageRender.h | |
parent | 53e3e4633244facb76740a58f1b2b9b6c1e2a00d (diff) |
BGE: Fix for precision lost in setBackground/getBackground at Video Texture
Now internally the variables are processed as floats avoiding int->float->char conversions that are causing precision lost.
A check for int numbers is maintained to keep compatibility with old behaviour.
Reviewers: ben2610, campbellbarton, moguri, hg1
Reviewed By: moguri, hg1
Subscribers: campbellbarton
Projects: #game_engine
Differential Revision: https://developer.blender.org/D1301
Diffstat (limited to 'source/gameengine/VideoTexture/ImageRender.h')
-rw-r--r-- | source/gameengine/VideoTexture/ImageRender.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/gameengine/VideoTexture/ImageRender.h b/source/gameengine/VideoTexture/ImageRender.h index bdf442c82d0..ef55e4dea84 100644 --- a/source/gameengine/VideoTexture/ImageRender.h +++ b/source/gameengine/VideoTexture/ImageRender.h @@ -55,9 +55,9 @@ public: virtual ~ImageRender (void); /// get background color - int getBackground (int idx) { return (idx < 0 || idx > 3) ? 0 : int(m_background[idx]*255.f); } + float getBackground (int idx); /// set background color - void setBackground (int red, int green, int blue, int alpha); + void setBackground (float red, float green, float blue, float alpha); /// clipping distance float getClip (void) { return m_clip; } |