summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2021-01-23 01:34:15 +0100
committerGitHub <noreply@github.com>2021-01-23 01:34:15 +0100
commit10120eb12fb91db551a00839ab30d7542634b87d (patch)
treee8c670366d80e62776b0856466625b50af97c0c7 /src
parentfix config.h (diff)
parentIncludes overhaul, fix some compiler warnings (diff)
downloadre3-10120eb12fb91db551a00839ab30d7542634b87d.tar
re3-10120eb12fb91db551a00839ab30d7542634b87d.tar.gz
re3-10120eb12fb91db551a00839ab30d7542634b87d.tar.bz2
re3-10120eb12fb91db551a00839ab30d7542634b87d.tar.lz
re3-10120eb12fb91db551a00839ab30d7542634b87d.tar.xz
re3-10120eb12fb91db551a00839ab30d7542634b87d.tar.zst
re3-10120eb12fb91db551a00839ab30d7542634b87d.zip
Diffstat (limited to 'src')
-rw-r--r--src/audio/AudioLogic.cpp2
-rw-r--r--src/audio/PoliceRadio.cpp1
-rw-r--r--src/audio/PoliceRadio.h2
-rw-r--r--src/audio/sampman.h1
-rw-r--r--src/audio/sampman_miles.cpp6
-rw-r--r--src/audio/sampman_oal.cpp35
-rw-r--r--src/collision/TempColModels.cpp1
-rw-r--r--src/collision/TempColModels.h2
-rw-r--r--src/control/Garages.h3
-rw-r--r--src/control/Script.h4
-rw-r--r--src/control/Script3.cpp1
-rw-r--r--src/control/Script4.cpp1
-rw-r--r--src/core/ControllerConfig.cpp8
-rw-r--r--src/core/Frontend.cpp6
-rw-r--r--src/core/Game.cpp5
-rw-r--r--src/core/Lists.h2
-rw-r--r--src/core/Pad.cpp9
-rw-r--r--src/core/PlayerInfo.h2
-rw-r--r--src/core/World.cpp5
-rw-r--r--src/core/World.h6
-rw-r--r--src/core/Zones.h4
-rw-r--r--src/core/common.h39
-rw-r--r--src/core/re3.cpp5
-rw-r--r--src/extras/custompipes.cpp2
-rw-r--r--src/extras/custompipes_d3d9.cpp2
-rw-r--r--src/extras/postfx.cpp3
-rw-r--r--src/extras/screendroplets.cpp2
-rw-r--r--src/fakerw/fake.cpp2
-rw-r--r--src/modelinfo/BaseModelInfo.cpp1
-rw-r--r--src/modelinfo/BaseModelInfo.h2
-rw-r--r--src/modelinfo/ModelInfo.h3
-rw-r--r--src/modelinfo/PedModelInfo.h1
-rw-r--r--src/peds/Ped.cpp1
-rw-r--r--src/peds/Ped.h2
-rw-r--r--src/render/MBlur.cpp1
-rw-r--r--src/render/Renderer.cpp2
-rw-r--r--src/render/WaterCreatures.cpp2
-rw-r--r--src/rw/RwHelper.cpp2
-rw-r--r--src/save/MemoryCard.cpp1
-rw-r--r--src/skel/glfw/glfw.cpp45
-rw-r--r--src/skel/win/win.cpp19
-rw-r--r--src/vehicles/Automobile.cpp1
-rw-r--r--src/vehicles/Bike.h1
-rw-r--r--src/vehicles/Boat.cpp1
-rw-r--r--src/vehicles/Vehicle.h6
45 files changed, 110 insertions, 142 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 7d759279..c58daaaf 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -41,7 +41,7 @@
#include "WindModifiers.h"
#include "Fluff.h"
#include "Script.h"
-
+#include "Wanted.h"
const int channels = ARRAY_SIZE(cAudioManager::m_asActiveSamples);
const int policeChannel = channels + 1;
diff --git a/src/audio/PoliceRadio.cpp b/src/audio/PoliceRadio.cpp
index cf6f5bee..e174e587 100644
--- a/src/audio/PoliceRadio.cpp
+++ b/src/audio/PoliceRadio.cpp
@@ -13,6 +13,7 @@
#include "World.h"
#include "Zones.h"
#include "sampman.h"
+#include "Wanted.h"
const int channels = ARRAY_SIZE(cAudioManager::m_asActiveSamples);
const int policeChannel = channels + 1;
diff --git a/src/audio/PoliceRadio.h b/src/audio/PoliceRadio.h
index e9a0fde0..d7c928e2 100644
--- a/src/audio/PoliceRadio.h
+++ b/src/audio/PoliceRadio.h
@@ -1,6 +1,6 @@
#pragma once
-#include "Wanted.h"
+#include "Crime.h"
struct cAMCrime {
int32 type;
diff --git a/src/audio/sampman.h b/src/audio/sampman.h
index 2db29244..5d7d39af 100644
--- a/src/audio/sampman.h
+++ b/src/audio/sampman.h
@@ -1,5 +1,4 @@
#pragma once
-#include "common.h"
#include "AudioSamples.h"
#define MAX_VOLUME 127
diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp
index c360d64f..2d6a655e 100644
--- a/src/audio/sampman_miles.cpp
+++ b/src/audio/sampman_miles.cpp
@@ -1,8 +1,5 @@
-#include "common.h"
-
#ifdef AUDIO_MSS
-#include <windows.h>
-#include <shobjidl.h>
+#include <shlobj.h>
#include <shlguid.h>
#include <time.h>
@@ -11,6 +8,7 @@
#include "eax-util.h"
#include "mss.h"
+#include "common.h"
#include "sampman.h"
#include "AudioManager.h"
#include "MusicManager.h"
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp
index 5fe05d54..0d06098d 100644
--- a/src/audio/sampman_oal.cpp
+++ b/src/audio/sampman_oal.cpp
@@ -1,17 +1,11 @@
//#define JUICY_OAL
#ifdef AUDIO_OAL
-#include "sampman.h"
-
#include <time.h>
#include "eax.h"
#include "eax-util.h"
-#define WITHWINDOWS
-#include "common.h"
-#include "crossplatform.h"
-
#ifdef _WIN32
#include <io.h>
#include <AL/al.h>
@@ -19,8 +13,24 @@
#include <AL/alext.h>
#include <AL/efx.h>
#include <AL/efx-presets.h>
+
+// for user MP3s
+#include <direct.h>
+#include <shlobj.h>
+#include <shlguid.h>
+#else
+#define _getcwd getcwd
+#endif
+
+#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK
+#pragma comment( lib, "OpenAL32.lib" )
#endif
+#include "common.h"
+#include "crossplatform.h"
+
+#include "sampman.h"
+
#include "oal/oal_utils.h"
#include "oal/aldlist.h"
#include "oal/channel.h"
@@ -38,19 +48,6 @@
//TODO: max channels
//TODO: loop count
-#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK
-#pragma comment( lib, "OpenAL32.lib" )
-#endif
-
-// for user MP3s
-#ifdef _WIN32
-#include <direct.h>
-#include <shobjidl.h>
-#include <shlguid.h>
-#else
-#define _getcwd getcwd
-#endif
-
cSampleManager SampleManager;
bool _bSampmanInitialised = false;
diff --git a/src/collision/TempColModels.cpp b/src/collision/TempColModels.cpp
index f8b26450..0c0d4376 100644
--- a/src/collision/TempColModels.cpp
+++ b/src/collision/TempColModels.cpp
@@ -1,6 +1,7 @@
#include "common.h"
#include "TempColModels.h"
+#include "Game.h"
CColModel CTempColModels::ms_colModelPed1;
CColModel CTempColModels::ms_colModelPed2;
diff --git a/src/collision/TempColModels.h b/src/collision/TempColModels.h
index 0c936d6f..1a888723 100644
--- a/src/collision/TempColModels.h
+++ b/src/collision/TempColModels.h
@@ -1,6 +1,6 @@
#pragma once
-#include "Collision.h"
+#include "ColModel.h"
class CTempColModels
{
diff --git a/src/control/Garages.h b/src/control/Garages.h
index 3d12d4a2..39327e4e 100644
--- a/src/control/Garages.h
+++ b/src/control/Garages.h
@@ -1,11 +1,10 @@
#pragma once
-#include "Automobile.h"
#include "audio_enums.h"
#include "Camera.h"
#include "config.h"
+#include "Lists.h"
class CVehicle;
-class CCamera;
enum eGarageState
{
diff --git a/src/control/Script.h b/src/control/Script.h
index ae984c59..a45e11cf 100644
--- a/src/control/Script.h
+++ b/src/control/Script.h
@@ -1,7 +1,5 @@
#pragma once
-#include "common.h"
#include "Font.h"
-#include "Ped.h"
#include "PedType.h"
#include "Text.h"
#include "Sprite2d.h"
@@ -38,9 +36,11 @@ void FlushLog();
#define SPHERE_MARKER_PULSE_FRACTION 0.1f
#ifdef USE_PRECISE_MEASUREMENT_CONVERTION
+#define MILES_IN_METER (0.000621371192f)
#define METERS_IN_FOOT (0.3048f)
#define FEET_IN_METER (3.28084f)
#else
+#define MILES_IN_METER (1 / 1670.f)
#define METERS_IN_FOOT (0.3f)
#define FEET_IN_METER (3.33f)
#endif
diff --git a/src/control/Script3.cpp b/src/control/Script3.cpp
index aba06d03..1ac18fa8 100644
--- a/src/control/Script3.cpp
+++ b/src/control/Script3.cpp
@@ -34,6 +34,7 @@
#include "Zones.h"
#include "GameLogic.h"
#include "Bike.h"
+#include "Wanted.h"
int8 CRunningScript::ProcessCommands500To599(int32 command)
{
diff --git a/src/control/Script4.cpp b/src/control/Script4.cpp
index 51dc14d3..9830f0dc 100644
--- a/src/control/Script4.cpp
+++ b/src/control/Script4.cpp
@@ -39,6 +39,7 @@
#include "World.h"
#include "Zones.h"
#include "Bike.h"
+#include "Wanted.h"
#ifdef FIX_BUGS
static bool IsSlideObjectUsedWrongByScript(const CVector& posTarget, const CVector& slideBy)
diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp
index eea1f6f0..585eac4e 100644
--- a/src/core/ControllerConfig.cpp
+++ b/src/core/ControllerConfig.cpp
@@ -1,11 +1,7 @@
-#if defined RW_D3D9 || defined RWLIBS
-#define DIRECTINPUT_VERSION 0x0800
-#include <dinput.h>
-#endif
-
+#define WITHDINPUT
#include "common.h"
#include "platform.h"
-#include "crossplatform.h" // for Windows version
+#include "crossplatform.h"
#include "ControllerConfig.h"
#include "Pad.h"
#include "FileMgr.h"
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index f8945d98..086a9887 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -1,10 +1,6 @@
-#if defined RW_D3D9 || defined RWLIBS
-#define DIRECTINPUT_VERSION 0x0800
-#include <dinput.h>
-#endif
-
#define FORCE_PC_SCALING
#define WITHWINDOWS
+#define WITHDINPUT
#include "common.h"
#ifndef PS2_MENU
#include "crossplatform.h"
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index c407bbe8..83d30bb4 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -1,6 +1,3 @@
-#pragma warning( push )
-#pragma warning( disable : 4005)
-#pragma warning( pop )
#include "common.h"
#include "platform.h"
@@ -10,7 +7,6 @@
#include "Accident.h"
#include "Antennas.h"
#include "Bridge.h"
-#include "Camera.h"
#include "CarCtrl.h"
#include "CarGen.h"
#include "CdStream.h"
@@ -69,7 +65,6 @@
#include "Skidmarks.h"
#include "SetPieces.h"
#include "SpecialFX.h"
-#include "Sprite2d.h"
#include "Stats.h"
#include "Streaming.h"
#include "SurfaceTable.h"
diff --git a/src/core/Lists.h b/src/core/Lists.h
index ecf24740..7572e882 100644
--- a/src/core/Lists.h
+++ b/src/core/Lists.h
@@ -1,7 +1,5 @@
#pragma once
-#include "common.h"
-
class CPtrNode
{
public:
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 60ff3555..671a4552 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -1,11 +1,4 @@
-#pragma warning( push )
-#pragma warning( disable : 4005)
-#if defined RW_D3D9 || defined RWLIBS
-#define DIRECTINPUT_VERSION 0x0800
-#include <dinput.h>
-#endif
-#pragma warning( pop )
-
+#define WITHDINPUT
#include "common.h"
#include "crossplatform.h"
#include "platform.h"
diff --git a/src/core/PlayerInfo.h b/src/core/PlayerInfo.h
index a3896ebb..a24185f0 100644
--- a/src/core/PlayerInfo.h
+++ b/src/core/PlayerInfo.h
@@ -1,6 +1,6 @@
#pragma once
-#include "Collision.h"
+#include "ColModel.h"
enum eWastedBustedState
{
diff --git a/src/core/World.cpp b/src/core/World.cpp
index f7d2a28b..bc698c83 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -4,7 +4,6 @@
#include "CopPed.h"
#include "CutsceneMgr.h"
#include "DMAudio.h"
-#include "Entity.h"
#include "EventList.h"
#include "Explosion.h"
#include "Fire.h"
@@ -12,11 +11,8 @@
#include "Glass.h"
#include "Messages.h"
#include "ModelIndices.h"
-#include "Object.h"
#include "ParticleObject.h"
-#include "Ped.h"
#include "Pickups.h"
-#include "PlayerPed.h"
#include "Population.h"
#include "ProjectileInfo.h"
#include "Record.h"
@@ -25,7 +21,6 @@
#include "RpAnimBlend.h"
#include "Shadows.h"
#include "TempColModels.h"
-#include "Vehicle.h"
#include "WaterLevel.h"
#include "World.h"
diff --git a/src/core/World.h b/src/core/World.h
index 59bf634c..81eb5d4c 100644
--- a/src/core/World.h
+++ b/src/core/World.h
@@ -3,6 +3,7 @@
#include "Game.h"
#include "Lists.h"
#include "PlayerInfo.h"
+#include "Collision.h"
/* Sectors span from -2400 to 1600 in x and -2000 to 2000 y.
* With 80x80 sectors, each is 50x50 units. */
@@ -48,11 +49,6 @@ public:
VALIDATE_SIZE(CSector, 0x28);
-class CEntity;
-struct CColPoint;
-struct CColLine;
-struct CStoredCollPoly;
-
class CWorld
{
static CPtrList ms_bigBuildingsList[NUM_LEVELS];
diff --git a/src/core/Zones.h b/src/core/Zones.h
index 5306d9f1..b987f009 100644
--- a/src/core/Zones.h
+++ b/src/core/Zones.h
@@ -103,8 +103,8 @@ public:
static void SetPedDensity(uint16 zoneid, uint8 day, uint16 peddensity);
static void SetPedGroup(uint16 zoneid, uint8 day, uint16 pedgroup);
static int16 FindAudioZone(CVector *pos);
- static CZone *GetPointerForZoneIndex(int32 i) { return i == -1 ? nil : &NavigationZoneArray[i]; }
- static int32 GetIndexForZonePointer(CZone *zone) { return zone == nil ? -1 : zone - NavigationZoneArray; }
+ static CZone *GetPointerForZoneIndex(ssize_t i) { return i == -1 ? nil : &NavigationZoneArray[i]; }
+ static ssize_t GetIndexForZonePointer(CZone *zone) { return zone == nil ? -1 : zone - NavigationZoneArray; }
static void AddZoneToAudioZoneArray(CZone *zone);
static void InitialiseAudioZoneArray(void);
static void SaveAllZones(uint8 *buffer, uint32 *length);
diff --git a/src/core/common.h b/src/core/common.h
index 2391f5fb..7fdbdf69 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -11,17 +11,34 @@
#include <string.h>
#include <math.h>
-#if defined _WIN32 && defined WITHWINDOWS
-#include <windows.h>
+#if !defined RW_D3D9 && defined LIBRW
+#undef WITHD3D
+#undef WITHDINPUT
+#endif
+
+#if (defined WITHD3D && !defined LIBRW)
+#define WITHWINDOWS
#endif
-#if defined _WIN32 && defined WITHD3D
+#if defined _WIN32 && defined WITHWINDOWS && !defined _INC_WINDOWS
#include <windows.h>
-#ifndef USE_D3D9
-#include <d3d8types.h>
-#else
-#include <d3d9types.h>
#endif
+
+#ifdef WITHD3D
+ #ifdef LIBRW
+ #define WITH_D3D // librw includes d3d9 itself via this right now
+ #else
+ #ifndef USE_D3D9
+ #include <d3d8types.h>
+ #else
+ #include <d3d9types.h>
+ #endif
+ #endif
+#endif
+
+#ifdef WITHDINPUT
+#define DIRECTINPUT_VERSION 0x0800
+#include <dinput.h>
#endif
#include <rwcore.h>
@@ -52,14 +69,6 @@
#define rwVENDORID_ROCKSTAR 0x0253F2
-// Get rid of bullshit windows definitions, we're not running on an 8086
-#ifdef far
-#undef far
-#endif
-#ifdef near
-#undef near
-#endif
-
#define Max(a,b) ((a) > (b) ? (a) : (b))
#define Min(a,b) ((a) < (b) ? (a) : (b))
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 80e8cb6b..7b3ab10c 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -1,7 +1,6 @@
#include <csignal>
#define WITHWINDOWS
#include "common.h"
-#include "crossplatform.h"
#include "Renderer.h"
#include "Occlusion.h"
#include "Credits.h"
@@ -39,6 +38,10 @@
#include "ControllerConfig.h"
#endif
+#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+#include "crossplatform.h"
+#endif
+
#ifndef _WIN32
#include "assert.h"
#include <stdarg.h>
diff --git a/src/extras/custompipes.cpp b/src/extras/custompipes.cpp
index 2cecf1c0..a485138e 100644
--- a/src/extras/custompipes.cpp
+++ b/src/extras/custompipes.cpp
@@ -1,4 +1,4 @@
-#define WITH_D3D
+#define WITHD3D
#include "common.h"
#ifdef EXTENDED_PIPELINES
diff --git a/src/extras/custompipes_d3d9.cpp b/src/extras/custompipes_d3d9.cpp
index d0984ffe..d7634e99 100644
--- a/src/extras/custompipes_d3d9.cpp
+++ b/src/extras/custompipes_d3d9.cpp
@@ -1,4 +1,4 @@
-#define WITH_D3D
+#define WITHD3D
#include "common.h"
#ifdef RW_D3D9
diff --git a/src/extras/postfx.cpp b/src/extras/postfx.cpp
index 2ea08141..03010267 100644
--- a/src/extras/postfx.cpp
+++ b/src/extras/postfx.cpp
@@ -1,5 +1,4 @@
-#define WITHWINDOWS
-#define WITH_D3D
+#define WITHD3D
#include "common.h"
#ifdef EXTENDED_COLOURFILTER
diff --git a/src/extras/screendroplets.cpp b/src/extras/screendroplets.cpp
index ac3a17b2..74c44da0 100644
--- a/src/extras/screendroplets.cpp
+++ b/src/extras/screendroplets.cpp
@@ -1,4 +1,4 @@
-#define WITH_D3D
+#define WITHD3D
#include "common.h"
#ifdef SCREEN_DROPLETS
diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp
index 4a8a945d..18a27ec1 100644
--- a/src/fakerw/fake.cpp
+++ b/src/fakerw/fake.cpp
@@ -1,5 +1,5 @@
#define _CRT_SECURE_NO_WARNINGS
-#define WITH_D3D
+#define WITH_D3D // not WITHD3D, so it's librw define
#include <rwcore.h>
#include <rpworld.h>
#include <rpmatfx.h>
diff --git a/src/modelinfo/BaseModelInfo.cpp b/src/modelinfo/BaseModelInfo.cpp
index 966ffb38..d0f868fa 100644
--- a/src/modelinfo/BaseModelInfo.cpp
+++ b/src/modelinfo/BaseModelInfo.cpp
@@ -5,6 +5,7 @@
#include "2dEffect.h"
#include "BaseModelInfo.h"
#include "ModelInfo.h"
+#include "ColModel.h"
CBaseModelInfo::CBaseModelInfo(ModelInfoType type)
{
diff --git a/src/modelinfo/BaseModelInfo.h b/src/modelinfo/BaseModelInfo.h
index 18e84c21..2d1dc8ac 100644
--- a/src/modelinfo/BaseModelInfo.h
+++ b/src/modelinfo/BaseModelInfo.h
@@ -1,6 +1,6 @@
#pragma once
-#include "Collision.h"
+struct CColModel;
#define MAX_MODEL_NAME (21)
diff --git a/src/modelinfo/ModelInfo.h b/src/modelinfo/ModelInfo.h
index 1ac7b0bb..30f4c015 100644
--- a/src/modelinfo/ModelInfo.h
+++ b/src/modelinfo/ModelInfo.h
@@ -1,14 +1,13 @@
#pragma once
#include "2dEffect.h"
-#include "BaseModelInfo.h"
#include "SimpleModelInfo.h"
#include "TimeModelInfo.h"
#include "WeaponModelInfo.h"
#include "ClumpModelInfo.h"
#include "PedModelInfo.h"
#include "VehicleModelInfo.h"
-#include "Instance.h"
+#include "templates.h"
class CModelInfo
{
diff --git a/src/modelinfo/PedModelInfo.h b/src/modelinfo/PedModelInfo.h
index 86e6b74a..79bd7eaa 100644
--- a/src/modelinfo/PedModelInfo.h
+++ b/src/modelinfo/PedModelInfo.h
@@ -1,6 +1,7 @@
#pragma once
#include "ClumpModelInfo.h"
+#include "ColModel.h"
#include "PedType.h"
enum PedNode {
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 22b03cce..6a3df18b 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -38,6 +38,7 @@
#include "WindModifiers.h"
#include "CutsceneShadow.h"
#include "Clock.h"
+#include "Wanted.h"
CPed *gapTempPedList[50];
uint16 gnNumTempPedList;
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 05b8914e..8b091d15 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -9,8 +9,8 @@
#include "Physical.h"
#include "Weapon.h"
#include "WeaponInfo.h"
-#include "AnimationId.h"
#include "PathFind.h"
+#include "Collision.h"
#define FEET_OFFSET 1.04f
#define CHECK_NEARBY_THINGS_MAX_DIST 15.0f
diff --git a/src/render/MBlur.cpp b/src/render/MBlur.cpp
index 205f9d92..a94a5245 100644
--- a/src/render/MBlur.cpp
+++ b/src/render/MBlur.cpp
@@ -1,4 +1,3 @@
-#define WITHWINDOWS
#ifndef LIBRW
#define WITHD3D
#endif
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 7522f832..8c4714fb 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1,4 +1,4 @@
-#define WITH_D3D
+#define WITHD3D
#include "common.h"
#include "main.h"
diff --git a/src/render/WaterCreatures.cpp b/src/render/WaterCreatures.cpp
index d3bd2701..01f241b3 100644
--- a/src/render/WaterCreatures.cpp
+++ b/src/render/WaterCreatures.cpp
@@ -1,10 +1,10 @@
+#include "common.h"
#include "WaterCreatures.h"
#include "ModelIndices.h"
#include "World.h"
#include "WaterLevel.h"
#include "Camera.h"
#include "PlayerPed.h"
-#include "config.h"
#include "General.h"
int CWaterCreatures::nNumActiveSeaLifeForms;
diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp
index d3fbd1d0..609dd79b 100644
--- a/src/rw/RwHelper.cpp
+++ b/src/rw/RwHelper.cpp
@@ -1,6 +1,4 @@
-#if defined RW_D3D9 || defined RWLIBS
#define WITHD3D
-#endif
#include "common.h"
#include "Timecycle.h"
diff --git a/src/save/MemoryCard.cpp b/src/save/MemoryCard.cpp
index c8ebcd86..d6e95d33 100644
--- a/src/save/MemoryCard.cpp
+++ b/src/save/MemoryCard.cpp
@@ -1,6 +1,7 @@
#define WITHWINDOWS
#include "common.h"
#ifdef PS2_MENU
+#include "crossplatform.h"
#include "MemoryCard.h"
#include "main.h"
#include "DMAudio.h"
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index 3154ad99..8c9289d2 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -1,22 +1,30 @@
#if defined RW_GL3 && !defined LIBRW_SDL2
#ifdef _WIN32
-#include <windows.h>
+#include <shlobj.h>
+#include <basetsd.h>
#include <mmsystem.h>
+#include <regstr.h>
#include <shellapi.h>
#include <windowsx.h>
-#include <basetsd.h>
-#include <regstr.h>
-#include <shlobj.h>
+
+DWORD _dwOperatingSystemVersion;
+#include "resource.h"
+#else
+long _dwOperatingSystemVersion;
+#ifndef __APPLE__
+#include <sys/sysinfo.h>
+#else
+#include <mach/mach_host.h>
+#include <sys/sysctl.h>
+#endif
+#include <errno.h>
+#include <locale.h>
+#include <signal.h>
+#include <stddef.h>
#endif
-#define WITHWINDOWS
#include "common.h"
-
-#pragma warning( push )
-#pragma warning( disable : 4005)
-#pragma warning( pop )
-
#if (defined(_MSC_VER))
#include <tchar.h>
#endif /* (defined(_MSC_VER)) */
@@ -72,23 +80,6 @@ static psGlobalType PsGlobal;
size_t _dwMemAvailPhys;
RwUInt32 gGameState;
-#ifdef _WIN32
-DWORD _dwOperatingSystemVersion;
-#include "resource.h"
-#else
-long _dwOperatingSystemVersion;
-#ifndef __APPLE__
-#include <sys/sysinfo.h>
-#else
-#include <mach/mach_host.h>
-#include <sys/sysctl.h>
-#endif
-#include <stddef.h>
-#include <locale.h>
-#include <signal.h>
-#include <errno.h>
-#endif
-
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
char gSelectedJoystickName[128] = "";
#endif
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index 84a010de..242a3fe2 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -2,7 +2,6 @@
#define _WIN32_WINDOWS 0x0500
#define WINVER 0x0500
-#define DIRECTINPUT_VERSION 0x0800
#include <winerror.h>
#include <windows.h>
@@ -20,13 +19,7 @@
#pragma warning( push )
#pragma warning( disable : 4005)
-#ifdef USE_D3D9
-#include <d3d9.h>
-#else
-#include <d3d8.h>
-#endif
#include <ddraw.h>
-#include <dinput.h>
#include <DShow.h>
#pragma warning( pop )
@@ -41,6 +34,9 @@
#pragma comment( lib, "strmiids.lib" )
#pragma comment( lib, "dinput8.lib" )
+#define WITHD3D
+#define WITHDINPUT
+#include "common.h"
#if (defined(_MSC_VER))
#include <tchar.h>
#endif /* (defined(_MSC_VER)) */
@@ -81,7 +77,6 @@ static psGlobalType PsGlobal;
#define JIF(x) if (FAILED(hr=(x))) \
{debug(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); return;}
-#include "common.h"
#include "main.h"
#include "FileMgr.h"
#include "Text.h"
@@ -92,12 +87,14 @@ static psGlobalType PsGlobal;
#include "Frontend.h"
#include "Game.h"
#include "PCSave.h"
-#include "MemoryCard.h"
-#include "Sprite2d.h"
#include "AnimViewer.h"
-#include "Font.h"
#include "MemoryMgr.h"
+#ifdef PS2_MENU
+#include "MemoryCard.h"
+#include "Font.h"
+#endif
+
VALIDATE_SIZE(psGlobalType, 0x28);
// DirectShow interfaces
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 8a5426ed..961b8108 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -49,6 +49,7 @@
#include "Object.h"
#include "Automobile.h"
#include "Bike.h"
+#include "Wanted.h"
bool bAllCarCheat;
diff --git a/src/vehicles/Bike.h b/src/vehicles/Bike.h
index 3fcf66a2..219d8872 100644
--- a/src/vehicles/Bike.h
+++ b/src/vehicles/Bike.h
@@ -2,6 +2,7 @@
#include "Vehicle.h"
#include "Skidmarks.h"
+#include "AnimManager.h"
enum eBikeNodes {
BIKE_NODE_NONE,
diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp
index adaab72c..5aed5814 100644
--- a/src/vehicles/Boat.cpp
+++ b/src/vehicles/Boat.cpp
@@ -27,6 +27,7 @@
#include "RpAnimBlend.h"
#include "Record.h"
#include "Shadows.h"
+#include "Wanted.h"
#define INVALID_ORIENTATION (-9999.99f)
diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h
index 7388bfab..4a361215 100644
--- a/src/vehicles/Vehicle.h
+++ b/src/vehicles/Vehicle.h
@@ -3,15 +3,15 @@
#include "Physical.h"
#include "AutoPilot.h"
#include "ModelIndices.h"
-#include "AnimManager.h"
-#include "Weapon.h"
+#include "AnimationId.h"
+#include "WeaponType.h"
+#include "Collision.h"
#include "HandlingMgr.h"
class CPed;
class CPlayerPed;
class CCopPed;
class CFire;
-struct tHandlingData;
enum {
RANDOM_VEHICLE = 1,