Skip to content

Commit

Permalink
ModelInfo limits for VC
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Feb 19, 2015
1 parent 4020468 commit 5b871c6
Show file tree
Hide file tree
Showing 7 changed files with 197 additions and 27 deletions.
7 changes: 5 additions & 2 deletions doc/limit_adjuster_gta3vcsa.ini
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ AudioScriptObj = 192
ColModel = 10500
AlphaEntityList = 1250
VisibleEntityPtrs = unlimited
AtomicModels = unlimited
TimeModels = unlimited
ClumpModels = unlimited
VehicleModels = unlimited
PedModels = unlimited
WeaponModels = unlimited
OutsideWorldWaterBlocks = 40
StaticShadows = 2048
Coronas = 2048
FrameLimit = 30
MemoryAvailable = 30%
Expand All @@ -72,7 +76,6 @@ AlphaEntityList = 1250
VisibleEntityPtrs = unlimited
TimeModels = unlimited
OutsideWorldWaterBlocks = 40
StaticShadows = 2048
Coronas = 2048
FrameLimit = 30
MemoryAvailable = 30%
Expand Down
72 changes: 67 additions & 5 deletions src/limits/ModelInfo/AtomicModels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,79 @@
#include "utility/dummy_object.hpp"

typedef dummy_object_vmt<0x20, 0x4C5540> CAtomicModelInfo_SA;
typedef dummy_object_vmt<0x44, 0x5602D0> CAtomicModelInfo_VC;


struct AtomicModelsVC : public StoreAdjuster<CAtomicModelInfo_VC, 0x709EAC, 3885> // T, pDefaultStore, dwDefaultCapacity
{
const char* GetLimitName()
{
return IsVC() ? "AtomicModels" : nullptr;
}

AtomicModelsVC()
{
if (*(DWORD *)0x55FEC1 != 3885) //exe modified by another adjuster
return;

this->SetGrower(0x48C688);
this->AddPointer(0x55F732, 0x0);
this->AddPointer(0x55F755, 0x0);
this->AddPointer(0x55F75B, 0x0);
this->AddPointer(0x55F764, 0x0);
this->AddPointer(0x55F83A, 0x0);
this->AddPointer(0x55F842, 0x0);
this->AddPointer(0x55F858, 0x0);
this->AddPointer(0x55F9BA, 0x0);
this->AddPointer(0x55FB24, 0x0);
this->AddPointer(0x55FB2E, 0x0);
this->AddPointer(0x55FBB3, 0x0);
this->AddPointer(0x55FBB9, 0x0);
this->AddPointer(0x55FBC2, 0x0);
this->AddPointer(0x55FBFA, 0x0);
this->AddPointer(0x55FC17, 0x0);
this->AddPointer(0x55FC1D, 0x0);
this->AddPointer(0x55FC26, 0x0);
this->AddPointer(0x55FC5E, 0x0);
this->AddPointer(0x55FC7B, 0x0);
this->AddPointer(0x55FC81, 0x0);
this->AddPointer(0x55FC8A, 0x0);
this->AddPointer(0x55FCC2, 0x0);
this->AddPointer(0x55FCDF, 0x0);
this->AddPointer(0x55FCE5, 0x0);
this->AddPointer(0x55FCEE, 0x0);
this->AddPointer(0x55FD26, 0x0);
this->AddPointer(0x55FD43, 0x0);
this->AddPointer(0x55FD49, 0x0);
this->AddPointer(0x55FD52, 0x0);
this->AddPointer(0x55FD8A, 0x0);
this->AddPointer(0x55FDA7, 0x0);
this->AddPointer(0x55FDAD, 0x0);
this->AddPointer(0x55FDB6, 0x0);
this->AddPointer(0x55FDEE, 0x0);
this->AddPointer(0x55FE0B, 0x0);
this->AddPointer(0x55FE11, 0x0);
this->AddPointer(0x55FE1A, 0x0);
this->AddPointer(0x55FE52, 0x0);
this->AddPointer(0x55FE6F, 0x0);
this->AddPointer(0x55FE75, 0x0);
this->AddPointer(0x55FE7E, 0x0);
//this->AddPointer(0x55FEE0, 0x0);
//this->AddPointer(0x55FEF3, 0x0);
if (GetLimitName()) injector::MakeNOP(0x55F74C, 5, true);
}

} AtomicModelsVC;

