diff options
author | Aki <please@ignore.pl> | 2022-03-31 23:41:46 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-03-31 23:41:46 +0200 |
commit | 8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e (patch) | |
tree | fa3ba288acb3f589e16700256ade2b25c73526c9 /Stars45/Game.cpp | |
parent | ac54470e8aeddc2acf9ae215241c77a2bf7e33e3 (diff) | |
download | starshatter-8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e.zip starshatter-8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e.tar.gz starshatter-8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e.tar.bz2 |
Moved HINST and HWND from Game to GameWinDX9
Diffstat (limited to 'Stars45/Game.cpp')
-rw-r--r-- | Stars45/Game.cpp | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/Stars45/Game.cpp b/Stars45/Game.cpp index bd6484e..3b480cc 100644 --- a/Stars45/Game.cpp +++ b/Stars45/Game.cpp @@ -34,7 +34,6 @@ const double MAX_FRAME_TIME_NORMAL = 1.0 / 5.0; Game::Game() : world(0), video_factory(0), video(0), video_settings(0), soundcard(0), screen(0), totaltime(0), - hInst(0), hwnd(0), status(Game::OK), exit_code(0), window_style(0) { Clock::Init(); @@ -75,24 +74,6 @@ Game::~Game() // +--------------------------------------------------------------------+ -HINSTANCE Game::GetHINST() -{ - if (game) - return game->hInst; - - return 0; -} - -HWND Game::GetHWND() -{ - if (game) - return game->hwnd; - - return 0; -} - -// +--------------------------------------------------------------------+ - bool Game::Init(HINSTANCE hi, HINSTANCE hpi, LPSTR cmdline, int nCmdShow) { @@ -129,31 +110,12 @@ Game::InitGame() int Game::Run() { - MSG msg; - status = RUN; - Print("\n"); - Print("+====================================================================+\n"); - Print("| RUN |\n"); - Print("+====================================================================+\n"); - - // Polling messages from event queue until quit Clock::GetInstance()->Set(); while (status < EXIT && !Panic::Panicked()) { - if (PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE)) { - if (msg.message == WM_QUIT) - break; - - TranslateMessage(&msg); - DispatchMessage(&msg); - } - else { - if (GameLoop()) - WaitMessage(); - } + GameLoop(); } - - return exit_code ? exit_code : msg.wParam; + return exit_code; } // +--------------------------------------------------------------------+ |