浏览代码

No segfault on window resize

Thomas Buck 11 年前
父节点
当前提交
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
     * Added loadPNG to TextureManager
8
     * Added loadPNG to TextureManager
9
     * Added loadImage to TextureManager, _detecting_ the file type
9
     * Added loadImage to TextureManager, _detecting_ the file type
10
     * Re-Implemented the move command
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
     [ 20140624 ]
14
     [ 20140624 ]
13
     * Some changes to allow compilation with Ubuntu 14.04 / gcc
15
     * Some changes to allow compilation with Ubuntu 14.04 / gcc

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

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

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

468
 
468
 
469
 void Render::drawLoadScreen()
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
     float w = getWindow().getWidth(), h = getWindow().getHeight();
472
     float w = getWindow().getWidth(), h = getWindow().getHeight();
473
 
473
 
474
     if (getTextureManager().getTextureCount() <= 0)
474
     if (getTextureManager().getTextureCount() <= 0)

正在加载...
取消
保存