struct AtomicModelsSA : public StoreAdjuster<CAtomicModelInfo_SA, 0xAAE950, 14000> // T, pDefaultStore, dwDefaultCapacity
{
const char* GetLimitName()
const char* GetLimitName()
{
return IsSA()? "AtomicModels" : nullptr;
}

AtomicModelsSA()
{
AtomicModelsSA()
{
this->SetGrower (0x5B3D9A);
this->AddPointer(0x4C63E1, 0x0);
this->AddPointer(0x4C63FE, 0x0);
Expand Down Expand Up @@ -56,6 +118,6 @@ struct AtomicModelsSA : public StoreAdjuster<CAtomicModelInfo_SA, 0xAAE950, 1400
this->AddPointer(0x4C69EF, 0x4);
this->AddPointer(0x4C6A2E, 0x4);
this->AddPointer(0x4C68AC, 0x1C);
}
}

} AtomicModelInfoSA;
} AtomicModelInfoSA;
37 changes: 33 additions & 4 deletions src/limits/ModelInfo/ClumpModels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,46 @@
#include "utility/dummy_object.hpp"

typedef dummy_object_vmt<0x24, 0x4C56F0> CClumpModelInfo_SA;
typedef dummy_object_vmt<0x30, 0x5601C0> CClumpModelInfo_VC;

struct ClumpModelsVC : public StoreAdjuster<CClumpModelInfo_VC, 0x752988, 5> // T, pDefaultStore, dwDefaultCapacity
{
const char* GetLimitName()
{
return IsVC() ? "ClumpModels" : nullptr;
}

ClumpModelsVC()
{
if (*(char *)0x55FF7A != 5) //exe modified by another adjuster
return;

this->SetGrower(0x48CABA);
this->SetGrower(0x55F642, 0x0);
this->SetGrower(0x55F65D, 0x0);
this->SetGrower(0x55F665, 0x0);
this->SetGrower(0x55F66E, 0x0);
this->SetGrower(0x55F8DE, 0x0);
this->SetGrower(0x55F8E6, 0x0);
this->SetGrower(0x55F903, 0x0);
this->SetGrower(0x55F9EC, 0x0);
this->SetGrower(0x55FB77, 0x0);
//this->SetGrower(0x55FF97, 0x0);
//this->SetGrower(0x55FFAA, 0x0);
if (GetLimitName()) injector::MakeNOP(0x55F655, 5, true);
}

} ClumpModelsVC;

struct ClumpModelsSA : public StoreAdjuster<CClumpModelInfo_SA, 0xB1E958, 92> // T, pDefaultStore, dwDefaultCapacity
{
const char* GetLimitName()
const char* GetLimitName()
{
return IsSA()? "ClumpModels" : nullptr;
}

ClumpModelsSA()
{
ClumpModelsSA()
{
this->SetGrower (0x5B407E, 0x5B413B);
this->AddPointer(0x4C64C9, 0x0);
this->AddPointer(0x4C64E0, 0x0);
Expand All @@ -29,6 +58,6 @@ struct ClumpModelsSA : public StoreAdjuster<CClumpModelInfo_SA, 0xB1E958, 92>
//this->AddPointer(0x856291, 0x0);
this->AddPointer(0x4C64D4, 0x4);
this->AddPointer(0x4C674D, 0x4);
}
}

} ClumpModelsSA;
8 changes: 4 additions & 4 deletions src/limits/ModelInfo/DamageAtomicModels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ typedef dummy_object_vmt<0x24, 0x4C55A0> CDamageAtomicModelInfo_SA;

