Skip to content

Commit

Permalink
2dEffects VC
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Feb 28, 2015
1 parent 5b871c6 commit 6c28be9
Show file tree
Hide file tree
Showing 8 changed files with 683 additions and 9 deletions.
7 changes: 5 additions & 2 deletions doc/limit_adjuster_gta3vcsa.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ WeaponModels = unlimited
EntitiesPerIpl = unlimited
EntityIpl = unlimited
StaticShadows = 2048
Coronas = 20048
Coronas = 20000
ScriptSearchLights = 1024
FrameLimit = 30
MemoryAvailable = 30%
#MAINsegmentSize = 200000
#MissionSize = 69000

[VCLIMITS]
PtrNode = 300000
Expand All @@ -53,12 +55,13 @@ AudioScriptObj = 192
ColModel = 10500
AlphaEntityList = 1250
VisibleEntityPtrs = unlimited
AtomicModels = unlimited
AtomicModels = 10000
TimeModels = unlimited
ClumpModels = unlimited
VehicleModels = unlimited
PedModels = unlimited
WeaponModels = unlimited
2dEffects = unlimited
OutsideWorldWaterBlocks = 40
Coronas = 2048
FrameLimit = 30
Expand Down
36 changes: 36 additions & 0 deletions src/limits/ModelInfo/2dEffects.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 2dEffectsInfo Adjuster for GTA /VC/
* Copyright (c) 2014 ThirteenAG <[email protected]>
* Licensed under the MIT License (http://opensource.org/licenses/MIT)
*/
#include "StoreAdjuster.hpp"
#include "utility/dummy_object.hpp"

typedef dummy_object_vmt<0x34, 0x5600B0> C2dEffectsInfo_VC;

struct _2dEffectsInfoVC : public StoreAdjuster<C2dEffectsInfo_VC, 0x75EF10, 1210> // T, pDefaultStore, dwDefaultCapacity
{
const char* GetLimitName()
{
return IsVC() ? "2dEffects" : nullptr;
}

_2dEffectsInfoVC()
{
if (*(DWORD *)0x560034 != 1210) //exe modified by another adjuster
return;

this->SetGrower(0x48BAEE);
this->SetGrower(0x53F22A);
this->SetGrower(0x53F26A);
this->AddPointer(0x55F571, 0x0);
this->AddPointer(0x55F989, 0x0);
this->AddPointer(0x55F991, 0x0);
this->AddPointer(0x55F9A8, 0x0);
this->AddPointer(0x55F9B0, 0x0);
this->AddPointer(0x55FB38, 0x0);
//this->AddPointer(0x560054, 0x0);
//this->AddPointer(0x560067, 0x0);
}

} _2dEffectsInfoVC;
23 changes: 16 additions & 7 deletions src/limits/ModelInfo/StoreAdjuster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ class StoreAdjuster : public SimpleAdjuster


// Called when the limit is found on the ini
virtual void ChangeLimit(int, const std::string& value)
{
virtual void ChangeLimit(int, const std::string& value)
{
if(Adjuster::IsUnlimited(value))
{
if(!pgrow[0].is_null()) hb[0].fun = injector::MakeCALL(pgrow[0], H_AddAnother<0>).get();
if(!pgrow[1].is_null()) hb[1].fun = injector::MakeCALL(pgrow[1], H_AddAnother<1>).get();

#if defined(_DEBUG) && 0 // For testing
#if defined(_DEBUG) && 1 // For testing
this->store.ForceCapacity(16);
#endif
}
Expand All @@ -78,7 +78,7 @@ class StoreAdjuster : public SimpleAdjuster
IsVC() ? 0x48DCE5 :
IsSA() ? 0x5B9253 : 0x0,
H_DoReflection).get();
}
}

// Gets the current usage of this CStore<>
virtual bool GetUsage(int, std::string& output)
Expand Down Expand Up @@ -162,10 +162,19 @@ class StoreAdjuster : public SimpleAdjuster
}

// Find pointers in the array that are in the old bounds and then fix it to the current bound
for(void** p = pModelInfoPtrs; p != pModelInfoPtrs_end; ++p)
for (void** p = pModelInfoPtrs; p != pModelInfoPtrs_end; ++p)
{
if(*p >= begin && *p <= end)
*p = (char*)*p - ((char*)begin - (char*)&store.GetStore()->m_Objects[0]);
if (*p)
{
void* lodptr = *(void**)(p + 0x30);
if (lodptr >= begin && lodptr <= end)
lodptr = (char*)lodptr - ((char*)begin - (char*)&store.GetStore()->m_Objects[0]);

if (*p >= begin && *p <= end)
*p = (char*)*p - ((char*)begin - (char*)&store.GetStore()->m_Objects[0]);

*(void**)(p + 0x30) = lodptr;
}
}
}

