Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
Game.cpp
Go to the documentation of this file.
1#include "Game.hpp"
2#include "Display.hpp"
4#include "MousePointer.hpp"
5#include "RenderSlots.hpp"
6#include "Timers.hpp"
7#include "UDUtils.hpp"
8#include "UIMessages.hpp"
9#include "UserInterface.hpp"
10
11#include <cstdint>
12
14{
15 namespace
16 {
17 std::uint64_t nextActionTick = 0;
18
20 {
21 (void)timers::configure(1, 0, 0, false, 0);
23 }
24 }
25
26
27 bool startup()
28 {
29 // UDUTILS_GenerateINIFile();
31 {
32 return false;
33 }
34
35 // InitRenderSlots();
37 {
38 return false;
39 }
40
41 // Création du MousePointer runtime.
42 if (!mouse::initialize())
43 {
45 return false;
46 }
47
48 // Source originale :
49 // LE_TimerSpeeds[1] = 1;
50 // LE_TimerRestartCount[1] = 3;
51 // LE_TimerSendUIMessage[1] = TRUE;
52 // LE_Timers[1] = 0;
53 if (!timers::configure(1, 1, 3, true, 0))
54 {
58 return false;
59 }
60
61 // Source originale :
62 // if (!MainExtendedInitialization())
63 // return FALSE;
65 {
70 return false;
71 }
72
74
75 return true;
76 }
77
79 {
80 // GameUpdateCycle() original.
81 bool gameRunning = true;
82 int limitCount = 50;
83
84 const std::uint64_t holdActionTick =
86
87 uimsg::Message message{};
88
89 while (
91 --limitCount > 0 &&
92 uimsg::receive(message))
93 {
96 }
97
98 // Original :
99 //
100 // if (nextActionTick < holdActionTick)
101 // {
102 // DISPLAY_tickActions(
103 // holdActionTick - nextActionTick);
104 //
105 // nextActionTick = holdActionTick;
106 // }
107
108 if (gameRunning &&
110 {
113 );
114
116 }
117
118 return gameRunning;
119 }
131}
132
133
134
135
136
unsigned index
void tickActions(std::uint64_t numberOfTicks)
Definition Display.cpp:621
void shutdownRenderSlots()
bool initializeRenderSlots()
void shutdown()
Definition Game.cpp:120
bool updateCycle()
Definition Game.cpp:78
bool startup()
Definition Game.cpp:27
std::uint64_t tickCount()
Definition Timers.cpp:183
bool configure(std::size_t index, std::uint8_t speed, std::uint16_t restartCount, bool sendUIMessage, std::uint16_t value)
Definition Timers.cpp:124
bool generateINIFile()
Definition UDUtils.cpp:29
std::size_t discardTimerEvents(std::size_t timerIndex)
bool receive(Message &message)
bool processUIMessage(const uimsg::Message &message)