Skip to content

Commit d1849ef

Browse files
authored
Replace gettickcount (w3dhub#83)
* Replace GetTickCount with the equivalent OpenW3D macro
1 parent b54167c commit d1849ef

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

Code/Commando/GameSpy_QnR.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ int main(int argc, char* argv[])
754754
{
755755
CGameSpyQnR mygame1("Test Game Server 1"), mygame2("Test Game Server 2");
756756
757-
srand( GetTickCount() );
757+
srand( TIMEGETTIME() );
758758
759759
printf("Press any key to quit\n");
760760
while (!_kbhit())

Code/Commando/floodprotectionmgr.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "messagewindow.h"
4040
#include "translatedb.h"
4141
#include "string_ids.h"
42+
#include "systimer.h"
4243

4344

4445
//////////////////////////////////////////////////////////////////////
@@ -70,7 +71,7 @@ FloodProtectionMgrClass::Decay_Old_Entries (void)
7071
{
7172
const int DECAY_TIME = 15000;
7273

73-
uint32 curr_time = ::GetTickCount ();
74+
uint32 curr_time = ::TIMEGETTIME ();
7475

7576
//
7677
// Loop over all the entries in the list
@@ -124,7 +125,7 @@ FloodProtectionMgrClass::Detect_Flooding (const wchar_t *text)
124125
// Add a new entry to the list
125126
//
126127
FLOOD_ENTRY entry;
127-
entry.time = ::GetTickCount ();
128+
entry.time = ::TIMEGETTIME ();
128129
entry.text_len = 0;
129130
FloodList.Add (entry);
130131
}
@@ -151,4 +152,4 @@ FloodProtectionMgrClass::Display_Flood_Message (void)
151152
}
152153

153154
return ;
154-
}
155+
}

Code/Tests/PhysTest/GraphicView.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ void CGraphicView::Timestep(void)
396396

397397
// Compute the amount of time elapsed for this frame.
398398
CPhysTestDoc * doc = (CPhysTestDoc *)GetDocument();
399-
DWORD curtime = ::GetTickCount();
399+
DWORD curtime = ::TIMEGETTIME();
400400
DWORD elapsedtime = curtime - doc->LastTime;
401401
if (elapsedtime > 100) {
402402
elapsedtime = 100;
@@ -510,7 +510,7 @@ void CGraphicView::Set_Active(bool onoff)
510510
} else {
511511
RemoveProp(m_hWnd,"Inactive");
512512
CPhysTestDoc * doc = (CPhysTestDoc *)GetDocument();
513-
doc->LastTime = ::GetTickCount();
513+
doc->LastTime = ::TIMEGETTIME();
514514
}
515515
}
516516

Code/ww3d2/animatedsoundmgr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "AudibleSound.h"
4848
#include "htree.h"
4949
#include "hanim.h"
50+
#include "systimer.h"
5051

5152

5253
//////////////////////////////////////////////////////////////////////
@@ -408,7 +409,7 @@ AnimatedSoundMgrClass::Trigger_Sound
408409
//
409410
int def_id = (*sound_list)[index].SoundDefinitionID;
410411
WWAudioClass::Get_Instance ()->Create_Instant_Sound (def_id, tm);
411-
WWDEBUG_SAY (("Triggering Sound %d\n", GetTickCount ()));
412+
WWDEBUG_SAY (("Triggering Sound %d\n", TIMEGETTIME ()));
412413
retval = frame;
413414
}
414415
}

0 commit comments

Comments
 (0)