Expand Down
239 changes: 239 additions & 0 deletions src/limits/Scripts/SCM/scmlimits.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
/*
* SCM Limits Adjuster
* Copyright (c) 2015 fastman92
* Licensed under the MIT License (http://opensource.org/licenses/MIT)
*/
#include "LimitAdjuster.h"
#include "SCMlimits.h"
#include "..\src\shared\cpatch\SCM\CPatch.h"

unsigned int Game_GTASA::SCMlimits::iMAINsegmentSize;
unsigned int Game_GTASA::SCMlimits::iMissionSize;

class SCMlimitsSA : public Adjuster
{
public:
enum
{
MAINsegmentSize,
MissionSize,
};

const Limit* GetLimits()
{
static Limit limits[] =
{
{ "MAINsegmentSize", MAINsegmentSize },
{ "MissionSize", MissionSize },
{ nullptr, 0 }
};

if (GetGVM().IsSA()) return limits;
return nullptr;
}

void ChangeLimit(int id, const std::string& value)
{

if (id = MAINsegmentSize)
{
Game_GTASA::SCMlimits::iMAINsegmentSize = std::stoi(value);
}

if (id = MissionSize)
{
Game_GTASA::SCMlimits::iMissionSize = std::stoi(value);
}
Game_GTASA::SCMlimits::PatchScriptLimits();
}
} SCMlimitsSA;

