1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 06:20:00 +00:00

int8 enums fixed

This commit is contained in:
withmorten 2020-12-07 00:56:12 +01:00
parent 4696e3f9c8
commit afdf8c25a0
6 changed files with 21 additions and 21 deletions

View file

@ -8121,7 +8121,7 @@ cAudioManager::ProcessGarages()
const float SOUND_INTENSITY = 80.0f; const float SOUND_INTENSITY = 80.0f;
CEntity *entity; CEntity *entity;
eGarageState state; uint8 state;
uint32 sampleIndex; uint32 sampleIndex;
uint8 j; uint8 j;
float distSquared; float distSquared;

View file

@ -202,7 +202,7 @@ void CGarages::Update(void)
aGarages[GarageToBeTidied].TidyUpGarage(); aGarages[GarageToBeTidied].TidyUpGarage();
} }
int16 CGarages::AddOne(CVector p1, CVector p2, eGarageType type, int32 targetId) int16 CGarages::AddOne(CVector p1, CVector p2, uint8 type, int32 targetId)
{ {
if (NumGarages >= NUM_GARAGES) { if (NumGarages >= NUM_GARAGES) {
assert(0); assert(0);
@ -285,7 +285,7 @@ int16 CGarages::AddOne(CVector p1, CVector p2, eGarageType type, int32 targetId)
return NumGarages++; return NumGarages++;
} }
void CGarages::ChangeGarageType(int16 garage, eGarageType type, int32 mi) void CGarages::ChangeGarageType(int16 garage, uint8 type, int32 mi)
{ {
CGarage* pGarage = &aGarages[garage]; CGarage* pGarage = &aGarages[garage];
pGarage->m_eGarageType = type; pGarage->m_eGarageType = type;
@ -2172,7 +2172,7 @@ void CGarages::CloseHideOutGaragesBeforeSave()
} }
} }
int32 CGarages::CountCarsInHideoutGarage(eGarageType type) int32 CGarages::CountCarsInHideoutGarage(uint8 type)
{ {
int32 total = 0; int32 total = 0;
for (int i = 0; i < NUM_GARAGE_STORED_CARS; i++) { for (int i = 0; i < NUM_GARAGE_STORED_CARS; i++) {
@ -2192,7 +2192,7 @@ int32 CGarages::CountCarsInHideoutGarage(eGarageType type)
return total; return total;
} }
int32 CGarages::FindMaxNumStoredCarsForGarage(eGarageType type) int32 CGarages::FindMaxNumStoredCarsForGarage(uint8 type)
{ {
switch (type) { switch (type) {
case GARAGE_HIDEOUT_ONE: case GARAGE_HIDEOUT_ONE:

View file

@ -7,7 +7,7 @@
class CVehicle; class CVehicle;
class CCamera; class CCamera;
enum eGarageState : int8 enum eGarageState
{ {
GS_FULLYCLOSED, GS_FULLYCLOSED,
GS_OPENED, GS_OPENED,
@ -18,7 +18,7 @@ enum eGarageState : int8
GS_AFTERDROPOFF, GS_AFTERDROPOFF,
}; };
enum eGarageType : int8 enum eGarageType
{ {
GARAGE_NONE, GARAGE_NONE,
GARAGE_MISSION, GARAGE_MISSION,
@ -81,8 +81,8 @@ VALIDATE_SIZE(CStoredCar, 0x28);
class CGarage class CGarage
{ {
eGarageType m_eGarageType; uint8 m_eGarageType;
eGarageState m_eGarageState; uint8 m_eGarageState;
bool field_2; // unused bool field_2; // unused
bool m_bClosingWithoutTargetCar; bool m_bClosingWithoutTargetCar;
bool m_bDeactivated; bool m_bDeactivated;
@ -207,8 +207,8 @@ public:
#endif #endif
static void Update(void); static void Update(void);
static int16 AddOne(CVector pos1, CVector pos2, eGarageType type, int32 targetId); static int16 AddOne(CVector pos1, CVector pos2, uint8 type, int32 targetId);
static void ChangeGarageType(int16, eGarageType, int32); static void ChangeGarageType(int16, uint8, int32);
static void PrintMessages(void); static void PrintMessages(void);
static void TriggerMessage(const char* text, int16, uint16 time, int16); static void TriggerMessage(const char* text, int16, uint16 time, int16);
static void SetTargetCarForMissonGarage(int16, CVehicle*); static void SetTargetCarForMissonGarage(int16, CVehicle*);
@ -244,10 +244,10 @@ private:
static bool IsCarSprayable(CVehicle*); static bool IsCarSprayable(CVehicle*);
static float FindDoorHeightForMI(int32); static float FindDoorHeightForMI(int32);
static void CloseHideOutGaragesBeforeSave(void); static void CloseHideOutGaragesBeforeSave(void);
static int32 CountCarsInHideoutGarage(eGarageType); static int32 CountCarsInHideoutGarage(uint8);
static int32 FindMaxNumStoredCarsForGarage(eGarageType); static int32 FindMaxNumStoredCarsForGarage(uint8);
static int32 GetBombTypeForGarageType(eGarageType type) { return type - GARAGE_BOMBSHOP1 + 1; } static int32 GetBombTypeForGarageType(uint8 type) { return type - GARAGE_BOMBSHOP1 + 1; }
static int32 GetCarsCollectedIndexForGarageType(eGarageType type) { return type - GARAGE_COLLECTCARS_1; } static int32 GetCarsCollectedIndexForGarageType(uint8 type) { return type - GARAGE_COLLECTCARS_1; }
friend class cAudioManager; friend class cAudioManager;
friend class CGarage; friend class CGarage;

View file

@ -291,7 +291,7 @@ int8 CRunningScript::ProcessCommands500To599(int32 command)
infZ = *(float*)&ScriptParams[5]; infZ = *(float*)&ScriptParams[5];
supZ = *(float*)&ScriptParams[2]; supZ = *(float*)&ScriptParams[2];
} }
ScriptParams[0] = CGarages::AddOne(CVector(infX, infY, infZ), CVector(supX, supY, supZ), (eGarageType)ScriptParams[6], 0); ScriptParams[0] = CGarages::AddOne(CVector(infX, infY, infZ), CVector(supX, supY, supZ), ScriptParams[6], 0);
StoreParameters(&m_nIp, 1); StoreParameters(&m_nIp, 1);
return 0; return 0;
} }
@ -316,7 +316,7 @@ int8 CRunningScript::ProcessCommands500To599(int32 command)
infZ = *(float*)&ScriptParams[5]; infZ = *(float*)&ScriptParams[5];
supZ = *(float*)&ScriptParams[2]; supZ = *(float*)&ScriptParams[2];
} }
ScriptParams[0] = CGarages::AddOne(CVector(infX, infY, infZ), CVector(supX, supY, supZ), (eGarageType)ScriptParams[6], ScriptParams[7]); ScriptParams[0] = CGarages::AddOne(CVector(infX, infY, infZ), CVector(supX, supY, supZ), ScriptParams[6], ScriptParams[7]);
StoreParameters(&m_nIp, 1); StoreParameters(&m_nIp, 1);
return 0; return 0;
} }
@ -1826,7 +1826,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
} }
case COMMAND_CHANGE_GARAGE_TYPE: case COMMAND_CHANGE_GARAGE_TYPE:
CollectParameters(&m_nIp, 2); CollectParameters(&m_nIp, 2);
CGarages::ChangeGarageType(ScriptParams[0], (eGarageType)ScriptParams[1], 0); CGarages::ChangeGarageType(ScriptParams[0], ScriptParams[1], 0);
return 0; return 0;
case COMMAND_ACTIVATE_CRUSHER_CRANE: case COMMAND_ACTIVATE_CRUSHER_CRANE:
{ {

View file

@ -1459,7 +1459,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
case COMMAND_CHANGE_GARAGE_TYPE_WITH_CAR_MODEL: case COMMAND_CHANGE_GARAGE_TYPE_WITH_CAR_MODEL:
{ {
CollectParameters(&m_nIp, 3); CollectParameters(&m_nIp, 3);
CGarages::ChangeGarageType(ScriptParams[0], (eGarageType)ScriptParams[1], ScriptParams[2]); CGarages::ChangeGarageType(ScriptParams[0], ScriptParams[1], ScriptParams[2]);
return 0; return 0;
} }
case COMMAND_FIND_DRUG_PLANE_COORDINATES: case COMMAND_FIND_DRUG_PLANE_COORDINATES:

View file

@ -43,7 +43,7 @@ enum eFormation
FORMATION_FRONT FORMATION_FRONT
}; };
enum FightState : int8 { enum FightState {
FIGHTSTATE_MOVE_FINISHED = -2, FIGHTSTATE_MOVE_FINISHED = -2,
FIGHTSTATE_JUST_ATTACKED, FIGHTSTATE_JUST_ATTACKED,
FIGHTSTATE_NO_MOVE, FIGHTSTATE_NO_MOVE,
@ -484,7 +484,7 @@ public:
CVector m_vecHitLastPos; CVector m_vecHitLastPos;
uint32 m_curFightMove; uint32 m_curFightMove;
uint8 m_fightButtonPressure; uint8 m_fightButtonPressure;
FightState m_fightState; int8 m_fightState;
bool m_takeAStepAfterAttack; bool m_takeAStepAfterAttack;
CFire *m_pFire; CFire *m_pFire;
CEntity *m_pLookTarget; CEntity *m_pLookTarget;