1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-06-14 10:53:13 +00:00

made code use TimeStepIn(Milli)Seconds; purged unnecessary inlines

This commit is contained in:
aap 2019-07-07 10:16:16 +02:00
parent b515ce4730
commit 533f265f55
11 changed files with 114 additions and 112 deletions

128
src/Pad.h
View file

@ -288,80 +288,80 @@ public:
static int32 *EditCodesForControls(int32 *pRsKeys, int32 nSize); static int32 *EditCodesForControls(int32 *pRsKeys, int32 nSize);
// mouse // mouse
inline bool GetLeftMouseJustDown() { return !!(NewMouseControllerState.LMB && !OldMouseControllerState.LMB); } bool GetLeftMouseJustDown() { return !!(NewMouseControllerState.LMB && !OldMouseControllerState.LMB); }
// keyboard // keyboard
inline bool GetCharJustDown(int32 c) { return !!(NewKeyState.VK_KEYS[c] && !OldKeyState.VK_KEYS[c]); } bool GetCharJustDown(int32 c) { return !!(NewKeyState.VK_KEYS[c] && !OldKeyState.VK_KEYS[c]); }
inline bool GetFJustDown(int32 n) { return !!(NewKeyState.F[n] && !OldKeyState.F[n]); } bool GetFJustDown(int32 n) { return !!(NewKeyState.F[n] && !OldKeyState.F[n]); }
inline bool GetEscapeJustDown() { return !!(NewKeyState.ESC && !OldKeyState.ESC); } bool GetEscapeJustDown() { return !!(NewKeyState.ESC && !OldKeyState.ESC); }
inline bool GetInsertJustDown() { return !!(NewKeyState.INS && !OldKeyState.INS); } bool GetInsertJustDown() { return !!(NewKeyState.INS && !OldKeyState.INS); }
inline bool GetDeleteJustDown() { return !!(NewKeyState.DEL && !OldKeyState.DEL); } bool GetDeleteJustDown() { return !!(NewKeyState.DEL && !OldKeyState.DEL); }
inline bool GetHomeJustDown() { return !!(NewKeyState.HOME && !OldKeyState.HOME); } bool GetHomeJustDown() { return !!(NewKeyState.HOME && !OldKeyState.HOME); }
inline bool GetEndJustDown() { return !!(NewKeyState.END && !OldKeyState.END); } bool GetEndJustDown() { return !!(NewKeyState.END && !OldKeyState.END); }
inline bool GetPageUpJustDown() { return !!(NewKeyState.PGUP && !OldKeyState.PGUP); } bool GetPageUpJustDown() { return !!(NewKeyState.PGUP && !OldKeyState.PGUP); }
inline bool GetPageDownJustDown() { return !!(NewKeyState.PGDN && !OldKeyState.PGDN); } bool GetPageDownJustDown() { return !!(NewKeyState.PGDN && !OldKeyState.PGDN); }
inline bool GetUpJustDown() { return !!(NewKeyState.UP && !OldKeyState.UP); } bool GetUpJustDown() { return !!(NewKeyState.UP && !OldKeyState.UP); }
inline bool GetDownJustDown() { return !!(NewKeyState.DOWN && !OldKeyState.DOWN); } bool GetDownJustDown() { return !!(NewKeyState.DOWN && !OldKeyState.DOWN); }
inline bool GetLeftJustDown() { return !!(NewKeyState.LEFT && !OldKeyState.LEFT); } bool GetLeftJustDown() { return !!(NewKeyState.LEFT && !OldKeyState.LEFT); }
inline bool GetRightJustDown() { return !!(NewKeyState.RIGHT && !OldKeyState.RIGHT); } bool GetRightJustDown() { return !!(NewKeyState.RIGHT && !OldKeyState.RIGHT); }
inline bool GetScrollLockJustDown() { return !!(NewKeyState.SCROLLLOCK && !OldKeyState.SCROLLLOCK); } bool GetScrollLockJustDown() { return !!(NewKeyState.SCROLLLOCK && !OldKeyState.SCROLLLOCK); }
inline bool GetPauseJustDown() { return !!(NewKeyState.PAUSE && !OldKeyState.PAUSE); } bool GetPauseJustDown() { return !!(NewKeyState.PAUSE && !OldKeyState.PAUSE); }
inline bool GetNumLockJustDown() { return !!(NewKeyState.NUMLOCK && !OldKeyState.NUMLOCK); } bool GetNumLockJustDown() { return !!(NewKeyState.NUMLOCK && !OldKeyState.NUMLOCK); }
inline bool GetDivideJustDown() { return !!(NewKeyState.DIV && !OldKeyState.DIV); } bool GetDivideJustDown() { return !!(NewKeyState.DIV && !OldKeyState.DIV); }
inline bool GetTimesJustDown() { return !!(NewKeyState.MUL && !OldKeyState.MUL); } bool GetTimesJustDown() { return !!(NewKeyState.MUL && !OldKeyState.MUL); }
inline bool GetMinusJustDown() { return !!(NewKeyState.SUB && !OldKeyState.SUB); } bool GetMinusJustDown() { return !!(NewKeyState.SUB && !OldKeyState.SUB); }
inline bool GetPlusJustDown() { return !!(NewKeyState.ADD && !OldKeyState.ADD); } bool GetPlusJustDown() { return !!(NewKeyState.ADD && !OldKeyState.ADD); }
inline bool GetPadEnterJustDown() { return !!(NewKeyState.ENTER && !OldKeyState.ENTER); } // GetEnterJustDown bool GetPadEnterJustDown() { return !!(NewKeyState.ENTER && !OldKeyState.ENTER); } // GetEnterJustDown
inline bool GetPadDelJustDown() { return !!(NewKeyState.DECIMAL && !OldKeyState.DECIMAL); } bool GetPadDelJustDown() { return !!(NewKeyState.DECIMAL && !OldKeyState.DECIMAL); }
inline bool GetPad1JustDown() { return !!(NewKeyState.NUM1 && !OldKeyState.NUM1); } bool GetPad1JustDown() { return !!(NewKeyState.NUM1 && !OldKeyState.NUM1); }
inline bool GetPad2JustDown() { return !!(NewKeyState.NUM2 && !OldKeyState.NUM2); } bool GetPad2JustDown() { return !!(NewKeyState.NUM2 && !OldKeyState.NUM2); }
inline bool GetPad3JustDown() { return !!(NewKeyState.NUM3 && !OldKeyState.NUM3); } bool GetPad3JustDown() { return !!(NewKeyState.NUM3 && !OldKeyState.NUM3); }
inline bool GetPad4JustDown() { return !!(NewKeyState.NUM4 && !OldKeyState.NUM4); } bool GetPad4JustDown() { return !!(NewKeyState.NUM4 && !OldKeyState.NUM4); }
inline bool GetPad5JustDown() { return !!(NewKeyState.NUM5 && !OldKeyState.NUM5); } bool GetPad5JustDown() { return !!(NewKeyState.NUM5 && !OldKeyState.NUM5); }
inline bool GetPad6JustDown() { return !!(NewKeyState.NUM6 && !OldKeyState.NUM6); } bool GetPad6JustDown() { return !!(NewKeyState.NUM6 && !OldKeyState.NUM6); }
inline bool GetPad7JustDown() { return !!(NewKeyState.NUM7 && !OldKeyState.NUM7); } bool GetPad7JustDown() { return !!(NewKeyState.NUM7 && !OldKeyState.NUM7); }
inline bool GetPad8JustDown() { return !!(NewKeyState.NUM8 && !OldKeyState.NUM8); } bool GetPad8JustDown() { return !!(NewKeyState.NUM8 && !OldKeyState.NUM8); }
inline bool GetPad9JustDown() { return !!(NewKeyState.NUM9 && !OldKeyState.NUM9); } bool GetPad9JustDown() { return !!(NewKeyState.NUM9 && !OldKeyState.NUM9); }
inline bool GetPad0JustDown() { return !!(NewKeyState.NUM0 && !OldKeyState.NUM0); } bool GetPad0JustDown() { return !!(NewKeyState.NUM0 && !OldKeyState.NUM0); }
inline bool GetBackspaceJustDown() { return !!(NewKeyState.BACKSP && !OldKeyState.BACKSP); } bool GetBackspaceJustDown() { return !!(NewKeyState.BACKSP && !OldKeyState.BACKSP); }
inline bool GetTabJustDown() { return !!(NewKeyState.TAB && !OldKeyState.TAB); } bool GetTabJustDown() { return !!(NewKeyState.TAB && !OldKeyState.TAB); }
inline bool GetCapsLockJustDown() { return !!(NewKeyState.CAPSLOCK && !OldKeyState.CAPSLOCK); } bool GetCapsLockJustDown() { return !!(NewKeyState.CAPSLOCK && !OldKeyState.CAPSLOCK); }
inline bool GetEnterJustDown() { return !!(NewKeyState.EXTENTER && !OldKeyState.EXTENTER); } bool GetEnterJustDown() { return !!(NewKeyState.EXTENTER && !OldKeyState.EXTENTER); }
inline bool GetLeftShiftJustDown() { return !!(NewKeyState.LSHIFT && !OldKeyState.LSHIFT); } bool GetLeftShiftJustDown() { return !!(NewKeyState.LSHIFT && !OldKeyState.LSHIFT); }
inline bool GetShiftJustDown() { return !!(NewKeyState.SHIFT && !OldKeyState.SHIFT); } bool GetShiftJustDown() { return !!(NewKeyState.SHIFT && !OldKeyState.SHIFT); }
inline bool GetRightShiftJustDown() { return !!(NewKeyState.RSHIFT && !OldKeyState.RSHIFT); } bool GetRightShiftJustDown() { return !!(NewKeyState.RSHIFT && !OldKeyState.RSHIFT); }
inline bool GetLeftCtrlJustDown() { return !!(NewKeyState.LCTRL && !OldKeyState.LCTRL); } bool GetLeftCtrlJustDown() { return !!(NewKeyState.LCTRL && !OldKeyState.LCTRL); }
inline bool GetRightCtrlJustDown() { return !!(NewKeyState.RCTRL && !OldKeyState.RCTRL); } bool GetRightCtrlJustDown() { return !!(NewKeyState.RCTRL && !OldKeyState.RCTRL); }
inline bool GetLeftAltJustDown() { return !!(NewKeyState.LALT && !OldKeyState.LALT); } bool GetLeftAltJustDown() { return !!(NewKeyState.LALT && !OldKeyState.LALT); }
inline bool GetRightAltJustDown() { return !!(NewKeyState.RALT && !OldKeyState.RALT); } bool GetRightAltJustDown() { return !!(NewKeyState.RALT && !OldKeyState.RALT); }
inline bool GetLeftWinJustDown() { return !!(NewKeyState.LWIN && !OldKeyState.LWIN); } bool GetLeftWinJustDown() { return !!(NewKeyState.LWIN && !OldKeyState.LWIN); }
inline bool GetRightWinJustDown() { return !!(NewKeyState.RWIN && !OldKeyState.RWIN); } bool GetRightWinJustDown() { return !!(NewKeyState.RWIN && !OldKeyState.RWIN); }
inline bool GetAppsJustDown() { return !!(NewKeyState.APPS && !OldKeyState.APPS); } bool GetAppsJustDown() { return !!(NewKeyState.APPS && !OldKeyState.APPS); }
// pad // pad
inline bool GetTriangleJustDown() { return !!(NewState.Triangle && !OldState.Triangle); } bool GetTriangleJustDown() { return !!(NewState.Triangle && !OldState.Triangle); }
inline bool GetCircleJustDown() { return !!(NewState.Circle && !OldState.Circle); } bool GetCircleJustDown() { return !!(NewState.Circle && !OldState.Circle); }
inline bool GetCrossJustDown() { return !!(NewState.Cross && !OldState.Cross); } bool GetCrossJustDown() { return !!(NewState.Cross && !OldState.Cross); }
inline bool GetSquareJustDown() { return !!(NewState.Square && !OldState.Square); } bool GetSquareJustDown() { return !!(NewState.Square && !OldState.Square); }
inline bool GetDPadUpJustDown() { return !!(NewState.DPadUp && !OldState.DPadUp); } bool GetDPadUpJustDown() { return !!(NewState.DPadUp && !OldState.DPadUp); }
inline bool GetDPadDownJustDown() { return !!(NewState.DPadDown && !OldState.DPadDown); } bool GetDPadDownJustDown() { return !!(NewState.DPadDown && !OldState.DPadDown); }
inline bool GetDPadLeftJustDown() { return !!(NewState.DPadLeft && !OldState.DPadLeft); } bool GetDPadLeftJustDown() { return !!(NewState.DPadLeft && !OldState.DPadLeft); }
inline bool GetDPadRightJustDown() { return !!(NewState.DPadRight && !OldState.DPadRight); } bool GetDPadRightJustDown() { return !!(NewState.DPadRight && !OldState.DPadRight); }
inline bool GetLeftShoulder1JustDown() { return !!(NewState.LeftShoulder1 && !OldState.LeftShoulder1); } bool GetLeftShoulder1JustDown() { return !!(NewState.LeftShoulder1 && !OldState.LeftShoulder1); }
inline bool GetLeftShoulder2JustDown() { return !!(NewState.LeftShoulder2 && !OldState.LeftShoulder2); } bool GetLeftShoulder2JustDown() { return !!(NewState.LeftShoulder2 && !OldState.LeftShoulder2); }
inline bool GetRightShoulder1JustDown() { return !!(NewState.RightShoulder1 && !OldState.RightShoulder1); } bool GetRightShoulder1JustDown() { return !!(NewState.RightShoulder1 && !OldState.RightShoulder1); }
inline bool GetRightShoulder2JustDown() { return !!(NewState.RightShoulder2 && !OldState.RightShoulder2); } bool GetRightShoulder2JustDown() { return !!(NewState.RightShoulder2 && !OldState.RightShoulder2); }
inline int32 GetLeftShoulder1(void) { return NewState.LeftShoulder1; } int32 GetLeftShoulder1(void) { return NewState.LeftShoulder1; }
inline int32 GetLeftShoulder2(void) { return NewState.LeftShoulder2; } int32 GetLeftShoulder2(void) { return NewState.LeftShoulder2; }
inline int32 GetRightShoulder1(void) { return NewState.RightShoulder1; } int32 GetRightShoulder1(void) { return NewState.RightShoulder1; }
inline int32 GetRightShoulder2(void) { return NewState.RightShoulder2; } int32 GetRightShoulder2(void) { return NewState.RightShoulder2; }
}; };
VALIDATE_SIZE(CPad, 0xFC); VALIDATE_SIZE(CPad, 0xFC);
#define IsButtonJustDown(pad, btn) \ #define IsButtonJustDown(pad, btn) \
(!(pad)->OldState.btn && (pad)->NewState.btn) (!(pad)->OldState.btn && (pad)->NewState.btn)
void LittleTest(void); void LittleTest(void);

