瀏覽代碼

No segfault on window resize

Thomas Buck 10 年之前
父節點
當前提交
13ade99a95
共有 3 個文件被更改,包括 4 次插入1 次删除
  1. 2
    0
      ChangeLog.md
  2. 1
    0
      src/Console.cpp
  3. 1
    1
      src/Render.cpp

+ 2
- 0
ChangeLog.md 查看文件

@@ -8,6 +8,8 @@
8 8
     * Added loadPNG to TextureManager
9 9
     * Added loadImage to TextureManager, _detecting_ the file type
10 10
     * Re-Implemented the move command
11
+    * Prevent crash (segfault) when resizing window while console is
12
+      not fully scrolled to the bottom
11 13
 
12 14
     [ 20140624 ]
13 15
     * Some changes to allow compilation with Ubuntu 14.04 / gcc

+ 1
- 0
src/Console.cpp 查看文件

@@ -99,6 +99,7 @@ void Console::display() {
99 99
             scrollIndicator = (mHistory.size() - lineCount - mLineOffset) * 100 / (mHistory.size() - lineCount);
100 100
         } else {
101 101
             scrollIndicator = 100;
102
+            mLineOffset = 0;
102 103
         }
103 104
 
104 105
         getFont().drawText(10, 10, 0.70f, BLUE,

+ 1
- 1
src/Render.cpp 查看文件

@@ -468,7 +468,7 @@ void Render::display()
468 468
 
469 469
 void Render::drawLoadScreen()
470 470
 {
471
-    float x = 0.0f, y = 0.0f, z = -160.0f;
471
+    float x = 0.0f, y = 0.0f, z = 0.0f;
472 472
     float w = getWindow().getWidth(), h = getWindow().getHeight();
473 473
 
474 474
     if (getTextureManager().getTextureCount() <= 0)

Loading…
取消
儲存