diff options
| author | jacob1 <jfu614@gmail.com> | 2012-10-03 22:55:19 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-10-05 15:31:04 (GMT) |
| commit | 97cea273e5d02ed13d674ec8cc8308afe51e54b0 (patch) | |
| tree | 3aff41d10f9f2dd08f98245369a6da70f0944693 /src/interface | |
| parent | 71db872e6422dd264ffa00a848d3f8a76e08b279 (diff) | |
| download | powder-97cea273e5d02ed13d674ec8cc8308afe51e54b0.zip powder-97cea273e5d02ed13d674ec8cc8308afe51e54b0.tar.gz | |
Fast quit option (disable to make "X" act like in tpt)
Diffstat (limited to 'src/interface')
| -rw-r--r-- | src/interface/Engine.cpp | 5 | ||||
| -rw-r--r-- | src/interface/Engine.h | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/interface/Engine.cpp b/src/interface/Engine.cpp index 643a023..cdfadc8 100644 --- a/src/interface/Engine.cpp +++ b/src/interface/Engine.cpp @@ -30,6 +30,7 @@ Engine::Engine(): FrameIndex(0), Fullscreen(false), Scale(1), + FastQuit(1), break_(false), lastTick(0) { @@ -109,7 +110,7 @@ void Engine::ShowWindow(Window * window) } -void Engine::CloseWindow() +int Engine::CloseWindow() { if(!windows.empty()) { @@ -139,10 +140,12 @@ void Engine::CloseWindow() mousexp_ = mousex_; mouseyp_ = mousey_; } + return 0; } else { state_ = NULL; + return 1; } } diff --git a/src/interface/Engine.h b/src/interface/Engine.h index b825eb8..fb110e4 100644 --- a/src/interface/Engine.h +++ b/src/interface/Engine.h @@ -22,7 +22,7 @@ namespace ui ~Engine(); void ShowWindow(Window * window); - void CloseWindow(); + int CloseWindow(); void onMouseMove(int x, int y); void onMouseClick(int x, int y, unsigned button); @@ -46,6 +46,8 @@ namespace ui inline bool GetFullscreen() { return Fullscreen; } void SetScale(int scale) { Scale = scale; } inline int GetScale() { return Scale; } + void SetFastQuit(bool fastquit) { FastQuit = fastquit; } + inline bool GetFastQuit() {return FastQuit; } void Tick(); void Draw(); @@ -88,6 +90,7 @@ namespace ui bool running_; bool break_; + bool FastQuit; int lastTick; int mouseb_; |
