Browse Source

No segfault on window resize

Thomas Buck 10 years ago
parent
commit
13ade99a95
3 changed files with 4 additions and 1 deletions
  1. 2
    0
      ChangeLog.md
  2. 1
    0
      src/Console.cpp
  3. 1
    1
      src/Render.cpp

+ 2
- 0
ChangeLog.md View File

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 View File

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 View File

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)

Loading…
Cancel
Save