summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/animation/AnimBlendAssocGroup.cpp20
-rw-r--r--src/audio/AudioManager.cpp2
-rw-r--r--src/audio/DMAudio.h1
-rw-r--r--src/audio/sampman.cpp119
-rw-r--r--src/control/Darkel.h3
-rw-r--r--src/control/PathFind.cpp35
-rw-r--r--src/control/TrafficLights.cpp2
-rw-r--r--src/core/CrimeType.h23
-rw-r--r--src/core/Game.cpp2
-rw-r--r--src/core/General.h2
-rw-r--r--src/core/Pad.cpp2
-rw-r--r--src/core/PlayerInfo.cpp2
-rw-r--r--src/core/Wanted.h22
-rw-r--r--src/core/common.h4
-rw-r--r--src/objects/ParticleObject.h2
-rw-r--r--src/peds/Ped.h10
-rw-r--r--src/render/ParticleMgr.h78
-rw-r--r--src/weapons/Weapon.h48
18 files changed, 230 insertions, 147 deletions
diff --git a/src/animation/AnimBlendAssocGroup.cpp b/src/animation/AnimBlendAssocGroup.cpp
index 27b091bd..e65bdf8d 100644
--- a/src/animation/AnimBlendAssocGroup.cpp
+++ b/src/animation/AnimBlendAssocGroup.cpp
@@ -59,7 +59,8 @@ CAnimBlendAssociation*
CAnimBlendAssocGroup::CopyAnimation(const char *name)
{
CAnimBlendAssociation *anim = GetAnimation(name);
- if(anim == nil) return nil;
+ if(anim == nil)
+ return nil;
CAnimManager::UncompressAnimation(anim->hierarchy);
return new CAnimBlendAssociation(*anim);
}
@@ -69,26 +70,19 @@ strcmpIgnoringDigits(const char *s1, const char *s2)
{
char c1, c2;
- for(;;) {
+ for(;;){
c1 = *s1;
c2 = *s2;
if(c1) s1++;
if(c2) s2++;
- if(c1 == '\0' && c2 == '\0') return true;
-#if 1
- if(iswdigit(c1) && iswdigit(c2))
-#else
+ if(c1 == '\0' && c2 == '\0')
+ return true;
if(__ascii_iswdigit(c1) && __ascii_iswdigit(c2))
-#endif
continue;
-#if 1
- c1 = toupper(c1);
- c2 = toupper(c2);
-#else
c1 = __ascii_toupper(c1);
c2 = __ascii_toupper(c2);
-#endif
- if(c1 != c2) return false;
+ if(c1 != c2)
+ return false;
}
}
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index 0a156cd4..4d5f8474 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -10035,7 +10035,7 @@ cAudioManager::UpdateReflections()
if(CWorld::ProcessVerticalLine(
camPos, m_avecReflectionsPos[4].z, colpoint,
ent, true, false, false, false, true, false,
- nil)) {
+ false)) {
m_afReflectionsDistances[4] =
colpoint.point.z - camPos.z;
} else {
diff --git a/src/audio/DMAudio.h b/src/audio/DMAudio.h
index 00bf75ad..9ce073b4 100644
--- a/src/audio/DMAudio.h
+++ b/src/audio/DMAudio.h
@@ -1,7 +1,6 @@
#pragma once
#include "audio_enums.h"
-#include "CrimeType.h"
enum eSound : int16
{
diff --git a/src/audio/sampman.cpp b/src/audio/sampman.cpp
index a375b847..d24de27f 100644
--- a/src/audio/sampman.cpp
+++ b/src/audio/sampman.cpp
@@ -1986,59 +1986,50 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
if ( nFile == STREAMED_SOUND_RADIO_MP3_PLAYER )
{
uint32 i = 0;
- do {
- if(i != 0 || _bIsMp3Active) {
- if(++_CurMP3Index >= nNumMP3s) _CurMP3Index = 0;
-
- _CurMP3Pos = 0;
-
- tMP3Entry *mp3 = _GetMP3EntryByIndex(_CurMP3Index);
-
- if(mp3) {
- mp3 = _pMP3List;
- if(mp3 == NULL) {
- _bIsMp3Active = false;
- nFile = 0;
- strcpy(filename, m_szCDRomRootPath);
- strcat(filename, StreamedNameTable[nFile]);
-
- mp3Stream[nStream] =
- AIL_open_stream(DIG, filename, 0);
- if(mp3Stream[nStream]) {
- AIL_set_stream_loop_count(
- mp3Stream[nStream], 1);
- AIL_set_stream_ms_position(
- mp3Stream[nStream], position);
- AIL_pause_stream(mp3Stream[nStream],
- 0);
- return true;
- }
-
- return false;
- }
- }
-
- if(mp3->pLinkPath != NULL)
- mp3Stream[nStream] =
- AIL_open_stream(DIG, mp3->pLinkPath, 0);
- else {
- strcpy(filename, _mp3DirectoryPath);
- strcat(filename, mp3->aFilename);
-
- mp3Stream[nStream] =
- AIL_open_stream(DIG, filename, 0);
- }
-
- if(mp3Stream[nStream]) {
- AIL_set_stream_loop_count(mp3Stream[nStream], 1);
- AIL_set_stream_ms_position(mp3Stream[nStream], 0);
- AIL_pause_stream(mp3Stream[nStream], 0);
- return true;
+
+ if ( !_bIsMp3Active ) goto FIND_MP3TRACK;
+
+ do
+ {
+ if ( ++_CurMP3Index >= nNumMP3s )
+ _CurMP3Index = 0;
+
+ _CurMP3Pos = 0;
+
+ tMP3Entry *mp3 = _GetMP3EntryByIndex(_CurMP3Index);
+
+ if ( mp3 )
+ {
+ mp3 = _pMP3List;
+ if ( mp3 == NULL )
+ {
+ _bIsMp3Active = false;
+ nFile = 0;
+ goto PLAY_STREAMEDTRACK;
}
-
- _bIsMp3Active = false;
- continue;
}
+
+ if ( mp3->pLinkPath != NULL )
+ mp3Stream[nStream] = AIL_open_stream(DIG, mp3->pLinkPath, 0);
+ else
+ {
+ strcpy(filename, _mp3DirectoryPath);
+ strcat(filename, mp3->aFilename);
+
+ mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0);
+ }
+
+ if ( mp3Stream[nStream] )
+ {
+ AIL_set_stream_loop_count(mp3Stream[nStream], 1);
+ AIL_set_stream_ms_position(mp3Stream[nStream], 0);
+ AIL_pause_stream(mp3Stream[nStream], 0);
+ return true;
+ }
+
+ goto NEXT_MP3TRACK;
+
+FIND_MP3TRACK:
if ( nPos > nStreamLength[STREAMED_SOUND_RADIO_MP3_PLAYER] )
position = 0;
@@ -2048,23 +2039,10 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
if ( e == NULL )
{
nFile = 0;
- strcpy(filename, m_szCDRomRootPath);
- strcat(filename, StreamedNameTable[nFile]);
- mp3Stream[nStream] =
- AIL_open_stream(DIG, filename, 0);
- if(mp3Stream[nStream]) {
- AIL_set_stream_loop_count(
- mp3Stream[nStream], 1);
- AIL_set_stream_ms_position(
- mp3Stream[nStream], position);
- AIL_pause_stream(mp3Stream[nStream], 0);
- return true;
- }
-
- return false;
+ goto PLAY_STREAMEDTRACK;
}
}
-
+
if ( e->pLinkPath != NULL )
mp3Stream[nStream] = AIL_open_stream(DIG, e->pLinkPath, 0);
else
@@ -2086,14 +2064,17 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
return true;
}
+NEXT_MP3TRACK:
_bIsMp3Active = false;
-
- } while(++i < nNumMP3s);
-
+
+ } while ( ++i < nNumMP3s );
+
position = 0;
nFile = 0;
+ goto PLAY_STREAMEDTRACK;
}
+PLAY_STREAMEDTRACK:
strcpy(filename, m_szCDRomRootPath);
strcat(filename, StreamedNameTable[nFile]);
diff --git a/src/control/Darkel.h b/src/control/Darkel.h
index 14529c63..b6092dcb 100644
--- a/src/control/Darkel.h
+++ b/src/control/Darkel.h
@@ -1,10 +1,9 @@
#pragma once
-
#include "ModelIndices.h"
-#include "WeaponType.h"
class CVehicle;
class CPed;
+enum eWeaponType;
enum
{
diff --git a/src/control/PathFind.cpp b/src/control/PathFind.cpp
index cedef63c..9d0959a8 100644
--- a/src/control/PathFind.cpp
+++ b/src/control/PathFind.cpp
@@ -1466,11 +1466,8 @@ CPathFind::DoPathSearch(uint8 type, CVector start, int32 startNodeId, CVector ta
targetNode = FindNodeClosestToCoors(target, type, distLimit);
else
targetNode = forcedTargetNode;
- if(targetNode < 0) {
- *pNumNodes = 0;
- if(pDist) *pDist = 100000.0f;
- return;
- }
+ if(targetNode < 0)
+ goto fail;
// Find start
int numPathsToTry;
@@ -1489,28 +1486,19 @@ CPathFind::DoPathSearch(uint8 type, CVector start, int32 startNodeId, CVector ta
numPathsToTry = 1;
startObj = m_mapObjects[m_pathNodes[startNodeId].objectIndex];
}
- if(numPathsToTry == 0) {
- *pNumNodes = 0;
- if(pDist) *pDist = 100000.0f;
- return;
- }
+ if(numPathsToTry == 0)
+ goto fail;
if(startNodeId < 0){
// why only check node 0?
- if(m_pathNodes[startObj->m_nodeIndices[type][0]].group !=
- m_pathNodes[targetNode].group) {
- *pNumNodes = 0;
- if(pDist) *pDist = 100000.0f;
- return;
- }
+ if(m_pathNodes[startObj->m_nodeIndices[type][0]].group != m_pathNodes[targetNode].group)
+ goto fail;
}else{
- if(m_pathNodes[startNodeId].group != m_pathNodes[targetNode].group) {
- *pNumNodes = 0;
- if(pDist) *pDist = 100000.0f;
- return;
- }
+ if(m_pathNodes[startNodeId].group != m_pathNodes[targetNode].group)
+ goto fail;
}
+
for(i = 0; i < 512; i++)
m_searchNodes[i].next = nil;
AddNodeToList(&m_pathNodes[targetNode], 0);
@@ -1588,6 +1576,11 @@ CPathFind::DoPathSearch(uint8 type, CVector start, int32 startNodeId, CVector ta
for(i = 0; i < numNodesToBeCleared; i++)
apNodesToBeCleared[i]->distance = MAX_DIST;
return;
+
+fail:
+ *pNumNodes = 0;
+ if(pDist)
+ *pDist = 100000.0f;
}
static CPathNode *pNodeList[32];
diff --git a/src/control/TrafficLights.cpp b/src/control/TrafficLights.cpp
index 70fcbc32..096bb484 100644
--- a/src/control/TrafficLights.cpp
+++ b/src/control/TrafficLights.cpp
@@ -8,7 +8,7 @@
#include "Clock.h"
#include "Weather.h"
#include "Timecycle.h"
-#include "PointLights.h"
+#include "Pointlights.h"
#include "Shadows.h"
#include "Coronas.h"
#include "SpecialFX.h"
diff --git a/src/core/CrimeType.h b/src/core/CrimeType.h
deleted file mode 100644
index 23f609eb..00000000
--- a/src/core/CrimeType.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#pragma once
-
-enum eCrimeType
-{
- CRIME_NONE,
- CRIME_POSSESSION_GUN,
- CRIME_HIT_PED,
- CRIME_HIT_COP,
- CRIME_SHOOT_PED,
- CRIME_SHOOT_COP,
- CRIME_STEAL_CAR,
- CRIME_RUN_REDLIGHT,
- CRIME_RECKLESS_DRIVING,
- CRIME_SPEEDING,
- CRIME_RUNOVER_PED,
- CRIME_RUNOVER_COP,
- CRIME_SHOOT_HELI,
- CRIME_PED_BURNED,
- CRIME_COP_BURNED,
- CRIME_VEHICLE_BURNED,
- CRIME_DESTROYED_CESSNA,
- NUM_CRIME_TYPES
-}; \ No newline at end of file
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index 8b2f8604..7ccf78d0 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -72,7 +72,7 @@
#include "Streaming.h"
#include "SurfaceTable.h"
#include "TempColModels.h"
-#include "Timecycle.h"
+#include "TimeCycle.h"
#include "TrafficLights.h"
#include "Train.h"
#include "TxdStore.h"
diff --git a/src/core/General.h b/src/core/General.h
index 103bafde..77828854 100644
--- a/src/core/General.h
+++ b/src/core/General.h
@@ -124,7 +124,7 @@ public:
static bool faststricmp(const char *str1, const char *str2)
{
for (; *str1; str1++, str2++) {
-#if 1
+#if MUCH_SLOWER
if (toupper(*str1) != toupper(*str2))
#else
if (__ascii_toupper(*str1) != __ascii_toupper(*str2))
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 49affbbe..86aff05e 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -6,7 +6,7 @@
#include "common.h"
#ifdef XINPUT
-#include <xinput.h>
+#include <Xinput.h>
#pragma comment( lib, "Xinput9_1_0.lib" )
#endif
diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp
index 3852f540..cfa0cea4 100644
--- a/src/core/PlayerInfo.cpp
+++ b/src/core/PlayerInfo.cpp
@@ -180,7 +180,7 @@ CPlayerInfo::MakePlayerSafe(bool toggle)
m_pPed->bExplosionProof = true;
m_pPed->m_bCanBeDamaged = false;
((CPlayerPed*)m_pPed)->ClearAdrenaline();
- CancelPlayerEnteringCars(nil);
+ CancelPlayerEnteringCars(false);
gFireManager.ExtinguishPoint(GetPos(), 4000.0f);
CExplosion::RemoveAllExplosionsInArea(GetPos(), 4000.0f);
CProjectileInfo::RemoveAllProjectiles();
diff --git a/src/core/Wanted.h b/src/core/Wanted.h
index c5e9d388..afeec8b0 100644
--- a/src/core/Wanted.h
+++ b/src/core/Wanted.h
@@ -3,7 +3,27 @@
class CEntity;
class CCopPed;
-#include "CrimeType.h"
+enum eCrimeType
+{
+ CRIME_NONE,
+ CRIME_POSSESSION_GUN,
+ CRIME_HIT_PED,
+ CRIME_HIT_COP,
+ CRIME_SHOOT_PED,
+ CRIME_SHOOT_COP,
+ CRIME_STEAL_CAR,
+ CRIME_RUN_REDLIGHT,
+ CRIME_RECKLESS_DRIVING,
+ CRIME_SPEEDING,
+ CRIME_RUNOVER_PED,
+ CRIME_RUNOVER_COP,
+ CRIME_SHOOT_HELI,
+ CRIME_PED_BURNED,
+ CRIME_COP_BURNED,
+ CRIME_VEHICLE_BURNED,
+ CRIME_DESTROYED_CESSNA,
+ NUM_CRIME_TYPES
+};
class CCrimeBeingQd
{
diff --git a/src/core/common.h b/src/core/common.h
index e10b222c..454b848a 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -12,7 +12,7 @@
#include <math.h>
#ifdef WITHWINDOWS
-#include <windows.h>
+#include <Windows.h>
#endif
#ifdef WITHD3D
@@ -62,7 +62,7 @@ typedef int64_t int64;
typedef uint16_t wchar;
#ifndef nil
-#define nil NULL
+#define nil nullptr
#endif
#include "config.h"
diff --git a/src/objects/ParticleObject.h b/src/objects/ParticleObject.h
index 7e4aebb7..9e28d272 100644
--- a/src/objects/ParticleObject.h
+++ b/src/objects/ParticleObject.h
@@ -1,7 +1,6 @@
#pragma once
#include "Placeable.h"
#include "AudioManager.h"
-#include "ParticleType.h"
#define MAX_PARTICLEOBJECTS 100
#define MAX_AUDIOHYDRANTS 8
@@ -38,6 +37,7 @@ enum eParticleObjectState
POBJECTSTATE_FREE,
};
+enum tParticleType;
class CParticle;
class CParticleObject : public CPlaceable
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 41f0ffb2..fc53e4bc 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -1,13 +1,12 @@
#pragma once
-#include "AnimManager.h"
-#include "CrimeType.h"
-#include "EventList.h"
-#include "PedIK.h"
-#include "PedStats.h"
#include "Physical.h"
#include "Weapon.h"
+#include "PedStats.h"
+#include "PedIK.h"
+#include "AnimManager.h"
#include "WeaponInfo.h"
+#include "EventList.h"
#define FEET_OFFSET 1.04f
#define CHECK_NEARBY_THINGS_MAX_DIST 15.0f
@@ -18,6 +17,7 @@ class CObject;
class CFire;
struct AnimBlendFrameData;
class CAnimBlendAssociation;
+enum eCrimeType;
struct PedAudioData
{
diff --git a/src/render/ParticleMgr.h b/src/render/ParticleMgr.h
index 0b4091de..605e69fe 100644
--- a/src/render/ParticleMgr.h
+++ b/src/render/ParticleMgr.h
@@ -1,9 +1,83 @@
#pragma once
-#include "ParticleType.h"
-
class CParticle;
+enum tParticleType
+{
+ PARTICLE_SPARK = 0,
+ PARTICLE_SPARK_SMALL,
+ PARTICLE_WHEEL_DIRT,
+ PARTICLE_WHEEL_WATER,
+ PARTICLE_BLOOD,
+ PARTICLE_BLOOD_SMALL,
+ PARTICLE_BLOOD_SPURT,
+ PARTICLE_DEBRIS,
+ PARTICLE_DEBRIS2,
+ PARTICLE_WATER,
+ PARTICLE_FLAME,
+ PARTICLE_FIREBALL,
+ PARTICLE_GUNFLASH,
+ PARTICLE_GUNFLASH_NOANIM,
+ PARTICLE_GUNSMOKE,
+ PARTICLE_GUNSMOKE2,
+ PARTICLE_SMOKE,
+ PARTICLE_SMOKE_SLOWMOTION,
+ PARTICLE_GARAGEPAINT_SPRAY,
+ PARTICLE_SHARD,
+ PARTICLE_SPLASH,
+ PARTICLE_CARFLAME,
+ PARTICLE_STEAM,
+ PARTICLE_STEAM2,
+ PARTICLE_STEAM_NY,
+ PARTICLE_STEAM_NY_SLOWMOTION,
+ PARTICLE_ENGINE_STEAM,
+ PARTICLE_RAINDROP,
+ PARTICLE_RAINDROP_SMALL,
+ PARTICLE_RAIN_SPLASH,
+ PARTICLE_RAIN_SPLASH_BIGGROW,
+ PARTICLE_RAIN_SPLASHUP,
+ PARTICLE_WATERSPRAY,
+ PARTICLE_EXPLOSION_MEDIUM,
+ PARTICLE_EXPLOSION_LARGE,
+ PARTICLE_EXPLOSION_MFAST,
+ PARTICLE_EXPLOSION_LFAST,
+ PARTICLE_CAR_SPLASH,
+ PARTICLE_BOAT_SPLASH,
+ PARTICLE_BOAT_THRUSTJET,
+ PARTICLE_BOAT_WAKE,
+ PARTICLE_WATER_HYDRANT,
+ PARTICLE_WATER_CANNON,
+ PARTICLE_EXTINGUISH_STEAM,
+ PARTICLE_PED_SPLASH,
+ PARTICLE_PEDFOOT_DUST,
+ PARTICLE_HELI_DUST,
+ PARTICLE_HELI_ATTACK,
+ PARTICLE_ENGINE_SMOKE,
+ PARTICLE_ENGINE_SMOKE2,
+ PARTICLE_CARFLAME_SMOKE,
+ PARTICLE_FIREBALL_SMOKE,
+ PARTICLE_PAINT_SMOKE,
+ PARTICLE_TREE_LEAVES,
+ PARTICLE_CARCOLLISION_DUST,
+ PARTICLE_CAR_DEBRIS,
+ PARTICLE_HELI_DEBRIS,
+ PARTICLE_EXHAUST_FUMES,
+ PARTICLE_RUBBER_SMOKE,
+ PARTICLE_BURNINGRUBBER_SMOKE,
+ PARTICLE_BULLETHIT_SMOKE,
+ PARTICLE_GUNSHELL_FIRST,
+ PARTICLE_GUNSHELL,
+ PARTICLE_GUNSHELL_BUMP1,
+ PARTICLE_GUNSHELL_BUMP2,
+ PARTICLE_TEST,
+ PARTICLE_BIRD_FRONT,
+ PARTICLE_RAINDROP_2D,
+
+ MAX_PARTICLES,
+ PARTICLE_FIRST = PARTICLE_SPARK,
+ PARTICLE_LAST = PARTICLE_RAINDROP_2D
+};
+
enum
{
ZCHECK_FIRST = BIT(0),
diff --git a/src/weapons/Weapon.h b/src/weapons/Weapon.h
index 76fe0870..265ffddb 100644
--- a/src/weapons/Weapon.h
+++ b/src/weapons/Weapon.h
@@ -3,7 +3,53 @@
#define DRIVEBYAUTOAIMING_MAXDIST (2.5f)
#define DOOMAUTOAIMING_MAXDIST (9000.0f)
-#include "WeaponType.h"
+enum eWeaponType
+{
+ WEAPONTYPE_UNARMED,
+ WEAPONTYPE_BASEBALLBAT,
+ WEAPONTYPE_COLT45,
+ WEAPONTYPE_UZI,
+ WEAPONTYPE_SHOTGUN,
+ WEAPONTYPE_AK47,
+ WEAPONTYPE_M16,
+ WEAPONTYPE_SNIPERRIFLE,
+ WEAPONTYPE_ROCKETLAUNCHER,
+ WEAPONTYPE_FLAMETHROWER,
+ WEAPONTYPE_MOLOTOV,
+ WEAPONTYPE_GRENADE,
+ WEAPONTYPE_DETONATOR,
+ WEAPONTYPE_HELICANNON,
+ WEAPONTYPE_LAST_WEAPONTYPE,
+ WEAPONTYPE_ARMOUR,
+ WEAPONTYPE_RAMMEDBYCAR,
+ WEAPONTYPE_RUNOVERBYCAR,
+ WEAPONTYPE_EXPLOSION,
+ WEAPONTYPE_UZI_DRIVEBY,
+ WEAPONTYPE_DROWNING,
+ WEAPONTYPE_FALL,
+ WEAPONTYPE_UNIDENTIFIED,
+
+ WEAPONTYPE_TOTALWEAPONS = WEAPONTYPE_LAST_WEAPONTYPE,
+ WEAPONTYPE_TOTAL_INVENTORY_WEAPONS = 13,
+};
+
+enum eWeaponFire {
+ WEAPON_FIRE_MELEE,
+ WEAPON_FIRE_INSTANT_HIT,
+ WEAPON_FIRE_PROJECTILE,
+ WEAPON_FIRE_AREA_EFFECT,
+ WEAPON_FIRE_USE
+};
+
+// Taken from MTA SA, seems it's unchanged
+enum eWeaponState
+{
+ WEAPONSTATE_READY,
+ WEAPONSTATE_FIRING,
+ WEAPONSTATE_RELOADING,
+ WEAPONSTATE_OUT_OF_AMMO,
+ WEAPONSTATE_MELEE_MADECONTACT
+};
class CEntity;
class CPhysical;