namespace Game_GTASA
{
unsigned __int8* SCMlimits::CTheScripts__ScriptSpace = (unsigned __int8*)0xA49960;

// Returns script space size
unsigned int SCMlimits::GetScriptSpaceSize()
{
return SCMlimits::iMAINsegmentSize + SCMlimits::iMissionSize;
}

// Sets max size of main.scm
void SCMlimits::SetMaxMAINsegmentSize(int maxMAINsegmentSize)
{
SCMlimits::iMAINsegmentSize = maxMAINsegmentSize;
}

// Sets max size of mission
void SCMlimits::SetMaxMissionSize(int iMaxMissionSize)
{
SCMlimits::iMissionSize = iMaxMissionSize;
}

// Patches script space limits, should be executed when limits are set.
void SCMlimits::PatchScriptLimits()
{
/*// CPatch::EnableDebugMode();
if (CPatch::IsDebugModeActive())
{
SCMlimits::iMAINsegmentSize = 200000;
SCMlimits::iMissionSize = 69000;
}
else
{
if (SCMlimits::iMAINsegmentSize == 200000
&& SCMlimits::iMissionSize == 69000)
return;
}*/

// See if sizes are multiplies of 4
if (SCMlimits::iMAINsegmentSize % 4 != 0 || SCMlimits::iMissionSize % 4 != 0)
{
/*printf_MessageBox(
"'Max size of MAIN segment' and 'Max mission size' have to be multiplies of 4\n"
"Given values:\n"
"SCMlimits::iMAINsegmentSize = %d\n"
"SCMlimits::iMissionSize = %d",
SCMlimits::iMAINsegmentSize,
SCMlimits::iMissionSize
);*/

return;
}

unsigned int ScriptSpaceSize = SCMlimits::GetScriptSpaceSize();

if (ScriptSpaceSize > 269000)
SCMlimits::CTheScripts__ScriptSpace = new unsigned __int8[ScriptSpaceSize];

// Patch references to CTheScripts::ScriptSpace
#if TRUE
{
CPatch::PatchPointer(0x44CA42 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x44CA92 + 2, CTheScripts__ScriptSpace); // mov eax, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x44CAB1 + 2, CTheScripts__ScriptSpace); // mov esi, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[esi]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x44CB36 + 2, CTheScripts__ScriptSpace); // mov ecx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edi]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x44CB58 + 2, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edi], ecx; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x44CB60 + 2, CTheScripts__ScriptSpace); // mov ecx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x44CB6B + 2, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax], 0; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x44CBAD + 2, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edi], ecx; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x463DAD + 1, CTheScripts__ScriptSpace); // add eax, offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x463E00 + 3, CTheScripts__ScriptSpace); // lea eax, _ZN11CTheScripts11ScriptSpaceE[ecx+edx*8]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x463E38 + 3, CTheScripts__ScriptSpace); // lea edx, _ZN11CTheScripts11ScriptSpaceE[eax+ecx]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x463E51 + 3, CTheScripts__ScriptSpace); // lea eax, _ZN11CTheScripts11ScriptSpaceE[ecx+edx]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x463FC7 + 2, CTheScripts__ScriptSpace); // add ecx, offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x463FE9 + 1, CTheScripts__ScriptSpace); // add eax, offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x4640DE + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x464159 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x464165 + 3, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax+edx*4]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x464191 + 3, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax+edx*4]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x4641BA + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x46429A + 2, CTheScripts__ScriptSpace); // mov eax, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x464310 + 3, CTheScripts__ScriptSpace); // mov eax, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax+edx*4]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x4643C0 + 2, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax], edx; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x464412 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x464420 + 3, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax+edx*4], esi; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x46444C + 3, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax+edx*4], esi; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x464473 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x464555 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x4645D0 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x4645DC + 3, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax+edx*4]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x464608 + 3, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax+edx*4]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x464631 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x4647CA + 1, CTheScripts__ScriptSpace); // add eax, offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x46482A + 3, CTheScripts__ScriptSpace); // lea eax, _ZN11CTheScripts11ScriptSpaceE[ecx+edx]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x464846 + 3, CTheScripts__ScriptSpace); // lea eax, _ZN11CTheScripts11ScriptSpaceE[eax+ecx*8]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x46485D + 3, CTheScripts__ScriptSpace); // lea eax, _ZN11CTheScripts11ScriptSpaceE[edx+eax*4]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x466834 + 2, CTheScripts__ScriptSpace); // lea eax, _ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x468D5D + 1, CTheScripts__ScriptSpace); // mov edi, offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x468E79 + 1, CTheScripts__ScriptSpace); // push offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x468ED5 + 1, CTheScripts__ScriptSpace); // push offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x469448 + 2, CTheScripts__ScriptSpace); // lea ecx, _ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x5D4C43 + 1, CTheScripts__ScriptSpace + 3); // mov eax, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE+3
CPatch::PatchPointer(0x5D4C92 + 2, CTheScripts__ScriptSpace); // lea ecx, _ZN11CTheScripts11ScriptSpaceE[edi]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x5D4CAF + 2, CTheScripts__ScriptSpace); // lea edx, _ZN11CTheScripts11ScriptSpaceE[edi]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x5D4F6A + 1, CTheScripts__ScriptSpace); // sub eax, offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x5D4F92 + 1, CTheScripts__ScriptSpace); // sub eax, offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x5D5020 + 2, CTheScripts__ScriptSpace); // lea ecx, _ZN11CTheScripts11ScriptSpaceE[edi]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x5D503D + 2, CTheScripts__ScriptSpace); // lea edx, _ZN11CTheScripts11ScriptSpaceE[edi]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x5D534F + 2, CTheScripts__ScriptSpace); // lea eax, _ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x5D537E + 2, CTheScripts__ScriptSpace); // lea edx, _ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x15620C3 + 2, CTheScripts__ScriptSpace); // lea eax, _ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x1564F1E + 2, CTheScripts__ScriptSpace); // mov ecx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x1564FB2 + 2, CTheScripts__ScriptSpace); // mov dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx], 0; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x1565610 + 1, CTheScripts__ScriptSpace); // push offset _ZN11CTheScripts11ScriptSpaceE; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x1565E20 + 1, CTheScripts__ScriptSpace + 3); // mov eax, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE+3
CPatch::PatchPointer(0x1565E25 + 2, CTheScripts__ScriptSpace + 3); // mov eax, dword ptr ds:(_ZN11CTheScripts11ScriptSpaceE+3)[eax]
CPatch::PatchPointer(0x1565E2B + 1, CTheScripts__ScriptSpace + 8); // add eax, (offset _ZN11CTheScripts11ScriptSpaceE+8)
CPatch::PatchPointer(0x1569FF2 + 2, CTheScripts__ScriptSpace); // mov ecx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x156A082 + 2, CTheScripts__ScriptSpace); // mov eax, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x156A09F + 2, CTheScripts__ScriptSpace); // mov ebx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x156AA19 + 2, CTheScripts__ScriptSpace); // cmp dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[eax], 1; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x156E375 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x156F378 + 2, CTheScripts__ScriptSpace); // mov edx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE[edx]; CTheScripts::ScriptSpace
CPatch::PatchPointer(0x156F453 + 1, CTheScripts__ScriptSpace + 3); // mov eax, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE+3
CPatch::PatchPointer(0x156F45C + 2, CTheScripts__ScriptSpace + 3); // mov ecx, dword ptr ds:(_ZN11CTheScripts11ScriptSpaceE+3)[eax]
CPatch::PatchPointer(0x156F462 + 2, CTheScripts__ScriptSpace + 3); // mov esi, dword ptr ds:(_ZN11CTheScripts11ScriptSpaceE+3)[ecx]
CPatch::PatchPointer(0x156F468 + 2, CTheScripts__ScriptSpace + 8); // add esi, (offset _ZN11CTheScripts11ScriptSpaceE+8)
CPatch::PatchPointer(0x156F5A0 + 2, CTheScripts__ScriptSpace + 3); // mov ecx, dword ptr ds:_ZN11CTheScripts11ScriptSpaceE+3
CPatch::PatchPointer(0x156F5A6 + 3, CTheScripts__ScriptSpace + 8); // mov ax, word ptr ds:(_ZN11CTheScripts11ScriptSpaceE+8)[ecx]
CPatch::PatchPointer(0x156F5AD + 2, CTheScripts__ScriptSpace + 8); // lea ecx, (_ZN11CTheScripts11ScriptSpaceE+8)[ecx]
}
#endif

// Patch sizes of MAIN segment size
#if TRUE
{
CPatch::PatchDWORD(0x468E74 + 1, iMAINsegmentSize); // push 200000 ; len
CPatch::PatchDWORD(0x468ECE + 1, iMAINsegmentSize); // push 200000 ; len
}
#endif

// Patch references to CTheScripts::ScriptSpace + iMissionSize
#if TRUE
{
CPatch::PatchPointer(0x4899D6 + 1, CTheScripts__ScriptSpace + iMAINsegmentSize); // push offset unk_A7A6A0
CPatch::PatchPointer(0x4899F5 + 1, CTheScripts__ScriptSpace + iMAINsegmentSize); // push offset unk_A7A6A0
CPatch::PatchPointer(0x489A0B + 3, CTheScripts__ScriptSpace + iMAINsegmentSize); // mov dword ptr [eax+10h], offset unk_A7A6A0
CPatch::PatchPointer(0x489A5F + 1, CTheScripts__ScriptSpace + iMAINsegmentSize); // push offset unk_A7A6A0
CPatch::PatchPointer(0x489A75 + 1, CTheScripts__ScriptSpace + iMAINsegmentSize); // push offset unk_A7A6A0
CPatch::PatchPointer(0x489A8B + 3, CTheScripts__ScriptSpace + iMAINsegmentSize); // mov dword ptr [eax+10h], offset unk_A7A6A0
}
#endif

// Patch sizes of mission space
#if TRUE
{
CPatch::PatchDWORD(0x4899D1 + 1, iMissionSize); // push 69000
CPatch::PatchDWORD(0x489A5A + 1, iMissionSize); // push 69000

}
#endif

// Patch sizes of CTheScripts::ScriptSpace
#if TRUE
{
CPatch::PatchDWORD(
0x401CF8 + 1,
ScriptSpaceSize / sizeof(DWORD)
); // mov ecx, 106B2h

}
#endif

//CPatch::DisableDebugMode();
/*CGenericLogStorage::SaveFormattedTextLn(
"Modified SCM limits:\n"
" - max size of MAIN segment from main.scm: %d bytes\n"
" - max size of mission from main.scm: %d bytes\n"
"Total size of CTheScripts::ScriptSpace: %d bytes"
,
SCMlimits::iMAINsegmentSize,
SCMlimits::iMissionSize,
ScriptSpaceSize);
CGenericLogStorage::WriteLineSeparator();*/
}
}
25 changes: 25 additions & 0 deletions src/limits/Scripts/SCM/scmlimits.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once

namespace Game_GTASA
{
class SCMlimits
{
public:
static unsigned int iMAINsegmentSize;
static unsigned int iMissionSize;

static unsigned __int8* CTheScripts__ScriptSpace;

// Returns script space size
static unsigned int GetScriptSpaceSize();

// Sets max size of main.scm
static void SetMaxMAINsegmentSize(int maxMAINsegmentSize);

// Sets max size of mission
static void SetMaxMissionSize(int iMaxMissionSize);

// Patches script space limits, should be executed when limits are set.
static void PatchScriptLimits();
};
}
Loading

0 comments on commit 6c28be9

Please sign in to comment.