summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-07-25 14:13:27 +0200
committereray orçunus <erayorcunus@gmail.com>2020-07-25 14:18:15 +0200
commit199d57b16c80e51ace23e1640a1c92c3ebca0314 (patch)
tree7e1dcfcca697c11c4272b142f4f2abef3b035352 /src
parentfixed hanim for 64 bit (diff)
downloadre3-199d57b16c80e51ace23e1640a1c92c3ebca0314.tar
re3-199d57b16c80e51ace23e1640a1c92c3ebca0314.tar.gz
re3-199d57b16c80e51ace23e1640a1c92c3ebca0314.tar.bz2
re3-199d57b16c80e51ace23e1640a1c92c3ebca0314.tar.lz
re3-199d57b16c80e51ace23e1640a1c92c3ebca0314.tar.xz
re3-199d57b16c80e51ace23e1640a1c92c3ebca0314.tar.zst
re3-199d57b16c80e51ace23e1640a1c92c3ebca0314.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/Game.cpp2
-rw-r--r--src/skel/crossplatform.h10
-rw-r--r--src/skel/win/win.cpp56
-rw-r--r--src/skel/win/win.h3
4 files changed, 32 insertions, 39 deletions
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index f6275133..0d839dfa 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -365,7 +365,7 @@ bool CGame::Initialise(const char* datFile)
CStreaming::LoadInitialPeds();
CStreaming::RequestBigBuildings(LEVEL_GENERIC);
CStreaming::LoadAllRequestedModels(false);
- printf("Streaming uses %dK of its memory", CStreaming::ms_memoryUsed / 1024);
+ printf("Streaming uses %zuK of its memory", CStreaming::ms_memoryUsed / 1024); // original modifier was %d
LoadingScreen("Loading the Game", "Load animations", GetRandomSplashScreen());
CAnimManager::LoadAnimFiles();
CPed::Initialise();
diff --git a/src/skel/crossplatform.h b/src/skel/crossplatform.h
index 066570be..268eedff 100644
--- a/src/skel/crossplatform.h
+++ b/src/skel/crossplatform.h
@@ -14,14 +14,10 @@ enum eWinVersion
#ifdef _WIN32
-// As long as WITHWINDOWS isn't defined / <Windows.h> isn't included, include <windef.h>, which is lighter.
+// As long as WITHWINDOWS isn't defined / <Windows.h> isn't included, we only need type definitions so let's include <IntSafe.h>.
+// NOTE: It's perfectly fine to include <Windows.h> here, but it can increase build size and time in *some* conditions, and maybe substantially in future if we'll use crossplatform.h more.
#ifndef _INC_WINDOWS
- #ifdef _WIN64
- #define _ARM64_
- #else
- #define _X86_
- #endif
- #include <windef.h>
+ #include <IntSafe.h>
#endif
#if defined RW_D3D9 || defined RWLIBS
#include "win.h"
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index 9fde9d32..5c5c7ece 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -312,34 +312,6 @@ psNativeTextureSupport(void)
/*
*****************************************************************************
*/
-static BOOL
-InitApplication(HANDLE instance)
-{
- /*
- * Perform any necessary MS Windows application initialization. Basically,
- * this means registering the window class for this application.
- */
-
- WNDCLASS windowClass;
-
- windowClass.style = CS_BYTEALIGNWINDOW;
- windowClass.lpfnWndProc = (WNDPROC) MainWndProc;
- windowClass.cbClsExtra = 0;
- windowClass.cbWndExtra = 0;
- windowClass.hInstance = (HINSTANCE)instance;
- windowClass.hIcon = nil;
- windowClass.hCursor = LoadCursor(nil, IDC_ARROW);
- windowClass.hbrBackground = nil;
- windowClass.lpszMenuName = NULL;
- windowClass.lpszClassName = AppClassName;
-
- return RegisterClass(&windowClass);
-}
-
-
-/*
- *****************************************************************************
- */
static HWND
InitInstance(HANDLE instance)
{
@@ -1295,6 +1267,34 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
/*
*****************************************************************************
*/
+static BOOL
+InitApplication(HANDLE instance)
+{
+ /*
+ * Perform any necessary MS Windows application initialization. Basically,
+ * this means registering the window class for this application.
+ */
+
+ WNDCLASS windowClass;
+
+ windowClass.style = CS_BYTEALIGNWINDOW;
+ windowClass.lpfnWndProc = (WNDPROC)MainWndProc;
+ windowClass.cbClsExtra = 0;
+ windowClass.cbWndExtra = 0;
+ windowClass.hInstance = (HINSTANCE)instance;
+ windowClass.hIcon = nil;
+ windowClass.hCursor = LoadCursor(nil, IDC_ARROW);
+ windowClass.hbrBackground = nil;
+ windowClass.lpszMenuName = NULL;
+ windowClass.lpszClassName = AppClassName;
+
+ return RegisterClass(&windowClass);
+}
+
+
+/*
+ *****************************************************************************
+ */
RwBool IsForegroundApp()
{
diff --git a/src/skel/win/win.h b/src/skel/win/win.h
index 4b2001f8..be840898 100644
--- a/src/skel/win/win.h
+++ b/src/skel/win/win.h
@@ -68,9 +68,6 @@ extern "C"
{
#endif /* __cplusplus */
-extern LRESULT CALLBACK
-MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam);
-
#ifdef __DINPUT_INCLUDED__
HRESULT _InputInitialise();
HRESULT CapturePad(RwInt32 padID);