summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-18 23:40:20 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-18 23:40:20 (GMT)
commit93afe0a1ea45efb5d62608555784580d4513bfd0 (patch)
tree8fa2e2776240c00f6dd2bf372c787e6e180fbf5d /src
parent740f0d30c3d5badc10da09af875b47d67128048b (diff)
downloadpowder-93afe0a1ea45efb5d62608555784580d4513bfd0.zip
powder-93afe0a1ea45efb5d62608555784580d4513bfd0.tar.gz
More robust EngineProcess (still doesn't fix lua bug)
Diffstat (limited to 'src')
-rw-r--r--src/PowderToySDL.cpp5
-rw-r--r--src/dialogues/TextPrompt.cpp1
-rw-r--r--src/interface/Engine.cpp7
-rw-r--r--src/interface/Engine.h1
4 files changed, 12 insertions, 2 deletions
diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp
index 9d1aa15..7eb9366 100644
--- a/src/PowderToySDL.cpp
+++ b/src/PowderToySDL.cpp
@@ -296,7 +296,7 @@ void EngineProcess()
{
if(engine->Broken())
{
- engine->Break();
+ engine->UnBreak();
break;
}
event.type = 0;
@@ -414,6 +414,9 @@ void EngineProcess()
}
engine->SetFps(fps);
}
+#ifdef DEBUG
+ std::cout << "Breaking out of EngineProcess" << std::endl;
+#endif
}
int main(int argc, char * argv[])
diff --git a/src/dialogues/TextPrompt.cpp b/src/dialogues/TextPrompt.cpp
index 3a2a39f..68333d1 100644
--- a/src/dialogues/TextPrompt.cpp
+++ b/src/dialogues/TextPrompt.cpp
@@ -5,6 +5,7 @@
* Author: Simon
*/
+#include <iostream>
#include "TextPrompt.h"
#include "interface/Label.h"
#include "interface/Button.h"
diff --git a/src/interface/Engine.cpp b/src/interface/Engine.cpp
index 31311fe..0d709e6 100644
--- a/src/interface/Engine.cpp
+++ b/src/interface/Engine.cpp
@@ -52,7 +52,12 @@ void Engine::Begin(int width, int height)
void Engine::Break()
{
- break_ = !break_;
+ break_ = true;
+}
+
+void Engine::UnBreak()
+{
+ break_ = false;
}
void Engine::Exit()
diff --git a/src/interface/Engine.h b/src/interface/Engine.h
index b28ba84..47e3859 100644
--- a/src/interface/Engine.h
+++ b/src/interface/Engine.h
@@ -38,6 +38,7 @@ namespace ui
inline bool Broken() { return break_; }
void Exit();
void Break();
+ void UnBreak();
void SetFullscreen(bool fullscreen) { Fullscreen = fullscreen; }
inline bool GetFullscreen() { return Fullscreen; }