Page MenuHome

BGE: Fix T43822 Videotexture does not use sky color for off-screen rendering
ClosedPublic

Authored by Jorge Bernal (lordloki) on May 9 2015, 12:49 PM.

Diff Detail

Repository
rB Blender

Event Timeline

Jorge Bernal (lordloki) retitled this revision from to BGE: Fix T43822 Videotexture does not use sky color for off-screen rendering.
Jorge Bernal (lordloki) updated this object.
  • Fix copy/paste error
source/gameengine/VideoTexture/ImageRender.cpp
80

It's only for python getter at initialization ?

source/gameengine/VideoTexture/ImageRender.cpp
80

yes, it is.

source/gameengine/VideoTexture/ImageRender.cpp
80

This is a dupli code, can you write a function like "SetBackroundFromWorldColor" ? which take as argument the scene or the world info.

  • Overload setBackground function to avoid duplicated code
Porteries Tristan (panzergame) edited edge metadata.

looks good to me.

This revision is now accepted and ready to land.May 9 2015, 3:17 PM
source/gameengine/Ketsji/KX_WorldInfo.cpp
103

float *KX_WorldInfo::getBackColor(void)

source/gameengine/Ketsji/KX_WorldInfo.h
91

I think Blender style is float *getBackColor();
Also I think this method can be private.

source/gameengine/Ketsji/KX_WorldInfo.h
91

How you want to write this methode as private ? it used in ImageRender, if you want safety the best is :
const float *getBackColor() const;

source/gameengine/Ketsji/KX_WorldInfo.h
91

Sorry my fault. I write the comment to the wrong method.

source/gameengine/VideoTexture/ImageRender.h
61

This method can be private.

Jorge Bernal (lordloki) edited edge metadata.
  • Style fixes.
  • force getBackColor to const
  • fix for alpha getting wrong index
source/gameengine/VideoTexture/ImageRender.h
61

Maybe, I can reuse the SetBackGround(KX_WorldInfo* wi); that it is not used?

source/gameengine/VideoTexture/ImageRender.h
61

I think SetBackGround() and SetWorldSettings() are relict's, and should be delete with the next cleanup.
Basically it make no difference if you declare the method private, protected, private. It is only god for non experienced programmers and it reduce the amount of code completion suggestions.
You can use the old method, you can make your method protected or you can leave as it is, if you prefer this. From my side it was only a suggestion that this method don't need to be public and can be private because it is not used anywhere else.
I personally have no strong preference about this.

  • move setBackground to SetBackGround reusing unused function that it seemed destined for this purpose
Thomas Szepe (hg1) edited edge metadata.

Looks good to me.

source/gameengine/VideoTexture/ImageRender.h
103

New style would be void SetBackGround(KX_Scene *scene);
But this can be done also with next cleanup patch.

Jorge Bernal (lordloki) edited edge metadata.
  • Rename to setBackgroundFromScene to increase readability
This revision was automatically updated to reflect the committed changes.