瀏覽代碼

Bugfix for Travis

Thomas Buck 9 年之前
父節點
當前提交
ee9c7f5cd7
共有 3 個檔案被更改,包括 8 行新增4 行删除
  1. 0
    3
      TODO.md
  2. 2
    0
      src/FontManager.cpp
  3. 6
    1
      src/UI.cpp

+ 0
- 3
TODO.md 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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);

Loading…
取消
儲存