struct DamageAtomicModelsSA : public StoreAdjuster<CDamageAtomicModelInfo_SA, 0xB1BF58, 70> // T, pDefaultStore, dwDefaultCapacity
{
const char* GetLimitName()
const char* GetLimitName()
{
return IsSA()? "DamageAtomicModels" : nullptr;
}

DamageAtomicModelsSA()
{
DamageAtomicModelsSA()
{
this->SetGrower (0x5B3D8E);
this->AddPointer(0x4C640B, 0x0);
this->AddPointer(0x4C6428, 0x0);
Expand All @@ -29,6 +29,6 @@ struct DamageAtomicModelsSA : public StoreAdjuster<CDamageAtomicModelInfo_SA, 0x
//this->AddPointer(0x856241, 0x0);
this->AddPointer(0x4C6416, 0x4);
this->AddPointer(0x4C665D, 0x4);
}
}

} DamageAtomicModelSA;
33 changes: 29 additions & 4 deletions src/limits/ModelInfo/PedModels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,42 @@
#include "utility/dummy_object.hpp"

typedef dummy_object_vmt<0x44, 0x4C57A0> CPedModelInfo_SA;
typedef dummy_object_vmt<0x48, 0x560120> CPedModelInfo_VC;

struct PedModelsVC : public StoreAdjuster<CPedModelInfo_VC, 0x75CA70, 130> // T, pDefaultStore, dwDefaultCapacity
{
const char* GetLimitName()
{
return IsVC() ? "PedModels" : nullptr;
}

PedModelsVC()
{
this->SetGrower(0x48BDE6);
this->AddPointer(0x55F582, 0x0);
this->AddPointer(0x55F5A3, 0x0);
this->AddPointer(0x55F5AB, 0x0);
this->AddPointer(0x55F5B4, 0x0);
this->AddPointer(0x55F951, 0x0);
this->AddPointer(0x55F959, 0x0);
this->AddPointer(0x55F973, 0x0);
this->AddPointer(0x55F9C4, 0x0);
this->AddPointer(0x55FB4D, 0x0);
//this->AddPointer(0x560015, 0x0);
//this->AddPointer(0x560028, 0x0);
}

} PedModelsVC;

struct PedModelsSA : public StoreAdjuster<CPedModelInfo_SA, 0xB478F8, 278> // T, pDefaultStore, dwDefaultCapacity
{
const char* GetLimitName()
const char* GetLimitName()
{
return IsSA()? "PedModels" : nullptr;
}

PedModelsSA()
{
PedModelsSA()
{
this->SetGrower (0x5B74A7);
this->AddPointer(0x4C6518, 0x0);
this->AddPointer(0x4C652F, 0x0);
Expand All @@ -29,6 +54,6 @@ struct PedModelsSA : public StoreAdjuster<CPedModelInfo_SA, 0xB478F8, 278> //
//this->AddPointer(0x8562B1, 0x0);
this->AddPointer(0x4C6523, 0x4);
this->AddPointer(0x4C67AD, 0x4);
}
}

} PedModelsSA;
33 changes: 29 additions & 4 deletions src/limits/ModelInfo/VehicleModels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,37 @@
static injector::hook_back<void*(__fastcall*)(void*)> hb_ctor;

typedef dummy_object_vmt<0x308, 0x4C75E0> CVehicleModelInfo_SA;
typedef dummy_object_vmt<0x174, 0x57AA20> CVehicleModelInfo_VC;


struct VehicleModelsVC : public StoreAdjuster<CVehicleModelInfo_VC, 0x752A88, 110> // T, pDefaultStore, dwDefaultCapacity
{
const char* GetLimitName()
{
return IsVC() ? "VehicleModels" : nullptr;
}

VehicleModelsVC()
{
this->SetGrower(0x48BF16);
this->AddPointer(0x55F5D2, 0x0);
this->AddPointer(0x55F5ED, 0x0);
this->AddPointer(0x55F5F3, 0x0);
this->AddPointer(0x55F5FE, 0x0);
this->AddPointer(0x55F919, 0x0);
this->AddPointer(0x55F921, 0x0);
this->AddPointer(0x55F93B, 0x0);
this->AddPointer(0x55F9D8, 0x0);
this->AddPointer(0x55FB62, 0x0);
//this->AddPointer(0x55FFD6, 0x0);
//this->AddPointer(0x55FFE9, 0x0);
}

} VehicleModelsVC;

