Quellcode durchsuchen

Bugfix for Travis

Thomas Buck vor 10 Jahren
Ursprung
Commit
ee9c7f5cd7
3 geänderte Dateien mit 8 neuen und 4 gelöschten Zeilen
  1. 0
    3
      TODO.md
  2. 2
    0
      src/FontManager.cpp
  3. 6
    1
      src/UI.cpp

+ 0
- 3
TODO.md Datei anzeigen

@@ -13,9 +13,6 @@
13 13
 ## Bugs
14 14
 
15 15
 * Screenshots are sometimes not written, sometimes distorted?
16
-* imgui integration still very much unfinished
17
-    * toggling with ‘q’ means one can’t use input ‘q’ into a text field
18
-    * clicking outside of the debug window does nothing
19 16
 
20 17
 ## Cmake
21 18
 

+ 2
- 0
src/FontManager.cpp Datei anzeigen

@@ -22,6 +22,7 @@ FontManager::FontManager() {
22 22
     add(new FontSDL(), ".ttf");
23 23
 #endif
24 24
 
25
+    mFontInit = false;
25 26
     font = -1;
26 27
 }
27 28
 
@@ -48,6 +49,7 @@ int FontManager::initialize() {
48 49
     if (font == -1)
49 50
         return -1;
50 51
 
52
+    mFontInit = true;
51 53
     fonts.at(font)->setFont(mFontName);
52 54
     return fonts.at(font)->initialize();
53 55
 }

+ 6
- 1
src/UI.cpp Datei anzeigen

@@ -84,9 +84,11 @@ void UI::eventsFinished() {
84 84
     ImGuiIO& io = ImGui::GetIO();
85 85
     io.DisplaySize = ImVec2((float)getWindow().getWidth(), (float)getWindow().getHeight());
86 86
 
87
-    static long lastTime = 0;
87
+    static unsigned long lastTime = 0;
88 88
     io.DeltaTime = ((float)(systemTimerGet() - lastTime)) / 1000.0f;
89 89
     lastTime = systemTimerGet();
90
+    if (io.DeltaTime <= 0.0f)
91
+        io.DeltaTime = 1.0f / 60.0f;
90 92
 
91 93
     ImGui::NewFrame();
92 94
 
@@ -220,6 +222,9 @@ void UI::handleKeyboard(KeyboardButton key, bool pressed) {
220 222
 }
221 223
 
222 224
 void UI::handleText(char *text, bool notFinished) {
225
+    if (notFinished)
226
+        return;
227
+
223 228
     ImGuiIO& io = ImGui::GetIO();
224 229
     while (*text != '\0') {
225 230
         io.AddInputCharacter(*text);

Laden…
Abbrechen
Speichern