Skip to content

Commit 70b1190

Browse files
committed
Don't use GetTickCount64 in 32-bit version
1 parent 14d13c4 commit 70b1190

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

LDView.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<IntrinsicFunctions>true</IntrinsicFunctions>
111111
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
112112
<AdditionalIncludeDirectories>.;./include;./boost/include;./3rdParty;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
113-
<PreprocessorDefinitions>USE_CPP11;HAVE_MINIZIP;NDEBUG;WIN32;_WINDOWS;_WIN32_WINDOWS=0x0501;_WIN32_WINNT=0x0501;_TC_STATIC;LDVIEW_APP;EXPORT_3DS;_NO_BOOST;%(PreprocessorDefinitions)</PreprocessorDefinitions>
113+
<PreprocessorDefinitions>LDVIEW_NO_64;USE_CPP11;HAVE_MINIZIP;NDEBUG;WIN32;_WINDOWS;_WIN32_WINDOWS=0x0501;_WIN32_WINNT=0x0501;_TC_STATIC;LDVIEW_APP;EXPORT_3DS;_NO_BOOST;%(PreprocessorDefinitions)</PreprocessorDefinitions>
114114
<StringPooling>true</StringPooling>
115115
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
116116
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -197,7 +197,7 @@
197197
<ClCompile>
198198
<Optimization>Disabled</Optimization>
199199
<AdditionalIncludeDirectories>.;./include;./boost/include;./3rdParty;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
200-
<PreprocessorDefinitions>USE_CPP11;HAVE_MINIZIP;_DEBUG;_LOG_PERFORMANCE;WIN32;_WINDOWS;_WIN32_WINDOWS=0x0501;_WIN32_WINNT=0x0501;_TC_STATIC;LDVIEW_APP;EXPORT_3DS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
200+
<PreprocessorDefinitions>LDVIEW_NO_64;USE_CPP11;HAVE_MINIZIP;_DEBUG;_LOG_PERFORMANCE;WIN32;_WINDOWS;_WIN32_WINDOWS=0x0501;_WIN32_WINNT=0x0501;_TC_STATIC;LDVIEW_APP;EXPORT_3DS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
201201
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
202202
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
203203
<PrecompiledHeaderOutputFile>.\Debug/LDView.pch</PrecompiledHeaderOutputFile>

ModelWindow.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,11 @@ int ModelWindow::progressCallback(
24612461
bool fromImage,
24622462
bool showErrors /*= false*/)
24632463
{
2464+
#ifdef LDVIEW_NO_64
2465+
DWORD thisProgressUpdate = GetTickCount();
2466+
#else
24642467
ULONGLONG thisProgressUpdate = GetTickCount64();
2468+
#endif
24652469

24662470
if (!windowShown)
24672471
{

ModelWindow.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,11 @@ class ModelWindow: public CUIOGLWindow
421421
HWND hProgressMessage;
422422
bool cancelLoad;
423423
bool loadCanceled;
424+
#ifdef LDVIEW_NO_64
425+
DWORD lastProgressUpdate;
426+
#else
424427
ULONGLONG lastProgressUpdate;
428+
#endif
425429
bool loading;
426430
bool needsRecompile;
427431
HWND hErrorWindow;

SSModelWindow.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ SSModelWindow::SSModelWindow(CUIWindow* parentWindow, int x, int y,
2525
DEFAULT_SS_SPEED))
2626
, ssRotationSpeed(TCUserDefaults::longForKey(SS_ROTATION_SPEED_KEY,
2727
DEFAULT_SS_ROT_SPEED))
28+
#ifdef LDVIEW_NO_64
29+
, startTick(GetTickCount())
30+
#else
2831
, startTick(GetTickCount64())
32+
#endif
2933
, powerSaveTimeout(0)
3034
, ssFileMode(TCUserDefaults::longForKey(SS_FILE_MODE_KEY,
3135
DEFAULT_SS_FILE_MODE))
@@ -202,7 +206,11 @@ void SSModelWindow::doPaint(void)
202206
double yScale = ((double)screenHeight - height) / 2.0;
203207
double newX;
204208
double newY;
209+
#ifdef LDVIEW_NO_64
210+
DWORD t = GetTickCount();
211+
#else
205212
ULONGLONG t = GetTickCount64();
213+
#endif
206214

207215
// rect.left = x;
208216
// rect.right = x + width;

SSModelWindow.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ class SSModelWindow : public ModelWindow
3737
long ssSize;
3838
long ssSpeed;
3939
long ssRotationSpeed;
40+
#ifdef LDVIEW_NO_64
41+
DWORD startTick;
42+
#else
4043
ULONGLONG startTick;
44+
#endif
4145
int powerSaveTimeout;
4246
ucstring ssFilename;
4347
long ssFileMode;

0 commit comments

Comments
 (0)