struct VehicleModelsSA : public StoreAdjuster<CVehicleModelInfo_SA, 0xB1F650, 212> // T, pDefaultStore, dwDefaultCapacity
{
const char* GetLimitName()
const char* GetLimitName()
{
return IsSA()? "VehicleModels" : nullptr;
}
Expand All @@ -29,8 +54,8 @@ struct VehicleModelsSA : public StoreAdjuster<CVehicleModelInfo_SA, 0xB1F650, 21
return StoreAdjuster::ChangeLimit(0, value);
}

VehicleModelsSA()
{
VehicleModelsSA()
{
// -----
this->SetGrower (0x5B6FD1);
this->AddPointer(0x4C64ED, 0x0);
Expand All @@ -43,7 +68,7 @@ struct VehicleModelsSA : public StoreAdjuster<CVehicleModelInfo_SA, 0xB1F650, 21
//this->AddPointer(0x8562A1, 0x0);
this->AddPointer(0x4C64F8, 0x4);
this->AddPointer(0x4C6780, 0x4);
}
}

// Initialises CVehicleModelInfo::m_apDirtMaterials at CVehicleModelInfo constructor
static void* __fastcall FixConstructor(CVehicleModelInfo_SA* p)
Expand Down
34 changes: 30 additions & 4 deletions src/limits/ModelInfo/WeaponModels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,43 @@
#include "utility/dummy_object.hpp"

typedef dummy_object_vmt<0x28, 0x4C5760> CWeaponModelInfo_SA;
typedef dummy_object_vmt<0x48, 0x560220> CWeaponModelInfo_VC;


struct WeaponModelsVC : public StoreAdjuster<CWeaponModelInfo_VC, 0x751F10, 37> // T, pDefaultStore, dwDefaultCapacity
{
const char* GetLimitName()
{
return IsVC() ? "WeaponModels" : nullptr;
}

WeaponModelsVC()
{
this->SetGrower(0x48CA2B);
this->AddPointer(0x55F692, 0x0);
this->AddPointer(0x55F6AF, 0x0);
this->AddPointer(0x55F6B5, 0x0);
this->AddPointer(0x55F6BE, 0x0);
this->AddPointer(0x55F8A9, 0x0);
this->AddPointer(0x55F8B1, 0x0);
this->AddPointer(0x55F8C8, 0x0);
this->AddPointer(0x55F9E2, 0x0);
this->AddPointer(0x55FB8C, 0x0);
//this->AddPointer(0x55FF5B, 0x0);
//this->AddPointer(0x55FF6E, 0x0);
}

} WeaponModelsVC;

struct WeaponModelsSA : public StoreAdjuster<CWeaponModelInfo_SA, 0xB1E158, 51> // T, pDefaultStore, dwDefaultCapacity
{
const char* GetLimitName()
const char* GetLimitName()
{
return IsSA()? "WeaponModels" : nullptr;
}

WeaponModelsSA()
{
WeaponModelsSA()
{
this->SetGrower (0x5B3FE6);
this->AddPointer(0x4C64A5, 0x0);
this->AddPointer(0x4C64BC, 0x0);
Expand All @@ -29,7 +55,7 @@ struct WeaponModelsSA : public StoreAdjuster<CWeaponModelInfo_SA, 0xB1E158, 51>
//this->AddPointer(0x856281, 0x0);
this->AddPointer(0x4C64B0, 0x4);
this->AddPointer(0x4C671D, 0x4);
}
}

} WeaponModelsSA;

0 comments on commit 5b871c6

Please sign in to comment.