diff options
-rw-r--r-- | src/core/FileLoader.cpp | 36 | ||||
-rw-r--r-- | src/core/FileLoader.h | 1 | ||||
-rw-r--r-- | src/core/Pad.cpp | 2 | ||||
-rw-r--r-- | src/core/TempColModels.cpp | 5 | ||||
-rw-r--r-- | src/core/TempColModels.h | 1 | ||||
-rw-r--r-- | src/modelinfo/VehicleModelInfo.cpp | 1 | ||||
-rw-r--r-- | src/modelinfo/VehicleModelInfo.h | 1 |
7 files changed, 42 insertions, 5 deletions
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp index fb826798..09c62c35 100644 --- a/src/core/FileLoader.cpp +++ b/src/core/FileLoader.cpp @@ -94,7 +94,9 @@ CFileLoader::LoadLevel(const char *filename) CObjectData::Initialise("DATA\\OBJECT.DAT"); CStreaming::Init(); CColStore::LoadAllCollision(); - // TODO(MIAMI): anim indices + for(int i = 0; i < MODELINFOSIZE; i++) + if(CModelInfo::GetModelInfo(i)) + CModelInfo::GetModelInfo(i)->ConvertAnimFileIndex(); objectsLoaded = true; } LoadingScreenLoadingFile(line + 4); @@ -597,7 +599,7 @@ CFileLoader::LoadObjectTypes(const char *filename) if(id < minID) minID = id; break; case WEAP: - assert(0 && "can't do this yet"); + LoadWeaponObject(line); break; case HIER: LoadClumpObject(line); @@ -753,6 +755,27 @@ CFileLoader::LoadTimeObject(const char *line) return id; } +int +CFileLoader::LoadWeaponObject(const char *line) +{ + int id, numObjs; + char model[24], txd[24], animFile[16]; + float dist; + CWeaponModelInfo *mi; + + sscanf(line, "%d %s %s %s %d %f", &id, model, txd, animFile, &numObjs, &dist); + + mi = CModelInfo::AddWeaponModel(id); + mi->SetName(model); + mi->SetNumAtomics(1); + mi->m_lodDistances[0] = dist; + mi->SetTexDictionary(txd); + mi->SetAnimFile(animFile); + mi->SetColModel(&CTempColModels::ms_colModelWeapon); + MatchModelString(model, id); + return id; +} + void CFileLoader::LoadClumpObject(const char *line) { @@ -773,7 +796,7 @@ CFileLoader::LoadVehicleObject(const char *line) { int id; char model[24], txd[24]; - char type[8], handlingId[16], gamename[32], anims[16], vehclass[12]; + char type[8], handlingId[16], gamename[32], animFile[16], vehclass[12]; uint32 frequency, comprules; int32 level, misc; float wheelScale; @@ -782,13 +805,13 @@ CFileLoader::LoadVehicleObject(const char *line) sscanf(line, "%d %s %s %s %s %s %s %s %d %d %x %d %f", &id, model, txd, - type, handlingId, gamename, anims, vehclass, + type, handlingId, gamename, animFile, vehclass, &frequency, &level, &comprules, &misc, &wheelScale); mi = CModelInfo::AddVehicleModel(id); mi->SetName(model); mi->SetTexDictionary(txd); - // TODO(MIAMI): anims + mi->SetAnimFile(animFile); for(p = gamename; *p; p++) if(*p == '_') *p = ' '; strcpy(mi->m_gameName, gamename); @@ -867,6 +890,7 @@ CFileLoader::LoadPedObject(const char *line) mi = CModelInfo::AddPedModel(id); mi->SetName(model); mi->SetTexDictionary(txd); + mi->SetAnimFile(animFile); mi->SetColModel(&CTempColModels::ms_colModelPed1); mi->m_pedType = CPedType::FindPedType(pedType); mi->m_pedStatType = CPedStats::GetPedStatType(pedStats); @@ -876,6 +900,8 @@ CFileLoader::LoadPedObject(const char *line) assert(animGroupId < NUM_ANIM_ASSOC_GROUPS); mi->m_animGroup = animGroupId; mi->m_carsCanDrive = carsCanDrive; + mi->radio1 = radio1; + mi->radio2 = radio2; } int diff --git a/src/core/FileLoader.h b/src/core/FileLoader.h index 959c919e..584a2312 100644 --- a/src/core/FileLoader.h +++ b/src/core/FileLoader.h @@ -25,6 +25,7 @@ public: static void LoadObjectTypes(const char *filename); static int LoadObject(const char *line); static int LoadTimeObject(const char *line); + static int LoadWeaponObject(const char *line); static void LoadClumpObject(const char *line); static void LoadVehicleObject(const char *line); static void LoadPedObject(const char *line); diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 6e2080cf..8e9858ce 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -2358,6 +2358,8 @@ void CPad::ResetCheats(void) CVehicle::bCheat3 = false; CVehicle::bCheat4 = false; CVehicle::bCheat5 = false; + gbBlackCars = false; + gbPinkCars = false; gbFastTime = false; CTimer::SetTimeScale(1.0f); diff --git a/src/core/TempColModels.cpp b/src/core/TempColModels.cpp index 70ded11b..f20923f2 100644 --- a/src/core/TempColModels.cpp +++ b/src/core/TempColModels.cpp @@ -16,6 +16,7 @@ CColModel CTempColModels::ms_colModelPedGroundHit; CColModel CTempColModels::ms_colModelBoot1; CColModel CTempColModels::ms_colModelDoor1; CColModel CTempColModels::ms_colModelBonnet1; +CColModel CTempColModels::ms_colModelWeapon; CColSphere s_aPedSpheres[3]; @@ -285,5 +286,9 @@ CTempColModels::Initialise(void) SET_COLMODEL_SPHERES(ms_colModelBodyPart2, s_aBodyPartSpheres2); + + ms_colModelWeapon.boundingSphere.Set(0.25f, CVector(0.0f, 0.0f, 0.0f)); + ms_colModelWeapon.boundingBox.Set(CVector(-0.25f, -0.25, -0.25f), CVector(0.25f, 0.25, 0.25f)); + #undef SET_COLMODEL_SPHERES } diff --git a/src/core/TempColModels.h b/src/core/TempColModels.h index 3e1dd5e1..0c936d6f 100644 --- a/src/core/TempColModels.h +++ b/src/core/TempColModels.h @@ -18,6 +18,7 @@ public: static CColModel ms_colModelBoot1; static CColModel ms_colModelDoor1; static CColModel ms_colModelBonnet1; + static CColModel ms_colModelWeapon; static void Initialise(void); }; diff --git a/src/modelinfo/VehicleModelInfo.cpp b/src/modelinfo/VehicleModelInfo.cpp index e050bab1..121e7baf 100644 --- a/src/modelinfo/VehicleModelInfo.cpp +++ b/src/modelinfo/VehicleModelInfo.cpp @@ -162,6 +162,7 @@ CVehicleModelInfo::CVehicleModelInfo(void) m_positions[i].z = 0.0f; } m_numColours = 0; + m_animFileIndex = -1; } void diff --git a/src/modelinfo/VehicleModelInfo.h b/src/modelinfo/VehicleModelInfo.h index b0525a0a..e71c9a77 100644 --- a/src/modelinfo/VehicleModelInfo.h +++ b/src/modelinfo/VehicleModelInfo.h @@ -68,6 +68,7 @@ public: uint8 m_currentColour1; uint8 m_currentColour2; RpAtomic *m_comps[6]; + // This is stupid, CClumpModelInfo already has it! union { int32 m_animFileIndex; char *m_animFileName; |