Merge pull request #198 from ShFil119/audio6

Audio part 6
This commit is contained in:
aap 2019-08-28 12:58:42 +02:00 committed by GitHub
commit 792893df59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 4528 additions and 1844 deletions

View File

@ -119,7 +119,7 @@ bool EAX3ListenerInterpolate(LPEAXLISTENERPROPERTIES lpStart, LPEAXLISTENERPROPE
if (lpStart->flReflectionsDelay == lpFinish->flReflectionsDelay) if (lpStart->flReflectionsDelay == lpFinish->flReflectionsDelay)
lpResult->flReflectionsDelay = lpStart->flReflectionsDelay; lpResult->flReflectionsDelay = lpStart->flReflectionsDelay;
else else
lpResult->flReflectionsDelay = (float)exp( (log(lpStart->flReflectionsDelay+0.0001) * flInvRatio) + (log(lpFinish->flReflectionsDelay+0.0001) * flRatio) ); lpResult->flReflectionsDelay = (float)exp( (log(lpStart->flReflectionsDelay+0.0001f) * flInvRatio) + (log(lpFinish->flReflectionsDelay+0.0001f) * flRatio) );
// Reflections Pan // Reflections Pan
@ -155,7 +155,7 @@ bool EAX3ListenerInterpolate(LPEAXLISTENERPROPERTIES lpStart, LPEAXLISTENERPROPE
if (lpStart->flReverbDelay == lpFinish->flReverbDelay) if (lpStart->flReverbDelay == lpFinish->flReverbDelay)
lpResult->flReverbDelay = lpStart->flReverbDelay; lpResult->flReverbDelay = lpStart->flReverbDelay;
else else
lpResult->flReverbDelay = (float)exp( (log(lpStart->flReverbDelay+0.0001) * flInvRatio) + (log(lpFinish->flReverbDelay+0.0001) * flRatio) ); lpResult->flReverbDelay = (float)exp( (log(lpStart->flReverbDelay+0.0001f) * flInvRatio) + (log(lpFinish->flReverbDelay+0.0001f) * flRatio) );
// Reverb Pan // Reverb Pan
@ -354,7 +354,7 @@ void Clamp(EAXVECTOR *eaxVector)
// Array of scenario names // // Array of scenario names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
char* EAX30_SCENARIO_NAMES[] = const char* EAX30_SCENARIO_NAMES[] =
{ {
"Castle", "Castle",
"Factory", "Factory",
@ -376,7 +376,7 @@ char* EAX30_SCENARIO_NAMES[] =
// Array of standardised location names // // Array of standardised location names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
char* EAX30_LOCATION_NAMES[] = const char* EAX30_LOCATION_NAMES[] =
{ {
"Hall", "Hall",
"Large Room", "Large Room",
@ -410,7 +410,7 @@ EAXLISTENERPROPERTIES EAX30_STANDARD_PRESETS[EAX30_NUM_STANDARD_SCENARIOS][EAX30
// Array of original environment names // // Array of original environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
char* EAX30_ORIGINAL_PRESET_NAMES[] = const char* EAX30_ORIGINAL_PRESET_NAMES[] =
{ {
"Generic", "Generic",
"Padded Cell", "Padded Cell",
@ -480,7 +480,7 @@ EAXLISTENERPROPERTIES EAX30_ORIGINAL_PRESETS[] =
// Array of sport environment names // // Array of sport environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
char* EAX30_SPORTS_PRESET_NAMES[] = const char* EAX30_SPORTS_PRESET_NAMES[] =
{ {
"Empty Stadium", "Empty Stadium",
"Full Stadium", "Full Stadium",
@ -512,7 +512,7 @@ EAXLISTENERPROPERTIES EAX30_SPORTS_PRESETS[] =
// Array of prefab environment names // // Array of prefab environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
char* EAX30_PREFAB_PRESET_NAMES[] = const char* EAX30_PREFAB_PRESET_NAMES[] =
{ {
"Workshop", "Workshop",
"School Room", "School Room",
@ -540,7 +540,7 @@ EAXLISTENERPROPERTIES EAX30_PREFAB_PRESETS[] =
// Array of Domes & Pipes environment names // // Array of Domes & Pipes environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
char* EAX30_DOMESNPIPES_PRESET_NAMES[] = const char* EAX30_DOMESNPIPES_PRESET_NAMES[] =
{ {
"Domed Tomb", "Domed Tomb",
"Saint Paul's Dome", "Saint Paul's Dome",
@ -570,7 +570,7 @@ EAXLISTENERPROPERTIES EAX30_DOMESNPIPES_PRESETS[] =
// Array of Outdoors environment names // // Array of Outdoors environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
char* EAX30_OUTDOORS_PRESET_NAMES[] = const char* EAX30_OUTDOORS_PRESET_NAMES[] =
{ {
"Backyard", "Backyard",
"Rolling Plains", "Rolling Plains",
@ -598,7 +598,7 @@ EAXLISTENERPROPERTIES EAX30_OUTDOORS_PRESETS[] =
// Array of Mood environment names // // Array of Mood environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
char* EAX30_MOOD_PRESET_NAMES[] = const char* EAX30_MOOD_PRESET_NAMES[] =
{ {
"Heaven", "Heaven",
"Hell", "Hell",
@ -622,7 +622,7 @@ EAXLISTENERPROPERTIES EAX30_MOOD_PRESETS[] =
// Array of driving environment names // // Array of driving environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
char* EAX30_DRIVING_PRESET_NAMES[] = const char* EAX30_DRIVING_PRESET_NAMES[] =
{ {
"Race Commentator", "Race Commentator",
"Pit Garage", "Pit Garage",
@ -656,7 +656,7 @@ EAXLISTENERPROPERTIES EAX30_DRIVING_PRESETS[] =
// Array of City environment names // // Array of City environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
char* EAX30_CITY_PRESET_NAMES[] = const char* EAX30_CITY_PRESET_NAMES[] =
{ {
"City Streets", "City Streets",
"Subway", "Subway",
@ -686,7 +686,7 @@ EAXLISTENERPROPERTIES EAX30_CITY_PRESETS[] =
// Array of Misc environment names // // Array of Misc environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
char* EAX30_MISC_PRESET_NAMES[] = const char* EAX30_MISC_PRESET_NAMES[] =
{ {
"Dusty Box Room", "Dusty Box Room",
"Chapel", "Chapel",

View File

@ -372,7 +372,7 @@ EAX30_SCENARIO;
// Array of scenario names // // Array of scenario names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
extern char* EAX30_SCENARIO_NAMES[]; extern const char* EAX30_SCENARIO_NAMES[];
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// Standardised Locations enumerated // // Standardised Locations enumerated //
@ -402,7 +402,7 @@ EAX30_LOCATION;
// Array of standardised location names // // Array of standardised location names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
extern char* EAX30_LOCATION_NAMES[]; extern const char* EAX30_LOCATION_NAMES[];
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// Number of effects in each scenario // // Number of effects in each scenario //
@ -471,7 +471,7 @@ EAX30_ORIGINAL_PRESET_ENUMS;
// Array of original environment names // // Array of original environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
extern char* EAX30_ORIGINAL_PRESET_NAMES[]; extern const char* EAX30_ORIGINAL_PRESET_NAMES[];
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// Original effects matrix // // Original effects matrix //
@ -501,7 +501,7 @@ EAX30_SPORTS_PRESET_ENUMS;
// Array of sport environment names // // Array of sport environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
extern char* EAX30_SPORTS_PRESET_NAMES[]; extern const char* EAX30_SPORTS_PRESET_NAMES[];
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// Sports effects matrix // // Sports effects matrix //
@ -529,7 +529,7 @@ EAX30_PREFAB_PRESET_ENUMS;
// Array of prefab environment names // // Array of prefab environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
char* EAX30_PREFAB_PRESET_NAMES[]; extern const char* EAX30_PREFAB_PRESET_NAMES[];
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// Prefab effects matrix // // Prefab effects matrix //
@ -558,7 +558,7 @@ EAX30_DOMESNPIPES_PRESET_ENUMS;
// Array of Domes & Pipes environment names // // Array of Domes & Pipes environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
extern char* EAX30_DOMESNPIPES_PRESET_NAMES[]; extern const char* EAX30_DOMESNPIPES_PRESET_NAMES[];
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// Domes & Pipes effects matrix // // Domes & Pipes effects matrix //
@ -586,7 +586,7 @@ EAX30_OUTDOORS_PRESET_ENUMS;
// Array of Outdoors environment names // // Array of Outdoors environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
extern char* EAX30_OUTDOORS_PRESET_NAMES[]; extern const char* EAX30_OUTDOORS_PRESET_NAMES[];
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// Outdoors effects matrix // // Outdoors effects matrix //
@ -612,7 +612,7 @@ EAX30_MOOD_PRESET_ENUMS;
// Array of Mood environment names // // Array of Mood environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
extern char* EAX30_MOOD_PRESET_NAMES[]; extern const char* EAX30_MOOD_PRESET_NAMES[];
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// Mood effects matrix // // Mood effects matrix //
@ -643,7 +643,7 @@ EAX30_DRIVING_PRESET_ENUMS;
// Array of driving environment names // // Array of driving environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
extern char* EAX30_DRIVING_PRESET_NAMES[]; extern const char* EAX30_DRIVING_PRESET_NAMES[];
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// Driving effects matrix // // Driving effects matrix //
@ -672,7 +672,7 @@ EAX30_CITY_PRESET_ENUMS;
// Array of City environment names // // Array of City environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
extern char* EAX30_CITY_PRESET_NAMES[]; extern const char* EAX30_CITY_PRESET_NAMES[];
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// City effects matrix // // City effects matrix //
@ -699,7 +699,7 @@ EAX30_MISC_PRESET_ENUMS;
// Array of Misc environment names // // Array of Misc environment names //
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
extern char* EAX30_MISC_PRESET_NAMES[]; extern const char* EAX30_MISC_PRESET_NAMES[];
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
// Misc effects matrix // // Misc effects matrix //

View File

@ -129,7 +129,7 @@ CAnimBlendAssocGroup::CreateAssociations(const char *name)
// Create associations from hierarchies for a given clump // Create associations from hierarchies for a given clump
void void
CAnimBlendAssocGroup::CreateAssociations(const char *blockName, RpClump *clump, char **animNames, int numAssocs) CAnimBlendAssocGroup::CreateAssociations(const char *blockName, RpClump *clump, const char **animNames, int numAssocs)
{ {
int i; int i;
CAnimBlock *animBlock; CAnimBlock *animBlock;
@ -157,5 +157,5 @@ STARTPATCHES
InjectHook(0x401420, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(uint32))&CAnimBlendAssocGroup::CopyAnimation, PATCH_JUMP); InjectHook(0x401420, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(uint32))&CAnimBlendAssocGroup::CopyAnimation, PATCH_JUMP);
InjectHook(0x4013E0, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(const char*))&CAnimBlendAssocGroup::CopyAnimation, PATCH_JUMP); InjectHook(0x4013E0, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(const char*))&CAnimBlendAssocGroup::CopyAnimation, PATCH_JUMP);
InjectHook(0x401130, (void (CAnimBlendAssocGroup::*)(const char*))&CAnimBlendAssocGroup::CreateAssociations, PATCH_JUMP); InjectHook(0x401130, (void (CAnimBlendAssocGroup::*)(const char*))&CAnimBlendAssocGroup::CreateAssociations, PATCH_JUMP);
InjectHook(0x401220, (void (CAnimBlendAssocGroup::*)(const char*, RpClump*, char**, int))&CAnimBlendAssocGroup::CreateAssociations, PATCH_JUMP); InjectHook(0x401220, (void (CAnimBlendAssocGroup::*)(const char*, RpClump*, const char**, int))&CAnimBlendAssocGroup::CreateAssociations, PATCH_JUMP);
ENDPATCHES ENDPATCHES

View File

@ -16,5 +16,5 @@ public:
CAnimBlendAssociation *CopyAnimation(uint32 id); CAnimBlendAssociation *CopyAnimation(uint32 id);
CAnimBlendAssociation *CopyAnimation(const char *name); CAnimBlendAssociation *CopyAnimation(const char *name);
void CreateAssociations(const char *name); void CreateAssociations(const char *name);
void CreateAssociations(const char *blockName, RpClump *clump, char **animNames, int numAssocs); void CreateAssociations(const char *blockName, RpClump *clump, const char **animNames, int numAssocs);
}; };

View File

@ -185,7 +185,7 @@ CAnimBlendAssociation::UpdateBlend(float timeDelta)
if(blendAmount <= 0.0f && blendDelta < 0.0f){ if(blendAmount <= 0.0f && blendDelta < 0.0f){
// We're faded out and are not fading in // We're faded out and are not fading in
blendAmount = 0.0f; blendAmount = 0.0f;
blendDelta = max(0.0, blendDelta); blendDelta = max(0.0f, blendDelta);
if(flags & ASSOC_DELETEFADEDOUT){ if(flags & ASSOC_DELETEFADEDOUT){
if(callbackType == CB_FINISH || callbackType == CB_DELETE) if(callbackType == CB_FINISH || callbackType == CB_DELETE)
callback(this, callbackArg); callback(this, callbackArg);
@ -197,7 +197,7 @@ CAnimBlendAssociation::UpdateBlend(float timeDelta)
if(blendAmount > 1.0f){ if(blendAmount > 1.0f){
// Maximally faded in, clamp values // Maximally faded in, clamp values
blendAmount = 1.0f; blendAmount = 1.0f;
blendDelta = min(0.0, blendDelta); blendDelta = min(0.0f, blendDelta);
} }
return true; return true;

View File

@ -198,7 +198,7 @@ AnimAssocDesc aStdAnimDescsSide[] = {
{ ANIM_IDLE_STANCE, ASSOC_REPEAT }, { ANIM_IDLE_STANCE, ASSOC_REPEAT },
{ ANIM_WALK_START, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION }, { ANIM_WALK_START, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
}; };
char *aStdAnimations[] = { char const *aStdAnimations[] = {
"walk_civi", "walk_civi",
"run_civi", "run_civi",
"sprint_panic", "sprint_panic",
@ -373,162 +373,162 @@ char *aStdAnimations[] = {
"PHONE_out", "PHONE_out",
"PHONE_talk", "PHONE_talk",
}; };
char *aPlayerAnimations[] = { char const *aPlayerAnimations[] = {
"walk_player", "walk_player",
"run_player", "run_player",
"SPRINT_civi", "SPRINT_civi",
"IDLE_STANCE", "IDLE_STANCE",
"walk_start", "walk_start",
}; };
char *aPlayerWithRocketAnimations[] = { char const *aPlayerWithRocketAnimations[] = {
"walk_rocket", "walk_rocket",
"run_rocket", "run_rocket",
"run_rocket", "run_rocket",
"idle_rocket", "idle_rocket",
"walk_start_rocket", "walk_start_rocket",
}; };
char *aPlayer1ArmedAnimations[] = { char const *aPlayer1ArmedAnimations[] = {
"walk_player", "walk_player",
"run_1armed", "run_1armed",
"SPRINT_civi", "SPRINT_civi",
"IDLE_STANCE", "IDLE_STANCE",
"walk_start", "walk_start",
}; };
char *aPlayer2ArmedAnimations[] = { char const *aPlayer2ArmedAnimations[] = {
"walk_player", "walk_player",
"run_armed", "run_armed",
"run_armed", "run_armed",
"idle_stance", "idle_stance",
"walk_start", "walk_start",
}; };
char *aPlayerBBBatAnimations[] = { char const *aPlayerBBBatAnimations[] = {
"walk_player", "walk_player",
"run_player", "run_player",
"run_player", "run_player",
"IDLE_STANCE", "IDLE_STANCE",
"walk_start", "walk_start",
}; };
char *aShuffleAnimations[] = { char const *aShuffleAnimations[] = {
"WALK_shuffle", "WALK_shuffle",
"RUN_civi", "RUN_civi",
"SPRINT_civi", "SPRINT_civi",
"IDLE_STANCE", "IDLE_STANCE",
}; };
char *aOldAnimations[] = { char const *aOldAnimations[] = {
"walk_old", "walk_old",
"run_civi", "run_civi",
"sprint_civi", "sprint_civi",
"idle_stance", "idle_stance",
}; };
char *aGang1Animations[] = { char const *aGang1Animations[] = {
"walk_gang1", "walk_gang1",
"run_gang1", "run_gang1",
"sprint_civi", "sprint_civi",
"idle_stance", "idle_stance",
}; };
char *aGang2Animations[] = { char const *aGang2Animations[] = {
"walk_gang2", "walk_gang2",
"run_gang1", "run_gang1",
"sprint_civi", "sprint_civi",
"idle_stance", "idle_stance",
}; };
char *aFatAnimations[] = { char const *aFatAnimations[] = {
"walk_fat", "walk_fat",
"run_civi", "run_civi",
"woman_runpanic", "woman_runpanic",
"idle_stance", "idle_stance",
}; };
char *aOldFatAnimations[] = { char const *aOldFatAnimations[] = {
"walk_fatold", "walk_fatold",
"run_fatold", "run_fatold",
"woman_runpanic", "woman_runpanic",
"idle_stance", "idle_stance",
}; };
char *aStdWomanAnimations[] = { char const *aStdWomanAnimations[] = {
"woman_walknorm", "woman_walknorm",
"woman_run", "woman_run",
"woman_runpanic", "woman_runpanic",
"woman_idlestance", "woman_idlestance",
}; };
char *aWomanShopAnimations[] = { char const *aWomanShopAnimations[] = {
"woman_walkshop", "woman_walkshop",
"woman_run", "woman_run",
"woman_run", "woman_run",
"woman_idlestance", "woman_idlestance",
}; };
char *aBusyWomanAnimations[] = { char const *aBusyWomanAnimations[] = {
"woman_walkbusy", "woman_walkbusy",
"woman_run", "woman_run",
"woman_runpanic", "woman_runpanic",
"woman_idlestance", "woman_idlestance",
}; };
char *aSexyWomanAnimations[] = { char const *aSexyWomanAnimations[] = {
"woman_walksexy", "woman_walksexy",
"woman_run", "woman_run",
"woman_runpanic", "woman_runpanic",
"woman_idlestance", "woman_idlestance",
}; };
char *aOldWomanAnimations[] = { char const *aOldWomanAnimations[] = {
"woman_walkold", "woman_walkold",
"woman_run", "woman_run",
"woman_runpanic", "woman_runpanic",
"woman_idlestance", "woman_idlestance",
}; };
char *aFatWomanAnimations[] = { char const *aFatWomanAnimations[] = {
"walk_fat", "walk_fat",
"woman_run", "woman_run",
"woman_runpanic", "woman_runpanic",
"woman_idlestance", "woman_idlestance",
}; };
char *aPanicChunkyAnimations[] = { char const *aPanicChunkyAnimations[] = {
"run_fatold", "run_fatold",
"woman_runpanic", "woman_runpanic",
"woman_runpanic", "woman_runpanic",
"idle_stance", "idle_stance",
}; };
char *aPlayerStrafeBackAnimations[] = { char const *aPlayerStrafeBackAnimations[] = {
"walk_player_back", "walk_player_back",
"run_player_back", "run_player_back",
"run_player_back", "run_player_back",
"IDLE_STANCE", "IDLE_STANCE",
"walk_start_back", "walk_start_back",
}; };
char *aPlayerStrafeLeftAnimations[] = { char const *aPlayerStrafeLeftAnimations[] = {
"walk_player_left", "walk_player_left",
"run_left", "run_left",
"run_left", "run_left",
"IDLE_STANCE", "IDLE_STANCE",
"walk_start_left", "walk_start_left",
}; };
char *aPlayerStrafeRightAnimations[] = { char const *aPlayerStrafeRightAnimations[] = {
"walk_player_right", "walk_player_right",
"run_right", "run_right",
"run_right", "run_right",
"IDLE_STANCE", "IDLE_STANCE",
"walk_start_right", "walk_start_right",
}; };
char *aRocketStrafeBackAnimations[] = { char const *aRocketStrafeBackAnimations[] = {
"walk_rocket_back", "walk_rocket_back",
"run_rocket_back", "run_rocket_back",
"run_rocket_back", "run_rocket_back",
"idle_rocket", "idle_rocket",
"walkst_rocket_back", "walkst_rocket_back",
}; };
char *aRocketStrafeLeftAnimations[] = { char const *aRocketStrafeLeftAnimations[] = {
"walk_rocket_left", "walk_rocket_left",
"run_rocket_left", "run_rocket_left",
"run_rocket_left", "run_rocket_left",
"idle_rocket", "idle_rocket",
"walkst_rocket_left", "walkst_rocket_left",
}; };
char *aRocketStrafeRightAnimations[] = { char const *aRocketStrafeRightAnimations[] = {
"walk_rocket_right", "walk_rocket_right",
"run_rocket_right", "run_rocket_right",
"run_rocket_right", "run_rocket_right",
"idle_rocket", "idle_rocket",
"walkst_rocket_right", "walkst_rocket_right",
}; };
AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS] = { const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS] = {
{ "man", "ped", MI_COP, 173, aStdAnimations, aStdAnimDescs }, { "man", "ped", MI_COP, 173, aStdAnimations, aStdAnimDescs },
{ "player", "ped", MI_COP, 5, aPlayerAnimations, aStdAnimDescs }, { "player", "ped", MI_COP, 5, aPlayerAnimations, aStdAnimDescs },
{ "playerrocket", "ped", MI_COP, 5, aPlayerWithRocketAnimations, aStdAnimDescs }, { "playerrocket", "ped", MI_COP, 5, aPlayerWithRocketAnimations, aStdAnimDescs },
@ -749,7 +749,7 @@ CAnimManager::LoadAnimFiles(void)
RpClump *clump = (RpClump*)mi->CreateInstance(); RpClump *clump = (RpClump*)mi->CreateInstance();
RpAnimBlendClumpInit(clump); RpAnimBlendClumpInit(clump);
CAnimBlendAssocGroup *group = &CAnimManager::ms_aAnimAssocGroups[i]; CAnimBlendAssocGroup *group = &CAnimManager::ms_aAnimAssocGroups[i];
AnimAssocDefinition *def = &CAnimManager::ms_aAnimAssocDefinitions[i]; const AnimAssocDefinition *def = &CAnimManager::ms_aAnimAssocDefinitions[i];
group->CreateAssociations(def->blockName, clump, def->animNames, def->numAnims); group->CreateAssociations(def->blockName, clump, def->animNames, def->numAnims);
for(j = 0; j < group->numAssociations; j++) for(j = 0; j < group->numAssociations; j++)
group->GetAnimation(j)->flags |= def->animDescs[j].flags; group->GetAnimation(j)->flags |= def->animDescs[j].flags;

View File

@ -231,17 +231,17 @@ struct AnimAssocDesc
struct AnimAssocDefinition struct AnimAssocDefinition
{ {
char *name; char const *name;
char *blockName; char const *blockName;
int32 modelIndex; int32 modelIndex;
int32 numAnims; int32 numAnims;
char **animNames; char const **animNames;
AnimAssocDesc *animDescs; AnimAssocDesc *animDescs;
}; };
class CAnimManager class CAnimManager
{ {
static AnimAssocDefinition ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS]; static const AnimAssocDefinition ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS];
static CAnimBlock *ms_aAnimBlocks; //[2] static CAnimBlock *ms_aAnimBlocks; //[2]
static CAnimBlendHierarchy *ms_aAnimations; //[250] static CAnimBlendHierarchy *ms_aAnimations; //[250]
static int32 &ms_numAnimBlocks; static int32 &ms_numAnimBlocks;

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "AudioSamples.h" #include "AudioSamples.h"
#include "DMAudio.h" #include "DMAudio.h"
@ -8,7 +8,7 @@ class tActiveSample
{ {
public: public:
int32 m_nEntityIndex; int32 m_nEntityIndex;
int32 field_4; int32 m_counter;
int32 m_nSampleIndex; int32 m_nSampleIndex;
uint8 m_bBankIndex; uint8 m_bBankIndex;
uint8 m_bIsDistant; uint8 m_bIsDistant;
@ -49,9 +49,11 @@ public:
uint8 field_89; uint8 field_89;
uint8 field_90; uint8 field_90;
uint8 field_91; uint8 field_91;
// no methods
}; };
static_assert(sizeof(tActiveSample) == 0x5c, "tActiveSample: error"); static_assert(sizeof(tActiveSample) == 92, "tActiveSample: error");
enum eAudioType : int32 { enum eAudioType : int32 {
AUDIOTYPE_PHYSICAL = 0, AUDIOTYPE_PHYSICAL = 0,
@ -72,6 +74,7 @@ enum eAudioType : int32 {
}; };
class CPhysical; class CPhysical;
class CAutomobile;
class tAudioEntity class tAudioEntity
{ {
@ -83,37 +86,45 @@ public:
int16 m_awAudioEvent[4]; int16 m_awAudioEvent[4];
uint8 gap_18[2]; uint8 gap_18[2];
float m_afVolume[4]; float m_afVolume[4];
uint8 field_24; uint8 m_Loops;
uint8 field_25[3]; uint8 field_25[3];
// no methods
}; };
static_assert(sizeof(tAudioEntity) == 0x28, "tAudioEntity: error"); static_assert(sizeof(tAudioEntity) == 40, "tAudioEntity: error");
class tPedComment class tPedComment
{ {
public: public:
int m_nSampleIndex; int32 m_nSampleIndex;
int field_4; int32 m_entityIndex;
CVector m_vecPos; CVector m_vecPos;
float m_fDistance; float m_fDistance;
uint8 m_bVolume; uint8 m_bVolume;
uint8 field_25; int8 field_25; // allocated time?
uint8 gap_26[2]; uint8 gap_26[2];
// no methods
}; };
static_assert(sizeof(tPedComment) == 0x1c, "tPedComment: error"); static_assert(sizeof(tPedComment) == 28, "tPedComment: error");
class cPedComments class cPedComments
{ {
public: public:
tPedComment m_asPedComments[40]; tPedComment m_asPedComments[2][20];
uint8 field_1120[40]; uint8 indexMap[2][20];
uint8 field_1160[2]; uint8 nrOfCommentsInBank[2];
uint8 field_1162; uint8 activeBank;
uint8 gap_1163[1]; uint8 gap_1163[1];
// reversed all methods
void Add(tPedComment *com); /// ok
void Process(); /// ok
}; };
static_assert(sizeof(cPedComments) == 0x48c, "cPedComments: error"); static_assert(sizeof(cPedComments) == 1164, "cPedComments: error");
class CEntity; class CEntity;
@ -131,9 +142,11 @@ public:
CVector m_vecPosition; CVector m_vecPosition;
float m_fDistance; float m_fDistance;
int32 m_nBaseVolume; int32 m_nBaseVolume;
// no methods
}; };
static_assert(sizeof(cAudioCollision) == 0x28, "cAudioCollision: error"); static_assert(sizeof(cAudioCollision) == 40, "cAudioCollision: error");
class cAudioCollisionManager class cAudioCollisionManager
{ {
@ -144,9 +157,11 @@ public:
uint8 m_bCollisionsInQueue; uint8 m_bCollisionsInQueue;
uint8 gap_811; uint8 gap_811;
cAudioCollision m_sQueue; cAudioCollision m_sQueue;
void AddCollisionToRequestedQueue(); // todo
}; };
static_assert(sizeof(cAudioCollisionManager) == 0x354, "cAudioCollisionManager: error"); static_assert(sizeof(cAudioCollisionManager) == 852, "cAudioCollisionManager: error");
class cMissionAudio class cMissionAudio
{ {
@ -164,16 +179,20 @@ public:
uint8 field_29; uint8 field_29;
uint8 field_30; uint8 field_30;
uint8 field_31; uint8 field_31;
// no methods
}; };
static_assert(sizeof(cMissionAudio) == 0x20, "cMissionAudio: error"); static_assert(sizeof(cMissionAudio) == 32, "cMissionAudio: error");
class cVehicleParams; class cVehicleParams;
class CPlane; class CPlane;
class CVehicle; class CVehicle;
class CPed; class CPed;
class cPedParams;
class cTransmission;
class cAudioScriptObject { class cAudioScriptObject
{
public: public:
int16 AudioId; int16 AudioId;
char _pad0[2]; char _pad0[2];
@ -186,10 +205,9 @@ public:
static void operator delete(void *, int); static void operator delete(void *, int);
}; };
static_assert(sizeof(cAudioScriptObject) == 0x14, "cAudioScriptObject: error"); static_assert(sizeof(cAudioScriptObject) == 20, "cAudioScriptObject: error");
enum enum {
{
/* /*
REFLECTION_YMAX = 0, top REFLECTION_YMAX = 0, top
REFLECTION_YMIN = 1, bottom REFLECTION_YMIN = 1, bottom
@ -206,8 +224,7 @@ enum
MAX_REFLECTIONS, MAX_REFLECTIONS,
}; };
enum AudioEntityHandle enum AudioEntityHandle {
{
AEHANDLE_NONE = -5, AEHANDLE_NONE = -5,
AEHANDLE_ERROR_NOAUDIOSYS = -4, AEHANDLE_ERROR_NOAUDIOSYS = -4,
AEHANDLE_ERROR_NOFREESLOT = -3, AEHANDLE_ERROR_NOFREESLOT = -3,
@ -215,10 +232,6 @@ enum AudioEntityHandle
AEHANDLE_ERROR_BADAUDIOTYPE = -1, AEHANDLE_ERROR_BADAUDIOTYPE = -1,
}; };
#define AEHANDLE_IS_FAILED(h) ((h)<0)
#define AEHANDLE_IS_OK(h) ((h)>=0)
class cAudioManager class cAudioManager
{ {
public: public:
@ -265,122 +278,40 @@ public:
uint8 field_19192; uint8 field_19192;
uint8 m_bUserPause; uint8 m_bUserPause;
uint8 m_bPreviousUserPause; uint8 m_bPreviousUserPause;
uint8 field_19195; uint8 field_19195; // time?
uint32 m_FrameCounter; uint32 m_FrameCounter;
inline uint32 GetFrameCounter(void) { return m_FrameCounter; } // getters
float GetReflectionsDistance(int32 idx) { return m_afReflectionsDistances[idx]; } uint32 GetFrameCounter() const { return m_FrameCounter; }
int32 GetRandomNumber(int32 idx) { return m_anRandomTable[idx]; } float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; }
// int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; }
// "Should" be in alphabetic order, except "getXTalkSfx"
void AddDetailsToRequestedOrderList(uint8 sample); /// ok void AddDetailsToRequestedOrderList(uint8 sample); /// ok
void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 unk1, void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 unk1,
uint8 unk2, bool notLooping); /// ok uint8 counter, bool notLooping); /// ok
void AddReflectionsToRequestedQueue(); /// ok (check value) void AddReflectionsToRequestedQueue(); /// ok (check value)
void AddReleasingSounds(); // todo (difficult) void AddReleasingSounds(); // todo (difficult)
void AddSampleToRequestedQueue(); /// ok void AddSampleToRequestedQueue(); /// ok
void AgeCrimes(); // todo void AgeCrimes(); // todo
int8 GetCurrent3DProviderIndex(); /// ok
void CalculateDistance(bool *ptr, float dist); /// ok void CalculateDistance(bool *ptr, float dist); /// ok
bool CheckForAnAudioFileOnCD(); /// ok bool CheckForAnAudioFileOnCD() const; /// ok
void ClearMissionAudio(); /// ok void ClearMissionAudio(); /// ok
void ClearRequestedQueue(); /// ok void ClearRequestedQueue(); /// ok
int32 ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, int32 ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2,
float speedMultiplier); /// ok float speedMultiplier) const; /// ok
int32 ComputePan(float, CVector *); // todo int32 ComputePan(float, CVector *); // todo
uint32 ComputeVolume(int emittingVolume, float soundIntensity, float distance); /// ok uint32 ComputeVolume(int emittingVolume, float soundIntensity, float distance) const; /// ok
int32 CreateEntity(int32 type, void *entity); /// ok int32 CreateEntity(int32 type, CPhysical *entity); /// ok
void DestroyAllGameCreatedEntities(); /// ok void DestroyAllGameCreatedEntities(); /// ok
void DestroyEntity(int32 id); /// ok void DestroyEntity(int32 id); /// ok
void DoJumboVolOffset() const; /// ok
void DoPoliceRadioCrackle(); /// ok void DoPoliceRadioCrackle(); /// ok
void GenerateIntegerRandomNumberTable(); /// ok // functions returning talk sfx,
// order from GetPedCommentSfx
float GetDistanceSquared(CVector *v); /// ok
void TranslateEntity(CVector *v1, CVector *v2); /// ok
// done
void Initialise();
void PostInitialiseGameSpecificSetup();
void InitialisePoliceRadioZones(); // todo
void ResetAudioLogicTimers(int32 timer); // todo
void Terminate();
char GetMissionScriptPoliceAudioPlayingStatus();
bool GetMissionAudioLoadingStatus();
uint8 GetNum3DProvidersAvailable();
bool IsMP3RadioChannelAvailable();
uint8 GetCDAudioDriveLetter();
void SetEffectsMasterVolume(uint8 volume);
void SetMusicMasterVolume(uint8 volume);
void SetEffectsFadeVolume(uint8 volume);
void SetMusicFadeVolume(uint8 volume);
void SetSpeakerConfig(int32 conf);
bool SetupJumboEngineSound(uint8, int32); // todo
void PreInitialiseGameSpecificSetup();
void SetMissionScriptPoliceAudio(int32 sfx);
bool UsesSiren(int32 model);
bool UsesSirenSwitching(int32 model);
bool MissionScriptAudioUsesPoliceChannel(int32 soundMission);
char* Get3DProviderName(uint8 id);
bool SetupJumboFlySound(uint8 emittingVol); /// ok
bool SetupJumboRumbleSound(uint8 emittingVol); /// ok
bool SetupJumboTaxiSound(uint8 vol); /// ok
bool SetupJumboWhineSound(uint8 emittingVol, int32 freq); /// ok
void PlayLoadedMissionAudio();
void SetMissionAudioLocation(float x, float y, float z);
void ResetPoliceRadio();
void InterrogateAudioEntities();
bool UsesReverseWarning(int32 model);
bool HasAirBrakes(int32 model);
int32 GetJumboTaxiFreq();
bool IsMissionAudioSampleFinished();
void InitialisePoliceRadio(); // todo
int32 RandomDisplacement(uint32 seed);
void ReleaseDigitalHandle();
void ReacquireDigitalHandle();
void SetDynamicAcousticModelingStatus(bool status);
bool IsAudioInitialised() const;
void SetEntityStatus(int32 id, bool status);
void PreTerminateGameSpecificShutdown();
void PostTerminateGameSpecificShutdown();
void PlayerJustGotInCar();
void PlayerJustLeftCar();
void Service();
void GetPhrase(uint32 *phrase, uint32 *prevPhrase, uint32 sample, uint32 maxOffset);
void DoJumboVolOffset();
int32 GetPedCommentSfx(CPed *ped, int32 sound);
uint32 GetPlayerTalkSfx(int16 sound); uint32 GetPlayerTalkSfx(int16 sound);
uint32 GetCopTalkSfx(int16 sound); uint32 GetCopTalkSfx(int16 sound);
uint32 GetSwatTalkSfx(int16 sound); uint32 GetSwatTalkSfx(int16 sound);
@ -457,29 +388,71 @@ public:
uint32 GetGenericMaleTalkSfx(int16 sound); uint32 GetGenericMaleTalkSfx(int16 sound);
uint32 GetGenericFemaleTalkSfx(int16 sound); uint32 GetGenericFemaleTalkSfx(int16 sound);
// end of functions returning talk sfx
void GenerateIntegerRandomNumberTable(); /// ok
char *Get3DProviderName(uint8 id) const;
uint8 GetCDAudioDriveLetter() const;
int8 GetCurrent3DProviderIndex() const; /// ok
float GetCollisionLoopingRatio(uint32 a, uint32 b, float c) const; // not used
float GetCollisionOneShotRatio(uint32 a, float b) const; /// ok
float GetCollisionRatio(float a, float b, float c, float d) const; /// ok
float GetDistanceSquared(CVector *v) const; /// ok
int32 GetJumboTaxiFreq() const; /// ok
bool GetMissionAudioLoadingStatus() const; /// ok
char GetMissionScriptPoliceAudioPlayingStatus() const; /// ok
uint8 GetNum3DProvidersAvailable() const;
int32 GetPedCommentSfx(CPed *ped, int32 sound);
void GetPhrase(uint32 *phrase, uint32 *prevPhrase, uint32 sample, uint32 maxOffset) const;
float GetVehicleDriveWheelSkidValue(uint8 a1, CAutomobile *a2, cTransmission *a3,
float a4); // todo
int32 GetVehicleNonDriveWheelSkidValue(float a1, int a2, int a3, int a4, float a5); // todo
bool HasAirBrakes(int32 model) const; /// ok
void Initialise(); /// ok
void InitialisePoliceRadio(); // todo
void InitialisePoliceRadioZones(); // todo
void InterrogateAudioEntities(); /// ok
bool IsAudioInitialised() const; /// ok
bool IsMissionAudioSampleFinished(); /// ok
bool IsMP3RadioChannelAvailable() const;
bool MissionScriptAudioUsesPoliceChannel(int32 soundMission) const; /// ok
void PlayLoadedMissionAudio(); /// ok
void PlayOneShot(int32 index, int16 sound, float vol); // todo
uint32 PlaySuspectLastSeen(float x, float y, float z); // todo
void PlayerJustGotInCar() const; /// ok
void PlayerJustLeftCar() const; /// ok
void PostInitialiseGameSpecificSetup(); /// ok
void PostTerminateGameSpecificShutdown(); /// ok
void PreInitialiseGameSpecificSetup() const;
void PreloadMissionAudio(char *); // todo
void PreTerminateGameSpecificShutdown(); /// ok
/// processX - main logic of adding new sounds
void ProcessActiveQueues(); // todo void ProcessActiveQueues(); // todo
bool ProcessAirBrakes(cVehicleParams *params); /// ok bool ProcessAirBrakes(cVehicleParams *params); /// ok
void ProcessAirportScriptObject(uint8 sound); /// ok void ProcessAirportScriptObject(uint8 sound); /// ok
bool ProcessBoatEngine(cVehicleParams *params); // todo requires CBoat bool ProcessBoatEngine(cVehicleParams *params); /// ok
bool ProcessBoatMovingOverWater(cVehicleParams *params); // todo requires CBoat bool ProcessBoatMovingOverWater(cVehicleParams *params); /// ok
void ProcessBridge(); // todo requires CBridge void ProcessBridge(); /// ok
void ProcessBridgeMotor(); /// ok void ProcessBridgeMotor(); /// ok
void ProcessBridgeOneShots(); // todo requires CBridge void ProcessBridgeOneShots(); /// ok
void ProcessBridgeWarning(); /// ok void ProcessBridgeWarning(); /// ok
bool ProcessCarBombTick(void *); // todo requires CVehicle bool ProcessCarBombTick(cVehicleParams *params); /// ok
void ProcessCesna(void *); // todo requires CPlane void ProcessCesna(void *); // todo requires CPlane
void ProcessCinemaScriptObject(uint8 sound); /// ok void ProcessCinemaScriptObject(uint8 sound); /// ok
void ProcessCrane(); // todo requires CCrane void ProcessCrane(); // todo requires CCrane
void ProcessDocksScriptObject(uint8 sound); /// ok void ProcessDocksScriptObject(uint8 sound); /// ok
// bool ProcessEngineDamage(void *); //todo requires CVehicle bool ProcessEngineDamage(cVehicleParams *params); /// ok
void ProcessEntity(int32 sound); /// ok void ProcessEntity(int32 sound); /// ok
void ProcessExplosions(int32 explosion); // todo requires CExplosion void ProcessExplosions(int32 explosion); /// ok
void ProcessFireHydrant(); /// ok void ProcessFireHydrant(); /// ok
void ProcessFires(int32 entity); // todo requires gFireManager void ProcessFires(int32 entity); // todo requires gFireManager
void ProcessFrontEnd(); /// ok void ProcessFrontEnd(); /// ok
void ProcessGarages(); // todo requires CGarages::aGarages void ProcessGarages(); // todo requires CGarages::aGarages
// bool ProcessHelicopter(void *); // todo requires CVehicle bool ProcessHelicopter(cVehicleParams *params); /// ok
void ProcessHomeScriptObject(uint8 sound); /// ok void ProcessHomeScriptObject(uint8 sound); /// ok
void ProcessJumbo(cVehicleParams *); /// ok void ProcessJumbo(cVehicleParams *); /// ok
void ProcessJumboAccel(CPlane *plane); /// ok void ProcessJumboAccel(CPlane *plane); /// ok
@ -490,52 +463,88 @@ public:
void ProcessJumboTaxi(); /// ok void ProcessJumboTaxi(); /// ok
void ProcessLaunderetteScriptObject(uint8 sound); /// ok void ProcessLaunderetteScriptObject(uint8 sound); /// ok
void ProcessLoopingScriptObject(uint8 sound); /// ok void ProcessLoopingScriptObject(uint8 sound); /// ok
// void ProcessMissionAudio(); void ProcessMissionAudio(); /// ok
// void ProcessModelVehicle(void *); void ProcessModelCarEngine(cVehicleParams *params); /// ok (check float comparisons)
// void ProcessOneShotScriptObject(uint8 sound); void ProcessOneShotScriptObject(uint8 sound); /// ok
void ProcessPed(CPhysical *p); // todo void ProcessPed(CPhysical *ped); /// ok
// void ProcessPedHeadphones(void *); void ProcessPedHeadphones(cPedParams *params); /// ok
// void ProcessPedOneShots(void *); void ProcessPedOneShots(cPedParams *params); // todo later (weird)
void ProcessPhysical(int32 id); /// ok void ProcessPhysical(int32 id); /// ok
void ProcessPlane(void *); // todo void ProcessPlane(cVehicleParams *params); /// ok
// void ProcessPlayersVehicleEngine(void *, void *); void ProcessPlayersVehicleEngine(cVehicleParams *params,
CAutomobile *automobile); /// ok (check float comparisons)
void ProcessPoliceCellBeatingScriptObject(uint8 sound); // todo void ProcessPoliceCellBeatingScriptObject(uint8 sound); // todo
void ProcessPornCinema(uint8 sound); /// ok void ProcessPornCinema(uint8 sound); /// ok
void ProcessProjectiles(); // todo void ProcessProjectiles(); // todo requires CProjectileInfo
// void ProcessRainOnVehicle(void *); void ProcessRainOnVehicle(cVehicleParams *params); /// ok
// void ProcessReverb(); void ProcessReverb() const; /// ok
// bool ProcessReverseGear(void *); bool ProcessReverseGear(cVehicleParams *a2); /// ok
void ProcessSawMillScriptObject(uint8 sound); /// ok void ProcessSawMillScriptObject(uint8 sound); /// ok
void ProcessScriptObject(int32 id); // todo void ProcessScriptObject(int32 id); /// ok
void ProcessShopScriptObject(uint8 sound); /// ok void ProcessShopScriptObject(uint8 sound); /// ok
void ProcessSpecial(); /// ok void ProcessSpecial(); /// ok
// bool ProcessTrainNoise(void *); bool ProcessTrainNoise(cVehicleParams *params); /// ok
void ProcessVehicle(CVehicle *); // todo void ProcessVehicle(CVehicle *); // todo
// bool ProcessVehicleDoors(void *); bool ProcessVehicleDoors(cVehicleParams *params); /// ok
// bool ProcessVehicleEngine(void *); // bool ProcessVehicleEngine(void *);
// void ProcessVehicleHorn(void *); // void ProcessVehicleHorn(cVehicleParams *params);
// void ProcessVehicleOneShots(void *); // void ProcessVehicleOneShots(void *);
// bool ProcessVehicleReverseWarning(void *); bool ProcessVehicleReverseWarning(cVehicleParams *params); /// ok
// bool ProcessVehicleRoadNoise(void *); bool ProcessVehicleRoadNoise(cVehicleParams *params); /// ok
// void ProcessVehicleSirenOrAlarm(void *); // void ProcessVehicleSirenOrAlarm(void *);
// void ProcessVehicleSkidding(void *); // void ProcessVehicleSkidding(void *);
void ProcessWaterCannon(int32); // todo void ProcessWaterCannon(int32); // todo
void ProcessWeather(int32 id); // todo void ProcessWeather(int32 id); /// ok
// bool ProcessWetRoadNoise(void *); bool ProcessWetRoadNoise(cVehicleParams *params); /// ok
void ProcessWorkShopScriptObject(uint8 sound); /// ok void ProcessWorkShopScriptObject(uint8 sound); /// ok
int32 RandomDisplacement(uint32 seed) const;
void ReacquireDigitalHandle() const;
void ReleaseDigitalHandle() const;
int32 ReportCollision(CEntity *a2, CEntity *a3, uint8 a4, uint8 a5, float a6,
float a7); // todo
int32 ReportCrime(eCrimeType crime, const CVector *pos); // todo
void ResetAudioLogicTimers(int32 timer); /// ok
void ResetPoliceRadio(); /// ok
void ResetTimers(uint32 a2); // todo
void PlayOneShot(int, unsigned short, float); void Service(); // todo
void SetEffectsFadeVol(unsigned char); void ServiceCollisions(); // todo
void SetMusicFadeVol(unsigned char); void ServicePoliceRadio(); // todo
int8 SetCurrent3DProvider(unsigned char); void ServicePoliceRadioChannel(int a2); // todo
void ReportCrime(eCrimeType, CVector const &); void ServiceSoundEffects(); // todo
void PlaySuspectLastSeen(float, float, float); int8 SetCurrent3DProvider(uint8); // todo
void ReportCollision(CEntity *, CEntity *, unsigned char, unsigned char, float, float); void SetDynamicAcousticModelingStatus(bool status);
void ResetTimers(unsigned int); void SetEffectsFadeVolume(uint8 volume) const;
void PreloadMissionAudio(char *); void SetEffectsMasterVolume(uint8 volume) const;
void SetEntityStatus(int32 id, bool status);
uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(int32); // todo
void SetMissionAudioLocation(float x, float y, float z);
void SetMissionScriptPoliceAudio(int32 sfx) const;
void SetMonoMode(uint8); // todo
void SetMusicFadeVolume(uint8 volume) const;
void SetMusicMasterVolume(uint8 volume) const;
void SetSpeakerConfig(int32 conf) const;
void SetUpLoopingCollisionSound(int a2, int a3); // todo
void SetUpOneShotCollisionSound(int a2); // todo
void SetupCrimeReport(); // todo
bool SetupJumboEngineSound(uint8, int32); // todo
bool SetupJumboFlySound(uint8 emittingVol); /// ok
bool SetupJumboRumbleSound(uint8 emittingVol); /// ok
bool SetupJumboTaxiSound(uint8 vol); /// ok
bool SetupJumboWhineSound(uint8 emittingVol, int32 freq); /// ok
void SetupPedComments(cPedParams *params, uint32 sound); /// ok
void SetupSuspectLastSeenReport(); // todo
void Terminate();
void TranslateEntity(CVector *v1, CVector *v2) const; /// ok
void UpdateGasPedalAudio(CAutomobile *automobile); // todo hook
bool UsesReverseWarning(int32 model) const;
bool UsesSiren(int32 model) const;
bool UsesSirenSwitching(int32 model) const;
}; };
static_assert(sizeof(cAudioManager) == 0x4B14, "cAudioManager: error"); static_assert(sizeof(cAudioManager) == 19220, "cAudioManager: error");
extern cAudioManager &AudioManager; extern cAudioManager &AudioManager;

View File

@ -7,7 +7,6 @@
cDMAudio &DMAudio = *(cDMAudio*)0x95CDBE; cDMAudio &DMAudio = *(cDMAudio*)0x95CDBE;
void void
cDMAudio::Initialise(void) cDMAudio::Initialise(void)
{ {
@ -29,7 +28,7 @@ cDMAudio::Service(void)
int32 int32
cDMAudio::CreateEntity(eAudioType type, void *UID) cDMAudio::CreateEntity(eAudioType type, void *UID)
{ {
return AudioManager.CreateEntity(type, UID); return AudioManager.CreateEntity(type, (CPhysical *)UID);
} }
void void
@ -80,7 +79,7 @@ cDMAudio::SetEffectsFadeVol(uint8 volume)
uint8 vol = volume; uint8 vol = volume;
if ( vol > MAX_VOLUME ) vol = MAX_VOLUME; if ( vol > MAX_VOLUME ) vol = MAX_VOLUME;
AudioManager.SetEffectsFadeVol(vol); AudioManager.SetEffectsFadeVolume(vol);
} }
void void
@ -89,7 +88,7 @@ cDMAudio::SetMusicFadeVol(uint8 volume)
uint8 vol = volume; uint8 vol = volume;
if ( vol > MAX_VOLUME ) vol = MAX_VOLUME; if ( vol > MAX_VOLUME ) vol = MAX_VOLUME;
AudioManager.SetMusicFadeVol(vol); AudioManager.SetMusicFadeVolume(vol);
} }
uint8 uint8
@ -165,15 +164,15 @@ cDMAudio::IsAudioInitialised(void)
} }
void void
cDMAudio::ReportCrime(eCrimeType crime, CVector const &pos) cDMAudio::ReportCrime(eCrimeType crime, const CVector &pos)
{ {
AudioManager.ReportCrime(crime, pos); AudioManager.ReportCrime(crime, &pos);
} }
int32 int32
cDMAudio::CreateLoopingScriptObject(cAudioScriptObject *scriptObject) cDMAudio::CreateLoopingScriptObject(cAudioScriptObject *scriptObject)
{ {
int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, scriptObject); int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, (CPhysical *)scriptObject);
if ( AEHANDLE_IS_OK(audioEntity) ) if ( AEHANDLE_IS_OK(audioEntity) )
AudioManager.SetEntityStatus(audioEntity, true); AudioManager.SetEntityStatus(audioEntity, true);
@ -190,7 +189,7 @@ cDMAudio::DestroyLoopingScriptObject(int32 audioEntity)
void void
cDMAudio::CreateOneShotScriptObject(cAudioScriptObject *scriptObject) cDMAudio::CreateOneShotScriptObject(cAudioScriptObject *scriptObject)
{ {
int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, scriptObject); int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, (CPhysical *)scriptObject);
if ( AEHANDLE_IS_OK(audioEntity) ) if ( AEHANDLE_IS_OK(audioEntity) )
{ {

View File

@ -1,4 +1,7 @@
#pragma once #pragma once
#include "Wanted.h"
enum eSound : int16 enum eSound : int16
{ {
SOUND_CAR_DOOR_CLOSE_BONNET = 0, SOUND_CAR_DOOR_CLOSE_BONNET = 0,
@ -171,6 +174,9 @@ enum eSound : int16
SOUND_TOTAL_PED_SOUNDS = 167, SOUND_TOTAL_PED_SOUNDS = 167,
}; };
#define AEHANDLE_IS_FAILED(h) ((h)<0)
#define AEHANDLE_IS_OK(h) ((h)>=0)
class cAudioScriptObject; class cAudioScriptObject;
class CEntity; class CEntity;
enum eCrimeType; enum eCrimeType;

View File

@ -1,11 +1,7 @@
#pragma once #pragma once
#include "Entity.h" #include "Entity.h"
class CBridge enum bridgeStates {
{
private:
enum bridgeStates
{
STATE_BRIDGE_LOCKED, STATE_BRIDGE_LOCKED,
STATE_LIFT_PART_IS_UP, STATE_LIFT_PART_IS_UP,
STATE_LIFT_PART_MOVING_DOWN, STATE_LIFT_PART_MOVING_DOWN,
@ -14,14 +10,15 @@ private:
STATE_LIFT_PART_MOVING_UP STATE_LIFT_PART_MOVING_UP
}; };
class CBridge
{
public:
static CEntity *&pLiftRoad, *&pLiftPart, *&pWeight; static CEntity *&pLiftRoad, *&pLiftPart, *&pWeight;
static int &State, &OldState; static int &State, &OldState;
static float &DefaultZLiftPart, &DefaultZLiftRoad, &DefaultZLiftWeight; static float &DefaultZLiftPart, &DefaultZLiftRoad, &DefaultZLiftWeight;
static float &OldLift; static float &OldLift;
static uint32 &TimeOfBridgeBecomingOperational; static uint32 &TimeOfBridgeBecomingOperational;
public:
static void Init(); static void Init();
static void Update(); static void Update();
static bool ShouldLightsBeFlashing(); static bool ShouldLightsBeFlashing();

View File

@ -68,7 +68,7 @@ bool CGarages::HasCarBeenCrushed(int32 handle)
return CrushedCarId == handle; return CrushedCarId == handle;
} }
WRAPPER void CGarages::TriggerMessage(char *text, int16, uint16 time, int16) { EAXJMP(0x426B20); } WRAPPER void CGarages::TriggerMessage(const char *text, int16, uint16 time, int16) { EAXJMP(0x426B20); }
WRAPPER bool CGarages::IsPointWithinHideOutGarage(CVector*) { EAXJMP(0x428260); } WRAPPER bool CGarages::IsPointWithinHideOutGarage(CVector*) { EAXJMP(0x428260); }
#if 0 #if 0
@ -97,7 +97,7 @@ void CGarages::PrintMessages()
CMessages::InsertNumberInString(TheText.Get(MessageIDString), MessageNumberInString, -1, -1, -1, -1, -1, gUString); CMessages::InsertNumberInString(TheText.Get(MessageIDString), MessageNumberInString, -1, -1, -1, -1, -1, gUString);
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f + 2.0 - 40.0f), gUString); CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f + 2.0f - 40.0f), gUString);
CFont::SetColor(CRGBA(89, 115, 150, 255)); CFont::SetColor(CRGBA(89, 115, 150, 255));
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f - 40.0f), gUString); CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f - 40.0f), gUString);
@ -107,7 +107,7 @@ void CGarages::PrintMessages()
CMessages::InsertNumberInString(TheText.Get(MessageIDString), MessageNumberInString, MessageNumberInString2, -1, -1, -1, -1, gUString); CMessages::InsertNumberInString(TheText.Get(MessageIDString), MessageNumberInString, MessageNumberInString2, -1, -1, -1, -1, gUString);
CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f + 2.0 - 40.0f), gUString); CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f + 2.0f - 40.0f), gUString);
CFont::SetColor(CRGBA(89, 115, 150, 255)); CFont::SetColor(CRGBA(89, 115, 150, 255));
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f - 40.0f), gUString); CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f - 40.0f), gUString);

View File

@ -22,7 +22,7 @@ public:
public: public:
static bool IsModelIndexADoor(uint32 id); static bool IsModelIndexADoor(uint32 id);
static void TriggerMessage(char *text, int16, uint16 time, int16); static void TriggerMessage(const char *text, int16, uint16 time, int16);
static void PrintMessages(void); static void PrintMessages(void);
static bool HasCarBeenCrushed(int32); static bool HasCarBeenCrushed(int32);
static bool IsPointWithinHideOutGarage(CVector*); static bool IsPointWithinHideOutGarage(CVector*);

View File

@ -1,8 +1,9 @@
#pragma once #pragma once
#include "Game.h"
class CPed; class CPed;
class CVehicle; class CVehicle;
enum eLevelName;
struct PedGroup struct PedGroup
{ {

View File

@ -342,7 +342,7 @@ void CReplay::StorePedUpdate(CPed *ped, int id)
tPedUpdatePacket* pp = (tPedUpdatePacket*)&Record.m_pBase[Record.m_nOffset]; tPedUpdatePacket* pp = (tPedUpdatePacket*)&Record.m_pBase[Record.m_nOffset];
pp->type = REPLAYPACKET_PED_UPDATE; pp->type = REPLAYPACKET_PED_UPDATE;
pp->index = id; pp->index = id;
pp->heading = 128.0f / M_PI * ped->m_fRotationCur; pp->heading = 128.0f / PI * ped->m_fRotationCur;
pp->matrix.CompressFromFullMatrix(ped->GetMatrix()); pp->matrix.CompressFromFullMatrix(ped->GetMatrix());
pp->assoc_group_id = ped->m_animGroup; pp->assoc_group_id = ped->m_animGroup;
/* Would be more sane to use GetJustIndex(ped->m_pMyVehicle) in following assignment */ /* Would be more sane to use GetJustIndex(ped->m_pMyVehicle) in following assignment */
@ -464,8 +464,8 @@ void CReplay::ProcessPedUpdate(CPed *ped, float interpolation, CAddressInReplayB
buffer->m_nOffset += sizeof(tPedUpdatePacket); buffer->m_nOffset += sizeof(tPedUpdatePacket);
return; return;
} }
ped->m_fRotationCur = pp->heading * M_PI / 128.0f; ped->m_fRotationCur = pp->heading * PI / 128.0f;
ped->m_fRotationDest = pp->heading * M_PI / 128.0f; ped->m_fRotationDest = pp->heading * PI / 128.0f;
CMatrix ped_matrix; CMatrix ped_matrix;
pp->matrix.DecompressIntoFullMatrix(ped_matrix); pp->matrix.DecompressIntoFullMatrix(ped_matrix);
ped->GetMatrix() = ped->GetMatrix() * CMatrix(1.0f - interpolation); ped->GetMatrix() = ped->GetMatrix() * CMatrix(1.0f - interpolation);
@ -632,17 +632,17 @@ void CReplay::StoreCarUpdate(CVehicle *vehicle, int id)
vp->primary_color = vehicle->m_currentColour1; vp->primary_color = vehicle->m_currentColour1;
vp->secondary_color = vehicle->m_currentColour2; vp->secondary_color = vehicle->m_currentColour2;
if (vehicle->GetModelIndex() == MI_RHINO) if (vehicle->GetModelIndex() == MI_RHINO)
vp->car_gun = 128.0f / M_PI * ((CAutomobile*)vehicle)->m_fCarGunLR; vp->car_gun = 128.0f / PI * ((CAutomobile*)vehicle)->m_fCarGunLR;
else else
vp->wheel_state = 50.0f * vehicle->m_fSteerAngle; vp->wheel_state = 50.0f * vehicle->m_fSteerAngle;
if (vehicle->IsCar()){ if (vehicle->IsCar()){
CAutomobile* car = (CAutomobile*)vehicle; CAutomobile* car = (CAutomobile*)vehicle;
for (int i = 0; i < 4; i++){ for (int i = 0; i < 4; i++){
vp->wheel_susp_dist[i] = 50.0f * car->m_aSuspensionSpringRatio[i]; vp->wheel_susp_dist[i] = 50.0f * car->m_aSuspensionSpringRatio[i];
vp->wheel_rotation[i] = 128.0f / M_PI * car->m_aWheelRotation[i]; vp->wheel_rotation[i] = 128.0f / PI * car->m_aWheelRotation[i];
} }
vp->door_angles[0] = 127.0f / M_PI * car->Doors[2].m_fAngle; vp->door_angles[0] = 127.0f / PI * car->Doors[2].m_fAngle;
vp->door_angles[1] = 127.0f / M_PI * car->Doors[3].m_fAngle; vp->door_angles[1] = 127.0f / PI * car->Doors[3].m_fAngle;
vp->door_status = 0; vp->door_status = 0;
for (int i = 0; i < 6; i++){ for (int i = 0; i < 6; i++){
if (car->Damage.GetDoorStatus(i) == 3) if (car->Damage.GetDoorStatus(i) == 3)
@ -675,7 +675,7 @@ void CReplay::ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressI
ApplyPanelDamageToCar(vp->panels, (CAutomobile*)vehicle, true); ApplyPanelDamageToCar(vp->panels, (CAutomobile*)vehicle, true);
vehicle->m_vecMoveSpeed = CVector(vp->velocityX / 8000.0f, vp->velocityY / 8000.0f, vp->velocityZ / 8000.0f); vehicle->m_vecMoveSpeed = CVector(vp->velocityX / 8000.0f, vp->velocityY / 8000.0f, vp->velocityZ / 8000.0f);
if (vehicle->GetModelIndex() == MI_RHINO) { if (vehicle->GetModelIndex() == MI_RHINO) {
((CAutomobile*)vehicle)->m_fCarGunLR = vp->car_gun * M_PI / 128.0f; ((CAutomobile*)vehicle)->m_fCarGunLR = vp->car_gun * PI / 128.0f;
vehicle->m_fSteerAngle = 0.0f; vehicle->m_fSteerAngle = 0.0f;
}else{ }else{
vehicle->m_fSteerAngle = vp->wheel_state / 50.0f; vehicle->m_fSteerAngle = vp->wheel_state / 50.0f;
@ -684,10 +684,10 @@ void CReplay::ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressI
CAutomobile* car = (CAutomobile*)vehicle; CAutomobile* car = (CAutomobile*)vehicle;
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
car->m_aSuspensionSpringRatio[i] = vp->wheel_susp_dist[i] / 50.0f; car->m_aSuspensionSpringRatio[i] = vp->wheel_susp_dist[i] / 50.0f;
car->m_aWheelRotation[i] = vp->wheel_rotation[i] * M_PI / 128.0f; car->m_aWheelRotation[i] = vp->wheel_rotation[i] * PI / 128.0f;
} }
car->Doors[2].m_fAngle = car->Doors[2].m_fPrevAngle = vp->door_angles[0] * M_PI / 127.0f; car->Doors[2].m_fAngle = car->Doors[2].m_fPrevAngle = vp->door_angles[0] * PI / 127.0f;
car->Doors[3].m_fAngle = car->Doors[3].m_fPrevAngle = vp->door_angles[1] * M_PI / 127.0f; car->Doors[3].m_fAngle = car->Doors[3].m_fPrevAngle = vp->door_angles[1] * PI / 127.0f;
if (vp->door_angles[0]) if (vp->door_angles[0])
car->Damage.SetDoorStatus(2, 2); car->Damage.SetDoorStatus(2, 2);
if (vp->door_angles[1]) if (vp->door_angles[1])

View File

@ -442,7 +442,7 @@ int m_iModeObbeCamIsInForCar;
static bool &m_bUseMouse3rdPerson; static bool &m_bUseMouse3rdPerson;
bool Get_Just_Switched_Status() { return m_bJust_Switched; } bool Get_Just_Switched_Status() { return m_bJust_Switched; }
inline const CMatrix GetCameraMatrix(void) { return m_cameraMatrix; } inline const CMatrix& GetCameraMatrix(void) { return m_cameraMatrix; }
CVector &GetGameCamPosition(void) { return m_vecGameCamPos; } CVector &GetGameCamPosition(void) { return m_vecGameCamPos; }
bool IsPointVisible(const CVector &center, const CMatrix *mat); bool IsPointVisible(const CVector &center, const CMatrix *mat);
bool IsSphereVisible(const CVector &center, float radius, const CMatrix *mat); bool IsSphereVisible(const CVector &center, float radius, const CMatrix *mat);

View File

@ -5,8 +5,8 @@
#include "rwcore.h" #include "rwcore.h"
#include "RwHelper.h" #include "RwHelper.h"
#define CDDEBUG(f, ...) debug ("%s: " f "\n", "cdvd_stream", __VA_ARGS__) #define CDDEBUG(f, ...) debug ("%s: " f "\n", "cdvd_stream", ## __VA_ARGS__)
#define CDTRACE(f, ...) printf("%s: " f "\n", "cdvd_stream", __VA_ARGS__) #define CDTRACE(f, ...) printf("%s: " f "\n", "cdvd_stream", ## __VA_ARGS__)
struct CdReadInfo struct CdReadInfo
{ {

View File

@ -4,7 +4,7 @@
#include "ModelIndices.h" #include "ModelIndices.h"
#include "World.h" #include "World.h"
#include "Wanted.h" #include "Wanted.h"
#include "Eventlist.h" #include "EventList.h"
int32 CEventList::ms_nFirstFreeSlotIndex; int32 CEventList::ms_nFirstFreeSlotIndex;
//CEvent gaEvent[NUMEVENTS]; //CEvent gaEvent[NUMEVENTS];

View File

@ -3,3 +3,27 @@
#include "Explosion.h" #include "Explosion.h"
WRAPPER void CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32) { EAXJMP(0x5591C0); } WRAPPER void CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32) { EAXJMP(0x5591C0); }
WRAPPER
int8 CExplosion::GetExplosionActiveCounter(uint8 id)
{
EAXJMP(0x559140);
}
WRAPPER
CVector *CExplosion::GetExplosionPosition(uint8 id)
{
EAXJMP(0x5591A0);
}
WRAPPER
uint8 CExplosion::GetExplosionType(uint8 id)
{
EAXJMP(0x559180);
}
WRAPPER
void CExplosion::ResetExplosionActiveCounter(uint8 id)
{
EAXJMP(0x559160);
}

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
class CEntity; class CEntity;
class CVector;
enum eExplosionType enum eExplosionType
{ {
@ -19,5 +20,11 @@ enum eExplosionType
class CExplosion class CExplosion
{ {
public: public:
static void AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32); static void AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type,
const CVector &pos, uint32);
static int8 GetExplosionActiveCounter(uint8 id);
static CVector *GetExplosionPosition(uint8 id);
static uint8 GetExplosionType(uint8 id);
static void ResetExplosionActiveCounter(uint8 id);
}; };

View File

@ -248,15 +248,15 @@ CFileMgr::OpenFileForWriting(const char *file)
} }
int int
CFileMgr::Read(int fd, char *buf, int len) CFileMgr::Read(int fd, const char *buf, int len)
{ {
return myfread(buf, 1, len, fd); return myfread((void*)buf, 1, len, fd);
} }
int int
CFileMgr::Write(int fd, char *buf, int len) CFileMgr::Write(int fd, const char *buf, int len)
{ {
return myfwrite(buf, 1, len, fd); return myfwrite((void*)buf, 1, len, fd);
} }
bool bool

View File

@ -12,8 +12,8 @@ public:
static int LoadFile(const char *file, uint8 *buf, int unused, const char *mode); static int LoadFile(const char *file, uint8 *buf, int unused, const char *mode);
static int OpenFile(const char *file, const char *mode); static int OpenFile(const char *file, const char *mode);
static int OpenFileForWriting(const char *file); static int OpenFileForWriting(const char *file);
static int Read(int fd, char *buf, int len); static int Read(int fd, const char *buf, int len);
static int Write(int fd, char *buf, int len); static int Write(int fd, const char *buf, int len);
static bool Seek(int fd, int offset, int whence); static bool Seek(int fd, int offset, int whence);
static bool ReadLine(int fd, char *buf, int len); static bool ReadLine(int fd, char *buf, int len);
static int CloseFile(int fd); static int CloseFile(int fd);

View File

@ -95,7 +95,7 @@ bool GetMouseMoveRight();
bool GetPadInput(); bool GetPadInput();
bool GetMouseInput(); bool GetMouseInput();
char *FrontendFilenames[] = { const char *FrontendFilenames[] = {
"fe2_mainpanel_ul", "fe2_mainpanel_ul",
"fe2_mainpanel_ur", "fe2_mainpanel_ur",
"fe2_mainpanel_dl", "fe2_mainpanel_dl",
@ -126,7 +126,7 @@ char *FrontendFilenames[] = {
"fe_radio9", // CHATTERBOX "fe_radio9", // CHATTERBOX
}; };
char *MenuFilenames[] = { const char *MenuFilenames[] = {
"connection24", "", "connection24", "",
"findgame24", "", "findgame24", "",
"hostgame24", "", "hostgame24", "",

View File

@ -1,7 +1,7 @@
#include "common.h" #include "common.h"
#include "patcher.h" #include "patcher.h"
#include "Game.h" #include "Game.h"
#include "Main.h" #include "main.h"
#include "CdStream.h" #include "CdStream.h"
#include "FileMgr.h" #include "FileMgr.h"

View File

@ -97,7 +97,7 @@ public:
} }
// should return direction in 0-8 range. fits perfectly to peds' path directions. // should return direction in 0-8 range. fits perfectly to peds' path directions.
static int CGeneral::GetNodeHeadingFromVector(float x, float y) static int GetNodeHeadingFromVector(float x, float y)
{ {
float angle = CGeneral::GetRadianAngleBetweenPoints(x, y, 0.0f, 0.0f); float angle = CGeneral::GetRadianAngleBetweenPoints(x, y, 0.0f, 0.0f);
if (angle < 0.0f) if (angle < 0.0f)

View File

@ -7,4 +7,5 @@
class CInstance : CPlaceable class CInstance : CPlaceable
{ {
public: public:
~CInstance() = default;
}; };

View File

@ -7,7 +7,7 @@ CPlaceable::CPlaceable(void)
m_matrix.SetScale(1.0f); m_matrix.SetScale(1.0f);
} }
CPlaceable::~CPlaceable(void) { } CPlaceable::~CPlaceable(void) = default;
void void
CPlaceable::SetHeading(float angle) CPlaceable::SetHeading(float angle)

View File

@ -156,7 +156,7 @@ public:
inline float sq(float x) { return x*x; } inline float sq(float x) { return x*x; }
#define SQR(x) ((x) * (x)) #define SQR(x) ((x) * (x))
#define PI M_PI #define PI (float)M_PI
#define TWOPI (PI*2) #define TWOPI (PI*2)
#define HALFPI (PI/2) #define HALFPI (PI/2)
#define DEGTORAD(x) ((x) * PI / 180.0f) #define DEGTORAD(x) ((x) * PI / 180.0f)
@ -171,16 +171,16 @@ inline float sq(float x) { return x*x; }
int myrand(void); int myrand(void);
void mysrand(unsigned int seed); void mysrand(unsigned int seed);
void re3_debug(char *format, ...); void re3_debug(const char *format, ...);
void re3_trace(const char *filename, unsigned int lineno, const char *func, char *format, ...); void re3_trace(const char *filename, unsigned int lineno, const char *func, const char *format, ...);
void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func); void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func);
#define DEBUGBREAK() __debugbreak(); #define DEBUGBREAK() __debugbreak();
#define debug(f, ...) re3_debug("[DBG]: " f, __VA_ARGS__) #define debug(f, ...) re3_debug("[DBG]: " f, ## __VA_ARGS__)
#define DEV(f, ...) re3_debug("[DEV]: " f, __VA_ARGS__) #define DEV(f, ...) re3_debug("[DEV]: " f, ## __VA_ARGS__)
#define TRACE(f, ...) re3_trace(__FILE__, __LINE__, __FUNCTION__, f, __VA_ARGS__) #define TRACE(f, ...) re3_trace(__FILE__, __LINE__, __FUNCTION__, f, ## __VA_ARGS__)
#define Error(f, ...) re3_debug("[ERROR]: " f, __VA_ARGS__) #define Error(f, ...) re3_debug("[ERROR]: " f, ## __VA_ARGS__)
#define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) ) #define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) )
#define ASSERT assert #define ASSERT assert
@ -200,7 +200,6 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
#define ABS(a) (((a) < 0) ? (-(a)) : (a)) #define ABS(a) (((a) < 0) ? (-(a)) : (a))
#define norm(value, min, max) (((value) < (min)) ? 0 : (((value) > (max)) ? 1 : (((value) - (min)) / ((max) - (min))))) #define norm(value, min, max) (((value) < (min)) ? 0 : (((value) > (max)) ? 1 : (((value) - (min)) / ((max) - (min)))))
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define STR(x) STRINGIFY(x) #define STR(x) STRINGIFY(x)
#define CONCAT_(x,y) x##y #define CONCAT_(x,y) x##y

View File

@ -425,7 +425,7 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
abort(); abort();
} }
void re3_debug(char *format, ...) void re3_debug(const char *format, ...)
{ {
va_list va; va_list va;
va_start(va, format); va_start(va, format);
@ -435,7 +435,7 @@ void re3_debug(char *format, ...)
printf("%s", re3_buff); printf("%s", re3_buff);
} }
void re3_trace(const char *filename, unsigned int lineno, const char *func, char *format, ...) void re3_trace(const char *filename, unsigned int lineno, const char *func, const char *format, ...)
{ {
char buff[re3_buffsize *2]; char buff[re3_buffsize *2];
va_list va; va_list va;

View File

@ -4,14 +4,14 @@
struct RwObjectNameIdAssocation struct RwObjectNameIdAssocation
{ {
char *name; const char *name;
int32 hierId; int32 hierId;
uint32 flags; uint32 flags;
}; };
struct RwObjectNameAssociation struct RwObjectNameAssociation
{ {
char *name; const char *name;
RwFrame *frame; RwFrame *frame;
}; };

View File

@ -1038,7 +1038,7 @@ CVehicleModelInfo::SetEnvironmentMap(void)
void void
CVehicleModelInfo::LoadEnvironmentMaps(void) CVehicleModelInfo::LoadEnvironmentMaps(void)
{ {
char *texnames[] = { const char *texnames[] = {
"reflection01", // only one used "reflection01", // only one used
"reflection02", "reflection02",
"reflection03", "reflection03",

View File

@ -3172,7 +3172,7 @@ CPed::CheckIfInTheAir(void)
CEntity *foundEntity; CEntity *foundEntity;
float startZ = pos.z - 1.54f; float startZ = pos.z - 1.54f;
bool foundGround = CWorld::ProcessVerticalLine(pos, startZ, foundColPoint, foundEntity, true, true, false, true, false, false, false); bool foundGround = CWorld::ProcessVerticalLine(pos, startZ, foundColPoint, foundEntity, true, true, false, true, false, false, nil);
if (!foundGround && m_nPedState != PED_JUMP) if (!foundGround && m_nPedState != PED_JUMP)
{ {
pos.z -= 1.04f; pos.z -= 1.04f;
@ -4622,7 +4622,7 @@ CPed::LoadFightData(void)
// Actually GetLocalDirectionTo(Turn/Look) // Actually GetLocalDirectionTo(Turn/Look)
int int
CPed::GetLocalDirection(CVector2D const &posOffset) CPed::GetLocalDirection(const CVector2D &posOffset)
{ {
float direction; float direction;

View File

@ -575,7 +575,7 @@ public:
void StartFightAttack(uint8); void StartFightAttack(uint8);
void SetWaitState(eWaitState, void*); void SetWaitState(eWaitState, void*);
bool FightStrike(CVector&); bool FightStrike(CVector&);
int GetLocalDirection(CVector2D const &); int GetLocalDirection(const CVector2D &);
void StartFightDefend(uint8, uint8, uint8); void StartFightDefend(uint8, uint8, uint8);
void PlayHitSound(CPed*); void PlayHitSound(CPed*);
void SetFall(int, AnimationId, uint8); void SetFall(int, AnimationId, uint8);
@ -718,6 +718,15 @@ public:
#endif #endif
}; };
class cPedParams
{
public:
char m_bDistanceCalculated;
char gap_1[3];
float m_fDistance;
CPed *m_pPed;
};
void FinishFuckUCB(CAnimBlendAssociation *assoc, void *arg); void FinishFuckUCB(CAnimBlendAssociation *assoc, void *arg);
static_assert(offsetof(CPed, m_nPedState) == 0x224, "CPed: error"); static_assert(offsetof(CPed, m_nPedState) == 0x224, "CPed: error");

View File

@ -38,7 +38,7 @@ CPedPlacement::FindZCoorForPed(CVector* pos)
CEntity* CEntity*
CPedPlacement::IsPositionClearOfCars(CVector* pos) CPedPlacement::IsPositionClearOfCars(CVector* pos)
{ {
return CWorld::TestSphereAgainstWorld(*pos, 0.25f, false, true, true, false, false, false, false); return CWorld::TestSphereAgainstWorld(*pos, 0.25f, nil, true, true, false, false, false, false);
} }
STARTPATCHES STARTPATCHES

View File

@ -10,7 +10,7 @@
#include "Clock.h" #include "Clock.h"
#include "Weather.h" #include "Weather.h"
#include "Stats.h" #include "Stats.h"
#include "math/maths.h" #include "maths.h"
#include "Frontend.h" #include "Frontend.h"
uint8 ScrollCharSet[59][5] = { uint8 ScrollCharSet[59][5] = {

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "common.h" #include "common.h"
#include "math/Vector.h" #include "Vector.h"
class CMovingThings class CMovingThings
{ {

View File

@ -1128,7 +1128,7 @@ void CHud::DrawAfterFade()
switch (OddJob2On) { switch (OddJob2On) {
case 0: case 0:
OddJob2On = 1; OddJob2On = 1;
OddJob2XOffset = 380.0; OddJob2XOffset = 380.0f;
break; break;
case 1: case 1:
if (OddJob2XOffset <= 2.0f) { if (OddJob2XOffset <= 2.0f) {
@ -1136,27 +1136,27 @@ void CHud::DrawAfterFade()
OddJob2On = 2; OddJob2On = 2;
} }
else { else {
fStep = 40.0; fStep = 40.0f;
if ((OddJob2XOffset * 0.16667) <= 40.0) if ((OddJob2XOffset * 0.16667f) <= 40.0f)
fStep = OddJob2XOffset * 0.16667; fStep = OddJob2XOffset * 0.16667f;
OddJob2XOffset = OddJob2XOffset - fStep; OddJob2XOffset = OddJob2XOffset - fStep;
} }
break; break;
case 2: case 2:
OddJob2Timer += (20.0 * CTimer::GetTimeStep()); OddJob2Timer += (20.0f * CTimer::GetTimeStep());
if (OddJob2Timer > 1500) { if (OddJob2Timer > 1500) {
OddJob2On = 3; OddJob2On = 3;
} }
break; break;
case 3: case 3:
fStep = 30.0; fStep = 30.0f;
if ((OddJob2XOffset * 0.2) >= 30.0) if ((OddJob2XOffset * 0.2f) >= 30.0f)
fStep = OddJob2XOffset * 0.2; fStep = OddJob2XOffset * 0.2f;
OddJob2XOffset = OddJob2XOffset - fStep; OddJob2XOffset = OddJob2XOffset - fStep;
if (OddJob2XOffset < -380.0) { if (OddJob2XOffset < -380.0f) {
OddJob2OffTimer = 5000.0; OddJob2OffTimer = 5000.0f;
OddJob2On = 0; OddJob2On = 0;
} }
break; break;

View File

@ -4,7 +4,7 @@
#include "TxdStore.h" #include "TxdStore.h"
#include "Timer.h" #include "Timer.h"
#include "Camera.h" #include "Camera.h"
#include "TimeCycle.h" #include "Timecycle.h"
#include "CutsceneMgr.h" #include "CutsceneMgr.h"
#include "Automobile.h" #include "Automobile.h"
#include "Ped.h" #include "Ped.h"

View File

@ -103,14 +103,14 @@ CVisibilityPlugins::SetRenderWareCamera(RwCamera *camera)
else else
ms_cullCompsDist = sq(TheCamera.LODDistMultiplier * 20.0f); ms_cullCompsDist = sq(TheCamera.LODDistMultiplier * 20.0f);
ms_vehicleLod0Dist = sq(70.0 * TheCamera.GenerationDistMultiplier); ms_vehicleLod0Dist = sq(70.0f * TheCamera.GenerationDistMultiplier);
ms_vehicleLod1Dist = sq(90.0 * TheCamera.GenerationDistMultiplier); ms_vehicleLod1Dist = sq(90.0f * TheCamera.GenerationDistMultiplier);
ms_vehicleFadeDist = sq(100.0 * TheCamera.GenerationDistMultiplier); ms_vehicleFadeDist = sq(100.0f * TheCamera.GenerationDistMultiplier);
ms_bigVehicleLod0Dist = sq(60.0 * TheCamera.GenerationDistMultiplier); ms_bigVehicleLod0Dist = sq(60.0f * TheCamera.GenerationDistMultiplier);
ms_bigVehicleLod1Dist = sq(150.0 * TheCamera.GenerationDistMultiplier); ms_bigVehicleLod1Dist = sq(150.0f * TheCamera.GenerationDistMultiplier);
ms_pedLod0Dist = sq(25.0 * TheCamera.LODDistMultiplier); ms_pedLod0Dist = sq(25.0f * TheCamera.LODDistMultiplier);
ms_pedLod1Dist = sq(60.0 * TheCamera.LODDistMultiplier); ms_pedLod1Dist = sq(60.0f * TheCamera.LODDistMultiplier);
ms_pedFadeDist = sq(70.0 * TheCamera.LODDistMultiplier); ms_pedFadeDist = sq(70.0f * TheCamera.LODDistMultiplier);
} }
RpMaterial* RpMaterial*

View File

@ -9,7 +9,7 @@
#include "Boat.h" #include "Boat.h"
#include "World.h" #include "World.h"
#include "General.h" #include "General.h"
#include "TimeCycle.h" #include "Timecycle.h"
#include "ZoneCull.h" #include "ZoneCull.h"
#include "Clock.h" #include "Clock.h"
#include "Particle.h" #include "Particle.h"

View File

@ -1661,7 +1661,7 @@ void CenterVideo(void)
/* /*
***************************************************************************** *****************************************************************************
*/ */
void PlayMovieInWindow(int cmdShow, LPTSTR szFile) void PlayMovieInWindow(int cmdShow, const char* szFile)
{ {
WCHAR wFileName[256]; WCHAR wFileName[256];
HRESULT hr; HRESULT hr;

View File

@ -8,7 +8,7 @@
#include "VisibilityPlugins.h" #include "VisibilityPlugins.h"
#include "DMAudio.h" #include "DMAudio.h"
#include "Clock.h" #include "Clock.h"
#include "TimeCycle.h" #include "Timecycle.h"
#include "ZoneCull.h" #include "ZoneCull.h"
#include "Camera.h" #include "Camera.h"
#include "Darkel.h" #include "Darkel.h"
@ -128,7 +128,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
m_fGasPedal = 0.0f; m_fGasPedal = 0.0f;
m_fBrakePedal = 0.0f; m_fBrakePedal = 0.0f;
m_pSetOnFireEntity = nil; m_pSetOnFireEntity = nil;
field_594 = 0; m_fGasPedalAudio = 0;
bNotDamagedUpsideDown = false; bNotDamagedUpsideDown = false;
bMoreResistantToDamage = false; bMoreResistantToDamage = false;
m_fVelocityChangeForAudio = 0.0f; m_fVelocityChangeForAudio = 0.0f;
@ -316,7 +316,7 @@ CAutomobile::ProcessControl(void)
// Set Center of Mass to make car more stable // Set Center of Mass to make car more stable
if(strongGrip1 || bCheat3) if(strongGrip1 || bCheat3)
m_vecCentreOfMass.z = 0.3f*m_aSuspensionSpringLength[0] + -1.0*m_fHeightAboveRoad; m_vecCentreOfMass.z = 0.3f*m_aSuspensionSpringLength[0] + -1.0f*m_fHeightAboveRoad;
else if(pHandling->Flags & HANDLING_NONPLAYER_STABILISER && m_status == STATUS_PHYSICS) else if(pHandling->Flags & HANDLING_NONPLAYER_STABILISER && m_status == STATUS_PHYSICS)
m_vecCentreOfMass.z = pHandling->CentreOfMass.z - 0.2f*pHandling->Dimension.z; m_vecCentreOfMass.z = pHandling->CentreOfMass.z - 0.2f*pHandling->Dimension.z;
else else
@ -1591,10 +1591,11 @@ CAutomobile::PreRender(void)
break; break;
} }
if(GetModelIndex() == MI_RCBANDIT || if(GetModelIndex() == MI_RCBANDIT || GetModelIndex() == MI_DODO ||
GetModelIndex() == MI_DODO || GetModelIndex() == MI_RHINO) {
GetModelIndex() == MI_RHINO) CShadows::StoreShadowForCar(this);
goto nolights; return;
}
// Turn lights on/off // Turn lights on/off
bool shouldLightsBeOn = bool shouldLightsBeOn =
@ -1739,7 +1740,7 @@ CAutomobile::PreRender(void)
// Taillight coronas // Taillight coronas
if(behindness > 0.0f){ if(behindness > 0.0f){
// Behind car // Behind car
float intensity = 0.4f*behindness + 0.4; float intensity = 0.4f*behindness + 0.4f;
float size = (behindness + 1.0f)/2.0f; float size = (behindness + 1.0f)/2.0f;
if(m_fGasPedal < 0.0f){ if(m_fGasPedal < 0.0f){
@ -1757,7 +1758,7 @@ CAutomobile::PreRender(void)
CCoronas::TYPE_STREAK, CCoronas::FLARE_NONE, CCoronas::REFLECTION_ON, CCoronas::TYPE_STREAK, CCoronas::FLARE_NONE, CCoronas::REFLECTION_ON,
CCoronas::LOSCHECK_OFF, CCoronas::STREAK_ON, angle); CCoronas::LOSCHECK_OFF, CCoronas::STREAK_ON, angle);
}else{ }else{
if(m_fBrakePedal > 0.0){ if(m_fBrakePedal > 0.0f){
intensity += 0.4f; intensity += 0.4f;
size += 0.3f; size += 0.3f;
} }
@ -1843,8 +1844,10 @@ CAutomobile::PreRender(void)
}else{ }else{
// Lights off // Lights off
if(m_status == STATUS_ABANDONED || m_status == STATUS_WRECKED) if(m_status == STATUS_ABANDONED || m_status == STATUS_WRECKED) {
goto nolights; CShadows::StoreShadowForCar(this);
return;
}
CVector lightPos = mi->m_positions[CAR_POS_TAILLIGHTS]; CVector lightPos = mi->m_positions[CAR_POS_TAILLIGHTS];
CVector lightR = GetMatrix() * lightPos; CVector lightR = GetMatrix() * lightPos;
@ -1903,7 +1906,6 @@ CAutomobile::PreRender(void)
} }
} }
nolights:
CShadows::StoreShadowForCar(this); CShadows::StoreShadowForCar(this);
} }
@ -2877,7 +2879,7 @@ CAutomobile::ProcessBuoyancy(void)
static RwRGBA black; static RwRGBA black;
if(pos.z >= 0.0f){ if(pos.z >= 0.0f){
nGenerateRaindrops = 0; nGenerateRaindrops = 0;
pos.z += 0.5; pos.z += 0.5f;
CParticleObject::AddObject(POBJECT_SPLASHES_AROUND, CParticleObject::AddObject(POBJECT_SPLASHES_AROUND,
pos, CVector(0.0f, 0.0f, 0.0f), 6.5f, 2500, black, true); pos, CVector(0.0f, 0.0f, 0.0f), 6.5f, 2500, black, true);
} }

View File

@ -117,7 +117,7 @@ public:
uint8 m_nWheelsOnGround; uint8 m_nWheelsOnGround;
uint8 m_nDriveWheelsOnGround; uint8 m_nDriveWheelsOnGround;
uint8 m_nDriveWheelsOnGroundPrev; uint8 m_nDriveWheelsOnGroundPrev;
int32 field_594; int32 m_fGasPedalAudio;
tWheelState m_aWheelState[4]; tWheelState m_aWheelState[4];
static bool &m_sAllTaxiLights; static bool &m_sAllTaxiLights;

View File

@ -6,9 +6,9 @@
cHandlingDataMgr &mod_HandlingManager = *(cHandlingDataMgr*)0x728060; cHandlingDataMgr &mod_HandlingManager = *(cHandlingDataMgr*)0x728060;
char *HandlingFilename = "HANDLING.CFG"; const char *HandlingFilename = "HANDLING.CFG";
char VehicleNames[NUMHANDLINGS][14] = { const char VehicleNames[NUMHANDLINGS][14] = {
"LANDSTAL", "LANDSTAL",
"IDAHO", "IDAHO",
"STINGER", "STINGER",
@ -199,7 +199,7 @@ cHandlingDataMgr::ConvertDataToGameUnits(tHandlingData *handling)
if(handling->fTurnMass < 10.0f) if(handling->fTurnMass < 10.0f)
handling->fTurnMass *= 5.0f; handling->fTurnMass *= 5.0f;
handling->fInvMass = 1.0f/handling->fMass; handling->fInvMass = 1.0f/handling->fMass;
handling->fBuoyancy = 100.0f/handling->nPercentSubmerged * 0.008*handling->fMass; handling->fBuoyancy = 100.0f/handling->nPercentSubmerged * 0.008f*handling->fMass;
// What the hell is going on here? // What the hell is going on here?
specificVolume = handling->Dimension.x*handling->Dimension.z*0.5f / handling->fMass; // ? specificVolume = handling->Dimension.x*handling->Dimension.z*0.5f / handling->fMass; // ?
@ -207,7 +207,7 @@ cHandlingDataMgr::ConvertDataToGameUnits(tHandlingData *handling)
b = 100.0f; b = 100.0f;
velocity = handling->Transmission.fMaxVelocity; velocity = handling->Transmission.fMaxVelocity;
while(a < b && velocity > 0.0f){ while(a < b && velocity > 0.0f){
velocity -= 0.01; velocity -= 0.01f;
a = handling->Transmission.fEngineAcceleration/6.0f; a = handling->Transmission.fEngineAcceleration/6.0f;
b = -velocity * (1.0f/(specificVolume * sq(velocity) + 1.0f) - 1.0f); b = -velocity * (1.0f/(specificVolume * sq(velocity) + 1.0f) - 1.0f);
} }

View File

@ -14,7 +14,7 @@
#include "Shadows.h" #include "Shadows.h"
#include "Coronas.h" #include "Coronas.h"
#include "Explosion.h" #include "Explosion.h"
#include "TimeCycle.h" #include "Timecycle.h"
#include "TempColModels.h" #include "TempColModels.h"
#include "World.h" #include "World.h"
#include "WaterLevel.h" #include "WaterLevel.h"

View File

@ -397,7 +397,7 @@ CPlane::ProcessControl(void)
planePathSpeed = PlanePath3Speed; planePathSpeed = PlanePath3Speed;
numPathNodes = NumPath3Nodes; numPathNodes = NumPath3Nodes;
if(CesnaMissionStatus == CESNA_STATUS_LANDED){ if(CesnaMissionStatus == CESNA_STATUS_LANDED){
pDrugRunCesna = false; pDrugRunCesna = nil;
FlagToDestroyWhenNextProcessed(); FlagToDestroyWhenNextProcessed();
} }
}else if(m_bIsDropOffCesna){ }else if(m_bIsDropOffCesna){
@ -407,7 +407,7 @@ CPlane::ProcessControl(void)
planePathSpeed = PlanePath4Speed; planePathSpeed = PlanePath4Speed;
numPathNodes = NumPath4Nodes; numPathNodes = NumPath4Nodes;
if(DropOffCesnaMissionStatus == CESNA_STATUS_LANDED){ if(DropOffCesnaMissionStatus == CESNA_STATUS_LANDED){
pDropOffCesna = false; pDropOffCesna = nil;
FlagToDestroyWhenNextProcessed(); FlagToDestroyWhenNextProcessed();
} }
}else{ }else{

View File

@ -97,8 +97,8 @@ CVehicle::CVehicle(uint8 CreatedBy)
DMAudio.SetEntityStatus(m_audioEntityId, true); DMAudio.SetEntityStatus(m_audioEntityId, true);
m_nRadioStation = CGeneral::GetRandomNumber() % USERTRACK; m_nRadioStation = CGeneral::GetRandomNumber() % USERTRACK;
m_pCurGroundEntity = nil; m_pCurGroundEntity = nil;
field_22A = 0; m_bRainAudioCounter = 0;
field_22B = 0; m_bRainSamplesCounter = 0;
m_comedyControlState = 0; m_comedyControlState = 0;
m_aCollPolys[0].valid = false; m_aCollPolys[0].valid = false;
m_aCollPolys[1].valid = false; m_aCollPolys[1].valid = false;

View File

@ -191,8 +191,8 @@ public:
eCarLock m_nDoorLock; eCarLock m_nDoorLock;
int8 m_nLastWeaponDamage; // see eWeaponType, -1 if no damage int8 m_nLastWeaponDamage; // see eWeaponType, -1 if no damage
int8 m_nRadioStation; int8 m_nRadioStation;
int8 field_22A; uint8 m_bRainAudioCounter;
int8 field_22B; uint8 m_bRainSamplesCounter;
uint8 m_nCarHornTimer; uint8 m_nCarHornTimer;
int8 field_22D; int8 field_22D;
bool m_bSirenOrAlarm; bool m_bSirenOrAlarm;