Procházet zdrojové kódy

No segfault on window resize

Thomas Buck před 10 roky
rodič
revize
13ade99a95
3 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 2
    0
      ChangeLog.md
  2. 1
    0
      src/Console.cpp
  3. 1
    1
      src/Render.cpp

+ 2
- 0
ChangeLog.md Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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…
Zrušit
Uložit