| 44 | } |
| 45 | |
| 46 | bool FrameByFrameCommandClass::FrameStepMainLoop() |
| 47 | { |
| 48 | if (Game::IsActive) |
| 49 | { |
| 50 | Game::CallBack(); |
| 51 | |
| 52 | if (Game::IsFocused && Game::SpecialDialog == 0) |
| 53 | { |
| 54 | MapClass::Instance.MarkNeedsRedraw(2); |
| 55 | |
| 56 | DWORD input; |
| 57 | int x, y; |
| 58 | MapClass::Instance.GetInputAndUpdate(input, x, y); |
| 59 | if (input != NULL) |
| 60 | { |
| 61 | Game::KeyboardProcess(input); |
| 62 | |
| 63 | // Allow to open options |
| 64 | if (input == VK_ESCAPE || input == VK_SPACE) |
| 65 | Game::SpecialDialog = 1; |
| 66 | } |
| 67 | |
| 68 | MapClass::Instance.Render(); |
| 69 | TacticalClass::Instance->Update(); |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | Sleep(1); |
| 74 | return Game::IsActive == false; |
| 75 | } |
| 76 | |
| 77 | DEFINE_HOOK(0x55D360, MainLoop_FrameStep_Begin, 0x5) |
| 78 | { |