View file

@ -14,22 +14,24 @@ class CTimer
static bool &m_CodePause; static bool &m_CodePause;
public: public:
static float GetTimeStep(void) { return ms_fTimeStep; } static float GetTimeStep(void) { return ms_fTimeStep; }
static inline void SetTimeStep(float ts) { ms_fTimeStep = ts; } static void SetTimeStep(float ts) { ms_fTimeStep = ts; }
static float GetTimeStepInSeconds() { return ms_fTimeStep / 50.0f; }
static float GetTimeStepInMilliseconds() { return ms_fTimeStep / 50.0f * 1000.0f; }
static float GetTimeStepNonClipped(void) { return ms_fTimeStepNonClipped; } static float GetTimeStepNonClipped(void) { return ms_fTimeStepNonClipped; }
static inline void SetTimeStepNonClipped(float ts) { ms_fTimeStepNonClipped = ts; } static float GetTimeStepNonClippedInSeconds(void) { return ms_fTimeStepNonClipped / 50.0f; }
static void SetTimeStepNonClipped(float ts) { ms_fTimeStepNonClipped = ts; }
static uint32 GetFrameCounter(void) { return m_FrameCounter; } static uint32 GetFrameCounter(void) { return m_FrameCounter; }
static inline void SetFrameCounter(uint32 fc) { m_FrameCounter = fc; } static void SetFrameCounter(uint32 fc) { m_FrameCounter = fc; }
static uint32 GetTimeInMilliseconds(void) { return m_snTimeInMilliseconds; } static uint32 GetTimeInMilliseconds(void) { return m_snTimeInMilliseconds; }
static inline void SetTimeInMilliseconds(uint32 t) { m_snTimeInMilliseconds = t; } static void SetTimeInMilliseconds(uint32 t) { m_snTimeInMilliseconds = t; }
static uint32 GetTimeInMillisecondsNonClipped(void) { return m_snTimeInMillisecondsNonClipped; } static uint32 GetTimeInMillisecondsNonClipped(void) { return m_snTimeInMillisecondsNonClipped; }
static inline void SetTimeInMillisecondsNonClipped(uint32 t) { m_snTimeInMillisecondsNonClipped = t; } static void SetTimeInMillisecondsNonClipped(uint32 t) { m_snTimeInMillisecondsNonClipped = t; }
static uint32 GetTimeInMillisecondsPauseMode(void) { return m_snTimeInMillisecondsPauseMode; } static uint32 GetTimeInMillisecondsPauseMode(void) { return m_snTimeInMillisecondsPauseMode; }
static inline void SetTimeInMillisecondsPauseMode(uint32 t) { m_snTimeInMillisecondsPauseMode = t; } static void SetTimeInMillisecondsPauseMode(uint32 t) { m_snTimeInMillisecondsPauseMode = t; }
static uint32 GetPreviousTimeInMilliseconds(void) { return m_snPreviousTimeInMilliseconds; } static uint32 GetPreviousTimeInMilliseconds(void) { return m_snPreviousTimeInMilliseconds; }
static inline void SetPreviousTimeInMilliseconds(uint32 t) { m_snPreviousTimeInMilliseconds = t; } static void SetPreviousTimeInMilliseconds(uint32 t) { m_snPreviousTimeInMilliseconds = t; }
static float GetTimeScale(void) { return ms_fTimeScale; } static float GetTimeScale(void) { return ms_fTimeScale; }
static inline void SetTimeScale(float ts) { ms_fTimeScale = ts; } static void SetTimeScale(float ts) { ms_fTimeScale = ts; }
static inline float GetFrameTimeStepInMilliseconds() { return ms_fTimeStep / 50.0f * 1000.0f; }
static bool GetIsPaused() { return m_UserPause || m_CodePause; } static bool GetIsPaused() { return m_UserPause || m_CodePause; }
static bool GetIsUserPaused() { return m_UserPause; } static bool GetIsUserPaused() { return m_UserPause; }

