Skip to content

Commit b2220f9

Browse files
committed
Changed FPSCounter and Detail to use references
1 parent 1ba3902 commit b2220f9

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

FPSCounter.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ class FPSCounter
44
{
55
public:
66
//!< The number of frames processed in the last second.
7-
static unsigned int &CurrentFrameRate;
7+
static constexpr reference<unsigned int, 0xABCD44u> const CurrentFrameRate{};
88

99
//!< The total number of frames elapsed.
10-
static unsigned int &TotalFramesElapsed;
10+
static constexpr reference<unsigned int, 0xABCD48u> const TotalFramesElapsed{};
1111

1212
//!< The time it took to process TotalFramesElapsed frames.
13-
static unsigned int &TotalTimeElapsed;
13+
static constexpr reference<unsigned int, 0xABCD4Cu> const TotalTimeElapsed{};
1414

1515
//!< Whether the current fps is considered too low.
16-
static bool &ReducedEffects;
16+
static constexpr reference<bool, 0xABCD50u> const ReducedEffects{};
1717

1818
//!< The average frame rate for all frames processed.
1919
static inline double GetAverageFrameRate()
@@ -30,10 +30,10 @@ class FPSCounter
3030
class Detail {
3131
public:
3232
//!< What is considered the minimum acceptable FPS.
33-
static unsigned int &MinFrameRate;
33+
static constexpr reference<unsigned int, 0x829FF4u> const MinFrameRate{};
3434

35-
//!< The zone that needs to be left to change
36-
static unsigned int &BufferZoneWidth;
35+
//!< The zone that needs to be left to change
36+
static constexpr reference<unsigned int, 0x829FF8u> const BufferZoneWidth{};
3737

3838
//!< The minimum frame rate considering the buffer zone.
3939
static inline unsigned int GetMinFrameRate()

StaticInits.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ ALIAS(ConvertClass *, FileSystem::THEATER_PAL, 0x87F6C4);
5050
ALIAS(ConvertClass *, FileSystem::MOUSE_PAL, 0x87F6C8);
5151
ALIAS(ConvertClass *, FileSystem::GRFXTXT_Convert, 0xA8F798);
5252

53-
#include <FPSCounter.h>
54-
ALIAS(unsigned int, FPSCounter::CurrentFrameRate, 0xABCD44);
55-
ALIAS(unsigned int, FPSCounter::TotalFramesElapsed, 0xABCD48);
56-
ALIAS(unsigned int, FPSCounter::TotalTimeElapsed, 0xABCD4C);
57-
ALIAS(bool, FPSCounter::ReducedEffects, 0xABCD50);
58-
ALIAS(unsigned int, Detail::MinFrameRate, 0x829FF4);
59-
ALIAS(unsigned int, Detail::BufferZoneWidth, 0x829FF8);
60-
6153
#include <LocomotionClass.h>
6254
ALIAS(const CLSID, LocomotionClass::CLSIDs::Drive, 0x7E9A30);
6355
ALIAS(const CLSID, LocomotionClass::CLSIDs::Jumpjet, 0x7E9AC0);

0 commit comments

Comments
 (0)