BGE bug #30173: ImageRender not working when initialized on frame 1. This was because...
authorBenoit Bolsee <benoit.bolsee@online.be>
Sat, 18 Feb 2012 15:25:31 +0000 (15:25 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Sat, 18 Feb 2012 15:25:31 +0000 (15:25 +0000)
source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
source/gameengine/GamePlayer/common/GPC_Canvas.cpp

index 7e7b3d2..0abea7f 100644 (file)
@@ -39,6 +39,8 @@ KX_BlenderCanvas::KX_BlenderCanvas(struct wmWindow *win, RAS_Rect &rect, struct
 m_win(win),
 m_frame_rect(rect)
 {
+       // initialize area so that it's available for game logic on frame 1 (ImageViewport)
+       m_area_rect = rect;
        // area boundaries needed for mouse coordinates in Letterbox framing mode
        m_area_left = ar->winrct.xmin;
        m_area_top = ar->winrct.ymax;
index df1bf31..82950f5 100644 (file)
@@ -52,6 +52,11 @@ GPC_Canvas::GPC_Canvas(
        m_height(height),
        m_bannersEnabled(false)
 {
+       // initialize area so that it's available for game logic on frame 1 (ImageViewport)
+       m_displayarea.m_x1 = 0;
+       m_displayarea.m_y1 = 0;
+       m_displayarea.m_x2 = width;
+       m_displayarea.m_y2 = height;
 }