View file

@ -262,8 +262,8 @@ public:
static void StreamAllNecessaryCarsAndPeds(void); static void StreamAllNecessaryCarsAndPeds(void);
static bool ShouldStandardCameraBeProcessed(void); static bool ShouldStandardCameraBeProcessed(void);
inline static bool IsPlayingBack() { return Mode == MODE_PLAYBACK; } static bool IsPlayingBack() { return Mode == MODE_PLAYBACK; }
inline static bool IsPlayingBackFromFile() { return bPlayingBackFromFile; } static bool IsPlayingBackFromFile() { return bPlayingBackFromFile; }
private: private:
static void RecordThisFrame(void); static void RecordThisFrame(void);

View file

@ -151,7 +151,7 @@ bool CUpsideDownCarCheck::IsCarUpsideDown(int32 id)
void CUpsideDownCarCheck::UpdateTimers() void CUpsideDownCarCheck::UpdateTimers()
{ {
uint32 timeStep = CTimer::GetFrameTimeStepInMilliseconds(); uint32 timeStep = CTimer::GetTimeStepInMilliseconds();
for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){ for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){
CVehicle* v = CPools::GetVehiclePool()->GetAt(m_sCars[i].m_nVehicleIndex); CVehicle* v = CPools::GetVehiclePool()->GetAt(m_sCars[i].m_nVehicleIndex);
if (v){ if (v){

View file

@ -26,7 +26,7 @@ public:
RwFrame *m_aCarNodes[NUM_CAR_NODES]; RwFrame *m_aCarNodes[NUM_CAR_NODES];
CColPoint m_aWheelColPoints[4]; CColPoint m_aWheelColPoints[4];
float m_aWheelDist[4]; float m_aWheelDist[4];
float m_aWheelDist_2[4]; float m_aWheelDistPrev[4];
float m_aWheelSkidThing[4]; float m_aWheelSkidThing[4];
int field_49C; int field_49C;
bool m_aWheelSkidmarkMuddy[4]; bool m_aWheelSkidmarkMuddy[4];

View file

@ -522,11 +522,11 @@ public:
void SetPedStats(ePedStats); void SetPedStats(ePedStats);
bool IsGangMember(void); bool IsGangMember(void);
inline bool HasWeapon(uint8 weaponType) { return m_weapons[weaponType].m_eWeaponType == weaponType; } bool HasWeapon(uint8 weaponType) { return m_weapons[weaponType].m_eWeaponType == weaponType; }
inline CWeapon &GetWeapon(uint8 weaponType) { return m_weapons[weaponType]; } CWeapon &GetWeapon(uint8 weaponType) { return m_weapons[weaponType]; }
inline CWeapon *GetWeapon(void) { return &m_weapons[m_currentWeapon]; } CWeapon *GetWeapon(void) { return &m_weapons[m_currentWeapon]; }
inline RwFrame *GetNodeFrame(int nodeId) { return m_pFrames[nodeId]->frame; } RwFrame *GetNodeFrame(int nodeId) { return m_pFrames[nodeId]->frame; }
inline static uint8 GetVehEnterExitFlag(eVehEnter vehEnter) { static uint8 GetVehEnterExitFlag(eVehEnter vehEnter) {
switch (vehEnter) { switch (vehEnter) {
case VEHICLE_ENTER_FRONT_RIGHT: case VEHICLE_ENTER_FRONT_RIGHT:
return 4; return 4;

View file

@ -346,7 +346,7 @@ CPhysical::ProcessControl(void)
IsPed() && !bPedPhysics){ IsPed() && !bPedPhysics){
m_vecMoveSpeedAvg = (m_vecMoveSpeedAvg + m_vecMoveSpeed)/2.0f; m_vecMoveSpeedAvg = (m_vecMoveSpeedAvg + m_vecMoveSpeed)/2.0f;
m_vecTurnSpeedAvg = (m_vecTurnSpeedAvg + m_vecTurnSpeed)/2.0f; m_vecTurnSpeedAvg = (m_vecTurnSpeedAvg + m_vecTurnSpeed)/2.0f;
float step = CTimer::GetTimeStep() * 0.003; float step = CTimer::GetTimeStep() * 0.003f;
if(m_vecMoveSpeedAvg.MagnitudeSqr() < step*step && if(m_vecMoveSpeedAvg.MagnitudeSqr() < step*step &&
m_vecTurnSpeedAvg.MagnitudeSqr() < step*step){ m_vecTurnSpeedAvg.MagnitudeSqr() < step*step){
m_nStaticFrames++; m_nStaticFrames++;

View file

@ -429,7 +429,7 @@ CVehicle::ProcessCarAlarm(void)
if(m_nAlarmState == 0 || m_nAlarmState == -1) if(m_nAlarmState == 0 || m_nAlarmState == -1)
return; return;
step = CTimer::GetTimeStep()/50.0f * 1000.0f; step = CTimer::GetTimeStepInMilliseconds();
if((uint16)m_nAlarmState < step) if((uint16)m_nAlarmState < step)
m_nAlarmState = 0; m_nAlarmState = 0;
else else

View file

@ -38,35 +38,35 @@ public:
x = 1.0f; x = 1.0f;
} }
inline const CVector &operator+=(CVector const &right) { const CVector &operator+=(CVector const &right) {
x += right.x; x += right.x;
y += right.y; y += right.y;
z += right.z; z += right.z;
return *this; return *this;
} }
inline const CVector &operator-=(CVector const &right) { const CVector &operator-=(CVector const &right) {
x -= right.x; x -= right.x;
y -= right.y; y -= right.y;
z -= right.z; z -= right.z;
return *this; return *this;
} }
inline const CVector &operator*=(float right) { const CVector &operator*=(float right) {
x *= right; x *= right;
y *= right; y *= right;
z *= right; z *= right;
return *this; return *this;
} }
inline const CVector &operator/=(float right) { const CVector &operator/=(float right) {
x /= right; x /= right;
y /= right; y /= right;
z /= right; z /= right;
return *this; return *this;
} }
inline CVector operator-() const { CVector operator-() const {
return CVector(-x, -y, -z); return CVector(-x, -y, -z);
} }

View file

@ -496,7 +496,7 @@ void CHud::Draw()
fZoneAlpha = 255.0f; fZoneAlpha = 255.0f;
break; break;
case 2: case 2:
m_ZoneFadeTimer += (CTimer::GetTimeStep() * 0.02f * 1000.0f); m_ZoneFadeTimer += CTimer::GetTimeStepInMilliseconds();
if (m_ZoneFadeTimer > 1000) { if (m_ZoneFadeTimer > 1000) {
m_ZoneState = 1; m_ZoneState = 1;
m_ZoneFadeTimer = 1000; m_ZoneFadeTimer = 1000;
@ -504,7 +504,7 @@ void CHud::Draw()
fZoneAlpha = m_ZoneFadeTimer * 0.001f * 255.0f; fZoneAlpha = m_ZoneFadeTimer * 0.001f * 255.0f;
break; break;
case 3: case 3:
m_ZoneFadeTimer += (CTimer::GetTimeStep() * 0.02f * -1000.0f); m_ZoneFadeTimer -= CTimer::GetTimeStepInMilliseconds();
if (m_ZoneFadeTimer < 0) { if (m_ZoneFadeTimer < 0) {
m_ZoneState = 0; m_ZoneState = 0;
m_ZoneFadeTimer = 0; m_ZoneFadeTimer = 0;
@ -512,7 +512,7 @@ void CHud::Draw()
fZoneAlpha = m_ZoneFadeTimer * 0.001f * 255.0f; fZoneAlpha = m_ZoneFadeTimer * 0.001f * 255.0f;
break; break;
case 4: case 4:
m_ZoneFadeTimer += (CTimer::GetTimeStep() * 0.02f * -1000.0f); m_ZoneFadeTimer -= CTimer::GetTimeStepInMilliseconds();
if (m_ZoneFadeTimer < 0) { if (m_ZoneFadeTimer < 0) {
m_ZoneFadeTimer = 0; m_ZoneFadeTimer = 0;
m_ZoneToPrint = m_pLastZoneName; m_ZoneToPrint = m_pLastZoneName;
@ -526,7 +526,7 @@ void CHud::Draw()
} }
if (!m_Message[0]) { if (!m_Message[0]) {
m_ZoneNameTimer += (CTimer::GetTimeStep() * 0.02f * 1000.0f); m_ZoneNameTimer += CTimer::GetTimeStepInMilliseconds();
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
@ -592,7 +592,7 @@ void CHud::Draw()
fVehicleAlpha = 255.0f; fVehicleAlpha = 255.0f;
break; break;
case 2: case 2:
m_VehicleFadeTimer += (CTimer::GetTimeStep() * 0.02f * 1000.0f); m_VehicleFadeTimer += CTimer::GetTimeStepInMilliseconds();
if (m_VehicleFadeTimer > 1000) { if (m_VehicleFadeTimer > 1000) {
m_VehicleState = 1; m_VehicleState = 1;
m_VehicleFadeTimer = 1000; m_VehicleFadeTimer = 1000;
@ -600,7 +600,7 @@ void CHud::Draw()
fVehicleAlpha = m_VehicleFadeTimer * 0.001f * 255.0f; fVehicleAlpha = m_VehicleFadeTimer * 0.001f * 255.0f;
break; break;
case 3: case 3:
m_VehicleFadeTimer += (CTimer::GetTimeStep() * 0.02f * -1000.0f); m_VehicleFadeTimer -= CTimer::GetTimeStepInMilliseconds();
if (m_VehicleFadeTimer < 0) { if (m_VehicleFadeTimer < 0) {
m_VehicleState = 0; m_VehicleState = 0;
m_VehicleFadeTimer = 0; m_VehicleFadeTimer = 0;
@ -608,7 +608,7 @@ void CHud::Draw()
fVehicleAlpha = m_VehicleFadeTimer * 0.001f * 255.0f; fVehicleAlpha = m_VehicleFadeTimer * 0.001f * 255.0f;
break; break;
case 4: case 4:
m_VehicleFadeTimer += (CTimer::GetTimeStep() * 0.02f * -1000.0f); m_VehicleFadeTimer -= CTimer::GetTimeStepInMilliseconds();
if (m_VehicleFadeTimer < 0) { if (m_VehicleFadeTimer < 0) {
m_VehicleFadeTimer = 0; m_VehicleFadeTimer = 0;
m_pVehicleNameToPrint = m_pLastVehicleName; m_pVehicleNameToPrint = m_pLastVehicleName;
@ -622,7 +622,7 @@ void CHud::Draw()
} }
if (!m_Message[0]) { if (!m_Message[0]) {
m_VehicleNameTimer += (CTimer::GetTimeStep() * 0.02f * 1000.0f); m_VehicleNameTimer += CTimer::GetTimeStepInMilliseconds();
CFont::SetJustifyOff(); CFont::SetJustifyOff();
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();
@ -924,11 +924,11 @@ void CHud::Draw()
CFont::SetFontStyle(FONT_HEADING); CFont::SetFontStyle(FONT_HEADING);
if (BigMessageX[0] >= (SCREEN_WIDTH - 20)) { if (BigMessageX[0] >= (SCREEN_WIDTH - 20)) {
BigMessageInUse[0] += (CTimer::GetTimeStep() * 0.02f * 120.0f); BigMessageInUse[0] += (CTimer::GetTimeStepInSeconds() * 120.0f);
if (BigMessageInUse[0] >= 120.0f) { if (BigMessageInUse[0] >= 120.0f) {
BigMessageInUse[0] = 120.0; BigMessageInUse[0] = 120.0;
BigMessageAlpha[0] += (CTimer::GetTimeStep() * 0.02f * -255.0f); BigMessageAlpha[0] += (CTimer::GetTimeStepInSeconds() * -255.0f);
} }
if (BigMessageAlpha[0] <= 0.0f) { if (BigMessageAlpha[0] <= 0.0f) {
@ -937,8 +937,8 @@ void CHud::Draw()
} }
} }
else { else {
BigMessageX[0] += (CTimer::GetTimeStep() * 0.02f * 255.0f); BigMessageX[0] += (CTimer::GetTimeStepInSeconds() * 255.0f);
BigMessageAlpha[0] += (CTimer::GetTimeStep() * 0.02f * 255.0f); BigMessageAlpha[0] += (CTimer::GetTimeStepInSeconds() * 255.0f);
if (BigMessageAlpha[0] >= 255.0f) if (BigMessageAlpha[0] >= 255.0f)
BigMessageAlpha[0] = 255.0f; BigMessageAlpha[0] = 255.0f;
@ -963,7 +963,7 @@ void CHud::Draw()
// WastedBustedText // WastedBustedText
if (m_BigMessage[2][0]) { if (m_BigMessage[2][0]) {
if (BigMessageInUse[2] != 0.0f) { if (BigMessageInUse[2] != 0.0f) {
BigMessageAlpha[2] += (CTimer::GetTimeStep() * 0.02f * 255.0f); BigMessageAlpha[2] += (CTimer::GetTimeStepInSeconds() * 255.0f);
if (BigMessageAlpha[2] > 255.0f) if (BigMessageAlpha[2] > 255.0f)
BigMessageAlpha[2] = 255.0; BigMessageAlpha[2] = 255.0;
@ -1045,7 +1045,7 @@ void CHud::DrawAfterFade()
} }
break; break;
case 2: case 2:
m_HelpMessageFadeTimer += 2 * (CTimer::GetTimeStep() * 0.02f * 1000.0f); m_HelpMessageFadeTimer += 2 * CTimer::GetTimeStepInMilliseconds();
if (m_HelpMessageFadeTimer > 0) { if (m_HelpMessageFadeTimer > 0) {
m_HelpMessageState = 1; m_HelpMessageState = 1;
m_HelpMessageFadeTimer = 0; m_HelpMessageFadeTimer = 0;
@ -1053,7 +1053,7 @@ void CHud::DrawAfterFade()
fAlpha = m_HelpMessageFadeTimer * 0.001f * 255.0f; fAlpha = m_HelpMessageFadeTimer * 0.001f * 255.0f;
break; break;
case 3: case 3:
m_HelpMessageFadeTimer -= 2 * (CTimer::GetTimeStep() * 0.02f * 1000.0f); m_HelpMessageFadeTimer -= 2 * CTimer::GetTimeStepInMilliseconds();
if (m_HelpMessageFadeTimer >= 0) { if (m_HelpMessageFadeTimer >= 0) {
m_HelpMessageState = 0; m_HelpMessageState = 0;
m_HelpMessageFadeTimer = 0; m_HelpMessageFadeTimer = 0;
@ -1061,7 +1061,7 @@ void CHud::DrawAfterFade()
fAlpha = m_HelpMessageFadeTimer * 0.001f * 255.0f; fAlpha = m_HelpMessageFadeTimer * 0.001f * 255.0f;
break; break;
case 4: case 4:
m_HelpMessageFadeTimer -= 2 * (CTimer::GetTimeStep() * 0.02f * 1000.0f); m_HelpMessageFadeTimer -= 2 * CTimer::GetTimeStepInMilliseconds();
if (m_HelpMessageFadeTimer >= 0) { if (m_HelpMessageFadeTimer >= 0) {
m_HelpMessageState = 2; m_HelpMessageState = 2;
m_HelpMessageFadeTimer = 0; m_HelpMessageFadeTimer = 0;
@ -1073,7 +1073,7 @@ void CHud::DrawAfterFade()
break; break;
} }
m_HelpMessageTimer += (CTimer::GetTimeStep() * 0.02f * 1000.0f); m_HelpMessageTimer += CTimer::GetTimeStepInMilliseconds();
CFont::SetAlphaFade(fAlpha); CFont::SetAlphaFade(fAlpha);
CFont::SetCentreOff(); CFont::SetCentreOff();
@ -1121,7 +1121,7 @@ void CHud::DrawAfterFade()
// Oddjob result // Oddjob result
if (OddJob2OffTimer > 0) if (OddJob2OffTimer > 0)
OddJob2OffTimer = OddJob2OffTimer - (CTimer::GetTimeStep() * 0.02f * 1000.0f); OddJob2OffTimer = OddJob2OffTimer - CTimer::GetTimeStepInMilliseconds();
static float fStep; static float fStep;
if (!m_BigMessage[1][0] && m_BigMessage[4][0] && m_BigMessage[5][0] && OddJob2OffTimer <= 0.0f) { if (!m_BigMessage[1][0] && m_BigMessage[4][0] && m_BigMessage[5][0] && OddJob2OffTimer <= 0.0f) {
@ -1197,11 +1197,11 @@ void CHud::DrawAfterFade()
CFont::SetRightJustifyOn(); CFont::SetRightJustifyOn();
CFont::SetFontStyle(FONT_HEADING); CFont::SetFontStyle(FONT_HEADING);
if (BigMessageX[1] >= (SCREEN_WIDTH - 20)) { if (BigMessageX[1] >= (SCREEN_WIDTH - 20)) {
BigMessageInUse[1] += (CTimer::GetTimeStep() * 0.02f * 120.0f); BigMessageInUse[1] += (CTimer::GetTimeStepInSeconds() * 120.0f);
if (BigMessageInUse[1] >= 120.0f) { if (BigMessageInUse[1] >= 120.0f) {
BigMessageInUse[1] = 120.0; BigMessageInUse[1] = 120.0;
BigMessageAlpha[1] += (CTimer::GetTimeStep() * 0.02f * -255.0f); BigMessageAlpha[1] += (CTimer::GetTimeStepInSeconds() * -255.0f);
} }
if (BigMessageAlpha[1] <= 0) { if (BigMessageAlpha[1] <= 0) {
m_BigMessage[1][0] = 0; m_BigMessage[1][0] = 0;
@ -1209,8 +1209,8 @@ void CHud::DrawAfterFade()
} }
} }
else { else {
BigMessageX[1] += (CTimer::GetTimeStep() * 0.02f * 255.0f); BigMessageX[1] += (CTimer::GetTimeStepInSeconds() * 255.0f);
BigMessageAlpha[1] += (CTimer::GetTimeStep() * 0.02f * 255.0f); BigMessageAlpha[1] += (CTimer::GetTimeStepInSeconds() * 255.0f);
if (BigMessageAlpha[1] >= 255.0f) if (BigMessageAlpha[1] >= 255.0f)
BigMessageAlpha[1] = 255.0f; BigMessageAlpha[1] = 255.0f;

View file

@ -74,7 +74,7 @@ public:
static void RemovePSystem(tParticleType type); static void RemovePSystem(tParticleType type);
static void RemoveParticle(CParticle *pParticle, CParticle *pPrevParticle, tParticleSystemData *pPSystemData); static void RemoveParticle(CParticle *pParticle, CParticle *pPrevParticle, tParticleSystemData *pPSystemData);
static inline void _Next(CParticle *&pParticle, CParticle *&pPrevParticle, tParticleSystemData *pPSystemData, bool bRemoveParticle) static void _Next(CParticle *&pParticle, CParticle *&pPrevParticle, tParticleSystemData *pPSystemData, bool bRemoveParticle)
{ {
if ( bRemoveParticle ) if ( bRemoveParticle )
{ {