Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2010-04-11 05:53:21 +0400
committerDalai Felinto <dfelinto@gmail.com>2010-04-11 05:53:21 +0400
commita8bca52d0985f93290adaf13a6c7d8e2938089bf (patch)
treeaf49e21135b0f7ea57b7d4856da48f3e371fcdb8 /source/gameengine/GamePlayer
parent4d2f5a275d402bd732bd52887d7aed5fce7276c4 (diff)
BGE fix #20456 - 2.5: mouse position problem (offseted by 1 vertically)
In Blender 2.49 the win width and height were been calculated including an extra pixel (e.g. a fullscreen editor would be (width + 1) by (height + 1) ) In opposite to that, Blender 2.5 window/editor code were fixed to have the exact width,height size. So although the BGE canvas code was still the same as 2.49 it was producing a wrong result. I'm also adding some commentaries in the setViewport code. BGE is setting the viewports 1 pixel larger. the setViewport command is been used as if one should pass (minx, miny, width, height), while it should be (minx, miny, maxx, maxy). I will take care of that later, if any one has extra comments on that, please let me know.
Diffstat (limited to 'source/gameengine/GamePlayer')
-rw-r--r--source/gameengine/GamePlayer/common/GPC_Canvas.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.cpp b/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
index 3fa27b40928..100ab4b72b3 100644
--- a/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
@@ -100,6 +100,12 @@ void GPC_Canvas::ClearColor(float r, float g, float b, float a)
void GPC_Canvas::SetViewPort(int x1, int y1, int x2, int y2)
{
+ /* x1 and y1 are the min pixel coordinate (e.g. 0)
+ x2 and y2 are the max pixel coordinate
+ the width,height is calculated including both pixels
+ therefore: max - min + 1
+ */
+
/* XXX, nasty, this needs to go somewhere else,
* but where... definitly need to clean up this
* whole canvas/rendertools mess.