Skip to content

Commit 5208bfe

Browse files
committed
Replace GetTickCount with the equivalent OpenW3D macro
1 parent 94fa5cf commit 5208bfe

21 files changed

Lines changed: 50 additions & 50 deletions

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ FloodProtectionMgrClass::Decay_Old_Entries (void)
7070
{
7171
const int DECAY_TIME = 15000;
7272

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

7575
//
7676
// Loop over all the entries in the list
@@ -124,7 +124,7 @@ FloodProtectionMgrClass::Detect_Flooding (const wchar_t *text)
124124
// Add a new entry to the list
125125
//
126126
FLOOD_ENTRY entry;
127-
entry.time = ::GetTickCount ();
127+
entry.time = ::TIMEGETTIME ();
128128
entry.text_len = 0;
129129
FloodList.Add (entry);
130130
}

Code/Launcher/patch.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,15 @@ void Apply_Patch(char *patchfile,ConfigFile &config,int skuIndex, bool show_dial
246246
HANDLE patchThread = CreateThread(NULL, 0, ApplyPatchThread, (LPVOID)patchfile, 0, &patchID);
247247

248248
int dotcnt = 9;
249-
DWORD last_time = GetTickCount();
249+
DWORD last_time = TIMEGETTIME();
250250
BOOL forward = false;
251251
char worktext[256];
252252
LoadStringA(NULL,IDS_WORKING_TEXT,worktext,sizeof(worktext)-12);
253253
int scnt = strlen(worktext)+1;
254254
strcat(worktext, " ..........");
255255
// Wait for the thread to finish
256256
while (rtpErrCode == -1) {
257-
if (GetTickCount() - last_time > 100) {
257+
if (TIMEGETTIME() - last_time > 100) {
258258
if (forward) {
259259
worktext[scnt+dotcnt] = '.';
260260
if (dotcnt == 9) forward = false;
@@ -265,7 +265,7 @@ void Apply_Patch(char *patchfile,ConfigFile &config,int skuIndex, bool show_dial
265265
else dotcnt--;
266266
}
267267
SetWindowText(GetDlgItem(PatchDialog,IDC_WORKING_BOX),(char *)worktext);
268-
last_time = GetTickCount();
268+
last_time = TIMEGETTIME();
269269
}
270270
while(PeekMessage(&msg,NULL,0,0, PM_REMOVE))
271271
{

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/Tools/LevelEdit/CameraMgr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ CameraMgr::On_Frame (void)
579579
//
580580
static DWORD last_vis_gen = 0;
581581
static DWORD last_static_anim_toggle = 0;
582-
DWORD current_ticks = ::GetTickCount ();
582+
DWORD current_ticks = ::TIMEGETTIME ();
583583
if ((::GetAsyncKeyState (VK_RETURN) < 0) && (current_ticks - last_vis_gen) > 1000) {
584584
Vector3 sample_point = m_WalkThruObj->Get_Transform ().Get_Translation () + Vector3 (0, 0, 1);
585585
::Get_Scene_Editor ()->Record_Vis_Info (m_pCamera->Get_Transform (), sample_point);
@@ -1233,7 +1233,7 @@ CameraMgr::Fly_To_Transform (const Matrix3D &transform)
12331233
index = m_FlyToSpline.Add_Key (end_point, 1);
12341234
m_FlyToSpline.Set_Tangents (index, looking_end, looking_end);
12351235

1236-
m_FlyToStartTime = ::GetTickCount ();
1236+
m_FlyToStartTime = ::TIMEGETTIME ();
12371237
Set_Camera_Mode (MODE_FLYTO);
12381238
return ;
12391239
}
@@ -1254,7 +1254,7 @@ CameraMgr::Update_Fly_To (void)
12541254
fly_ticks = fly_ticks / m_SpeedModifier;
12551255
}
12561256

1257-
DWORD current_time = ::GetTickCount ();
1257+
DWORD current_time = ::TIMEGETTIME ();
12581258
float spline_time = float(current_time - m_FlyToStartTime) / fly_ticks;
12591259
spline_time = std::min (1.0F, spline_time);
12601260

Code/Tools/LevelEdit/GenerateVisDialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ GenerateVisDialogClass::OnOK (void)
134134
//
135135
// Record the time when the vis preprocessing is started
136136
//
137-
DWORD start_time = ::GetTickCount();
137+
DWORD start_time = ::TIMEGETTIME();
138138

139139
//
140140
// Reset the vis data (which also causes the culling systems to re-partition)
@@ -173,7 +173,7 @@ GenerateVisDialogClass::OnOK (void)
173173
//
174174
// Display the total elapsed time to the user
175175
//
176-
DWORD elapsed_time = ::GetTickCount() - start_time;
176+
DWORD elapsed_time = ::TIMEGETTIME() - start_time;
177177
int hours = elapsed_time / (1000 * 60 * 60);
178178
elapsed_time -= hours * (1000 * 60 * 60);
179179
int minutes = elapsed_time / (1000 * 60);

Code/Tools/LevelEdit/GeneratingEdgeSampledVisDialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ GeneratingEdgeSampledVisDialogClass::OnInitDialog (void)
151151
//
152152
// Record the time at operation start
153153
//
154-
m_StartTime = ::GetTickCount ();
154+
m_StartTime = ::TIMEGETTIME ();
155155
Update_Stats ();
156156
return true;
157157
}
@@ -239,7 +239,7 @@ GeneratingEdgeSampledVisDialogClass::Update_Stats (void)
239239
//
240240
// Make a rough estimate of the time we have remaining
241241
//
242-
DWORD elapsed_ticks = ::GetTickCount () - m_StartTime;
242+
DWORD elapsed_ticks = ::TIMEGETTIME () - m_StartTime;
243243
DWORD avg_ticks = elapsed_ticks / std::max(processed,1);
244244
DWORD remaining_ticks = avg_ticks * (total - processed);
245245

Code/Tools/LevelEdit/GeneratingLightVisDialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ GeneratingLightVisDialogClass::WindowProc(UINT message, WPARAM wParam, LPARAM lP
141141

142142
::Get_Main_View ()->Allow_Repaint (false);
143143
SceneEditorClass *scene_editor = ::Get_Scene_Editor ();
144-
m_StartTicks = ::GetTickCount ();
144+
m_StartTicks = ::TIMEGETTIME ();
145145

146146
/*
147147
** Generate the start and end index for the lights we're going to vis
@@ -204,7 +204,7 @@ GeneratingLightVisDialogClass::Update_Status (int cur_light)
204204
//
205205
// Update the elapsed and estimated remaining time
206206
//
207-
DWORD cur_ticks = ::GetTickCount();
207+
DWORD cur_ticks = ::TIMEGETTIME();
208208
DWORD elapsed_ticks;
209209
if (cur_ticks > m_StartTicks) {
210210
elapsed_ticks = cur_ticks - m_StartTicks;

Code/Tools/LevelEdit/GeneratingManualVisDialog.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ GeneratingManualVisDialogClass::WindowProc
141141
//
142142
m_TotalPoints = Get_Manual_Point_Count ();
143143
m_CurrentPoint = 0;
144-
m_StartTime = ::GetTickCount();
144+
m_StartTime = ::TIMEGETTIME();
145145

146146
//
147147
// Render the manual vis points
@@ -175,9 +175,9 @@ GeneratingManualVisDialogClass::On_Manual_Vis_Point_Render (DWORD milliseconds)
175175
// Process window's messages once a second
176176
//
177177
static DWORD last_message_pump = 0;
178-
if (::GetTickCount () - last_message_pump > 1000) {
178+
if (::TIMEGETTIME () - last_message_pump > 1000) {
179179
General_Pump_Messages ();
180-
last_message_pump = ::GetTickCount ();
180+
last_message_pump = ::TIMEGETTIME ();
181181

182182
//
183183
// Output our current status to the status file
@@ -250,7 +250,7 @@ GeneratingManualVisDialogClass::Update_Time (void)
250250
//
251251
// Compute the elapsed and estimated remaining time
252252
//
253-
DWORD cur_ticks = ::GetTickCount();
253+
DWORD cur_ticks = ::TIMEGETTIME();
254254
DWORD elapsed_ticks;
255255
if (cur_ticks > m_StartTime) {
256256
elapsed_ticks = cur_ticks - m_StartTime;

Code/Tools/LevelEdit/GeneratingVisDialog.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ GeneratingVisDialogClass::WindowProc
230230
if (message == WM_USER+101) {
231231

232232
::Get_Main_View ()->Allow_Repaint (false);
233-
m_StartTime = ::GetTickCount();
233+
m_StartTime = ::TIMEGETTIME();
234234

235235
//
236236
// Build a list of nodes we should use during the vis-generation
@@ -309,7 +309,7 @@ GeneratingVisDialogClass::Update_Time (void)
309309
//
310310
// Compute the elapsed and estimated remaining time
311311
//
312-
DWORD cur_ticks = ::GetTickCount();
312+
DWORD cur_ticks = ::TIMEGETTIME();
313313
DWORD elapsed_ticks;
314314
if (cur_ticks > m_StartTime) {
315315
elapsed_ticks = cur_ticks - m_StartTime;
@@ -448,7 +448,7 @@ GeneratingVisDialogClass::Generate_Points
448448
SetDlgItemText (IDC_STATUS_TEXT, status_text);
449449

450450
CString elapsed_text;
451-
elapsed_text.Format ("Elapsed Time: %.1f minutes.",(::GetTickCount() - m_StartTime) / 60000.0f);
451+
elapsed_text.Format ("Elapsed Time: %.1f minutes.",(::TIMEGETTIME() - m_StartTime) / 60000.0f);
452452
SetDlgItemText (IDC_ELAPSED_TIME_TEXT, elapsed_text);
453453

454454
m_ProgressCtrl.SetPos ((index * 100) / count);

0 commit comments

Comments
 (0)