Merge branch 'master' into game_dev
This commit is contained in:
commit
e71b000cc5
@ -35,7 +35,6 @@ to reverse at the time, calling the original functions is acceptable.
|
||||
cAudioManager - WIP
|
||||
CBoat
|
||||
CBulletInfo
|
||||
CMenuManager - WIP
|
||||
CObject
|
||||
CPacManPickups
|
||||
CPedPath
|
||||
|
Binary file not shown.
22
premake5.lua
22
premake5.lua
@ -1,5 +1,5 @@
|
||||
workspace "re3"
|
||||
configurations { "Debug", "Release", "ReleaseFH" }
|
||||
configurations { "Debug", "Release", "ReleaseFH", "DebugRW", "ReleaseRW" }
|
||||
location "build"
|
||||
|
||||
files { "src/*.*" }
|
||||
@ -13,6 +13,7 @@ workspace "re3"
|
||||
files { "src/objects/*.*" }
|
||||
files { "src/peds/*.*" }
|
||||
files { "src/render/*.*" }
|
||||
files { "src/rw/*.*" }
|
||||
files { "src/save/*.*" }
|
||||
files { "src/skel/*.*" }
|
||||
files { "src/skel/win/*.*" }
|
||||
@ -32,6 +33,7 @@ workspace "re3"
|
||||
includedirs { "src/objects" }
|
||||
includedirs { "src/peds" }
|
||||
includedirs { "src/render" }
|
||||
includedirs { "src/rw" }
|
||||
includedirs { "src/save/" }
|
||||
includedirs { "src/skel/" }
|
||||
includedirs { "src/skel/win" }
|
||||
@ -47,6 +49,12 @@ workspace "re3"
|
||||
|
||||
libdirs { "dxsdk/lib" }
|
||||
libdirs { "milessdk/lib" }
|
||||
|
||||
filter "configurations:DebugRW or configurations:ReleaseRW"
|
||||
defines { "RWLIBS" }
|
||||
libdirs { "rwsdk/lib/d3d8/release" }
|
||||
links { "rwcore", "rpworld", "rpmatfx", "rpskin", "rphanim", "rtbmp" }
|
||||
filter {}
|
||||
|
||||
pbcommands = {
|
||||
"setlocal EnableDelayedExpansion",
|
||||
@ -102,3 +110,15 @@ project "re3"
|
||||
staticruntime "on"
|
||||
targetextension ".asi"
|
||||
setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "scripts/")
|
||||
|
||||
filter "configurations:DebugRW"
|
||||
defines { "DEBUG" }
|
||||
staticruntime "on"
|
||||
symbols "On"
|
||||
setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/")
|
||||
|
||||
filter "configurations:ReleaseRW"
|
||||
defines { "NDEBUG" }
|
||||
optimize "On"
|
||||
staticruntime "on"
|
||||
setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/")
|
||||
|
@ -151,7 +151,7 @@ cAudioManager::SetUpLoopingCollisionSound(cAudioCollision *col, uint8 counter)
|
||||
m_sQueueSample.m_bVolume =
|
||||
ComputeVolume(emittingVol, CollisionSoundIntensity, m_sQueueSample.m_fDistance);
|
||||
if(m_sQueueSample.m_bVolume) {
|
||||
m_sQueueSample.m_counter = counter;
|
||||
m_sQueueSample.m_nCounter = counter;
|
||||
m_sQueueSample.m_vecPos = col->m_vecPosition;
|
||||
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
||||
m_sQueueSample.m_bIs2D = false;
|
||||
@ -164,7 +164,7 @@ cAudioManager::SetUpLoopingCollisionSound(cAudioCollision *col, uint8 counter)
|
||||
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
|
||||
m_sQueueSample.m_fSpeedMultiplier = 4.0f;
|
||||
m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = 0;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = false;
|
||||
m_sQueueSample.m_nReleasingVolumeDivider = 5;
|
||||
m_sQueueSample.m_bReverbFlag = true;
|
||||
m_sQueueSample.m_bRequireReflection = false;
|
||||
@ -270,7 +270,7 @@ cAudioManager::SetUpOneShotCollisionSound(cAudioCollision *col)
|
||||
break;
|
||||
}
|
||||
m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16);
|
||||
m_sQueueSample.m_counter = counter++;
|
||||
m_sQueueSample.m_nCounter = counter++;
|
||||
if(counter >= 255) counter = 28;
|
||||
m_sQueueSample.m_vecPos = col->m_vecPosition;
|
||||
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
||||
@ -282,7 +282,7 @@ cAudioManager::SetUpOneShotCollisionSound(cAudioCollision *col)
|
||||
m_sQueueSample.m_nLoopEnd = -1;
|
||||
m_sQueueSample.m_fSpeedMultiplier = 4.0f;
|
||||
m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = 1;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = true;
|
||||
m_sQueueSample.m_bReverbFlag = true;
|
||||
m_sQueueSample.m_bRequireReflection = false;
|
||||
AddSampleToRequestedQueue();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -138,7 +138,7 @@ class tSound
|
||||
{
|
||||
public:
|
||||
int32 m_nEntityIndex;
|
||||
int32 m_counter;
|
||||
int32 m_nCounter;
|
||||
int32 m_nSampleIndex;
|
||||
uint8 m_bBankIndex;
|
||||
bool m_bIs2D;
|
||||
@ -170,8 +170,8 @@ public:
|
||||
bool m_bRequireReflection; // Used for oneshots
|
||||
uint8 m_bOffset;
|
||||
int32 m_nReleasingVolumeDivider;
|
||||
uint8 m_bIsProcessed;
|
||||
uint8 m_bLoopEnded;
|
||||
bool m_bIsProcessed;
|
||||
bool m_bLoopEnded;
|
||||
uint8 field_82;
|
||||
uint8 field_83;
|
||||
int32 calculatedVolume;
|
||||
@ -244,14 +244,14 @@ class cMissionAudio
|
||||
{
|
||||
public:
|
||||
CVector m_vecPos;
|
||||
uint8 field_12;
|
||||
bool m_bPredefinedProperties;
|
||||
uint8 gap_13[3];
|
||||
int m_nSampleIndex;
|
||||
uint8 m_bLoadingStatus;
|
||||
uint8 m_bPlayStatus;
|
||||
uint8 field_22;
|
||||
uint8 field_23;
|
||||
int field_24;
|
||||
int32 m_nMissionAudioCounter;
|
||||
bool m_bIsPlayed;
|
||||
uint8 field_29;
|
||||
uint8 field_30;
|
||||
@ -328,7 +328,7 @@ public:
|
||||
int32 m_nBridgeEntity;
|
||||
cMissionAudio m_sMissionAudio;
|
||||
int32 m_anRandomTable[5];
|
||||
uint8 field_19192; // time?
|
||||
uint8 m_bTimeSpent;
|
||||
uint8 m_bUserPause;
|
||||
uint8 m_bPreviousUserPause;
|
||||
uint8 field_19195; // unused
|
||||
|
@ -125,7 +125,7 @@ void
|
||||
cAudioManager::DoPoliceRadioCrackle()
|
||||
{
|
||||
m_sQueueSample.m_nEntityIndex = m_nPoliceChannelEntity;
|
||||
m_sQueueSample.m_counter = 0;
|
||||
m_sQueueSample.m_nCounter = 0;
|
||||
m_sQueueSample.m_nSampleIndex = SFX_POLICE_RADIO_CRACKLE;
|
||||
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
|
||||
m_sQueueSample.m_bIs2D = true;
|
||||
@ -136,7 +136,7 @@ cAudioManager::DoPoliceRadioCrackle()
|
||||
m_sQueueSample.m_bEmittingVolume = m_sQueueSample.m_bVolume;
|
||||
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(SFX_POLICE_RADIO_CRACKLE);
|
||||
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(SFX_POLICE_RADIO_CRACKLE);
|
||||
m_sQueueSample.m_bReleasingSoundFlag = 0;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = false;
|
||||
m_sQueueSample.m_bReverbFlag = false;
|
||||
m_sQueueSample.m_bOffset = 63;
|
||||
m_sQueueSample.m_nReleasingVolumeDivider = 3;
|
||||
@ -147,17 +147,20 @@ cAudioManager::DoPoliceRadioCrackle()
|
||||
void
|
||||
cAudioManager::ServicePoliceRadio()
|
||||
{
|
||||
int32 wantedLevel = 0; // bug?;
|
||||
int32 wantedLevel = 0; // uninitialized variable
|
||||
static uint32 nLastSeen = 300;
|
||||
|
||||
if (!m_bIsInitialised) return;
|
||||
if(!m_bIsInitialised) return;
|
||||
|
||||
if (!m_bUserPause) {
|
||||
if(!m_bUserPause) {
|
||||
bool crimeReport = SetupCrimeReport();
|
||||
#ifdef FIX_BUGS // Crash at 0x5fe6ef
|
||||
if(!FindPlayerPed() || !FindPlayerPed()->m_pWanted) return;
|
||||
#endif
|
||||
wantedLevel = FindPlayerPed()->m_pWanted->m_nWantedLevel;
|
||||
if (!crimeReport) {
|
||||
if (wantedLevel) {
|
||||
if (nLastSeen) {
|
||||
if(!crimeReport) {
|
||||
if(wantedLevel) {
|
||||
if(nLastSeen) {
|
||||
--nLastSeen;
|
||||
} else {
|
||||
nLastSeen = m_anRandomTable[1] % 1000 + 2000;
|
||||
|
@ -410,6 +410,8 @@ void CCrane::FindCarInSectorList(CPtrList* pList)
|
||||
if (pVehicle->GetPosition().x < m_fPickupX1 || pVehicle->GetPosition().x > m_fPickupX2 ||
|
||||
pVehicle->GetPosition().y < m_fPickupY1 || pVehicle->GetPosition().y > m_fPickupY2)
|
||||
continue;
|
||||
if (pVehicle->pDriver)
|
||||
continue;
|
||||
if (Abs(pVehicle->GetMoveSpeed().x) >= CAR_MOVING_SPEED_THRESHOLD ||
|
||||
Abs(pVehicle->GetMoveSpeed().y) >= CAR_MOVING_SPEED_THRESHOLD ||
|
||||
Abs(pVehicle->GetMoveSpeed().z) >= CAR_MOVING_SPEED_THRESHOLD)
|
||||
@ -674,4 +676,4 @@ void CranesLoad(uint8* buf, uint32 size)
|
||||
|
||||
STARTPATCHES
|
||||
InjectHook(0x5454D0, CranesLoad, PATCH_JUMP); // GenericLoad
|
||||
ENDPATCHES
|
||||
ENDPATCHES
|
||||
|
@ -111,7 +111,7 @@ CPickup::GiveUsAPickUpObject(int32 handle)
|
||||
object->bUsesCollision = false;
|
||||
object->bIsPickup = true;
|
||||
|
||||
object->field_172 = m_eModelIndex == MI_PICKUP_BONUS ? m_nQuantity : 0;
|
||||
object->m_nBonusValue = m_eModelIndex == MI_PICKUP_BONUS ? m_nQuantity : 0;
|
||||
|
||||
switch (m_eType)
|
||||
{
|
||||
@ -671,9 +671,9 @@ void
|
||||
CPickups::DoPickUpEffects(CEntity *entity)
|
||||
{
|
||||
if (entity->GetModelIndex() == MI_PICKUP_KILLFRENZY)
|
||||
entity->m_flagD80 = CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame;
|
||||
entity->bDoNotRender = CTheScripts::IsPlayerOnAMission() || CDarkel::FrenzyOnGoing() || !CGame::nastyGame;
|
||||
|
||||
if (!entity->m_flagD80) {
|
||||
if (!entity->bDoNotRender) {
|
||||
float s = Sin((float)((CTimer::GetTimeInMilliseconds() + (uintptr)entity) & 0x7FF) * DEGTORAD(360.0f / 0x800));
|
||||
float modifiedSin = 0.3f * (s + 1.0f);
|
||||
|
||||
@ -716,7 +716,7 @@ CPickups::DoPickUpEffects(CEntity *entity)
|
||||
size, 65.0f, CCoronas::TYPE_RING, CCoronas::FLARE_NONE, CCoronas::REFLECTION_OFF, CCoronas::LOSCHECK_OFF, CCoronas::STREAK_OFF, 0.0f);
|
||||
|
||||
CObject *object = (CObject*)entity;
|
||||
if (object->m_obj_flag2 || object->bOutOfStock || object->field_172) {
|
||||
if (object->m_obj_flag2 || object->bOutOfStock || object->m_nBonusValue) {
|
||||
float dist = (TheCamera.GetPosition() - pos).Magnitude();
|
||||
const float MAXDIST = 12.0f;
|
||||
|
||||
@ -734,7 +734,7 @@ CPickups::DoPickUpEffects(CEntity *entity)
|
||||
aMessages[NumMessages].m_color.blue = aWeaponBlues[colorId];
|
||||
aMessages[NumMessages].m_color.alpha = (1.0f - dist / MAXDIST) * 128.0f;
|
||||
aMessages[NumMessages].m_bOutOfStock = object->bOutOfStock;
|
||||
aMessages[NumMessages].m_quantity = object->field_172;
|
||||
aMessages[NumMessages].m_quantity = object->m_nBonusValue;
|
||||
NumMessages++;
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ CDebug::DebugAddText(const char *str)
|
||||
{
|
||||
int32 i = 0;
|
||||
if (*str != '\0') {
|
||||
while (i < MAX_STR_LEN) {
|
||||
while (i < MAX_STR_LEN - 1) {
|
||||
ms_aTextBuffer[ms_nCurrentTextLine][i++] = *(str++);
|
||||
if (*str == '\0')
|
||||
break;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -7,28 +7,11 @@
|
||||
#define MENUHEADER_WIDTH 0.84f
|
||||
#define MENUHEADER_HEIGHT 1.6f
|
||||
|
||||
#define MENUACTION_X_MARGIN 40.0f
|
||||
#define MENU_X_MARGIN 40.0f
|
||||
#define MENUACTION_POS_Y 60.0f
|
||||
#define MENUACTION_WIDTH 0.38f
|
||||
#define MENUACTION_WIDTH 38.0f
|
||||
#define MENUACTION_SCALE_MULT 0.9f
|
||||
|
||||
#define MENUCOLUMN_POS_X MENUHEADER_POS_X + 16.0f
|
||||
#define MENUCOLUMN_MAX_Y 149.0f
|
||||
#define MENUCOLUMN_MID_Y 100.0f
|
||||
#define MENUCOLUMN_MIN_Y 110.0f
|
||||
#define MENUCOLUMN_PAUSE_Y 25.0f
|
||||
#define MENUCOLUMN_START_Y 9.0f
|
||||
#define MENUCOLUMN_FEDS 139.0f
|
||||
|
||||
#define MENUCOLUMN_SAVE_X 121.0f
|
||||
#define MENUCOLUMN_SAVE_Y 111.0f
|
||||
|
||||
#define MENUCOLUMN_SPACING_MAX 24.0f
|
||||
#define MENUCOLUMN_SPACING_MIN 20.0f
|
||||
|
||||
#define MENUSELECT_BOX_MAX 20.5f
|
||||
#define MENUSELECT_BOX_MIN 17.0f
|
||||
|
||||
#ifndef ASPECT_RATIO_SCALE
|
||||
#define MENURADIO_ICON_X 31.5f
|
||||
#else
|
||||
@ -38,12 +21,13 @@
|
||||
#define MENURADIO_ICON_W 60.0f
|
||||
#define MENURADIO_ICON_H 60.0f
|
||||
|
||||
#define MENUDROP_COLOR_A 150
|
||||
#define MENUDROP_COLOR_SIZE -1
|
||||
|
||||
#define MENUSLIDER_X 256.0f
|
||||
#define MENUSLIDER_UNK 256.0f
|
||||
|
||||
#define BIGTEXT_X_SCALE 0.75f
|
||||
#define BIGTEXT_Y_SCALE 0.9f
|
||||
#define MEDIUMTEXT_X_SCALE 0.55f
|
||||
#define MEDIUMTEXT_Y_SCALE 0.8f
|
||||
#define SMALLTEXT_X_SCALE 0.45f
|
||||
#define SMALLTEXT_Y_SCALE 0.7f
|
||||
#define SMALLESTTEXT_X_SCALE 0.4f
|
||||
@ -67,6 +51,33 @@
|
||||
#define PLAYERSETUP_LIST_BODY_TOP 47
|
||||
#define PLAYERSETUP_ROW_HEIGHT 9
|
||||
|
||||
#define STATS_SLIDE_Y_PER_SECOND 30.0f
|
||||
#define STATS_ROW_HEIGHT 20.0f
|
||||
#define STATS_ROW_X_MARGIN 50.0f
|
||||
#define STATS_BOTTOM_MARGIN 135.0f
|
||||
#define STATS_TOP_MARGIN 40.0f
|
||||
#define STATS_TOP_DIMMING_AREA_LENGTH (93.0f - STATS_TOP_MARGIN)
|
||||
#define STATS_BOTTOM_DIMMING_AREA_LENGTH 55.0f
|
||||
#define STATS_PUT_BACK_TO_BOTTOM_Y 50.0f
|
||||
#define STATS_RATING_X 24.0f
|
||||
#define STATS_RATING_Y 20.0f
|
||||
|
||||
#define CONTSETUP_STANDARD_ROW_HEIGHT 10.7f
|
||||
#define CONTSETUP_CLASSIC_ROW_HEIGHT 9.0f
|
||||
#define CONTSETUP_BOUND_HIGHLIGHT_HEIGHT 10
|
||||
#define CONTSETUP_BOUND_COLUMN_WIDTH 190.0f
|
||||
#define CONTSETUP_LIST_HEADER_HEIGHT 20.0f
|
||||
#define CONTSETUP_LIST_TOP 28.0f
|
||||
#define CONTSETUP_LIST_RIGHT 18.0f
|
||||
#define CONTSETUP_LIST_BOTTOM 120.0f
|
||||
#define CONTSETUP_LIST_LEFT 18.0f
|
||||
#define CONTSETUP_COLUMN_1_X 40.0f
|
||||
#define CONTSETUP_COLUMN_2_X 210.0f
|
||||
#define CONTSETUP_COLUMN_3_X (CONTSETUP_COLUMN_2_X + CONTSETUP_BOUND_COLUMN_WIDTH + 10.0f)
|
||||
#define CONTSETUP_BACK_RIGHT 35.0f
|
||||
#define CONTSETUP_BACK_BOTTOM 122.0f
|
||||
#define CONTSETUP_BACK_HEIGHT 25.0f
|
||||
|
||||
enum eLanguages
|
||||
{
|
||||
LANGUAGE_AMERICAN,
|
||||
@ -185,19 +196,19 @@ enum eMenuScreen
|
||||
MENUPAGE_NEW_GAME_RELOAD = 10,
|
||||
MENUPAGE_LOAD_SLOT_CONFIRM = 11,
|
||||
MENUPAGE_DELETE_SLOT_CONFIRM = 12,
|
||||
MENUPAGE_13 = 13,
|
||||
MENUPAGE_NO_MEMORY_CARD = 13,
|
||||
MENUPAGE_LOADING_IN_PROGRESS = 14,
|
||||
MENUPAGE_DELETING_IN_PROGRESS = 15,
|
||||
MENUPAGE_16 = 16,
|
||||
MENUPAGE_PS2_LOAD_FAILED = 16,
|
||||
MENUPAGE_DELETE_FAILED = 17,
|
||||
MENUPAGE_DEBUG_MENU = 18,
|
||||
MENUPAGE_MEMORY_CARD_1 = 19,
|
||||
MENUPAGE_MEMORY_CARD_2 = 20,
|
||||
MENUPAGE_MEMORY_CARD_DEBUG = 19,
|
||||
MENUPAGE_MEMORY_CARD_TEST = 20,
|
||||
MENUPAGE_MULTIPLAYER_MAIN = 21,
|
||||
MENUPAGE_SAVE_FAILED_1 = 22,
|
||||
MENUPAGE_SAVE_FAILED_2 = 23,
|
||||
MENUPAGE_PS2_SAVE_FAILED = 22,
|
||||
MENUPAGE_PS2_SAVE_FAILED_2 = 23,
|
||||
MENUPAGE_SAVE = 24,
|
||||
MENUPAGE_NO_MEMORY_CARD = 25,
|
||||
MENUPAGE_NO_MEMORY_CARD_2 = 25,
|
||||
MENUPAGE_CHOOSE_SAVE_SLOT = 26,
|
||||
MENUPAGE_SAVE_OVERWRITE_CONFIRM = 27,
|
||||
MENUPAGE_MULTIPLAYER_MAP = 28,
|
||||
@ -438,7 +449,7 @@ struct BottomBarOption
|
||||
struct CMenuScreen
|
||||
{
|
||||
char m_ScreenName[8];
|
||||
int32 unk;
|
||||
int32 unk; // 2 on MENUPAGE_MULTIPLAYER_START, 1 on everywhere else
|
||||
int32 m_PreviousPage[2]; // eMenuScreen
|
||||
int32 m_ParentEntry[2]; // row
|
||||
|
||||
@ -544,11 +555,12 @@ public:
|
||||
static bool &m_bShutDownFrontEndRequested;
|
||||
static bool &m_PrefsAllowNastyGame;
|
||||
|
||||
static float &menuXYpadding;
|
||||
static float &actionTextScaleX;
|
||||
static float &actionTextScaleY;
|
||||
static int32 &sthWithButtons;
|
||||
static int32 &sthWithButtons2;
|
||||
static uint8 m_PrefsStereoMono;
|
||||
static int32 m_SelectedMap;
|
||||
static int32 m_SelectedGameType;
|
||||
static uint8 m_PrefsPlayerRed;
|
||||
static uint8 m_PrefsPlayerGreen;
|
||||
static uint8 m_PrefsPlayerBlue;
|
||||
|
||||
#ifndef MASTER
|
||||
static bool m_PrefsMarketing;
|
||||
@ -557,6 +569,7 @@ public:
|
||||
|
||||
#ifdef MENU_MAP
|
||||
static bool bMenuMapActive;
|
||||
static bool bMapMouseShownOnce;
|
||||
static float fMapSize;
|
||||
static float fMapCenterY;
|
||||
static float fMapCenterX;
|
||||
@ -565,9 +578,9 @@ public:
|
||||
#endif
|
||||
|
||||
public:
|
||||
static void BuildStatLine(char *text, void *stat, uint8 aFloat, void *stat2);
|
||||
static void BuildStatLine(char *text, void *stat, bool itsFloat, void *stat2);
|
||||
static void CentreMousePointer();
|
||||
int CheckCodesForControls(int32);
|
||||
void CheckCodesForControls(int);
|
||||
bool CheckHover(int x1, int x2, int y1, int y2);
|
||||
void CheckSliderMovement(int);
|
||||
int CostructStatLine(int);
|
||||
@ -585,13 +598,13 @@ public:
|
||||
#endif
|
||||
void DrawPlayerSetupScreen();
|
||||
int FadeIn(int alpha);
|
||||
void FilterOutColorMarkersFromString(uint16, CRGBA &);
|
||||
void FilterOutColorMarkersFromString(wchar*, CRGBA &);
|
||||
int GetStartOptionsCntrlConfigScreens();
|
||||
static void InitialiseChangedLanguageSettings();
|
||||
void LoadAllTextures();
|
||||
void LoadSettings();
|
||||
static void MessageScreen(char *);
|
||||
static void PickNewPlayerColour();
|
||||
void MessageScreen(const char *);
|
||||
void PickNewPlayerColour();
|
||||
void PrintBriefs();
|
||||
static void PrintErrorMessage();
|
||||
void PrintStats();
|
||||
@ -612,6 +625,7 @@ public:
|
||||
void WaitForUserCD();
|
||||
void PrintController();
|
||||
int GetNumOptionsCntrlConfigScreens();
|
||||
int ConstructStatLine(int);
|
||||
|
||||
// New (not in function or inlined in the game)
|
||||
void ThingsToDoBeforeLeavingPage();
|
||||
|
@ -1,22 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
// There are some missing/wrong entries in here.
|
||||
// TODO: There are some missing/wrong entries in here.
|
||||
|
||||
const CMenuScreen aScreens[] = {
|
||||
// MENUPAGE_NONE = 0
|
||||
{ "", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0, },
|
||||
{ "", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0, },
|
||||
|
||||
// MENUPAGE_STATS = 1 - Both PrintStats and Draw were printing the page name, so deleted the string Draw looked for.
|
||||
// MENUPAGE_STATS = 1
|
||||
#ifdef MENU_MAP
|
||||
{ ""/*"FET_STA"*/, MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 5, 3,
|
||||
{ "FET_STA", 1, MENUPAGE_NONE, MENUPAGE_NONE, 5, 3,
|
||||
#else
|
||||
{ ""/*"FET_STA"*/, MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 5, 2,
|
||||
{ "FET_STA", 1, MENUPAGE_NONE, MENUPAGE_NONE, 5, 2,
|
||||
#endif
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENUPAGE_NEW_GAME = 2
|
||||
{ "FET_SGA", MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 0, 1,
|
||||
{ "FET_SGA", 1, MENUPAGE_NONE, MENUPAGE_NONE, 0, 1,
|
||||
MENUACTION_CHANGEMENU, "FES_SNG", SAVESLOT_NONE, MENUPAGE_NEW_GAME_RELOAD,
|
||||
MENUACTION_POPULATESLOTS_CHANGEMENU, "GMLOAD", SAVESLOT_NONE, MENUPAGE_CHOOSE_LOAD_SLOT,
|
||||
MENUACTION_POPULATESLOTS_CHANGEMENU, "FES_DGA", SAVESLOT_NONE, MENUPAGE_CHOOSE_DELETE_SLOT,
|
||||
@ -25,15 +25,15 @@ const CMenuScreen aScreens[] = {
|
||||
|
||||
// MENUPAGE_BRIEFS = 3
|
||||
#ifdef MENU_MAP
|
||||
{ "FET_BRE", MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 6, 4,
|
||||
{ "FET_BRE", 1, MENUPAGE_NONE, MENUPAGE_NONE, 6, 4,
|
||||
#else
|
||||
{ "FET_BRE", MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 6, 3,
|
||||
{ "FET_BRE", 1, MENUPAGE_NONE, MENUPAGE_NONE, 6, 3,
|
||||
#endif
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENU_CONTROLLER_SETTINGS = 4
|
||||
{ "FET_CON", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0,
|
||||
{ "FET_CON", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0,
|
||||
MENUACTION_CTRLCONFIG, "FEC_CCF", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS,
|
||||
MENUACTION_CTRLDISPLAY, "FEC_CDP", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS,
|
||||
MENUACTION_CTRLVIBRATION, "FEC_VIB", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS,
|
||||
@ -41,7 +41,7 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_SOUND_SETTINGS = 5
|
||||
{ "FET_AUD", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 1, 1,
|
||||
{ "FET_AUD", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 1, 1,
|
||||
MENUACTION_MUSICVOLUME, "FEA_MUS", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
|
||||
MENUACTION_SFXVOLUME, "FEA_SFX", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
|
||||
MENUACTION_AUDIOHW, "FEA_3DH", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
|
||||
@ -53,7 +53,7 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_GRAPHICS_SETTINGS = 6
|
||||
{ "FET_DIS", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 2, 2,
|
||||
{ "FET_DIS", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 2, 2,
|
||||
MENUACTION_BRIGHTNESS, "FED_BRI", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
||||
MENUACTION_DRAWDIST, "FEM_LOD", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
||||
MENUACTION_FRAMESYNC, "FEM_VSC", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
||||
@ -67,7 +67,7 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_LANGUAGE_SETTINGS = 7
|
||||
{ "FET_LAN", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 3, 3,
|
||||
{ "FET_LAN", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 3, 3,
|
||||
MENUACTION_LANG_ENG, "FEL_ENG", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_LANG_FRE, "FEL_FRE", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_LANG_GER, "FEL_GER", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
@ -80,7 +80,7 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_CHOOSE_LOAD_SLOT = 8
|
||||
{ "FET_LG", MENUPAGE_NEW_GAME, MENUPAGE_NEW_GAME, MENUPAGE_NEW_GAME, 1, 1,
|
||||
{ "FET_LG", 1, MENUPAGE_NEW_GAME, MENUPAGE_NEW_GAME, 1, 1,
|
||||
MENUACTION_CHANGEMENU, "FESZ_CA", SAVESLOT_NONE, MENUPAGE_NEW_GAME,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL1", SAVESLOT_1, MENUPAGE_LOAD_SLOT_CONFIRM,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL2", SAVESLOT_2, MENUPAGE_LOAD_SLOT_CONFIRM,
|
||||
@ -93,7 +93,7 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_CHOOSE_DELETE_SLOT = 9
|
||||
{ "FET_DG", MENUPAGE_NEW_GAME, MENUPAGE_NEW_GAME, MENUPAGE_NEW_GAME, 2, 2,
|
||||
{ "FET_DG", 1, MENUPAGE_NEW_GAME, MENUPAGE_NEW_GAME, 2, 2,
|
||||
MENUACTION_CHANGEMENU, "FESZ_CA", SAVESLOT_NONE, MENUPAGE_NEW_GAME,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL1", SAVESLOT_1, MENUPAGE_DELETE_SLOT_CONFIRM,
|
||||
MENUACTION_CHECKSAVE, "FEM_SL2", SAVESLOT_2, MENUPAGE_DELETE_SLOT_CONFIRM,
|
||||
@ -106,104 +106,123 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_NEW_GAME_RELOAD = 10
|
||||
{ "FET_NG", MENUPAGE_NEW_GAME, MENUPAGE_NEW_GAME, MENUPAGE_NEW_GAME, 0, 0,
|
||||
{ "FET_NG", 1, MENUPAGE_NEW_GAME, MENUPAGE_NEW_GAME, 0, 0,
|
||||
MENUACTION_LABEL, "FESZ_QR", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEM_NO", SAVESLOT_NONE, MENUPAGE_NEW_GAME,
|
||||
MENUACTION_NEWGAME, "FEM_YES", SAVESLOT_NONE, MENUPAGE_NEW_GAME_RELOAD,
|
||||
},
|
||||
|
||||
// MENUPAGE_LOAD_SLOT_CONFIRM = 11
|
||||
{ "FET_LG", MENUPAGE_CHOOSE_LOAD_SLOT, MENUPAGE_CHOOSE_LOAD_SLOT, MENUPAGE_CHOOSE_LOAD_SLOT, 0, 0,
|
||||
{ "FET_LG", 1, MENUPAGE_CHOOSE_LOAD_SLOT, MENUPAGE_CHOOSE_LOAD_SLOT, 0, 0,
|
||||
MENUACTION_LABEL, "FESZ_QL", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEM_NO", SAVESLOT_NONE, MENUPAGE_CHOOSE_LOAD_SLOT,
|
||||
MENUACTION_CHANGEMENU, "FEM_YES", SAVESLOT_NONE, MENUPAGE_LOADING_IN_PROGRESS,
|
||||
},
|
||||
|
||||
// MENUPAGE_DELETE_SLOT_CONFIRM = 12
|
||||
{ "FET_DG", MENUPAGE_CHOOSE_DELETE_SLOT, MENUPAGE_CHOOSE_DELETE_SLOT, MENUPAGE_CHOOSE_DELETE_SLOT, 0, 0,
|
||||
{ "FET_DG", 1, MENUPAGE_CHOOSE_DELETE_SLOT, MENUPAGE_CHOOSE_DELETE_SLOT, 0, 0,
|
||||
MENUACTION_LABEL, "FESZ_QD", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEM_NO", SAVESLOT_NONE, MENUPAGE_CHOOSE_DELETE_SLOT,
|
||||
MENUACTION_CHANGEMENU, "FEM_YES", SAVESLOT_NONE, MENUPAGE_DELETING,
|
||||
},
|
||||
|
||||
// MENUPAGE_13 = 13
|
||||
{ "FES_NOC", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
// MENUPAGE_NO_MEMORY_CARD = 13
|
||||
{ "FES_NOC", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_LABEL, "FEC_OFI", SAVESLOT_NONE, MENUPAGE_NONE, // only in mobile. FEC_OFI is missing
|
||||
},
|
||||
|
||||
// MENUPAGE_LOADING_IN_PROGRESS = 14
|
||||
{ "FET_LG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_LG", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_LABEL, "FED_LDW", SAVESLOT_NONE, MENUPAGE_LOAD_SLOT_CONFIRM,
|
||||
},
|
||||
|
||||
// MENUPAGE_DELETING_IN_PROGRESS = 15
|
||||
{ "FET_DG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_DG", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_LABEL, "FEDL_WR", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENUPAGE_16 = 16
|
||||
{ "FET_LG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
// MENUPAGE_PS2_LOAD_FAILED = 16
|
||||
{ "FET_LG", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_LABEL, "FES_LOE", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENUPAGE_DELETE_FAILED = 17
|
||||
{ "FET_DG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_DG", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_LABEL, "FES_DEE", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEC_OKK", SAVESLOT_NONE, MENUPAGE_CHOOSE_DELETE_SLOT,
|
||||
},
|
||||
|
||||
// MENUPAGE_DEBUG_MENU = 18
|
||||
{ "FED_DBG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
{ "FED_DBG", 1, MENUPAGE_NONE, MENUPAGE_NONE, 4, 0,
|
||||
MENUACTION_RELOADIDE, "FED_RID", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_RELOADIPL, "FED_RIP", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_SETDBGFLAG, "FED_DFL", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_SWITCHBIGWHITEDEBUGLIGHT, "FED_DLS", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_PEDROADGROUPS, "FED_SPR", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CARROADGROUPS, "FED_SCR", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_COLLISIONPOLYS, "FED_SCP", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_PARSEHEAP, "FED_PAH", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_SHOWCULL, "FED_SCZ", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_DEBUGSTREAM, "FED_DSR", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENUPAGE_MEMORY_CARD_1 = 19
|
||||
{ "FEM_MCM", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
// MENUPAGE_MEMORY_CARD_DEBUG = 19
|
||||
{ "FEM_MCM", 1, MENUPAGE_NONE, MENUPAGE_NONE, 7, 0,
|
||||
MENUACTION_REGMEMCARD1, "FEM_RMC", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_TESTFORMATMEMCARD1, "FEM_TFM", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_TESTUNFORMATMEMCARD1, "FEM_TUM", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CREATEROOTDIR, "FEM_CRD", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CREATELOADICONS, "FEM_CLI", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_FILLWITHGUFF, "FEM_FFF", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_SAVEONLYTHEGAME, "FEM_SOG", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_SAVEGAME, "FEM_STG", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_SAVEGAMEUNDERGTA, "FEM_STS", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CREATECOPYPROTECTED, "FEM_CPD", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENUPAGE_MEMORY_CARD_2 = 20
|
||||
{ "FEM_MC2", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
// MENUPAGE_MEMORY_CARD_TEST = 20
|
||||
{ "FEM_MC2", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_MULTIPLAYER_MAIN = 21
|
||||
{ "FET_MP", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_MP", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_SAVE_FAILED_1 = 22
|
||||
{ "MCDNSP", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
// MENUPAGE_PS2_SAVE_FAILED = 22
|
||||
{ "MCDNSP", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_MEMCARDSAVECONFIRM, "JAILB_U", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENUPAGE_SAVE_FAILED_2 = 23
|
||||
{ "MCGNSP", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
// MENUPAGE_PS2_SAVE_FAILED_2 = 23
|
||||
{ "MCGNSP", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_MEMCARDSAVECONFIRM, "JAILB_U", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// Unused in PC but anyway
|
||||
// MENUPAGE_SAVE = 24
|
||||
#ifdef PS2_SAVE_DIALOG
|
||||
{ "FET_SG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_SG", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_CHANGEMENU, "FESZ_SA", SAVESLOT_NONE, MENUPAGE_CHOOSE_SAVE_SLOT,
|
||||
MENUACTION_RESUME_FROM_SAVEZONE, "FESZ_CA", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
#else
|
||||
{ "FET_SG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_SG", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_LABEL, "FES_SCG", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_POPULATESLOTS_CHANGEMENU, "GMSAVE", SAVESLOT_NONE, MENUPAGE_CHOOSE_SAVE_SLOT,
|
||||
MENUACTION_RESUME_FROM_SAVEZONE, "FESZ_CA", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
#endif
|
||||
|
||||
// MENUPAGE_NO_MEMORY_CARD = 25
|
||||
{ "FES_NOC", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
// MENUPAGE_NO_MEMORY_CARD_2 = 25
|
||||
{ "FES_NOC", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_CHANGEMENU, "FESZ_CA", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENUPAGE_CHOOSE_SAVE_SLOT = 26
|
||||
{ "FET_SG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_SG", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_RESUME_FROM_SAVEZONE, "FESZ_CA", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEM_SL1", SAVESLOT_1, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
|
||||
MENUACTION_CHANGEMENU, "FEM_SL2", SAVESLOT_2, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
|
||||
@ -216,49 +235,49 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_SAVE_OVERWRITE_CONFIRM = 27
|
||||
{ "FET_SG", MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
|
||||
{ "FET_SG", 1, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
|
||||
MENUACTION_LABEL, "FESZ_QO", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEM_YES", SAVESLOT_NONE, MENUPAGE_SAVING_IN_PROGRESS,
|
||||
MENUACTION_CHANGEMENU, "FEM_NO", SAVESLOT_NONE, MENUPAGE_CHOOSE_SAVE_SLOT,
|
||||
},
|
||||
|
||||
// MENUPAGE_MULTIPLAYER_MAP = 28
|
||||
{ "FET_MAP", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_MAP", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_MULTIPLAYER_CONNECTION = 29
|
||||
{ "FET_CON", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_CON", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_MULTIPLAYER_FIND_GAME = 30
|
||||
{ "FET_FG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_FG", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_MULTIPLAYER_MODE = 31
|
||||
{ "FET_GT", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_GT", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_MULTIPLAYER_CREATE = 32
|
||||
{ "FET_HG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_HG", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_MULTIPLAYER_START = 33
|
||||
{ "FEN_STA", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FEN_STA", 2, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_SKIN_SELECT_OLD = 34
|
||||
{ "FET_PS", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_PS", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_CONTROLLER_PC = 35
|
||||
{ "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0,
|
||||
{ "FET_CTL", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0,
|
||||
MENUACTION_CTRLMETHOD, "FET_CME", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
|
||||
MENUACTION_CHANGEMENU, "FET_RDK", SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS,
|
||||
MENUACTION_CHANGEMENU, "FET_AMS", SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS,
|
||||
@ -268,7 +287,7 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_CONTROLLER_PC_OLD1 = 36
|
||||
{ "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 0, 0,
|
||||
{ "FET_CTL", 1, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 0, 0,
|
||||
MENUACTION_GETKEY, "FEC_PLB", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD1,
|
||||
MENUACTION_GETKEY, "FEC_CWL", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD1,
|
||||
MENUACTION_GETKEY, "FEC_CWR", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD1,
|
||||
@ -282,12 +301,12 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_CONTROLLER_PC_OLD2 = 37
|
||||
{ "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 1, 1,
|
||||
{ "FET_CTL", 1, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 1, 1,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_CONTROLLER_PC_OLD3 = 38
|
||||
{ "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 2, 2,
|
||||
{ "FET_CTL", 1, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 2, 2,
|
||||
MENUACTION_GETKEY, "FEC_LUP", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD3,
|
||||
MENUACTION_GETKEY, "FEC_LDN", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD3,
|
||||
MENUACTION_GETKEY, "FEC_SMS", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD3,
|
||||
@ -296,20 +315,24 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_CONTROLLER_PC_OLD4 = 39
|
||||
{ "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 3, 3,
|
||||
{ "FET_CTL", 1, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 3, 3,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_CONTROLLER_DEBUG = 40
|
||||
{ "FEC_DBG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
{ "FEC_DBG", 1, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 3, 3,
|
||||
MENUACTION_GETKEY, "FEC_TGD", SAVESLOT_NONE, MENUPAGE_CONTROLLER_DEBUG,
|
||||
MENUACTION_GETKEY, "FEC_TDO", SAVESLOT_NONE, MENUPAGE_CONTROLLER_DEBUG,
|
||||
MENUACTION_GETKEY, "FEC_TSS", SAVESLOT_NONE, MENUPAGE_CONTROLLER_DEBUG,
|
||||
MENUACTION_GETKEY, "FEC_SMS", SAVESLOT_NONE, MENUPAGE_CONTROLLER_DEBUG,
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENUPAGE_OPTIONS = 41
|
||||
#ifdef MENU_MAP
|
||||
{ "FET_OPT", MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 1, 5,
|
||||
{ "FET_OPT", 1, MENUPAGE_NONE, MENUPAGE_NONE, 1, 5,
|
||||
#else
|
||||
{ "FET_OPT", MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 1, 4,
|
||||
{ "FET_OPT", 1, MENUPAGE_NONE, MENUPAGE_NONE, 1, 4,
|
||||
#endif
|
||||
MENUACTION_CHANGEMENU, "FET_CTL", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
|
||||
MENUACTION_LOADRADIO, "FET_AUD", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
|
||||
@ -321,9 +344,9 @@ const CMenuScreen aScreens[] = {
|
||||
|
||||
// MENUPAGE_EXIT = 42
|
||||
#ifdef MENU_MAP
|
||||
{ "FET_QG", MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 2, 6,
|
||||
{ "FET_QG", 1, MENUPAGE_NONE, MENUPAGE_NONE, 2, 6,
|
||||
#else
|
||||
{ "FET_QG", MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 2, 5,
|
||||
{ "FET_QG", 1, MENUPAGE_NONE, MENUPAGE_NONE, 2, 5,
|
||||
#endif
|
||||
MENUACTION_LABEL, "FEQ_SRE", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEM_NO", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
@ -331,58 +354,58 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_SAVING_IN_PROGRESS = 43
|
||||
{ "", MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
|
||||
{ "", 1, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
|
||||
MENUACTION_LABEL, "FES_WAR", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENUPAGE_SAVE_SUCCESSFUL = 44
|
||||
{ "FET_SG", MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
|
||||
{ "FET_SG", 1, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
|
||||
MENUACTION_LABEL, "FES_SSC", SAVESLOT_LABEL, MENUPAGE_NONE,
|
||||
MENUACTION_RESUME_FROM_SAVEZONE, "FEC_OKK", SAVESLOT_NONE, MENUPAGE_CHOOSE_SAVE_SLOT,
|
||||
},
|
||||
|
||||
// MENUPAGE_DELETING = 45
|
||||
{ "FET_DG", MENUPAGE_CHOOSE_DELETE_SLOT, MENUPAGE_CHOOSE_DELETE_SLOT, MENUPAGE_CHOOSE_DELETE_SLOT, 0, 0,
|
||||
{ "FET_DG", 1, MENUPAGE_CHOOSE_DELETE_SLOT, MENUPAGE_CHOOSE_DELETE_SLOT, 0, 0,
|
||||
MENUACTION_LABEL, "FED_DLW", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENUPAGE_DELETE_SUCCESS = 46
|
||||
{ "FET_DG", MENUPAGE_CHOOSE_DELETE_SLOT, MENUPAGE_CHOOSE_DELETE_SLOT, MENUPAGE_CHOOSE_DELETE_SLOT, 0, 0,
|
||||
{ "FET_DG", 1, MENUPAGE_CHOOSE_DELETE_SLOT, MENUPAGE_CHOOSE_DELETE_SLOT, 0, 0,
|
||||
MENUACTION_LABEL, "DEL_FNM", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEC_OKK", SAVESLOT_NONE, MENUPAGE_CHOOSE_DELETE_SLOT,
|
||||
},
|
||||
|
||||
// MENUPAGE_SAVE_FAILED = 47
|
||||
{ "FET_SG", MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
|
||||
{ "FET_SG", 1, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
|
||||
MENUACTION_LABEL, "FEC_SVU", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEC_OKK", SAVESLOT_NONE, MENUPAGE_CHOOSE_SAVE_SLOT,
|
||||
},
|
||||
|
||||
// MENUPAGE_LOAD_FAILED = 48
|
||||
{ "FET_SG", MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
|
||||
{ "FET_SG", 1, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
|
||||
MENUACTION_LABEL, "FEC_SVU", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENUPAGE_LOAD_FAILED_2 = 49
|
||||
{ "FET_LG", MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
|
||||
{ "FET_LG", 1, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
|
||||
MENUACTION_LABEL, "FEC_LUN", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_CHOOSE_LOAD_SLOT,
|
||||
},
|
||||
|
||||
// MENUPAGE_FILTER_GAME = 50
|
||||
{ "FIL_FLT", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FIL_FLT", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_START_MENU = 51
|
||||
{ "FEM_MM", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FEM_MM", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_CHANGEMENU, "FEN_STA", SAVESLOT_NONE, MENUPAGE_NEW_GAME,
|
||||
MENUACTION_CHANGEMENU, "FET_OPT", SAVESLOT_NONE, MENUPAGE_OPTIONS,
|
||||
MENUACTION_CHANGEMENU, "FEM_QT", SAVESLOT_NONE, MENUPAGE_EXIT,
|
||||
},
|
||||
|
||||
// MENUPAGE_PAUSE_MENU = 52
|
||||
{ "FET_PAU", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "FET_PAU", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
MENUACTION_RESUME, "FEM_RES", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
MENUACTION_CHANGEMENU, "FEN_STA", SAVESLOT_NONE, MENUPAGE_NEW_GAME,
|
||||
#ifdef MENU_MAP
|
||||
@ -395,22 +418,24 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_CHOOSE_MODE = 53
|
||||
{ "FEN_STA", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
|
||||
{ "FEN_STA", 1, MENUPAGE_NONE, MENUPAGE_NONE, 0, 1,
|
||||
MENUACTION_CHANGEMENU, "FET_SP", SAVESLOT_NONE, MENUPAGE_NEW_GAME,
|
||||
MENUACTION_INITMP, "FET_MP", SAVESLOT_NONE, MENUPAGE_MULTIPLAYER_MAIN,
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
|
||||
// MENUPAGE_SKIN_SELECT = 54
|
||||
{ "FET_PSU", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 4, 4,
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_MULTIPLAYER_MAIN,
|
||||
{ "FET_PSU", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 4, 4,
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_MULTIPLAYER_MAIN,
|
||||
},
|
||||
|
||||
// MENUPAGE_KEYBOARD_CONTROLS = 55
|
||||
{ "FET_STI", MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 1, 1,
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
|
||||
{ "FET_STI", 1, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 1, 1,
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
|
||||
},
|
||||
|
||||
// MENUPAGE_MOUSE_CONTROLS = 56
|
||||
{ "FET_MTI", MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 2, 2,
|
||||
{ "FET_MTI", 1, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 2, 2,
|
||||
MENUACTION_MOUSESENS, "FEC_MSH", SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS,
|
||||
MENUACTION_INVVERT, "FEC_IVV", SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS,
|
||||
MENUACTION_MOUSESTEER, "FET_MST", SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS,
|
||||
@ -418,18 +443,18 @@ const CMenuScreen aScreens[] = {
|
||||
},
|
||||
|
||||
// MENUPAGE_57 = 57
|
||||
{ "", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "", 0, MENUPAGE_NONE, MENUPAGE_NONE, 0, 0,
|
||||
|
||||
},
|
||||
|
||||
// MENUPAGE_58 = 58
|
||||
{ "", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
|
||||
{ "", 0, MENUPAGE_NONE, MENUPAGE_NONE, 0, 0,
|
||||
|
||||
},
|
||||
|
||||
#ifdef MENU_MAP
|
||||
// MENUPAGE_MAP = 59
|
||||
{ "FEG_MAP", MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 5, 2,
|
||||
{ "FEG_MAP", 1, MENUPAGE_NONE, MENUPAGE_NONE, 5, 2,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
@ -1,8 +1,14 @@
|
||||
#include "common.h"
|
||||
#include "patcher.h"
|
||||
#include "Pools.h"
|
||||
#include "World.h"
|
||||
|
||||
#include "Boat.h"
|
||||
#include "CarCtrl.h"
|
||||
#include "Population.h"
|
||||
#include "ProjectileInfo.h"
|
||||
#include "Streaming.h"
|
||||
#include "Wanted.h"
|
||||
#include "World.h"
|
||||
|
||||
CCPtrNodePool *&CPools::ms_pPtrNodePool = *(CCPtrNodePool**)0x943044;
|
||||
CEntryInfoNodePool *&CPools::ms_pEntryInfoNodePool = *(CEntryInfoNodePool**)0x941448;
|
||||
@ -14,13 +20,6 @@ CObjectPool *&CPools::ms_pObjectPool = *(CObjectPool**)0x880E28;
|
||||
CDummyPool *&CPools::ms_pDummyPool = *(CDummyPool**)0x8F2C18;
|
||||
CAudioScriptObjectPool *&CPools::ms_pAudioScriptObjectPool = *(CAudioScriptObjectPool**)0x8F1B6C;
|
||||
|
||||
WRAPPER void CPools::LoadObjectPool(uint8* buf, uint32 size) { EAXJMP(0x4a2550); }
|
||||
WRAPPER void CPools::LoadPedPool(uint8* buf, uint32 size) { EAXJMP(0x4a2b50); }
|
||||
WRAPPER void CPools::LoadVehiclePool(uint8* buf, uint32 size) { EAXJMP(0x4a1b40); }
|
||||
WRAPPER void CPools::SaveObjectPool(uint8* buf, uint32 *size) { EAXJMP(0x4a22d0); }
|
||||
WRAPPER void CPools::SavePedPool(uint8* buf, uint32 *size) { EAXJMP(0x4a29b0); }
|
||||
WRAPPER void CPools::SaveVehiclePool(uint8* buf, uint32 *size) { EAXJMP(0x4a2080); }
|
||||
|
||||
void
|
||||
CPools::Initialise(void)
|
||||
{
|
||||
@ -99,6 +98,333 @@ CPools::MakeSureSlotInObjectPoolIsEmpty(int32 slot)
|
||||
}
|
||||
}
|
||||
|
||||
void CPools::LoadVehiclePool(uint8* buf, uint32 size)
|
||||
{
|
||||
INITSAVEBUF
|
||||
int nNumCars = ReadSaveBuf<int>(buf);
|
||||
int nNumBoats = ReadSaveBuf<int>(buf);
|
||||
for (int i = 0; i < nNumCars + nNumBoats; i++) {
|
||||
uint32 type = ReadSaveBuf<uint32>(buf);
|
||||
int16 model = ReadSaveBuf<int16>(buf);
|
||||
CStreaming::RequestModel(model, STREAMFLAGS_DEPENDENCY);
|
||||
CStreaming::LoadAllRequestedModels(false);
|
||||
int32 slot = ReadSaveBuf<int32>(buf);
|
||||
CVehicle* pVehicle;
|
||||
char* vbuf = new char[max(sizeof(CAutomobile), sizeof(CBoat))];
|
||||
if (type == VEHICLE_TYPE_BOAT) {
|
||||
memcpy(vbuf, buf, sizeof(CBoat));
|
||||
SkipSaveBuf(buf, sizeof(CBoat));
|
||||
CBoat* pBoat = new(slot) CBoat(model, RANDOM_VEHICLE);
|
||||
pVehicle = pBoat;
|
||||
--CCarCtrl::NumRandomCars; // why?
|
||||
}
|
||||
else if (type == VEHICLE_TYPE_CAR) {
|
||||
memcpy(vbuf, buf, sizeof(CAutomobile));
|
||||
SkipSaveBuf(buf, sizeof(CAutomobile));
|
||||
CStreaming::RequestModel(model, 0); // is it needed?
|
||||
CStreaming::LoadAllRequestedModels(false);
|
||||
CAutomobile* pAutomobile = new(slot) CAutomobile(model, RANDOM_VEHICLE);
|
||||
pVehicle = pAutomobile;
|
||||
CCarCtrl::NumRandomCars--; // why?
|
||||
pAutomobile->Damage = ((CAutomobile*)vbuf)->Damage;
|
||||
pAutomobile->SetupDamageAfterLoad();
|
||||
}
|
||||
else
|
||||
assert(0);
|
||||
CVehicle* pBufferVehicle = (CVehicle*)vbuf;
|
||||
pVehicle->GetMatrix() = pBufferVehicle->GetMatrix();
|
||||
pVehicle->VehicleCreatedBy = pBufferVehicle->VehicleCreatedBy;
|
||||
pVehicle->m_currentColour1 = pBufferVehicle->m_currentColour1;
|
||||
pVehicle->m_currentColour2 = pBufferVehicle->m_currentColour2;
|
||||
pVehicle->m_nAlarmState = pBufferVehicle->m_nAlarmState;
|
||||
pVehicle->m_nNumMaxPassengers = pBufferVehicle->m_nNumMaxPassengers;
|
||||
pVehicle->field_1D0[0] = pBufferVehicle->field_1D0[0];
|
||||
pVehicle->field_1D0[1] = pBufferVehicle->field_1D0[1];
|
||||
pVehicle->field_1D0[2] = pBufferVehicle->field_1D0[2];
|
||||
pVehicle->field_1D0[3] = pBufferVehicle->field_1D0[3];
|
||||
pVehicle->m_fSteerAngle = pBufferVehicle->m_fSteerAngle;
|
||||
pVehicle->m_fGasPedal = pBufferVehicle->m_fGasPedal;
|
||||
pVehicle->m_fBrakePedal = pBufferVehicle->m_fBrakePedal;
|
||||
pVehicle->bIsLawEnforcer = pBufferVehicle->bIsLawEnforcer;
|
||||
pVehicle->bIsLocked = pBufferVehicle->bIsLocked;
|
||||
pVehicle->bEngineOn = pBufferVehicle->bEngineOn;
|
||||
pVehicle->bIsHandbrakeOn = pBufferVehicle->bIsHandbrakeOn;
|
||||
pVehicle->bLightsOn = pBufferVehicle->bLightsOn;
|
||||
pVehicle->bFreebies = pBufferVehicle->bFreebies;
|
||||
pVehicle->m_fHealth = pBufferVehicle->m_fHealth;
|
||||
pVehicle->m_nCurrentGear = pBufferVehicle->m_nCurrentGear;
|
||||
pVehicle->m_fChangeGearTime = pBufferVehicle->m_fChangeGearTime;
|
||||
pVehicle->m_nTimeOfDeath = pBufferVehicle->m_nTimeOfDeath;
|
||||
#ifdef FIX_BUGS //must be copypaste
|
||||
pVehicle->m_nBombTimer = pBufferVehicle->m_nBombTimer;
|
||||
#else
|
||||
pVehicle->m_nTimeOfDeath = pBufferVehicle->m_nTimeOfDeath;
|
||||
#endif
|
||||
pVehicle->m_nDoorLock = pBufferVehicle->m_nDoorLock;
|
||||
pVehicle->m_status = pBufferVehicle->m_status;
|
||||
pVehicle->m_type = pBufferVehicle->m_type;
|
||||
(pVehicle->GetAddressOfEntityProperties())[0] = (pBufferVehicle->GetAddressOfEntityProperties())[0];
|
||||
(pVehicle->GetAddressOfEntityProperties())[1] = (pBufferVehicle->GetAddressOfEntityProperties())[1];
|
||||
pVehicle->AutoPilot = pBufferVehicle->AutoPilot;
|
||||
CWorld::Add(pVehicle);
|
||||
delete[] vbuf;
|
||||
}
|
||||
VALIDATESAVEBUF(size)
|
||||
}
|
||||
|
||||
void CPools::SaveVehiclePool(uint8* buf, uint32* size)
|
||||
{
|
||||
INITSAVEBUF
|
||||
int nNumCars = 0;
|
||||
int nNumBoats = 0;
|
||||
int nPoolSize = GetVehiclePool()->GetSize();
|
||||
for (int i = 0; i < nPoolSize; i++) {
|
||||
CVehicle* pVehicle = GetVehiclePool()->GetSlot(i);
|
||||
if (!pVehicle)
|
||||
continue;
|
||||
bool bHasPassenger = false;
|
||||
for (int j = 0; j < 8; j++) {
|
||||
if (pVehicle->pPassengers[i])
|
||||
bHasPassenger = true;
|
||||
}
|
||||
if (!pVehicle->pDriver && !bHasPassenger) {
|
||||
if (pVehicle->IsCar() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
|
||||
++nNumCars;
|
||||
if (pVehicle->IsBoat() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
|
||||
++nNumBoats;
|
||||
}
|
||||
}
|
||||
*size = nNumCars * (sizeof(uint32) + sizeof(int16) + sizeof(int32) + sizeof(CAutomobile)) + sizeof(int) +
|
||||
nNumBoats * (sizeof(uint32) + sizeof(int16) + sizeof(int32) + sizeof(CBoat)) + sizeof(int);
|
||||
WriteSaveBuf(buf, nNumCars);
|
||||
WriteSaveBuf(buf, nNumBoats);
|
||||
for (int i = 0; i < nPoolSize; i++) {
|
||||
CVehicle* pVehicle = GetVehiclePool()->GetSlot(i);
|
||||
if (!pVehicle)
|
||||
continue;
|
||||
bool bHasPassenger = false;
|
||||
for (int j = 0; j < 8; j++) {
|
||||
if (pVehicle->pPassengers[j])
|
||||
bHasPassenger = true;
|
||||
}
|
||||
if (!pVehicle->pDriver && !bHasPassenger) {
|
||||
if (pVehicle->IsCar() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) {
|
||||
WriteSaveBuf(buf, (uint32)pVehicle->m_vehType);
|
||||
WriteSaveBuf(buf, pVehicle->m_modelIndex);
|
||||
WriteSaveBuf(buf, GetVehicleRef(pVehicle));
|
||||
memcpy(buf, pVehicle, sizeof(CAutomobile));
|
||||
SkipSaveBuf(buf, sizeof(CAutomobile));
|
||||
}
|
||||
if (pVehicle->IsBoat() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) {
|
||||
WriteSaveBuf(buf, (uint32)pVehicle->m_vehType);
|
||||
WriteSaveBuf(buf, pVehicle->m_modelIndex);
|
||||
WriteSaveBuf(buf, GetVehicleRef(pVehicle));
|
||||
memcpy(buf, pVehicle, sizeof(CBoat));
|
||||
SkipSaveBuf(buf, sizeof(CBoat));
|
||||
}
|
||||
}
|
||||
}
|
||||
VALIDATESAVEBUF(*size)
|
||||
}
|
||||
|
||||
void CPools::SaveObjectPool(uint8* buf, uint32* size)
|
||||
{
|
||||
INITSAVEBUF
|
||||
CProjectileInfo::RemoveAllProjectiles();
|
||||
CObject::DeleteAllTempObjects();
|
||||
int nObjects = 0;
|
||||
int nPoolSize = GetObjectPool()->GetSize();
|
||||
for (int i = 0; i < nPoolSize; i++) {
|
||||
CObject* pObject = GetObjectPool()->GetSlot(i);
|
||||
if (!pObject)
|
||||
continue;
|
||||
if (pObject->ObjectCreatedBy == MISSION_OBJECT)
|
||||
++nObjects;
|
||||
}
|
||||
*size = nObjects * (sizeof(int16) + sizeof(int) + sizeof(CCompressedMatrixNotAligned) + sizeof(uint32) +
|
||||
sizeof(float) + sizeof(CCompressedMatrixNotAligned) + sizeof(uint32) + sizeof(int8) + 7 * sizeof(bool) + sizeof(float) +
|
||||
sizeof(int8) + sizeof(int8) + sizeof(uint32) + 2 * sizeof(uint32)) + sizeof(int);
|
||||
WriteSaveBuf(buf, nObjects);
|
||||
for (int i = 0; i < nPoolSize; i++) {
|
||||
CObject* pObject = GetObjectPool()->GetSlot(i);
|
||||
if (!pObject)
|
||||
continue;
|
||||
if (pObject->ObjectCreatedBy == MISSION_OBJECT) {
|
||||
bool bIsPickup = pObject->bIsPickup;
|
||||
bool bFlag2 = pObject->m_obj_flag2;
|
||||
bool bOutOfStock = pObject->bOutOfStock;
|
||||
bool bGlassCracked = pObject->bGlassCracked;
|
||||
bool bGlassBroken = pObject->bGlassBroken;
|
||||
bool bHasBeenDamaged = pObject->bHasBeenDamaged;
|
||||
bool bUseVehicleColours = pObject->bUseVehicleColours;
|
||||
CCompressedMatrixNotAligned tmp;
|
||||
WriteSaveBuf(buf, pObject->m_modelIndex);
|
||||
WriteSaveBuf(buf, GetObjectRef(pObject));
|
||||
tmp.CompressFromFullMatrix(pObject->GetMatrix());
|
||||
WriteSaveBuf(buf, tmp);
|
||||
WriteSaveBuf(buf, (uint32)0); // game writes ununitialized data here
|
||||
WriteSaveBuf(buf, pObject->m_fUprootLimit);
|
||||
tmp.CompressFromFullMatrix(pObject->m_objectMatrix);
|
||||
WriteSaveBuf(buf, tmp);
|
||||
WriteSaveBuf(buf, (uint32)0); // same
|
||||
WriteSaveBuf(buf, pObject->ObjectCreatedBy);
|
||||
WriteSaveBuf(buf, bIsPickup);
|
||||
WriteSaveBuf(buf, bFlag2);
|
||||
WriteSaveBuf(buf, bOutOfStock);
|
||||
WriteSaveBuf(buf, bGlassCracked);
|
||||
WriteSaveBuf(buf, bGlassBroken);
|
||||
WriteSaveBuf(buf, bHasBeenDamaged);
|
||||
WriteSaveBuf(buf, bUseVehicleColours);
|
||||
WriteSaveBuf(buf, pObject->m_fCollisionDamageMultiplier);
|
||||
WriteSaveBuf(buf, pObject->m_nCollisionDamageEffect);
|
||||
WriteSaveBuf(buf, pObject->m_nSpecialCollisionResponseCases);
|
||||
WriteSaveBuf(buf, pObject->m_nEndOfLifeTime);
|
||||
WriteSaveBuf(buf, (pObject->GetAddressOfEntityProperties())[0]);
|
||||
WriteSaveBuf(buf, (pObject->GetAddressOfEntityProperties())[1]);
|
||||
}
|
||||
}
|
||||
VALIDATESAVEBUF(*size)
|
||||
}
|
||||
|
||||
void CPools::LoadObjectPool(uint8* buf, uint32 size)
|
||||
{
|
||||
INITSAVEBUF
|
||||
int nObjects = ReadSaveBuf<int>(buf);
|
||||
for (int i = 0; i < nObjects; i++) {
|
||||
int16 mi = ReadSaveBuf<int16>(buf);
|
||||
int ref = ReadSaveBuf<int>(buf);
|
||||
char* obuf = new char[sizeof(CObject)];
|
||||
CObject* pBufferObject = (CObject*)obuf;
|
||||
CCompressedMatrixNotAligned tmp;
|
||||
tmp = ReadSaveBuf<CCompressedMatrixNotAligned>(buf);
|
||||
tmp.DecompressIntoFullMatrix(pBufferObject->GetMatrix());
|
||||
ReadSaveBuf<uint32>(buf);
|
||||
pBufferObject->m_fUprootLimit = ReadSaveBuf<float>(buf);
|
||||
tmp = ReadSaveBuf<CCompressedMatrixNotAligned>(buf);
|
||||
tmp.DecompressIntoFullMatrix(pBufferObject->m_objectMatrix);
|
||||
ReadSaveBuf<uint32>(buf);
|
||||
pBufferObject->ObjectCreatedBy = ReadSaveBuf<int8>(buf);
|
||||
pBufferObject->bIsPickup = ReadSaveBuf<bool>(buf);
|
||||
pBufferObject->m_flagE2 = ReadSaveBuf<bool>(buf);
|
||||
pBufferObject->bOutOfStock = ReadSaveBuf<bool>(buf);
|
||||
pBufferObject->bGlassCracked = ReadSaveBuf<bool>(buf);
|
||||
pBufferObject->bGlassBroken = ReadSaveBuf<bool>(buf);
|
||||
pBufferObject->bHasBeenDamaged = ReadSaveBuf<bool>(buf);
|
||||
pBufferObject->bUseVehicleColours = ReadSaveBuf<bool>(buf);
|
||||
pBufferObject->m_fCollisionDamageMultiplier = ReadSaveBuf<float>(buf);
|
||||
pBufferObject->m_nCollisionDamageEffect = ReadSaveBuf<uint8>(buf);
|
||||
pBufferObject->m_nSpecialCollisionResponseCases = ReadSaveBuf<uint8>(buf);
|
||||
pBufferObject->m_nEndOfLifeTime = ReadSaveBuf<uint32>(buf);
|
||||
(pBufferObject->GetAddressOfEntityProperties())[0] = ReadSaveBuf<uint32>(buf);
|
||||
(pBufferObject->GetAddressOfEntityProperties())[1] = ReadSaveBuf<uint32>(buf);
|
||||
if (GetObjectPool()->GetSlot(ref >> 8))
|
||||
CPopulation::ConvertToDummyObject(GetObjectPool()->GetSlot(ref >> 8));
|
||||
CObject* pObject = new(ref) CObject(mi, false);
|
||||
pObject->GetMatrix() = pBufferObject->GetMatrix();
|
||||
pObject->m_fUprootLimit = pBufferObject->m_fUprootLimit;
|
||||
pObject->m_objectMatrix = pBufferObject->m_objectMatrix;
|
||||
pObject->ObjectCreatedBy = pBufferObject->ObjectCreatedBy;
|
||||
pObject->bIsPickup = pBufferObject->bIsPickup;
|
||||
pObject->m_flagE2 = pBufferObject->m_flagE2;
|
||||
pObject->bOutOfStock = pBufferObject->bOutOfStock;
|
||||
pObject->bGlassCracked = pBufferObject->bGlassCracked;
|
||||
pObject->bGlassBroken = pBufferObject->bGlassBroken;
|
||||
pObject->bHasBeenDamaged = pBufferObject->bHasBeenDamaged;
|
||||
pObject->bUseVehicleColours = pBufferObject->bUseVehicleColours;
|
||||
pObject->m_fCollisionDamageMultiplier = pBufferObject->m_fCollisionDamageMultiplier;
|
||||
pObject->m_nCollisionDamageEffect = pBufferObject->m_nCollisionDamageEffect;
|
||||
pObject->m_nSpecialCollisionResponseCases = pBufferObject->m_nSpecialCollisionResponseCases;
|
||||
pObject->m_nEndOfLifeTime = pBufferObject->m_nEndOfLifeTime;
|
||||
(pObject->GetAddressOfEntityProperties())[0] = (pBufferObject->GetAddressOfEntityProperties())[0];
|
||||
(pObject->GetAddressOfEntityProperties())[1] = (pBufferObject->GetAddressOfEntityProperties())[1];
|
||||
pObject->bHasCollided = false;
|
||||
CWorld::Add(pObject);
|
||||
delete[] obuf;
|
||||
}
|
||||
VALIDATESAVEBUF(size)
|
||||
}
|
||||
|
||||
void CPools::SavePedPool(uint8* buf, uint32* size)
|
||||
{
|
||||
INITSAVEBUF
|
||||
int nNumPeds = 0;
|
||||
int nPoolSize = GetPedPool()->GetSize();
|
||||
for (int i = 0; i < nPoolSize; i++) {
|
||||
CPed* pPed = GetPedPool()->GetSlot(i);
|
||||
if (!pPed)
|
||||
continue;
|
||||
if (!pPed->bInVehicle && pPed->m_nPedType == PEDTYPE_PLAYER1)
|
||||
nNumPeds++;
|
||||
}
|
||||
*size = sizeof(int) + nNumPeds * (sizeof(uint32) + sizeof(int16) + sizeof(int) + sizeof(CPlayerPed) +
|
||||
sizeof(CWanted::MaximumWantedLevel) + sizeof(CWanted::nMaximumWantedLevel) + MAX_MODEL_NAME);
|
||||
WriteSaveBuf(buf, nNumPeds);
|
||||
for (int i = 0; i < nPoolSize; i++) {
|
||||
CPed* pPed = GetPedPool()->GetSlot(i);
|
||||
if (!pPed)
|
||||
continue;
|
||||
if (!pPed->bInVehicle && pPed->m_nPedType == PEDTYPE_PLAYER1) {
|
||||
WriteSaveBuf(buf, pPed->m_nPedType);
|
||||
WriteSaveBuf(buf, pPed->m_modelIndex);
|
||||
WriteSaveBuf(buf, GetPedRef(pPed));
|
||||
memcpy(buf, pPed, sizeof(CPlayerPed));
|
||||
SkipSaveBuf(buf, sizeof(CPlayerPed));
|
||||
WriteSaveBuf(buf, CWanted::MaximumWantedLevel);
|
||||
WriteSaveBuf(buf, CWanted::nMaximumWantedLevel);
|
||||
memcpy(buf, CModelInfo::GetModelInfo(pPed->GetModelIndex())->GetName(), MAX_MODEL_NAME);
|
||||
SkipSaveBuf(buf, MAX_MODEL_NAME);
|
||||
}
|
||||
}
|
||||
VALIDATESAVEBUF(*size);
|
||||
}
|
||||
|
||||
void CPools::LoadPedPool(uint8* buf, uint32 size)
|
||||
{
|
||||
INITSAVEBUF
|
||||
int nPeds = ReadSaveBuf<int>(buf);
|
||||
for (int i = 0; i < nPeds; i++) {
|
||||
uint32 pedtype = ReadSaveBuf<uint32>(buf);
|
||||
int16 model = ReadSaveBuf<int16>(buf);
|
||||
int ref = ReadSaveBuf<int>(buf);
|
||||
char* pbuf = new char[sizeof(CPlayerPed)];
|
||||
CPlayerPed* pBufferPlayer = (CPlayerPed*)pbuf;
|
||||
CPed* pPed;
|
||||
char name[MAX_MODEL_NAME];
|
||||
// the code implies that there was idea to load non-player ped
|
||||
if (pedtype == PEDTYPE_PLAYER1) { // always true
|
||||
memcpy(pbuf, buf, sizeof(CPlayerPed));
|
||||
SkipSaveBuf(buf, sizeof(CPlayerPed));
|
||||
CWanted::MaximumWantedLevel = ReadSaveBuf<int32>(buf);
|
||||
CWanted::nMaximumWantedLevel = ReadSaveBuf<int32>(buf);
|
||||
memcpy(name, buf, MAX_MODEL_NAME);
|
||||
SkipSaveBuf(buf, MAX_MODEL_NAME);
|
||||
}
|
||||
CStreaming::RequestSpecialModel(model, name, STREAMFLAGS_DONT_REMOVE);
|
||||
CStreaming::LoadAllRequestedModels(false);
|
||||
if (pedtype == PEDTYPE_PLAYER1) {
|
||||
CPlayerPed* pPlayerPed = new(ref) CPlayerPed();
|
||||
for (int i = 0; i < ARRAY_SIZE(pPlayerPed->m_nTargettableObjects); i++)
|
||||
pPlayerPed->m_nTargettableObjects[i] = pBufferPlayer->m_nTargettableObjects[i];
|
||||
pPlayerPed->m_fMaxStamina = pBufferPlayer->m_fMaxStamina;
|
||||
pPed = pPlayerPed;
|
||||
}
|
||||
pPed->GetPosition() = pBufferPlayer->GetPosition();
|
||||
pPed->m_fHealth = pBufferPlayer->m_fHealth;
|
||||
pPed->m_fArmour = pBufferPlayer->m_fArmour;
|
||||
pPed->CharCreatedBy = pBufferPlayer->CharCreatedBy;
|
||||
pPed->m_currentWeapon = 0;
|
||||
pPed->m_maxWeaponTypeAllowed = pBufferPlayer->m_maxWeaponTypeAllowed;
|
||||
for (int i = 0; i < WEAPONTYPE_TOTAL_INVENTORY_WEAPONS; i++)
|
||||
pPed->m_weapons[i] = pBufferPlayer->m_weapons[i];
|
||||
if (pedtype == PEDTYPE_PLAYER1) {
|
||||
pPed->m_wepAccuracy = 100;
|
||||
CWorld::Players[0].m_pPed = (CPlayerPed*)pPed;
|
||||
}
|
||||
CWorld::Add(pPed);
|
||||
delete[] pbuf;
|
||||
}
|
||||
VALIDATESAVEBUF(size)
|
||||
}
|
||||
|
||||
STARTPATCHES
|
||||
InjectHook(0x4A1770, CPools::Initialise, PATCH_JUMP);
|
||||
@ -111,4 +437,7 @@ STARTPATCHES
|
||||
InjectHook(0x4A1B00, CPools::GetObjectRef, PATCH_JUMP);
|
||||
InjectHook(0x4A1B20, CPools::GetObject, PATCH_JUMP);
|
||||
InjectHook(0x4A2DB0, CPools::MakeSureSlotInObjectPoolIsEmpty, PATCH_JUMP);
|
||||
InjectHook(0x4A1B40, CPools::LoadVehiclePool, PATCH_JUMP);
|
||||
InjectHook(0x4A2550, CPools::LoadObjectPool, PATCH_JUMP);
|
||||
InjectHook(0x4A2B50, CPools::LoadPedPool, PATCH_JUMP);
|
||||
ENDPATCHES
|
||||
|
@ -1412,8 +1412,8 @@ CRadar::DrawYouAreHereSprite(float x, float y)
|
||||
}
|
||||
} else {
|
||||
if (CTimer::GetTimeInMillisecondsPauseMode() - lastChange > 200) {
|
||||
lastChange = CTimer::GetTimeInMillisecondsPauseMode();
|
||||
show = !show;
|
||||
lastChange = CTimer::GetTimeInMillisecondsPauseMode();
|
||||
show = !show;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1422,7 +1422,7 @@ CRadar::DrawYouAreHereSprite(float x, float y)
|
||||
float top = y - SCREEN_SCALE_Y(2.0f);
|
||||
float right = SCREEN_SCALE_X(12.0) + x;
|
||||
float bottom = y - SCREEN_SCALE_Y(26.0f);
|
||||
CentreSprite.Draw(CRect(left, top, right, bottom), CRGBA(255, 217, 106, 255));
|
||||
CentreSprite.Draw(CRect(left, top, right, bottom), CRGBA(255, 255, 255, 255));
|
||||
}
|
||||
MapLegendList[MapLegendCounter++] = RADAR_SPRITE_CENTRE;
|
||||
}
|
||||
@ -1503,4 +1503,4 @@ STARTPATCHES
|
||||
InjectHook(0x4A6F30, CRadar::LoadAllRadarBlips, PATCH_JUMP);
|
||||
//InjectHook(0x4A7000, `global constructor keyed to'Radar.cpp, PATCH_JUMP);
|
||||
//InjectHook(0x4A7260, sRadarTrace::sRadarTrace, PATCH_JUMP);
|
||||
ENDPATCHES
|
||||
ENDPATCHES
|
@ -34,6 +34,10 @@ LARGE_INTEGER &perfSuspendCounter = *(LARGE_INTEGER*)0x62A318;
|
||||
//UInt32 suspendDepth;
|
||||
uint32 &suspendDepth = *(uint32*)0x62A320;
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
double frameTime;
|
||||
#endif
|
||||
|
||||
void CTimer::Initialise(void)
|
||||
{
|
||||
debug("Initialising CTimer...\n");
|
||||
@ -90,17 +94,21 @@ void CTimer::Update(void)
|
||||
|
||||
float updInCyclesScaled = updInCycles * ms_fTimeScale;
|
||||
|
||||
double upd = updInCyclesScaled / (double)_nCyclesPerMS;
|
||||
// We need that real frame time to fix transparent menu bug.
|
||||
#ifndef FIX_BUGS
|
||||
double
|
||||
#endif
|
||||
frameTime = updInCyclesScaled / (double)_nCyclesPerMS;
|
||||
|
||||
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + upd;
|
||||
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + frameTime;
|
||||
|
||||
if ( GetIsPaused() )
|
||||
ms_fTimeStep = 0.0f;
|
||||
else
|
||||
{
|
||||
m_snTimeInMilliseconds = m_snTimeInMilliseconds + upd;
|
||||
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + upd;
|
||||
ms_fTimeStep = updInCyclesScaled / (double)_nCyclesPerMS / 20.0f;
|
||||
m_snTimeInMilliseconds = m_snTimeInMilliseconds + frameTime;
|
||||
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + frameTime;
|
||||
ms_fTimeStep = frameTime / 1000.0f * 50.0f;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -109,19 +117,23 @@ void CTimer::Update(void)
|
||||
|
||||
uint32 updInMs = timer - oldPcTimer;
|
||||
|
||||
double upd = (double)updInMs * ms_fTimeScale;
|
||||
// We need that real frame time to fix transparent menu bug.
|
||||
#ifndef FIX_BUGS
|
||||
double
|
||||
#endif
|
||||
frameTime = (double)updInMs * ms_fTimeScale;
|
||||
|
||||
oldPcTimer = timer;
|
||||
|
||||
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + upd;
|
||||
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + frameTime;
|
||||
|
||||
if ( GetIsPaused() )
|
||||
ms_fTimeStep = 0.0f;
|
||||
else
|
||||
{
|
||||
m_snTimeInMilliseconds = m_snTimeInMilliseconds + upd;
|
||||
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + upd;
|
||||
ms_fTimeStep = upd / 1000.0f * 50.0f;
|
||||
m_snTimeInMilliseconds = m_snTimeInMilliseconds + frameTime;
|
||||
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + frameTime;
|
||||
ms_fTimeStep = frameTime / 1000.0f * 50.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,3 +54,7 @@ public:
|
||||
static void StartUserPause(void);
|
||||
static void EndUserPause(void);
|
||||
};
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
extern double frameTime;
|
||||
#endif
|
||||
|
@ -74,9 +74,11 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
|
||||
}
|
||||
|
||||
|
||||
#ifndef RWLIBS
|
||||
// little hack
|
||||
extern void **rwengine;
|
||||
#define RwEngineInstance (*rwengine)
|
||||
#endif
|
||||
|
||||
#include "skeleton.h"
|
||||
#include "Draw.h"
|
||||
|
@ -21,10 +21,15 @@
|
||||
#include "Particle.h"
|
||||
#include "Console.h"
|
||||
#include "Debug.h"
|
||||
#include "Hud.h"
|
||||
|
||||
#include <list>
|
||||
|
||||
#ifndef RWLIBS
|
||||
void **rwengine = *(void***)0x5A10E1;
|
||||
#else
|
||||
extern "C" int vsprintf(char* const _Buffer, char const* const _Format, va_list _ArgList);
|
||||
#endif
|
||||
|
||||
DebugMenuAPI gDebugMenuAPI;
|
||||
|
||||
@ -338,6 +343,7 @@ DebugMenuPopulate(void)
|
||||
DebugMenuAddCmd("Spawn", "Spawn Rhino", [](){ SpawnCar(MI_RHINO); });
|
||||
DebugMenuAddCmd("Spawn", "Spawn Firetruck", [](){ SpawnCar(MI_FIRETRUCK); });
|
||||
|
||||
DebugMenuAddVarBool8("Debug", "Draw hud", (int8*)&CHud::m_Wants_To_Draw_Hud, nil);
|
||||
DebugMenuAddVar("Debug", "Engine Status", &engineStatus, nil, 1, 0, 226, nil);
|
||||
DebugMenuAddCmd("Debug", "Set Engine Status", SetEngineStatus);
|
||||
DebugMenuAddCmd("Debug", "Fix Car", FixCar);
|
||||
|
@ -62,11 +62,11 @@ CEntity::CEntity(void)
|
||||
bRemoveFromWorld = false;
|
||||
bHasHitWall = false;
|
||||
bImBeingRendered = false;
|
||||
m_flagD8 = false;
|
||||
bTouchingWater = false;
|
||||
bIsSubway = false;
|
||||
bDrawLast = false;
|
||||
bNoBrightHeadLights = false;
|
||||
m_flagD80 = false;
|
||||
bDoNotRender = false;
|
||||
|
||||
bDistanceFade = false;
|
||||
m_flagE2 = false;
|
||||
|
@ -73,11 +73,11 @@ public:
|
||||
uint32 bRemoveFromWorld : 1;
|
||||
uint32 bHasHitWall : 1;
|
||||
uint32 bImBeingRendered : 1;
|
||||
uint32 m_flagD8 : 1; // used by cBuoyancy::ProcessBuoyancy
|
||||
uint32 bTouchingWater : 1; // used by cBuoyancy::ProcessBuoyancy
|
||||
uint32 bIsSubway : 1; // set when subway, but maybe different meaning?
|
||||
uint32 bDrawLast : 1;
|
||||
uint32 bNoBrightHeadLights : 1;
|
||||
uint32 m_flagD80 : 1; // CObject visibility?
|
||||
uint32 bDoNotRender : 1;
|
||||
|
||||
// flagsE
|
||||
uint32 bDistanceFade : 1;
|
||||
@ -90,6 +90,7 @@ public:
|
||||
CReference *m_pFirstReference;
|
||||
|
||||
CColModel *GetColModel(void) { return CModelInfo::GetModelInfo(m_modelIndex)->GetColModel(); }
|
||||
uint32* GetAddressOfEntityProperties() { /* AWFUL */ return (uint32*)((char*)&m_rwObject + sizeof(m_rwObject)); }
|
||||
|
||||
CEntity(void);
|
||||
~CEntity(void);
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include "Collision.h"
|
||||
|
||||
#define MAX_MODEL_NAME (24)
|
||||
|
||||
enum ModeInfoType : uint8
|
||||
{
|
||||
MITYPE_NA = 0,
|
||||
@ -21,7 +23,7 @@ class CBaseModelInfo
|
||||
{
|
||||
protected:
|
||||
// TODO?: make more things protected
|
||||
char m_name[24];
|
||||
char m_name[MAX_MODEL_NAME];
|
||||
CColModel *m_colModel;
|
||||
C2dEffect *m_twodEffects;
|
||||
int16 m_objectId;
|
||||
|
@ -6,12 +6,11 @@
|
||||
#include "Radar.h"
|
||||
#include "Object.h"
|
||||
#include "DummyObject.h"
|
||||
|
||||
WRAPPER void CObject::ObjectDamage(float amount) { EAXJMP(0x4BB240); }
|
||||
WRAPPER void CObject::DeleteAllTempObjectInArea(CVector, float) { EAXJMP(0x4BBED0); }
|
||||
WRAPPER void CObject::Init(void) { EAXJMP(0x4BAEC0); }
|
||||
WRAPPER void CObject::ProcessControl(void) { EAXJMP(0x4BB040); }
|
||||
WRAPPER void CObject::Teleport(CVector) { EAXJMP(0x4BBDA0); }
|
||||
#include "Particle.h"
|
||||
#include "General.h"
|
||||
#include "ObjectData.h"
|
||||
#include "World.h"
|
||||
#include "Floater.h"
|
||||
|
||||
int16 &CObject::nNoTempObjects = *(int16*)0x95CCA2;
|
||||
int16 &CObject::nBodyCastHealth = *(int16*)0x5F7D4C; // 1000
|
||||
@ -28,13 +27,13 @@ CObject::CObject(void)
|
||||
m_nCollisionDamageEffect = 0;
|
||||
m_nSpecialCollisionResponseCases = COLLRESPONSE_NONE;
|
||||
m_bCameraToAvoidThisObject = false;
|
||||
ObjectCreatedBy = 0;
|
||||
ObjectCreatedBy = UNKNOWN_OBJECT;
|
||||
m_nEndOfLifeTime = 0;
|
||||
// m_nRefModelIndex = -1; // duplicate
|
||||
// bUseVehicleColours = false; // duplicate
|
||||
m_colour2 = 0;
|
||||
m_colour1 = m_colour2;
|
||||
field_172 = 0;
|
||||
m_nBonusValue = 0;
|
||||
bIsPickup = false;
|
||||
m_obj_flag2 = false;
|
||||
bOutOfStock = false;
|
||||
@ -82,10 +81,46 @@ CObject::~CObject(void)
|
||||
nNoTempObjects--;
|
||||
}
|
||||
|
||||
void
|
||||
CObject::ProcessControl(void)
|
||||
{
|
||||
CVector point, impulse;
|
||||
if (m_nCollisionDamageEffect)
|
||||
ObjectDamage(m_fDamageImpulse);
|
||||
CPhysical::ProcessControl();
|
||||
if (mod_Buoyancy.ProcessBuoyancy(this, m_fBuoyancy, &point, &impulse)) {
|
||||
bIsInWater = true;
|
||||
bIsStatic = false;
|
||||
ApplyMoveForce(impulse);
|
||||
ApplyTurnForce(impulse, point);
|
||||
float fTimeStep = Pow(0.97f, CTimer::GetTimeStep());
|
||||
m_vecMoveSpeed *= fTimeStep;
|
||||
m_vecTurnSpeed *= fTimeStep;
|
||||
}
|
||||
if ((m_modelIndex == MI_EXPLODINGBARREL || m_modelIndex == MI_PETROLPUMP) && bHasBeenDamaged && bIsVisible
|
||||
&& (CGeneral::GetRandomNumber() & 0x1F) == 10) {
|
||||
bExplosionProof = true;
|
||||
bIsVisible = false;
|
||||
bUsesCollision = false;
|
||||
bAffectedByGravity = false;
|
||||
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CObject::Teleport(CVector vecPos)
|
||||
{
|
||||
CWorld::Remove(this);
|
||||
m_matrix.GetPosition() = vecPos;
|
||||
m_matrix.UpdateRW();
|
||||
UpdateRwFrame();
|
||||
CWorld::Add(this);
|
||||
}
|
||||
|
||||
void
|
||||
CObject::Render(void)
|
||||
{
|
||||
if(m_flagD80)
|
||||
if(bDoNotRender)
|
||||
return;
|
||||
|
||||
if(m_nRefModelIndex != -1 && ObjectCreatedBy == TEMP_OBJECT && bUseVehicleColours){
|
||||
@ -117,6 +152,152 @@ CObject::RemoveLighting(bool reset)
|
||||
WorldReplaceScorchedLightsWithNormal(Scene.world);
|
||||
}
|
||||
|
||||
void
|
||||
CObject::ObjectDamage(float amount)
|
||||
{
|
||||
if (!m_nCollisionDamageEffect || !bUsesCollision)
|
||||
return;
|
||||
static int8 nFrameGen = 0;
|
||||
bool bBodyCastDamageEffect = false;
|
||||
if (m_modelIndex == MI_BODYCAST){
|
||||
if (amount > 50.0f)
|
||||
nBodyCastHealth = (int16)(nBodyCastHealth - 0.5f * amount);
|
||||
if (nBodyCastHealth < 0)
|
||||
nBodyCastHealth = 0;
|
||||
if (nBodyCastHealth < 200)
|
||||
bBodyCastDamageEffect = true;
|
||||
amount = 0.0f;
|
||||
}
|
||||
if ((amount * m_fCollisionDamageMultiplier > 150.0f || bBodyCastDamageEffect) && m_nCollisionDamageEffect) {
|
||||
const CVector& vecPos = m_matrix.GetPosition();
|
||||
const float fDirectionZ = 0.0002f * amount;
|
||||
switch (m_nCollisionDamageEffect)
|
||||
{
|
||||
case COLDAMAGE_EFFECT_CHANGE_MODEL:
|
||||
bRenderDamaged = true;
|
||||
break;
|
||||
case COLDAMAGE_EFFECT_SPLIT_MODEL:
|
||||
break;
|
||||
case COLDAMAGE_EFFECT_SMASH_COMPLETELY:
|
||||
bIsVisible = false;
|
||||
bUsesCollision = false;
|
||||
bIsStatic = true;
|
||||
bExplosionProof = true;
|
||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||
break;
|
||||
case COLDAMAGE_EFFECT_CHANGE_THEN_SMASH:
|
||||
if (!bRenderDamaged) {
|
||||
bRenderDamaged = true;
|
||||
}
|
||||
else {
|
||||
bIsVisible = false;
|
||||
bUsesCollision = false;
|
||||
bIsStatic = true;
|
||||
bExplosionProof = true;
|
||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
break;
|
||||
case COLDAMAGE_EFFECT_SMASH_CARDBOX_COMPLETELY: {
|
||||
bIsVisible = false;
|
||||
bUsesCollision = false;
|
||||
bIsStatic = true;
|
||||
bExplosionProof = true;
|
||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||
const RwRGBA color = { 96, 48, 0, 255 };
|
||||
for (int32 i = 0; i < 25; i++) {
|
||||
CVector vecDir(CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(0.1f, 0.15f) + fDirectionZ);
|
||||
++nFrameGen;
|
||||
int32 currentFrame = nFrameGen & 3;
|
||||
float fRandom = CGeneral::GetRandomNumberInRange(0.01f, 1.0f);
|
||||
RwRGBA randomColor = { color.red * fRandom, color.green * fRandom , color.blue, color.alpha };
|
||||
float fSize = CGeneral::GetRandomNumberInRange(0.02f, 0.18f);
|
||||
int32 nRotationSpeed = CGeneral::GetRandomNumberInRange(-40, 80);
|
||||
CParticle::AddParticle(PARTICLE_CAR_DEBRIS, vecPos, vecDir, nil, fSize, randomColor, nRotationSpeed, 0, currentFrame, 0);
|
||||
}
|
||||
PlayOneShotScriptObject(_SCRSOUND_CARDBOARD_BOX_SMASH, vecPos);
|
||||
break;
|
||||
}
|
||||
case COLDAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY: {
|
||||
bIsVisible = false;
|
||||
bUsesCollision = false;
|
||||
bIsStatic = true;
|
||||
bExplosionProof = true;
|
||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||
const RwRGBA color = { 128, 128, 128, 255 };
|
||||
for (int32 i = 0; i < 45; i++) {
|
||||
CVector vecDir(CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(0.1f, 0.15f) + fDirectionZ);
|
||||
++nFrameGen;
|
||||
int32 currentFrame = nFrameGen & 3;
|
||||
float fRandom = CGeneral::GetRandomNumberInRange(0.5f, 0.5f);
|
||||
RwRGBA randomColor = { color.red * fRandom, color.green * fRandom , color.blue * fRandom, color.alpha };
|
||||
float fSize = CGeneral::GetRandomNumberInRange(0.02f, 0.18f);
|
||||
int32 nRotationSpeed = CGeneral::GetRandomNumberInRange(-40, 80);
|
||||
CParticle::AddParticle(PARTICLE_CAR_DEBRIS, vecPos, vecDir, nil, fSize, randomColor, nRotationSpeed, 0, currentFrame, 0);
|
||||
}
|
||||
PlayOneShotScriptObject(_SCRSOUND_WOODEN_BOX_SMASH, vecPos);
|
||||
break;
|
||||
}
|
||||
case COLDAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY: {
|
||||
bIsVisible = false;
|
||||
bUsesCollision = false;
|
||||
bIsStatic = true;
|
||||
bExplosionProof = true;
|
||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||
const RwRGBA color1 = { 200, 0, 0, 255 };
|
||||
const RwRGBA color2 = { 200, 200, 200, 255 };
|
||||
for (int32 i = 0; i < 10; i++) {
|
||||
CVector vecDir(CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(0.1f, 0.15f) + fDirectionZ);
|
||||
++nFrameGen;
|
||||
int32 currentFrame = nFrameGen & 3;
|
||||
RwRGBA color = color2;
|
||||
if (nFrameGen & 1)
|
||||
color = color1;
|
||||
float fSize = CGeneral::GetRandomNumberInRange(0.02f, 0.18f);
|
||||
int32 nRotationSpeed = CGeneral::GetRandomNumberInRange(-40, 80);
|
||||
CParticle::AddParticle(PARTICLE_CAR_DEBRIS, vecPos, vecDir, nil, fSize, color, nRotationSpeed, 0, currentFrame, 0);
|
||||
}
|
||||
PlayOneShotScriptObject(_SCRSOUND_TYRE_BUMP, vecPos);
|
||||
break;
|
||||
}
|
||||
case COLDAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY: {
|
||||
bIsVisible = false;
|
||||
bUsesCollision = false;
|
||||
bIsStatic = true;
|
||||
bExplosionProof = true;
|
||||
SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||
SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
||||
const RwRGBA color1 = { 200, 0, 0, 255 };
|
||||
const RwRGBA color2 = { 200, 200, 200, 255 };
|
||||
for (int32 i = 0; i < 32; i++) {
|
||||
CVector vecDir(CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(-0.35f, 0.7f),
|
||||
CGeneral::GetRandomNumberInRange(0.1f, 0.15f) + fDirectionZ);
|
||||
++nFrameGen;
|
||||
int32 currentFrame = nFrameGen & 3;
|
||||
RwRGBA color = color2;
|
||||
if (nFrameGen & 1)
|
||||
color = color1;
|
||||
float fSize = CGeneral::GetRandomNumberInRange(0.02f, 0.18f);
|
||||
int32 nRotationSpeed = CGeneral::GetRandomNumberInRange(-40, 80);
|
||||
CParticle::AddParticle(PARTICLE_CAR_DEBRIS, vecPos, vecDir, nil, fSize, color, nRotationSpeed, 0, currentFrame, 0);
|
||||
}
|
||||
PlayOneShotScriptObject(_SCRSOUND_COL_CAR, vecPos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CObject::RefModelInfo(int32 modelId)
|
||||
@ -125,6 +306,39 @@ CObject::RefModelInfo(int32 modelId)
|
||||
CModelInfo::GetModelInfo(modelId)->AddRef();
|
||||
}
|
||||
|
||||
void
|
||||
CObject::Init(void)
|
||||
{
|
||||
m_type = ENTITY_TYPE_OBJECT;;
|
||||
CObjectData::SetObjectData(m_modelIndex, *this);
|
||||
m_nEndOfLifeTime = 0;
|
||||
ObjectCreatedBy = GAME_OBJECT;
|
||||
bIsStatic = true;
|
||||
bIsPickup = false;
|
||||
m_obj_flag2 = false;
|
||||
bOutOfStock = false;
|
||||
bGlassCracked = false;
|
||||
bGlassBroken = false;
|
||||
bHasBeenDamaged = false;
|
||||
bUseVehicleColours = false;
|
||||
m_nRefModelIndex = -1;
|
||||
m_colour1 = 0;
|
||||
m_colour2 = 0;
|
||||
m_nBonusValue = 0;
|
||||
m_pCollidingEntity = nil;
|
||||
CColPoint point;
|
||||
CEntity* outEntity = nil;
|
||||
const CVector& vecPos = m_matrix.GetPosition();
|
||||
if (CWorld::ProcessVerticalLine(vecPos, vecPos.z - 10.0f, point, outEntity, true, false, false, false, false, false, nil))
|
||||
m_pCurSurface = outEntity;
|
||||
else
|
||||
m_pCurSurface = nil;
|
||||
if (m_modelIndex == MI_BODYCAST)
|
||||
nBodyCastHealth = 1000;
|
||||
else if (m_modelIndex == MI_BUOY)
|
||||
bTouchingWater = true;
|
||||
}
|
||||
|
||||
bool
|
||||
CObject::CanBeDeleted(void)
|
||||
{
|
||||
@ -142,6 +356,45 @@ CObject::CanBeDeleted(void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CObject::DeleteAllMissionObjects()
|
||||
{
|
||||
CObjectPool* objectPool = CPools::GetObjectPool();
|
||||
for (int32 i = 0; i < objectPool->GetSize(); i++) {
|
||||
CObject* pObject = objectPool->GetSlot(i);
|
||||
if (pObject && pObject->ObjectCreatedBy == MISSION_OBJECT) {
|
||||
CWorld::Remove(pObject);
|
||||
delete pObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CObject::DeleteAllTempObjects()
|
||||
{
|
||||
CObjectPool* objectPool = CPools::GetObjectPool();
|
||||
for (int32 i = 0; i < objectPool->GetSize(); i++) {
|
||||
CObject* pObject = objectPool->GetSlot(i);
|
||||
if (pObject && pObject->ObjectCreatedBy == TEMP_OBJECT) {
|
||||
CWorld::Remove(pObject);
|
||||
delete pObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CObject::DeleteAllTempObjectInArea(CVector point, float fRadius)
|
||||
{
|
||||
CObjectPool *objectPool = CPools::GetObjectPool();
|
||||
for (int32 i = 0; i < objectPool->GetSize(); i++) {
|
||||
CObject *pObject = objectPool->GetSlot(i);
|
||||
if (pObject && pObject->ObjectCreatedBy == TEMP_OBJECT && fRadius * fRadius > pObject->GetPosition().MagnitudeSqr()) {
|
||||
CWorld::Remove(pObject);
|
||||
delete pObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <new>
|
||||
|
||||
class CObject_ : public CObject
|
||||
@ -152,6 +405,9 @@ public:
|
||||
CObject *ctor(CDummyObject *dummy) { return ::new (this) CObject(dummy); }
|
||||
void dtor(void) { CObject::~CObject(); }
|
||||
void Render_(void) { CObject::Render(); }
|
||||
void ProcessControl_(void) { CObject::ProcessControl(); }
|
||||
bool SetupLighting_(void) { return CObject::SetupLighting(); }
|
||||
void RemoveLighting_(bool reset) { CObject::RemoveLighting(reset); }
|
||||
};
|
||||
|
||||
STARTPATCHES
|
||||
@ -159,5 +415,16 @@ STARTPATCHES
|
||||
InjectHook(0x4BACE0, (CObject* (CObject::*)(int32, bool)) &CObject_::ctor, PATCH_JUMP);
|
||||
InjectHook(0x4BAD50, (CObject* (CObject::*)(CDummyObject*)) &CObject_::ctor, PATCH_JUMP);
|
||||
InjectHook(0x4BAE00, &CObject_::dtor, PATCH_JUMP);
|
||||
InjectHook(0x4BB040, &CObject_::ProcessControl_, PATCH_JUMP);
|
||||
InjectHook(0x4BBDA0, &CObject::Teleport, PATCH_JUMP);
|
||||
InjectHook(0x4BB1E0, &CObject_::Render_, PATCH_JUMP);
|
||||
InjectHook(0x4A7C90, &CObject_::SetupLighting_, PATCH_JUMP);
|
||||
InjectHook(0x4A7CD0, &CObject_::RemoveLighting_, PATCH_JUMP);
|
||||
InjectHook(0x4BB240, &CObject::ObjectDamage, PATCH_JUMP);
|
||||
InjectHook(0x4BBD80, &CObject::RefModelInfo, PATCH_JUMP);
|
||||
InjectHook(0x4BAEC0, &CObject::Init, PATCH_JUMP);
|
||||
InjectHook(0x4BB010, &CObject::CanBeDeleted, PATCH_JUMP);
|
||||
InjectHook(0x4BBE60, &CObject::DeleteAllMissionObjects, PATCH_JUMP);
|
||||
InjectHook(0x4BBDF0, &CObject::DeleteAllTempObjects, PATCH_JUMP);
|
||||
InjectHook(0x4BBED0, &CObject::DeleteAllTempObjectInArea, PATCH_JUMP);
|
||||
ENDPATCHES
|
||||
|
@ -3,12 +3,25 @@
|
||||
#include "Physical.h"
|
||||
|
||||
enum {
|
||||
UNKNOWN_OBJECT = 0,
|
||||
GAME_OBJECT = 1,
|
||||
MISSION_OBJECT = 2,
|
||||
TEMP_OBJECT = 3,
|
||||
CUTSCENE_OBJECT = 4,
|
||||
};
|
||||
|
||||
enum {
|
||||
COLDAMAGE_EFFECT_NONE = 0,
|
||||
COLDAMAGE_EFFECT_CHANGE_MODEL = 1,
|
||||
COLDAMAGE_EFFECT_SPLIT_MODEL = 2,
|
||||
COLDAMAGE_EFFECT_SMASH_COMPLETELY = 3,
|
||||
COLDAMAGE_EFFECT_CHANGE_THEN_SMASH = 4,
|
||||
COLDAMAGE_EFFECT_SMASH_CARDBOX_COMPLETELY = 50,
|
||||
COLDAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY = 60,
|
||||
COLDAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY = 70,
|
||||
COLDAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY = 80,
|
||||
};
|
||||
|
||||
enum {
|
||||
COLLRESPONSE_NONE,
|
||||
COLLRESPONSE_CHANGE_MODEL,
|
||||
@ -41,21 +54,21 @@ public:
|
||||
int8 bHasBeenDamaged : 1;
|
||||
int8 bUseVehicleColours : 1;
|
||||
int8 m_obj_flag80 : 1;
|
||||
int8 field_172; // car for a bonus pickup?
|
||||
int8 field_173;
|
||||
int8 m_nBonusValue;
|
||||
int8 field_173;
|
||||
float m_fCollisionDamageMultiplier;
|
||||
uint8 m_nCollisionDamageEffect;
|
||||
uint8 m_nSpecialCollisionResponseCases;
|
||||
bool m_bCameraToAvoidThisObject;
|
||||
int8 field_17B;
|
||||
int8 field_17C;
|
||||
int8 field_17D;
|
||||
int8 field_17E;
|
||||
int8 field_17F;
|
||||
int8 field_17B;
|
||||
int8 field_17C;
|
||||
int8 field_17D;
|
||||
int8 field_17E;
|
||||
int8 field_17F;
|
||||
uint32 m_nEndOfLifeTime;
|
||||
int16 m_nRefModelIndex;
|
||||
int8 field_186;
|
||||
int8 field_187;
|
||||
int8 field_186;
|
||||
int8 field_187;
|
||||
CEntity *m_pCurSurface;
|
||||
CEntity *m_pCollidingEntity;
|
||||
int8 m_colour1, m_colour2;
|
||||
@ -74,7 +87,7 @@ public:
|
||||
~CObject(void);
|
||||
|
||||
void ProcessControl(void);
|
||||
void Teleport(CVector);
|
||||
void Teleport(CVector vecPos);
|
||||
void Render(void);
|
||||
bool SetupLighting(void);
|
||||
void RemoveLighting(bool reset);
|
||||
@ -84,6 +97,8 @@ public:
|
||||
void Init(void);
|
||||
bool CanBeDeleted(void);
|
||||
|
||||
static void DeleteAllTempObjectInArea(CVector, float);
|
||||
static void DeleteAllMissionObjects();
|
||||
static void DeleteAllTempObjects();
|
||||
static void DeleteAllTempObjectInArea(CVector point, float fRadius);
|
||||
};
|
||||
static_assert(sizeof(CObject) == 0x198, "CObject: error");
|
||||
|
@ -28,10 +28,8 @@ CCivilianPed::CivilianAI(void)
|
||||
return;
|
||||
|
||||
if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS) {
|
||||
if (m_pedInObjective) {
|
||||
if (m_pedInObjective->IsPlayer())
|
||||
return;
|
||||
}
|
||||
if (m_pedInObjective && m_pedInObjective->IsPlayer())
|
||||
return;
|
||||
}
|
||||
if (CTimer::GetTimeInMilliseconds() <= m_lookTimer)
|
||||
return;
|
||||
@ -75,7 +73,7 @@ CCivilianPed::CivilianAI(void)
|
||||
} else {
|
||||
SetMoveState(PEDMOVE_WALK);
|
||||
}
|
||||
} else if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops) {
|
||||
} else if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops != 0) {
|
||||
SetFindPathAndFlee(m_threatEntity, 5000);
|
||||
if (threatDistSqr < sq(10.0f)) {
|
||||
SetMoveState(PEDMOVE_RUN);
|
||||
@ -170,8 +168,8 @@ CCivilianPed::CivilianAI(void)
|
||||
if (m_threatEntity && m_threatEntity->IsPed()) {
|
||||
CPed *threatPed = (CPed*)m_threatEntity;
|
||||
if (m_pedStats->m_fear <= 100 - threatPed->m_pedStats->m_temper && threatPed->m_nPedType != PEDTYPE_COP) {
|
||||
if (threatPed->GetWeapon()->IsTypeMelee() || !GetWeapon()->IsTypeMelee()) {
|
||||
if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops) {
|
||||
if (threatPed->GetWeapon(m_currentWeapon).IsTypeMelee() || !GetWeapon()->IsTypeMelee()) {
|
||||
if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops != 0) {
|
||||
if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS) {
|
||||
SetFindPathAndFlee(m_threatEntity, 10000);
|
||||
}
|
||||
|
@ -15027,7 +15027,7 @@ CPed::ProcessBuoyancy(void)
|
||||
#endif
|
||||
|
||||
if (mod_Buoyancy.ProcessBuoyancy(this, GRAVITY * m_fMass * buoyancyLevel, &buoyancyPoint, &buoyancyImpulse)) {
|
||||
m_flagD8 = true;
|
||||
bTouchingWater = true;
|
||||
CEntity *entity;
|
||||
CColPoint point;
|
||||
if (CWorld::ProcessVerticalLine(GetPosition(), GetPosition().z - 3.0f, point, entity, false, true, false, false, false, false, false)
|
||||
@ -15093,7 +15093,7 @@ CPed::ProcessBuoyancy(void)
|
||||
} else
|
||||
return;
|
||||
} else
|
||||
m_flagD8 = false;
|
||||
bTouchingWater = false;
|
||||
|
||||
if (nGenerateWaterCircles && CTimer::GetTimeInMilliseconds() >= nGenerateWaterCircles) {
|
||||
CVector pos = GetPosition();
|
||||
|
@ -967,7 +967,7 @@ CPopulation::ConvertToRealObject(CDummyObject *dummy)
|
||||
} else if (obj->m_modelIndex == MI_BUOY) {
|
||||
obj->bIsStatic = false;
|
||||
obj->m_vecMoveSpeed = CVector(0.0f, 0.0f, -0.001f);
|
||||
obj->m_flagD8 = true;
|
||||
obj->bTouchingWater = true;
|
||||
obj->AddToMovingList();
|
||||
}
|
||||
}
|
||||
|
@ -21,54 +21,52 @@
|
||||
#include "User.h"
|
||||
#include "World.h"
|
||||
|
||||
wchar *CHud::m_HelpMessage = (wchar*)0x86B888;
|
||||
wchar *CHud::m_LastHelpMessage = (wchar*)0x6E8F28;
|
||||
int32 &CHud::m_HelpMessageState = *(int32*)0x880E1C;
|
||||
int32 &CHud::m_HelpMessageTimer = *(int32*)0x880FA4;
|
||||
int32 &CHud::m_HelpMessageFadeTimer = *(int32*)0x8F6258;
|
||||
wchar *CHud::m_HelpMessageToPrint = (wchar*)0x664480;
|
||||
float &CHud::m_HelpMessageDisplayTime = *(float*)0x8E2C28;
|
||||
float &CHud::m_fTextBoxNumLines = *(float*)0x8E2C28;
|
||||
float &CHud::m_fHelpMessageTime = *(float *)0x8E2C28;
|
||||
bool &CHud::m_HelpMessageQuick = *(bool *)0x95CCF7;
|
||||
int32 CHud::m_ZoneState = *(int32*)0x8F29AC;
|
||||
wchar CHud::m_HelpMessage[256]; // = (wchar*)0x86B888;
|
||||
wchar CHud::m_LastHelpMessage[256]; // = (wchar*)0x6E8F28;
|
||||
uint32 CHud::m_HelpMessageState; // = *(int32*)0x880E1C;
|
||||
uint32 CHud::m_HelpMessageTimer; // = *(int32*)0x880FA4;
|
||||
int32 CHud::m_HelpMessageFadeTimer; // = *(int32*)0x8F6258;
|
||||
wchar CHud::m_HelpMessageToPrint[256]; // = (wchar*)0x664480;
|
||||
float CHud::m_fHelpMessageTime; // *(float *)0x8E2C28;
|
||||
bool CHud::m_HelpMessageQuick; // = *(bool*)0x95CCF7;
|
||||
uint32 CHud::m_ZoneState; // = *(int32*)0x8F29AC;
|
||||
int32 CHud::m_ZoneFadeTimer;
|
||||
int32 CHud::m_ZoneNameTimer = *(int32*)0x8F1A50;
|
||||
wchar *&CHud::m_pZoneName = *(wchar **)0x8E2C2C;
|
||||
wchar *CHud::m_pLastZoneName = (wchar*)0x8F432C;
|
||||
uint32 CHud::m_ZoneNameTimer; // = *(int32*)0x8F1A50;
|
||||
wchar *CHud::m_pZoneName; // = *(wchar**)0x8E2C2C;
|
||||
wchar *CHud::m_pLastZoneName; // = (wchar*)0x8F432C;
|
||||
wchar *CHud::m_ZoneToPrint;
|
||||
int32 CHud::m_VehicleState = *(int32*)0x940560;
|
||||
uint32 CHud::m_VehicleState; // = *(int32*)0x940560;
|
||||
int32 CHud::m_VehicleFadeTimer;
|
||||
int32 CHud::m_VehicleNameTimer = *(int32*)0x8F2A14;
|
||||
wchar *&CHud::m_VehicleName = *(wchar **)0x942FB4;
|
||||
wchar *CHud::m_pLastVehicleName = *(wchar **)0x8E2DD8;
|
||||
uint32 CHud::m_VehicleNameTimer; // = *(int32*)0x8F2A14;
|
||||
wchar *CHud::m_VehicleName; // = *(wchar**)0x942FB4;
|
||||
wchar *CHud::m_pLastVehicleName; // = *(wchar**)0x8E2DD8;
|
||||
wchar *CHud::m_pVehicleNameToPrint;
|
||||
wchar *CHud::m_Message = (wchar*)0x72E318;
|
||||
wchar *CHud::m_PagerMessage = (wchar*)0x878840;
|
||||
bool &CHud::m_Wants_To_Draw_Hud = *(bool*)0x95CD89;
|
||||
bool &CHud::m_Wants_To_Draw_3dMarkers = *(bool*)0x95CD62;
|
||||
wchar(&CHud::m_BigMessage)[6][128] = *(wchar(*)[6][128])*(uintptr*)0x664CE0;
|
||||
int16 &CHud::m_ItemToFlash = *(int16*)0x95CC82;
|
||||
wchar CHud::m_Message[256];// = (wchar*)0x72E318;
|
||||
wchar CHud::m_PagerMessage[256]; // = (wchar*)0x878840;
|
||||
bool CHud::m_Wants_To_Draw_Hud; // (bool*)0x95CD89;
|
||||
bool CHud::m_Wants_To_Draw_3dMarkers; // = *(bool*)0x95CD62;
|
||||
wchar CHud::m_BigMessage[6][128]; // = *(wchar(*)[6][128]) * (uintptr*)0x664CE0;
|
||||
int16 CHud::m_ItemToFlash; // = *(int16*)0x95CC82;
|
||||
|
||||
// These aren't really in CHud
|
||||
float CHud::BigMessageInUse[6];
|
||||
float CHud::BigMessageAlpha[6];
|
||||
float CHud::BigMessageX[6];
|
||||
float &CHud::OddJob2OffTimer = *(float*)0x942FA0;
|
||||
int8 &CHud::CounterOnLastFrame = *(int8*)0x95CD67;
|
||||
float &CHud::OddJob2XOffset = *(float*)0x8F1B5C;
|
||||
int16 &CHud::CounterFlashTimer = *(int16*)0x95CC20;
|
||||
int16 &CHud::OddJob2Timer = *(int16*)0x95CC52;
|
||||
int8 &CHud::TimerOnLastFrame = *(int8*)0x95CDA7;
|
||||
int16 &CHud::OddJob2On = *(int16*)0x95CC78;
|
||||
int16 &CHud::TimerFlashTimer = *(int16*)0x95CC6C;
|
||||
int16 &CHud::PagerSoundPlayed = *(int16*)0x95CC4A;
|
||||
int32 &CHud::SpriteBrightness = *(int32*)0x95CC54;
|
||||
float &CHud::PagerXOffset = *(float*)0x941590;
|
||||
int16 &CHud::PagerTimer = *(int16*)0x95CC3A;
|
||||
int16 &CHud::PagerOn = *(int16*)0x95CCA0;
|
||||
float CHud::OddJob2OffTimer; // = *(float*)0x942FA0;
|
||||
bool CHud::CounterOnLastFrame; // = *(int8*)0x95CD67;
|
||||
float CHud::OddJob2XOffset; // = *(float*)0x8F1B5C;
|
||||
uint16 CHud::CounterFlashTimer; // = *(int16*)0x95CC20;
|
||||
uint16 CHud::OddJob2Timer; // = *(int16*)0x95CC52;
|
||||
bool CHud::TimerOnLastFrame; //= *(int8*)0x95CDA7;
|
||||
int16 CHud::OddJob2On; //= *(int16*)0x95CC78;
|
||||
uint16 CHud::TimerFlashTimer; //= *(int16*)0x95CC6C;
|
||||
int16 CHud::PagerSoundPlayed; //= *(int16*)0x95CC4A;
|
||||
int32 CHud::SpriteBrightness; //= *(int32*)0x95CC54;
|
||||
float CHud::PagerXOffset; //= *(float*)0x941590;
|
||||
int16 CHud::PagerTimer; //= *(int16*)0x95CC3A;
|
||||
int16 CHud::PagerOn; //= *(int16*)0x95CCA0;
|
||||
|
||||
CSprite2d *CHud::Sprites = (CSprite2d*)0x95CB9C;
|
||||
CSprite2d CHud::Sprites[NUM_HUD_SPRITES]; // = (CSprite2d*)0x95CB9C;
|
||||
|
||||
struct
|
||||
{
|
||||
@ -90,14 +88,14 @@ struct
|
||||
{"detonator", "detonator_mask"},
|
||||
{"", ""},
|
||||
{"", ""},
|
||||
{"radardisc", "radardiscm"},
|
||||
{"radardisc", "radardisc"},
|
||||
{"pager", "pagerm"},
|
||||
{"", ""},
|
||||
{"", ""},
|
||||
{"bleeder", ""},
|
||||
{"sitesniper", "sitesniperm"},
|
||||
{"siteM16", "siteM16m"},
|
||||
{"siterocket", "siterocketm"}
|
||||
{"siterocket", "siterocket"}
|
||||
};
|
||||
|
||||
RwTexture *&gpSniperSightTex = *(RwTexture**)0x8F5834;
|
||||
@ -415,7 +413,7 @@ void CHud::Draw()
|
||||
DrawZoneName
|
||||
*/
|
||||
if (m_pZoneName) {
|
||||
float fZoneAlpha = 0.0f;
|
||||
float fZoneAlpha = 255.0f;
|
||||
|
||||
if (m_pZoneName != m_pLastZoneName) {
|
||||
switch (m_ZoneState) {
|
||||
@ -429,7 +427,7 @@ void CHud::Draw()
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
m_ZoneNameTimer = 0;
|
||||
m_ZoneNameTimer = 5;
|
||||
m_ZoneState = 4;
|
||||
break;
|
||||
default:
|
||||
@ -441,6 +439,7 @@ void CHud::Draw()
|
||||
if (m_ZoneState) {
|
||||
switch (m_ZoneState) {
|
||||
case 1:
|
||||
m_ZoneFadeTimer = 1000;
|
||||
if (m_ZoneNameTimer > 10000) {
|
||||
m_ZoneFadeTimer = 1000;
|
||||
m_ZoneState = 3;
|
||||
@ -468,7 +467,6 @@ void CHud::Draw()
|
||||
if (m_ZoneFadeTimer < 0) {
|
||||
m_ZoneFadeTimer = 0;
|
||||
m_ZoneToPrint = m_pLastZoneName;
|
||||
m_ZoneNameTimer = 0;
|
||||
m_ZoneState = 2;
|
||||
}
|
||||
fZoneAlpha = m_ZoneFadeTimer * 0.001f * 255.0f;
|
||||
@ -500,12 +498,6 @@ void CHud::Draw()
|
||||
}
|
||||
}
|
||||
}
|
||||
/*else {
|
||||
m_pLastZoneName = nil;
|
||||
m_ZoneState = 0;
|
||||
m_ZoneFadeTimer = 0;
|
||||
m_ZoneNameTimer = 0;
|
||||
}*/
|
||||
|
||||
/*
|
||||
DrawVehicleName
|
||||
@ -633,9 +625,9 @@ void CHud::Draw()
|
||||
wchar sTimer[16];
|
||||
|
||||
if (!CUserDisplay::OnscnTimer.m_sEntries[0].m_bTimerProcessed)
|
||||
TimerOnLastFrame = 0;
|
||||
TimerOnLastFrame = false;
|
||||
if (!CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterProcessed)
|
||||
CounterOnLastFrame = 0;
|
||||
CounterOnLastFrame = false;
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
#define TIMER_RIGHT_OFFSET 34.0f // Taken from VC frenzy timer
|
||||
@ -647,7 +639,7 @@ void CHud::Draw()
|
||||
if (!TimerOnLastFrame)
|
||||
TimerFlashTimer = 1;
|
||||
|
||||
TimerOnLastFrame = 1;
|
||||
TimerOnLastFrame = true;
|
||||
|
||||
if (TimerFlashTimer) {
|
||||
if (++TimerFlashTimer > 50)
|
||||
@ -685,7 +677,7 @@ void CHud::Draw()
|
||||
if (!CounterOnLastFrame)
|
||||
CounterFlashTimer = 1;
|
||||
|
||||
CounterOnLastFrame = 1;
|
||||
CounterOnLastFrame = true;
|
||||
|
||||
if (CounterFlashTimer) {
|
||||
if (++CounterFlashTimer > 50)
|
||||
@ -739,11 +731,9 @@ void CHud::Draw()
|
||||
/*
|
||||
DrawPager
|
||||
*/
|
||||
if (!m_PagerMessage[0]) {
|
||||
if (PagerOn == 1) {
|
||||
PagerSoundPlayed = false;
|
||||
PagerOn = 2;
|
||||
}
|
||||
if (!m_PagerMessage[0] && PagerOn == 1) {
|
||||
PagerSoundPlayed = false;
|
||||
PagerOn = 2;
|
||||
}
|
||||
if (m_PagerMessage[0] || PagerOn == 2) {
|
||||
if (!PagerOn) {
|
||||
@ -752,7 +742,7 @@ void CHud::Draw()
|
||||
}
|
||||
if (PagerOn == 1) {
|
||||
if (PagerXOffset > 0.0f) {
|
||||
float fStep = PagerXOffset * 0.05f;
|
||||
float fStep = PagerXOffset * 0.1f;
|
||||
if (fStep > 10.0f)
|
||||
fStep = 10.0f;
|
||||
PagerXOffset -= fStep * CTimer::GetTimeStep();
|
||||
@ -763,10 +753,10 @@ void CHud::Draw()
|
||||
}
|
||||
}
|
||||
else if (PagerOn == 2) {
|
||||
float fStep = PagerXOffset * 0.05f;
|
||||
float fStep = PagerXOffset * 0.1f;
|
||||
if (fStep < 2.0f)
|
||||
fStep = 2.0f;
|
||||
PagerXOffset += fStep * CTimer::GetTimeStep();
|
||||
PagerXOffset += fStep;
|
||||
if (PagerXOffset > 150.0f) {
|
||||
PagerXOffset = 150.0f;
|
||||
PagerOn = 0;
|
||||
@ -815,9 +805,7 @@ void CHud::Draw()
|
||||
DrawScriptText
|
||||
*/
|
||||
if (!CTimer::GetIsUserPaused()) {
|
||||
intro_text_line* IntroText = CTheScripts::IntroTextLines;
|
||||
|
||||
for (int i = 0; i < MAX_NUM_INTRO_TEXT_LINES; i++) {
|
||||
for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroTextLines); i++) {
|
||||
if (CTheScripts::IntroTextLines[i].m_Text[0] && CTheScripts::IntroTextLines[i].m_bTextBeforeFade) {
|
||||
CFont::SetScale(SCREEN_SCALE_X(CTheScripts::IntroTextLines[i].m_fScaleX), SCREEN_SCALE_Y(CTheScripts::IntroTextLines[i].m_fScaleY * 0.5f));
|
||||
CFont::SetColor(CTheScripts::IntroTextLines[i].m_sColor);
|
||||
@ -858,31 +846,31 @@ void CHud::Draw()
|
||||
CFont::SetPropOff();
|
||||
|
||||
CFont::SetFontStyle(CTheScripts::IntroTextLines[i].m_nFont);
|
||||
CFont::PrintString(SCREEN_SCALE_X(640.0f - CTheScripts::IntroTextLines[i].m_fAtX), SCREEN_SCALE_Y(448.0f - CTheScripts::IntroTextLines[i].m_fAtY), IntroText->m_Text);
|
||||
CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - CTheScripts::IntroTextLines[i].m_fAtX), SCREEN_SCALE_Y(DEFAULT_SCREEN_HEIGHT - CTheScripts::IntroTextLines[i].m_fAtY), CTheScripts::IntroTextLines[i].m_Text);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroRectangles); i++) {
|
||||
intro_script_rectangle &IntroRect = CTheScripts::IntroRectangles[i];
|
||||
|
||||
intro_script_rectangle* IntroRect = CTheScripts::IntroRectangles;
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (CTheScripts::IntroRectangles[i].m_bIsUsed && CTheScripts::IntroRectangles[i].m_bBeforeFade) {
|
||||
if (CTheScripts::IntroRectangles[i].m_nTextureId >= 0) {
|
||||
// Yeah, top and bottom changed place. R* vision
|
||||
if (IntroRect.m_bIsUsed && IntroRect.m_bBeforeFade) {
|
||||
if (IntroRect.m_nTextureId >= 0) {
|
||||
CRect rect = {
|
||||
CTheScripts::IntroRectangles[i].m_sRect.left,
|
||||
CTheScripts::IntroRectangles[i].m_sRect.bottom,
|
||||
CTheScripts::IntroRectangles[i].m_sRect.right,
|
||||
CTheScripts::IntroRectangles[i].m_sRect.bottom };
|
||||
IntroRect.m_sRect.left,
|
||||
IntroRect.m_sRect.top,
|
||||
IntroRect.m_sRect.right,
|
||||
IntroRect.m_sRect.bottom };
|
||||
|
||||
CTheScripts::ScriptSprites[CTheScripts::IntroRectangles[i].m_nTextureId].Draw(rect, IntroRect->m_sColor);
|
||||
CTheScripts::ScriptSprites[IntroRect.m_nTextureId].Draw(rect, IntroRect.m_sColor);
|
||||
}
|
||||
else {
|
||||
CRect rect = {
|
||||
CTheScripts::IntroRectangles[i].m_sRect.left,
|
||||
CTheScripts::IntroRectangles[i].m_sRect.bottom,
|
||||
CTheScripts::IntroRectangles[i].m_sRect.right,
|
||||
CTheScripts::IntroRectangles[i].m_sRect.bottom };
|
||||
IntroRect.m_sRect.left,
|
||||
IntroRect.m_sRect.top,
|
||||
IntroRect.m_sRect.right,
|
||||
IntroRect.m_sRect.bottom };
|
||||
|
||||
CSprite2d::DrawRect(rect, IntroRect->m_sColor);
|
||||
CSprite2d::DrawRect(rect, IntroRect.m_sColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -928,7 +916,7 @@ void CHud::Draw()
|
||||
CFont::SetCentreSize(SCREEN_SCALE_X(615.0f));
|
||||
CFont::SetFontStyle(FONT_HEADING);
|
||||
|
||||
if (BigMessageX[0] >= (SCREEN_WIDTH - 20)) {
|
||||
if (BigMessageX[0] >= SCREEN_SCALE_FROM_RIGHT(20.0f)) {
|
||||
BigMessageInUse[0] += CTimer::GetTimeStep();
|
||||
|
||||
if (BigMessageInUse[0] >= 120.0f) {
|
||||
@ -945,7 +933,7 @@ void CHud::Draw()
|
||||
BigMessageX[0] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
||||
BigMessageAlpha[0] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
||||
|
||||
if (BigMessageAlpha[0] >= 255.0f)
|
||||
if (BigMessageAlpha[0] > 255.0f)
|
||||
BigMessageAlpha[0] = 255.0f;
|
||||
}
|
||||
|
||||
@ -989,7 +977,7 @@ void CHud::Draw()
|
||||
CFont::SetFontStyle(FONT_HEADING);
|
||||
|
||||
CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[2]));
|
||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f + 4.0f), SCREEN_SCALE_FROM_BOTTOM(78.0f), m_BigMessage[2]);
|
||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f - 4.0f), SCREEN_SCALE_FROM_BOTTOM(78.0f), m_BigMessage[2]);
|
||||
|
||||
CFont::SetColor(CRGBA(170, 123, 87, BigMessageAlpha[2]));
|
||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(82.0f), m_BigMessage[2]);
|
||||
@ -1018,7 +1006,7 @@ void CHud::DrawAfterFade()
|
||||
m_HelpMessageState = 2;
|
||||
m_HelpMessageTimer = 0;
|
||||
CMessages::WideStringCopy(m_HelpMessageToPrint, m_HelpMessage, 256);
|
||||
m_HelpMessageDisplayTime = CMessages::GetWideStringLength(m_HelpMessage) * 0.05f + 3.0f;
|
||||
m_fHelpMessageTime = CMessages::GetWideStringLength(m_HelpMessage) * 0.05f + 3.0f;
|
||||
|
||||
if (TheCamera.m_ScreenReductionPercentage == 0.0f)
|
||||
DMAudio.PlayFrontEndSound(SOUND_A0, 0);
|
||||
@ -1036,14 +1024,14 @@ void CHud::DrawAfterFade()
|
||||
CMessages::WideStringCopy(m_LastHelpMessage, m_HelpMessage, 256);
|
||||
}
|
||||
|
||||
float fAlpha = 255.0f;
|
||||
float fAlpha = 225.0f;
|
||||
|
||||
if (m_HelpMessageState) {
|
||||
if (m_HelpMessageState != 0) {
|
||||
switch (m_HelpMessageState) {
|
||||
case 1:
|
||||
fAlpha = 255.0f;
|
||||
fAlpha = 225.0f;
|
||||
m_HelpMessageFadeTimer = 600;
|
||||
if (m_HelpMessageTimer > m_fHelpMessageTime * 1000 || m_HelpMessageQuick && m_HelpMessageTimer > 1500) {
|
||||
if (m_HelpMessageTimer > m_fHelpMessageTime * 1000.0f || m_HelpMessageQuick && m_HelpMessageTimer > 1500.0f) {
|
||||
m_HelpMessageFadeTimer = 600;
|
||||
m_HelpMessageState = 3;
|
||||
}
|
||||
@ -1054,24 +1042,24 @@ void CHud::DrawAfterFade()
|
||||
m_HelpMessageState = 1;
|
||||
m_HelpMessageFadeTimer = 0;
|
||||
}
|
||||
fAlpha = m_HelpMessageFadeTimer * 0.001f * 255.0f;
|
||||
fAlpha = m_HelpMessageFadeTimer * 0.001f * 225.0f;
|
||||
break;
|
||||
case 3:
|
||||
m_HelpMessageFadeTimer -= 2 * CTimer::GetTimeStepInMilliseconds();
|
||||
if (m_HelpMessageFadeTimer >= 0) {
|
||||
if (m_HelpMessageFadeTimer < 0) {
|
||||
m_HelpMessageState = 0;
|
||||
m_HelpMessageFadeTimer = 0;
|
||||
}
|
||||
fAlpha = m_HelpMessageFadeTimer * 0.001f * 255.0f;
|
||||
fAlpha = m_HelpMessageFadeTimer * 0.001f * 225.0f;
|
||||
break;
|
||||
case 4:
|
||||
m_HelpMessageFadeTimer -= 2 * CTimer::GetTimeStepInMilliseconds();
|
||||
if (m_HelpMessageFadeTimer >= 0) {
|
||||
if (m_HelpMessageFadeTimer < 0) {
|
||||
m_HelpMessageState = 2;
|
||||
m_HelpMessageFadeTimer = 0;
|
||||
CMessages::WideStringCopy(m_HelpMessageToPrint, m_LastHelpMessage, 400);
|
||||
CMessages::WideStringCopy(m_HelpMessageToPrint, m_LastHelpMessage, 256);
|
||||
}
|
||||
fAlpha = m_HelpMessageFadeTimer * 0.001f * 255.0f;
|
||||
fAlpha = m_HelpMessageFadeTimer * 0.001f * 225.0f;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -1088,19 +1076,75 @@ void CHud::DrawAfterFade()
|
||||
else
|
||||
CFont::SetScale(SCREEN_SCALE_X(0.52f), SCREEN_SCALE_Y(1.1f));
|
||||
|
||||
CFont::SetColor(CRGBA(175, 175, 175, 255));
|
||||
CFont::SetJustifyOff();
|
||||
CFont::SetWrapx(SCREEN_SCALE_X(200.0f + 26.0f - 4.0f));
|
||||
CFont::SetFontStyle(FONT_BANK);
|
||||
CFont::SetBackgroundOn();
|
||||
CFont::SetBackGroundOnlyTextOff();
|
||||
CFont::SetBackgroundColor(CRGBA(0, 0, 0, fAlpha * 0.8f));
|
||||
CFont::SetColor(CRGBA(175, 175, 175, 255));
|
||||
CFont::SetBackgroundColor(CRGBA(0, 0, 0, fAlpha * 0.9f));
|
||||
CFont::PrintString(SCREEN_SCALE_X(26.0f), SCREEN_SCALE_Y(28.0f + (150.0f - PagerXOffset) * 0.6f), CHud::m_HelpMessageToPrint);
|
||||
CFont::SetAlphaFade(255.0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
m_HelpMessageState = 0;
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroTextLines); i++) {
|
||||
intro_text_line &line = CTheScripts::IntroTextLines[i];
|
||||
if (line.m_Text[0] != '\0' && !line.m_bTextBeforeFade) {
|
||||
CFont::SetScale(SCREEN_SCALE_X(line.m_fScaleX), SCREEN_SCALE_Y(line.m_fScaleY) / 2);
|
||||
|
||||
CFont::SetColor(line.m_sColor);
|
||||
if (line.m_bJustify)
|
||||
CFont::SetJustifyOn();
|
||||
else
|
||||
CFont::SetJustifyOff();
|
||||
|
||||
if (line.m_bRightJustify)
|
||||
CFont::SetRightJustifyOn();
|
||||
else
|
||||
CFont::SetRightJustifyOff();
|
||||
|
||||
if (line.m_bCentered)
|
||||
CFont::SetCentreOn();
|
||||
else
|
||||
CFont::SetCentreOff();
|
||||
|
||||
CFont::SetWrapx(SCREEN_SCALE_X(line.m_fWrapX));
|
||||
CFont::SetCentreSize(SCREEN_SCALE_X(line.m_fCenterSize));
|
||||
if (line.m_bBackground)
|
||||
CFont::SetBackgroundOn();
|
||||
else
|
||||
CFont::SetBackgroundOff();
|
||||
|
||||
CFont::SetBackgroundColor(line.m_sBackgroundColor);
|
||||
if (line.m_bBackgroundOnly)
|
||||
CFont::SetBackGroundOnlyTextOn();
|
||||
else
|
||||
CFont::SetBackGroundOnlyTextOff();
|
||||
|
||||
if (line.m_bTextProportional)
|
||||
CFont::SetPropOn();
|
||||
else
|
||||
CFont::SetPropOff();
|
||||
|
||||
CFont::SetFontStyle(line.m_nFont);
|
||||
CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - line.m_fAtX), SCREEN_SCALE_Y(DEFAULT_SCREEN_HEIGHT - line.m_fAtY), line.m_Text);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroRectangles); i++) {
|
||||
intro_script_rectangle &rectangle = CTheScripts::IntroRectangles[i];
|
||||
if (rectangle.m_bIsUsed && !rectangle.m_bBeforeFade) {
|
||||
|
||||
// Yeah, top and bottom changed place. R* vision
|
||||
if (rectangle.m_nTextureId >= 0) {
|
||||
CTheScripts::ScriptSprites[rectangle.m_nTextureId].Draw(CRect(rectangle.m_sRect.left, rectangle.m_sRect.bottom,
|
||||
rectangle.m_sRect.right, rectangle.m_sRect.top), rectangle.m_sColor);
|
||||
} else {
|
||||
CSprite2d::DrawRect(CRect(rectangle.m_sRect.left, rectangle.m_sRect.bottom,
|
||||
rectangle.m_sRect.right, rectangle.m_sRect.top), rectangle.m_sColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DrawBigMessage2
|
||||
@ -1142,10 +1186,9 @@ void CHud::DrawAfterFade()
|
||||
if (OddJob2OffTimer > 0)
|
||||
OddJob2OffTimer -= CTimer::GetTimeStepInMilliseconds();
|
||||
|
||||
static float fStep;
|
||||
float fStep;
|
||||
if (m_BigMessage[5][0] && OddJob2OffTimer <= 0.0f) {
|
||||
if (OddJob2On <= 3) {
|
||||
switch (OddJob2On) {
|
||||
switch (OddJob2On) {
|
||||
case 0:
|
||||
OddJob2On = 1;
|
||||
OddJob2XOffset = 380.0f;
|
||||
@ -1156,9 +1199,7 @@ void CHud::DrawAfterFade()
|
||||
OddJob2On = 2;
|
||||
}
|
||||
else {
|
||||
fStep = 40.0f;
|
||||
if ((OddJob2XOffset / 6.0f) <= 40.0f)
|
||||
fStep = OddJob2XOffset / 6.0f;
|
||||
fStep = min(40.0f, OddJob2XOffset / 6.0f);
|
||||
OddJob2XOffset = OddJob2XOffset - fStep;
|
||||
}
|
||||
break;
|
||||
@ -1169,9 +1210,7 @@ void CHud::DrawAfterFade()
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
fStep = 30.0f;
|
||||
if ((OddJob2XOffset / 5.0f) >= 30.0f)
|
||||
fStep = OddJob2XOffset / 5.0f;
|
||||
fStep = max(30.0f, OddJob2XOffset / 5.0f);
|
||||
|
||||
OddJob2XOffset = OddJob2XOffset - fStep;
|
||||
|
||||
@ -1182,7 +1221,6 @@ void CHud::DrawAfterFade()
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_BigMessage[1][0]) {
|
||||
@ -1216,10 +1254,10 @@ void CHud::DrawAfterFade()
|
||||
CFont::SetScale(SCREEN_SCALE_X(1.04f), SCREEN_SCALE_Y(1.6f));
|
||||
|
||||
CFont::SetPropOn();
|
||||
CFont::SetRightJustifyWrap(-500.0f);
|
||||
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(-500.0f));
|
||||
CFont::SetRightJustifyOn();
|
||||
CFont::SetFontStyle(FONT_HEADING);
|
||||
if (BigMessageX[1] >= (SCREEN_WIDTH - 20)) {
|
||||
if (BigMessageX[1] >= SCREEN_SCALE_FROM_RIGHT(20.0f)) {
|
||||
BigMessageInUse[1] += CTimer::GetTimeStep();
|
||||
|
||||
if (BigMessageInUse[1] >= 120.0f) {
|
||||
@ -1230,12 +1268,11 @@ void CHud::DrawAfterFade()
|
||||
m_BigMessage[1][0] = 0;
|
||||
BigMessageAlpha[1] = 0.0f;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
BigMessageX[1] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
||||
BigMessageAlpha[1] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
||||
|
||||
if (BigMessageAlpha[1] >= 255.0f)
|
||||
if (BigMessageAlpha[1] > 255.0f)
|
||||
BigMessageAlpha[1] = 255.0f;
|
||||
}
|
||||
|
||||
@ -1273,7 +1310,7 @@ void CHud::GetRidOfAllHudMessages()
|
||||
m_HelpMessageFadeTimer = 0;
|
||||
m_HelpMessageState = 0;
|
||||
m_HelpMessageQuick = 0;
|
||||
m_HelpMessageDisplayTime = 1.0f;
|
||||
m_fHelpMessageTime = 1.0f;
|
||||
m_VehicleName = nil;
|
||||
m_pLastVehicleName = nil;
|
||||
m_pVehicleNameToPrint = nil;
|
||||
@ -1303,7 +1340,7 @@ void CHud::Initialise()
|
||||
CTxdStore::PopCurrentTxd();
|
||||
CTxdStore::SetCurrentTxd(HudTXD);
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(WeaponFilenames); i++) {
|
||||
for (int i = 0; i < NUM_HUD_SPRITES; i++) {
|
||||
Sprites[i].SetTexture(WeaponFilenames[i].name, WeaponFilenames[i].mask);
|
||||
}
|
||||
|
||||
@ -1314,14 +1351,14 @@ void CHud::Initialise()
|
||||
if (gpRocketSightTex == nil)
|
||||
gpRocketSightTex = RwTextureRead("siterocket", nil);
|
||||
|
||||
CounterOnLastFrame = 0;
|
||||
CounterOnLastFrame = false;
|
||||
m_ItemToFlash = ITEM_NONE;
|
||||
OddJob2Timer = 0;
|
||||
OddJob2OffTimer = 0.0f;
|
||||
OddJob2On = 0;
|
||||
OddJob2XOffset = 0.0f;
|
||||
CounterFlashTimer = 0;
|
||||
TimerOnLastFrame = 0;
|
||||
TimerOnLastFrame = false;
|
||||
TimerFlashTimer = 0;
|
||||
SpriteBrightness = 0;
|
||||
PagerOn = 0;
|
||||
@ -1338,14 +1375,14 @@ void CHud::ReInitialise() {
|
||||
|
||||
GetRidOfAllHudMessages();
|
||||
|
||||
CounterOnLastFrame = 0;
|
||||
CounterOnLastFrame = false;
|
||||
m_ItemToFlash = ITEM_NONE;
|
||||
OddJob2Timer = 0;
|
||||
OddJob2OffTimer = 0.0f;
|
||||
OddJob2On = 0;
|
||||
OddJob2XOffset = 0.0f;
|
||||
CounterFlashTimer = 0;
|
||||
TimerOnLastFrame = 0;
|
||||
TimerOnLastFrame = false;
|
||||
TimerFlashTimer = 0;
|
||||
SpriteBrightness = 0;
|
||||
PagerOn = 0;
|
||||
@ -1435,7 +1472,7 @@ void CHud::SetZoneName(wchar *name)
|
||||
|
||||
void CHud::Shutdown()
|
||||
{
|
||||
for (int i = 0; i < ARRAY_SIZE(WeaponFilenames); ++i) {
|
||||
for (int i = 0; i < NUM_HUD_SPRITES; ++i) {
|
||||
Sprites[i].Delete();
|
||||
}
|
||||
|
||||
|
@ -27,59 +27,60 @@ enum eSprites
|
||||
HUD_RADARDISC = 15,
|
||||
HUD_PAGER = 16,
|
||||
HUD_SITESNIPER = 20,
|
||||
HUD_SITEM16 = 21
|
||||
HUD_SITEM16,
|
||||
HUD_SITEROCKET,
|
||||
NUM_HUD_SPRITES,
|
||||
};
|
||||
|
||||
class CHud
|
||||
{
|
||||
public:
|
||||
static CSprite2d *Sprites;
|
||||
static int32 &SpriteBrightness;
|
||||
static wchar *m_HelpMessage;
|
||||
static wchar *m_LastHelpMessage;
|
||||
static int32 &m_HelpMessageState;
|
||||
static int32 &m_HelpMessageTimer;
|
||||
static int32 &m_HelpMessageFadeTimer;
|
||||
static wchar *m_HelpMessageToPrint;
|
||||
static CSprite2d Sprites[NUM_HUD_SPRITES];
|
||||
static wchar m_HelpMessage[256];
|
||||
static wchar m_LastHelpMessage[256];
|
||||
static uint32 m_HelpMessageState;
|
||||
static uint32 m_HelpMessageTimer;
|
||||
static int32 m_HelpMessageFadeTimer;
|
||||
static wchar m_HelpMessageToPrint[256];
|
||||
static float &m_HelpMessageDisplayTime;
|
||||
static float &m_fTextBoxNumLines;
|
||||
static float &m_fHelpMessageTime;
|
||||
static bool &m_HelpMessageQuick;
|
||||
static int32 m_ZoneState;
|
||||
static float m_fHelpMessageTime;
|
||||
static bool m_HelpMessageQuick;
|
||||
static uint32 m_ZoneState;
|
||||
static int32 m_ZoneFadeTimer;
|
||||
static int32 m_ZoneNameTimer;
|
||||
static wchar *&m_pZoneName;
|
||||
static uint32 m_ZoneNameTimer;
|
||||
static wchar *m_pZoneName;
|
||||
static wchar *m_pLastZoneName;
|
||||
static wchar *m_ZoneToPrint;
|
||||
static wchar *&m_VehicleName;
|
||||
static wchar *m_VehicleName;
|
||||
static wchar *m_pLastVehicleName;
|
||||
static wchar *m_pVehicleNameToPrint;
|
||||
static int32 m_VehicleState;
|
||||
static uint32 m_VehicleState;
|
||||
static int32 m_VehicleFadeTimer;
|
||||
static int32 m_VehicleNameTimer;
|
||||
static wchar *m_Message;
|
||||
static wchar *m_PagerMessage;
|
||||
static bool &m_Wants_To_Draw_Hud;
|
||||
static bool &m_Wants_To_Draw_3dMarkers;
|
||||
static wchar(&m_BigMessage)[6][128];
|
||||
static int16 &m_ItemToFlash;
|
||||
static uint32 m_VehicleNameTimer;
|
||||
static wchar m_Message[256];
|
||||
static wchar m_PagerMessage[256];
|
||||
static bool m_Wants_To_Draw_Hud;
|
||||
static bool m_Wants_To_Draw_3dMarkers;
|
||||
static wchar m_BigMessage[6][128];
|
||||
static int16 m_ItemToFlash;
|
||||
|
||||
// These aren't really in CHud
|
||||
static float BigMessageInUse[6];
|
||||
static float BigMessageAlpha[6];
|
||||
static float BigMessageX[6];
|
||||
static float &OddJob2OffTimer;
|
||||
static int8 &CounterOnLastFrame;
|
||||
static float &OddJob2XOffset;
|
||||
static int16 &CounterFlashTimer;
|
||||
static int16 &OddJob2Timer;
|
||||
static int8 &TimerOnLastFrame;
|
||||
static int16 &OddJob2On;
|
||||
static int16 &TimerFlashTimer;
|
||||
static int16 &PagerSoundPlayed;
|
||||
static float &PagerXOffset;
|
||||
static int16 &PagerTimer;
|
||||
static int16 &PagerOn;
|
||||
static float OddJob2OffTimer;
|
||||
static bool CounterOnLastFrame;
|
||||
static float OddJob2XOffset;
|
||||
static uint16 CounterFlashTimer;
|
||||
static uint16 OddJob2Timer;
|
||||
static bool TimerOnLastFrame;
|
||||
static int16 OddJob2On;
|
||||
static uint16 TimerFlashTimer;
|
||||
static int16 PagerSoundPlayed;
|
||||
static int32 SpriteBrightness;
|
||||
static float PagerXOffset;
|
||||
static int16 PagerTimer;
|
||||
static int16 PagerOn;
|
||||
|
||||
public:
|
||||
static void Draw();
|
||||
|
@ -147,7 +147,11 @@ RwTexDictionaryGtaStreamRead2(RwStream *stream, RwTexDictionary *texDict)
|
||||
}
|
||||
|
||||
#ifdef GTA_PC
|
||||
#ifdef RWLIBS
|
||||
extern "C" RwInt32 _rwD3D8FindCorrectRasterFormat(RwRasterType type, RwInt32 flags);
|
||||
#else
|
||||
WRAPPER RwInt32 _rwD3D8FindCorrectRasterFormat(RwRasterType type, RwInt32 flags) { EAXJMP(0x59A350); }
|
||||
#endif
|
||||
|
||||
void
|
||||
ReadVideoCardCapsFile(uint32 &cap32, uint32 &cap24, uint32 &cap16, uint32 &cap8)
|
@ -11,7 +11,8 @@ typedef RwV3d *(*rwVectorsMultFn) (RwV3d * pointsOut,
|
||||
const RwV3d * pointsIn,
|
||||
RwInt32 numPoints,
|
||||
const RwMatrix * matrix);
|
||||
|
||||
|
||||
#ifndef RWLIBS
|
||||
|
||||
WRAPPER void _rwObjectHasFrameSetFrame(void* object, RwFrame* frame) { EAXJMP(0x5BC950); }
|
||||
WRAPPER RpAtomic* AtomicDefaultRenderCallBack(RpAtomic* atomic) { EAXJMP(0x59E690); }
|
||||
@ -412,4 +413,427 @@ WRAPPER RxNodeDefinition* RxNodeDefinitionGetAtomicEnumerateLights() { EAXJMP(0x
|
||||
WRAPPER RxNodeDefinition* RxNodeDefinitionGetMaterialScatter() { EAXJMP(0x5DDAA0); }
|
||||
WRAPPER RxNodeDefinition* RxNodeDefinitionGetLight() { EAXJMP(0x5DF040); }
|
||||
WRAPPER RxNodeDefinition* RxNodeDefinitionGetPostLight() { EAXJMP(0x5DF560); }
|
||||
WRAPPER void RxD3D8AllInOneSetRenderCallBack(RxPipelineNode* node, RxD3D8AllInOneRenderCallBack callback) { EAXJMP(0x5DFC60); }
|
||||
WRAPPER void RxD3D8AllInOneSetRenderCallBack(RxPipelineNode* node, RxD3D8AllInOneRenderCallBack callback) { EAXJMP(0x5DFC60); }
|
||||
#else
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void* _rwFrameOpen(void* instance, RwInt32 offset, RwInt32 size);
|
||||
void* _rwFrameClose(void* instance, RwInt32 offset, RwInt32 size);
|
||||
RwFrame* _rwFrameCloneAndLinkClones(RwFrame* root);
|
||||
RwFrame* _rwFramePurgeClone(RwFrame* root);
|
||||
RwBool RwFrameDirty(RwFrame const* frame);
|
||||
void _rwFrameInit(RwFrame* frame);
|
||||
RwBool _rwMatrixSetMultFn(rwMatrixMultFn multMat);
|
||||
void* _rwMatrixClose(void* instance, RwInt32 offset, RwInt32 size);
|
||||
void* _rwMatrixOpen(void* instance, RwInt32 offset, RwInt32 size);
|
||||
RwBool _rwVectorSetMultFn(rwVectorMultFn multPoint, rwVectorsMultFn multPoints, rwVectorMultFn multVector, rwVectorsMultFn multVectors);
|
||||
void* _rwVectorClose(void* instance, RwInt32 offset, RwInt32 size);
|
||||
void* _rwVectorOpen(void* instance, RwInt32 offset, RwInt32 size);
|
||||
RwBool _rwPluginRegistryOpen();
|
||||
RwBool _rwPluginRegistryClose();
|
||||
}
|
||||
|
||||
STARTPATCHES
|
||||
InjectHook(0x5BC950, &_rwObjectHasFrameSetFrame, PATCH_JUMP);
|
||||
InjectHook(0x59E690, &AtomicDefaultRenderCallBack, PATCH_JUMP);
|
||||
InjectHook(0x59E6C0, &_rpAtomicResyncInterpolatedSphere, PATCH_JUMP);
|
||||
InjectHook(0x59E800, &RpAtomicGetWorldBoundingSphere, PATCH_JUMP);
|
||||
InjectHook(0x59ED50, &RpClumpGetNumAtomics, PATCH_JUMP);
|
||||
InjectHook(0x59ED80, &RpClumpRender, PATCH_JUMP);
|
||||
InjectHook(0x59EDD0, &RpClumpForAllAtomics, PATCH_JUMP);
|
||||
InjectHook(0x59EE10, &RpClumpForAllCameras, PATCH_JUMP);
|
||||
InjectHook(0x59EE60, &RpClumpForAllLights, PATCH_JUMP);
|
||||
InjectHook(0x59EEB0, &RpAtomicCreate, PATCH_JUMP);
|
||||
InjectHook(0x59EFA0, &RpAtomicSetGeometry, PATCH_JUMP);
|
||||
InjectHook(0x59F020, &RpAtomicDestroy, PATCH_JUMP);
|
||||
InjectHook(0x59F0A0, &RpAtomicClone, PATCH_JUMP);
|
||||
InjectHook(0x59F1B0, &RpClumpClone, PATCH_JUMP);
|
||||
InjectHook(0x59F490, &RpClumpCreate, PATCH_JUMP);
|
||||
InjectHook(0x59F500, &RpClumpDestroy, PATCH_JUMP);
|
||||
InjectHook(0x59F680, &RpClumpAddAtomic, PATCH_JUMP);
|
||||
InjectHook(0x59F6B0, &RpClumpRemoveAtomic, PATCH_JUMP);
|
||||
InjectHook(0x59F6E0, &RpClumpRemoveLight, PATCH_JUMP);
|
||||
InjectHook(0x59FC50, &RpClumpStreamRead, PATCH_JUMP);
|
||||
InjectHook(0x5A0510, &RpAtomicRegisterPlugin, PATCH_JUMP);
|
||||
InjectHook(0x5A0540, &RpClumpRegisterPlugin, PATCH_JUMP);
|
||||
InjectHook(0x5A0570, &RpAtomicRegisterPluginStream, PATCH_JUMP);
|
||||
InjectHook(0x5A05A0, &RpAtomicSetStreamAlwaysCallBack, PATCH_JUMP);
|
||||
InjectHook(0x5A05C0, &RpAtomicSetStreamRightsCallBack, PATCH_JUMP);
|
||||
InjectHook(0x5A05E0, &RpAtomicGetPluginOffset, PATCH_JUMP);
|
||||
InjectHook(0x5A0600, &RpAtomicSetFrame, PATCH_JUMP);
|
||||
InjectHook(0x5A0DC0, &RwEngineRegisterPlugin, PATCH_JUMP);
|
||||
InjectHook(0x5A0DF0, &RwEngineGetPluginOffset, PATCH_JUMP);
|
||||
InjectHook(0x5A0E10, &RwEngineGetNumSubSystems, PATCH_JUMP);
|
||||
InjectHook(0x5A0E40, &RwEngineGetSubSystemInfo, PATCH_JUMP);
|
||||
InjectHook(0x5A0E70, &RwEngineGetCurrentSubSystem, PATCH_JUMP);
|
||||
InjectHook(0x5A0EA0, &RwEngineSetSubSystem, PATCH_JUMP);
|
||||
InjectHook(0x5A0ED0, &RwEngineGetNumVideoModes, PATCH_JUMP);
|
||||
InjectHook(0x5A0F00, &RwEngineGetVideoModeInfo, PATCH_JUMP);
|
||||
InjectHook(0x5A0F30, &RwEngineGetCurrentVideoMode, PATCH_JUMP);
|
||||
InjectHook(0x5A0F60, &RwEngineSetVideoMode, PATCH_JUMP);
|
||||
InjectHook(0x5A0F90, &RwEngineStop, PATCH_JUMP);
|
||||
InjectHook(0x5A0FE0, &RwEngineStart, PATCH_JUMP);
|
||||
InjectHook(0x5A1070, &RwEngineClose, PATCH_JUMP);
|
||||
InjectHook(0x5A10E0, &RwEngineOpen, PATCH_JUMP);
|
||||
InjectHook(0x5A1290, &RwEngineTerm, PATCH_JUMP);
|
||||
InjectHook(0x5A12D0, &RwEngineInit, PATCH_JUMP);
|
||||
InjectHook(0x5A15E0, &_rwFrameOpen, PATCH_JUMP);
|
||||
InjectHook(0x5A1650, &_rwFrameClose, PATCH_JUMP);
|
||||
InjectHook(0x5A1690, &_rwFrameCloneAndLinkClones, PATCH_JUMP);
|
||||
InjectHook(0x5A1880, &_rwFramePurgeClone, PATCH_JUMP);
|
||||
InjectHook(0x5A1930, &RwFrameDirty, PATCH_JUMP);
|
||||
InjectHook(0x5A1950, &_rwFrameInit, PATCH_JUMP);
|
||||
InjectHook(0x5A1A00, &RwFrameCreate, PATCH_JUMP);
|
||||
InjectHook(0x5A1A30, &RwFrameDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5A1BF0, &RwFrameDestroyHierarchy, PATCH_JUMP);
|
||||
InjectHook(0x5A1C60, &RwFrameUpdateObjects, PATCH_JUMP);
|
||||
InjectHook(0x5A1CE0, &RwFrameGetLTM, PATCH_JUMP);
|
||||
InjectHook(0x5A1D00, &RwFrameAddChild, PATCH_JUMP);
|
||||
InjectHook(0x5A1ED0, &RwFrameRemoveChild, PATCH_JUMP);
|
||||
InjectHook(0x5A1FC0, &RwFrameForAllChildren, PATCH_JUMP);
|
||||
InjectHook(0x5A2000, &RwFrameTranslate, PATCH_JUMP);
|
||||
InjectHook(0x5A20A0, &RwFrameScale, PATCH_JUMP);
|
||||
InjectHook(0x5A2140, &RwFrameTransform, PATCH_JUMP);
|
||||
InjectHook(0x5A21E0, &RwFrameRotate, PATCH_JUMP);
|
||||
InjectHook(0x5A2280, &RwFrameSetIdentity, PATCH_JUMP);
|
||||
InjectHook(0x5A2340, &RwFrameForAllObjects, PATCH_JUMP);
|
||||
InjectHook(0x5A2380, &RwFrameRegisterPlugin, PATCH_JUMP);
|
||||
InjectHook(0x5A23B0, &_rwMatrixSetMultFn, PATCH_JUMP);
|
||||
InjectHook(0x5A2520, &_rwMatrixDeterminant, PATCH_JUMP);
|
||||
InjectHook(0x5A2570, &_rwMatrixOrthogonalError, PATCH_JUMP);
|
||||
InjectHook(0x5A25D0, &_rwMatrixNormalError, PATCH_JUMP);
|
||||
InjectHook(0x5A2660, &_rwMatrixIdentityError, PATCH_JUMP);
|
||||
InjectHook(0x5A2730, &_rwMatrixClose, PATCH_JUMP);
|
||||
InjectHook(0x5A2770, &_rwMatrixOpen, PATCH_JUMP);
|
||||
InjectHook(0x5A2820, &RwMatrixOptimize, PATCH_JUMP);
|
||||
InjectHook(0x5A28E0, &RwMatrixUpdate, PATCH_JUMP);
|
||||
InjectHook(0x5A28F0, &RwMatrixMultiply, PATCH_JUMP);
|
||||
InjectHook(0x5A2960, &RwMatrixRotateOneMinusCosineSine, PATCH_JUMP);
|
||||
InjectHook(0x5A2BF0, &RwMatrixRotate, PATCH_JUMP);
|
||||
InjectHook(0x5A2C90, &RwMatrixInvert, PATCH_JUMP);
|
||||
InjectHook(0x5A2EE0, &RwMatrixScale, PATCH_JUMP);
|
||||
InjectHook(0x5A3070, &RwMatrixTranslate, PATCH_JUMP);
|
||||
InjectHook(0x5A31C0, &RwMatrixTransform, PATCH_JUMP);
|
||||
InjectHook(0x5A3300, &RwMatrixDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5A3330, &RwMatrixCreate, PATCH_JUMP);
|
||||
InjectHook(0x5A3450, &_rwVectorSetMultFn, PATCH_JUMP);
|
||||
InjectHook(0x5A3600, &_rwV3dNormalize, PATCH_JUMP);
|
||||
InjectHook(0x5A36A0, &RwV3dLength, PATCH_JUMP);
|
||||
InjectHook(0x5A3710, &_rwSqrt, PATCH_JUMP);
|
||||
InjectHook(0x5A3770, &_rwInvSqrt, PATCH_JUMP);
|
||||
InjectHook(0x5A37D0, &RwV3dTransformPoints, PATCH_JUMP);
|
||||
InjectHook(0x5A37E0, &RwV3dTransformVectors, PATCH_JUMP);
|
||||
InjectHook(0x5A37F0, &_rwVectorClose, PATCH_JUMP);
|
||||
InjectHook(0x5A3860, &_rwVectorOpen, PATCH_JUMP);
|
||||
InjectHook(0x5A3AD0, &RwStreamRead, PATCH_JUMP);
|
||||
InjectHook(0x5A3C30, &RwStreamWrite, PATCH_JUMP);
|
||||
InjectHook(0x5A3DF0, &RwStreamSkip, PATCH_JUMP);
|
||||
InjectHook(0x5A3F10, &RwStreamClose, PATCH_JUMP);
|
||||
InjectHook(0x5A3FE0, &RwStreamOpen, PATCH_JUMP);
|
||||
InjectHook(0x5A43A0, &RwIm2DGetNearScreenZ, PATCH_JUMP);
|
||||
InjectHook(0x5A43B0, &RwIm2DGetFarScreenZ, PATCH_JUMP);
|
||||
InjectHook(0x5A43C0, &RwRenderStateSet, PATCH_JUMP);
|
||||
InjectHook(0x5A4410, &RwRenderStateGet, PATCH_JUMP);
|
||||
InjectHook(0x5A4420, &RwIm2DRenderLine, PATCH_JUMP);
|
||||
InjectHook(0x5A4430, &RwIm2DRenderPrimitive, PATCH_JUMP);
|
||||
InjectHook(0x5A4440, &RwIm2DRenderIndexedPrimitive, PATCH_JUMP);
|
||||
InjectHook(0x5A5020, &RwCameraEndUpdate, PATCH_JUMP);
|
||||
InjectHook(0x5A5030, &RwCameraBeginUpdate, PATCH_JUMP);
|
||||
InjectHook(0x5A5040, &RwCameraSetViewOffset, PATCH_JUMP);
|
||||
InjectHook(0x5A5070, &RwCameraSetNearClipPlane, PATCH_JUMP);
|
||||
InjectHook(0x5A5140, &RwCameraSetFarClipPlane, PATCH_JUMP);
|
||||
InjectHook(0x5A5170, &RwCameraFrustumTestSphere, PATCH_JUMP);
|
||||
InjectHook(0x5A51E0, &RwCameraClear, PATCH_JUMP);
|
||||
InjectHook(0x5A5210, &RwCameraShowRaster, PATCH_JUMP);
|
||||
InjectHook(0x5A5240, &RwCameraSetProjection, PATCH_JUMP);
|
||||
InjectHook(0x5A52B0, &RwCameraSetViewWindow, PATCH_JUMP);
|
||||
InjectHook(0x5A52F0, &RwCameraRegisterPlugin, PATCH_JUMP);
|
||||
InjectHook(0x5A5320, &RwCameraDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5A5360, &RwCameraCreate, PATCH_JUMP);
|
||||
InjectHook(0x5A7100, &RwTextureSetMipmapping, PATCH_JUMP);
|
||||
InjectHook(0x5A7120, &RwTextureGetMipmapping, PATCH_JUMP);
|
||||
InjectHook(0x5A7130, &RwTextureSetAutoMipmapping, PATCH_JUMP);
|
||||
InjectHook(0x5A7150, &RwTextureGetAutoMipmapping, PATCH_JUMP);
|
||||
InjectHook(0x5A7160, &RwTexDictionaryCreate, PATCH_JUMP);
|
||||
InjectHook(0x5A7200, &RwTexDictionaryDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5A7290, &RwTexDictionaryForAllTextures, PATCH_JUMP);
|
||||
InjectHook(0x5A72D0, &RwTextureCreate, PATCH_JUMP);
|
||||
InjectHook(0x5A7330, &RwTextureDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5A73B0, &RwTextureSetName, PATCH_JUMP);
|
||||
InjectHook(0x5A7420, &RwTextureSetMaskName, PATCH_JUMP);
|
||||
InjectHook(0x5A7490, &RwTexDictionaryAddTexture, PATCH_JUMP);
|
||||
InjectHook(0x5A74D0, &RwTexDictionaryFindNamedTexture, PATCH_JUMP);
|
||||
InjectHook(0x5A7550, &RwTexDictionarySetCurrent, PATCH_JUMP);
|
||||
InjectHook(0x5A7570, &RwTexDictionaryGetCurrent, PATCH_JUMP);
|
||||
InjectHook(0x5A7580, &RwTextureRead, PATCH_JUMP);
|
||||
InjectHook(0x5A7780, &RwTextureRasterGenerateMipmaps, PATCH_JUMP);
|
||||
InjectHook(0x5A9120, &RwImageCreate, PATCH_JUMP);
|
||||
InjectHook(0x5A9180, &RwImageDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5A91E0, &RwImageAllocatePixels, PATCH_JUMP);
|
||||
InjectHook(0x5A92A0, &RwImageFreePixels, PATCH_JUMP);
|
||||
InjectHook(0x5A92D0, &RwImageMakeMask, PATCH_JUMP);
|
||||
InjectHook(0x5A93A0, &RwImageApplyMask, PATCH_JUMP);
|
||||
InjectHook(0x5A9750, &RwImageSetPath, PATCH_JUMP);
|
||||
InjectHook(0x5A9810, &RwImageRead, PATCH_JUMP);
|
||||
InjectHook(0x5A9B40, &RwImageFindFileType, PATCH_JUMP);
|
||||
InjectHook(0x5A9C10, &RwImageReadMaskedImage, PATCH_JUMP);
|
||||
InjectHook(0x5A9F50, &RwImageCopy, PATCH_JUMP);
|
||||
InjectHook(0x5AA130, &RwImageGammaCorrect, PATCH_JUMP);
|
||||
InjectHook(0x5AA2C0, &RwImageSetGamma, PATCH_JUMP);
|
||||
InjectHook(0x5AA4E0, &_rwStreamWriteVersionedChunkHeader, PATCH_JUMP);
|
||||
InjectHook(0x5AA540, &RwStreamFindChunk, PATCH_JUMP);
|
||||
InjectHook(0x5AA640, &RwMemLittleEndian32, PATCH_JUMP);
|
||||
InjectHook(0x5AA650, &RwMemNative32, PATCH_JUMP);
|
||||
InjectHook(0x5AA660, &RwMemFloat32ToReal, PATCH_JUMP);
|
||||
InjectHook(0x5AA680, &RwStreamWriteReal, PATCH_JUMP);
|
||||
InjectHook(0x5AA720, &RwStreamWriteInt32, PATCH_JUMP);
|
||||
InjectHook(0x5AA740, &RwStreamReadReal, PATCH_JUMP);
|
||||
InjectHook(0x5AA7B0, &RwStreamReadInt32, PATCH_JUMP);
|
||||
InjectHook(0x5AA800, &RwTextureStreamGetSize, PATCH_JUMP);
|
||||
InjectHook(0x5AA870, &RwTextureStreamWrite, PATCH_JUMP);
|
||||
InjectHook(0x5AAA40, &RwTextureStreamRead, PATCH_JUMP);
|
||||
InjectHook(0x5AB020, &RwTexDictionaryStreamWrite, PATCH_JUMP);
|
||||
InjectHook(0x5AC890, &RpMorphTargetCalcBoundingSphere, PATCH_JUMP);
|
||||
InjectHook(0x5AC9A0, &RpGeometryAddMorphTargets, PATCH_JUMP);
|
||||
InjectHook(0x5ACB60, &RpGeometryTriangleSetVertexIndices, PATCH_JUMP);
|
||||
InjectHook(0x5ACB90, &RpGeometryTriangleSetMaterial, PATCH_JUMP);
|
||||
InjectHook(0x5ACBF0, &RpGeometryForAllMaterials, PATCH_JUMP);
|
||||
InjectHook(0x5ACC30, &RpGeometryLock, PATCH_JUMP);
|
||||
InjectHook(0x5ACC60, &RpGeometryUnlock, PATCH_JUMP);
|
||||
InjectHook(0x5ACD10, &RpGeometryCreate, PATCH_JUMP);
|
||||
InjectHook(0x5ACF40, &_rpGeometryAddRef, PATCH_JUMP);
|
||||
InjectHook(0x5ACF50, &RpGeometryDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5ACFF0, &RpGeometryRegisterPlugin, PATCH_JUMP);
|
||||
InjectHook(0x5AD020, &RpGeometryRegisterPluginStream, PATCH_JUMP);
|
||||
InjectHook(0x5AD050, &RpGeometryStreamRead, PATCH_JUMP);
|
||||
InjectHook(0x5AD6D0, &RwRasterGetCurrentContext, PATCH_JUMP);
|
||||
InjectHook(0x5AD6F0, &RwRasterUnlock, PATCH_JUMP);
|
||||
InjectHook(0x5AD710, &RwRasterRenderFast, PATCH_JUMP);
|
||||
InjectHook(0x5AD750, &RwRasterUnlockPalette, PATCH_JUMP);
|
||||
InjectHook(0x5AD780, &RwRasterDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5AD7C0, &RwRasterPushContext, PATCH_JUMP);
|
||||
InjectHook(0x5AD810, &RwRasterRegisterPlugin, PATCH_JUMP);
|
||||
InjectHook(0x5AD840, &RwRasterLockPalette, PATCH_JUMP);
|
||||
InjectHook(0x5AD870, &RwRasterPopContext, PATCH_JUMP);
|
||||
InjectHook(0x5AD8C0, &RwRasterGetNumLevels, PATCH_JUMP);
|
||||
InjectHook(0x5AD900, &RwRasterShowRaster, PATCH_JUMP);
|
||||
InjectHook(0x5AD930, &RwRasterCreate, PATCH_JUMP);
|
||||
InjectHook(0x5AD9D0, &RwRasterLock, PATCH_JUMP);
|
||||
InjectHook(0x5ADC30, &RpMaterialCreate, PATCH_JUMP);
|
||||
InjectHook(0x5ADCB0, &RpMaterialDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5ADD10, &RpMaterialSetTexture, PATCH_JUMP);
|
||||
InjectHook(0x5ADD40, &RpMaterialRegisterPlugin, PATCH_JUMP);
|
||||
InjectHook(0x5ADD70, &RpMaterialRegisterPluginStream, PATCH_JUMP);
|
||||
InjectHook(0x5ADDA0, &RpMaterialStreamRead, PATCH_JUMP);
|
||||
InjectHook(0x5AE0B0, &_rpSectorDefaultRenderCallBack, PATCH_JUMP);
|
||||
InjectHook(0x5AE100, &_rpWorldForAllGlobalLights, PATCH_JUMP);
|
||||
InjectHook(0x5AE150, &_rpWorldSectorForAllLocalLights, PATCH_JUMP);
|
||||
InjectHook(0x5AE190, &RpWorldUnlock, PATCH_JUMP);
|
||||
InjectHook(0x5AE2B0, &RpWorldSectorGetWorld, PATCH_JUMP);
|
||||
InjectHook(0x5AE340, &RpWorldDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5AE6A0, &RpWorldCreate, PATCH_JUMP);
|
||||
InjectHook(0x5AEA40, &RpWorldRegisterPlugin, PATCH_JUMP);
|
||||
InjectHook(0x5AEA70, &RpWorldRegisterPluginStream, PATCH_JUMP);
|
||||
InjectHook(0x5AEAA0, &RpWorldPluginAttach, PATCH_JUMP);
|
||||
InjectHook(0x5AFB80, &RpWorldAddCamera, PATCH_JUMP);
|
||||
InjectHook(0x5AFBB0, &RpWorldRemoveCamera, PATCH_JUMP);
|
||||
InjectHook(0x5AFC10, &RpAtomicGetWorld, PATCH_JUMP);
|
||||
InjectHook(0x5AFC20, &RpWorldAddClump, PATCH_JUMP);
|
||||
InjectHook(0x5AFDA0, &RpWorldAddLight, PATCH_JUMP);
|
||||
InjectHook(0x5AFDF0, &RpWorldRemoveLight, PATCH_JUMP);
|
||||
InjectHook(0x5AFE70, &RtBMPImageRead, PATCH_JUMP);
|
||||
InjectHook(0x5B07D0, &RpSkinPluginAttach, PATCH_JUMP);
|
||||
InjectHook(0x5B1050, &RpSkinAtomicSetHAnimHierarchy, PATCH_JUMP);
|
||||
InjectHook(0x5B1070, &RpSkinAtomicGetHAnimHierarchy, PATCH_JUMP);
|
||||
InjectHook(0x5B1080, &RpSkinGeometryGetSkin, PATCH_JUMP);
|
||||
InjectHook(0x5B1090, &RpSkinGeometrySetSkin, PATCH_JUMP);
|
||||
InjectHook(0x5B10D0, &RpSkinGetSkinToBoneMatrices, PATCH_JUMP);
|
||||
InjectHook(0x5B10E0, &RpHAnimHierarchyCreate, PATCH_JUMP);
|
||||
InjectHook(0x5B11F0, &RpHAnimFrameGetHierarchy, PATCH_JUMP);
|
||||
InjectHook(0x5B1200, &RpHAnimHierarchySetCurrentAnim, PATCH_JUMP);
|
||||
InjectHook(0x5B12B0, &RpHAnimHierarchySubAnimTime, PATCH_JUMP);
|
||||
InjectHook(0x5B1480, &RpHAnimHierarchyAddAnimTime, PATCH_JUMP);
|
||||
InjectHook(0x5B1780, &RpHAnimHierarchyUpdateMatrices, PATCH_JUMP);
|
||||
InjectHook(0x5B1C10, &RpHAnimAnimationStreamRead, PATCH_JUMP);
|
||||
InjectHook(0x5B1D50, &RpHAnimPluginAttach, PATCH_JUMP);
|
||||
InjectHook(0x5B2640, &RpMatFXPluginAttach, PATCH_JUMP);
|
||||
InjectHook(0x5B3750, &RpMatFXAtomicEnableEffects, PATCH_JUMP);
|
||||
InjectHook(0x5B3780, &RpMatFXMaterialSetEffects, PATCH_JUMP);
|
||||
InjectHook(0x5B38D0, &RpMatFXMaterialSetupEnvMap, PATCH_JUMP);
|
||||
InjectHook(0x5B3A40, &RpMatFXMaterialSetBumpMapTexture, PATCH_JUMP);
|
||||
InjectHook(0x5B3CF0, &RwD3D8SetRenderState, PATCH_JUMP);
|
||||
InjectHook(0x5B3D40, &RwD3D8GetRenderState, PATCH_JUMP);
|
||||
InjectHook(0x5B3D60, &RwD3D8SetTextureStageState, PATCH_JUMP);
|
||||
InjectHook(0x5B53A0, &RwD3D8SetTexture, PATCH_JUMP);
|
||||
InjectHook(0x5B6720, &RwIm3DTransform, PATCH_JUMP);
|
||||
InjectHook(0x5B67F0, &RwIm3DEnd, PATCH_JUMP);
|
||||
InjectHook(0x5B6820, &RwIm3DRenderIndexedPrimitive, PATCH_JUMP);
|
||||
InjectHook(0x5B6980, &RwIm3DRenderLine, PATCH_JUMP);
|
||||
InjectHook(0x5B6A50, &RwIm3DSetTransformPipeline, PATCH_JUMP);
|
||||
InjectHook(0x5B6AC0, &RwIm3DSetRenderPipeline, PATCH_JUMP);
|
||||
InjectHook(0x5B95D0, &RwD3D8EngineSetRefreshRate, PATCH_JUMP);
|
||||
InjectHook(0x5B9640, &RwD3D8CameraAttachWindow, PATCH_JUMP);
|
||||
InjectHook(0x5BAEB0, &RwD3D8DeviceSupportsDXTTexture, PATCH_JUMP);
|
||||
InjectHook(0x5BAF90, &RwD3D8SetVertexShader, PATCH_JUMP);
|
||||
InjectHook(0x5BAFD0, &RwD3D8SetPixelShader, PATCH_JUMP);
|
||||
InjectHook(0x5BB010, &RwD3D8SetStreamSource, PATCH_JUMP);
|
||||
InjectHook(0x5BB060, &RwD3D8SetIndices, PATCH_JUMP);
|
||||
InjectHook(0x5BB0B0, &RwD3D8DrawIndexedPrimitive, PATCH_JUMP);
|
||||
InjectHook(0x5BB140, &RwD3D8DrawPrimitive, PATCH_JUMP);
|
||||
InjectHook(0x5BB1D0, &RwD3D8SetTransform, PATCH_JUMP);
|
||||
InjectHook(0x5BB310, &RwD3D8GetTransform, PATCH_JUMP);
|
||||
InjectHook(0x5BB340, &RwD3D8SetTransformWorld, PATCH_JUMP);
|
||||
InjectHook(0x5BB490, &RwD3D8SetSurfaceProperties, PATCH_JUMP);
|
||||
InjectHook(0x5BB7A0, &RwD3D8SetLight, PATCH_JUMP);
|
||||
InjectHook(0x5BB890, &RwD3D8EnableLight, PATCH_JUMP);
|
||||
InjectHook(0x5BB9F0, &RwD3D8DynamicVertexBufferCreate, PATCH_JUMP);
|
||||
InjectHook(0x5BBAE0, &RwD3D8DynamicVertexBufferDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5BBB10, &RwD3D8IndexBufferCreate, PATCH_JUMP);
|
||||
InjectHook(0x5BBB40, &RwD3D8CreatePixelShader, PATCH_JUMP);
|
||||
InjectHook(0x5BBB90, &RwD3D8DeletePixelShader, PATCH_JUMP);
|
||||
InjectHook(0x5BBC00, &RwD3D8SetPixelShaderConstant, PATCH_JUMP);
|
||||
InjectHook(0x5BBC30, &RwD3D8GetCaps, PATCH_JUMP);
|
||||
InjectHook(0x5BBC40, &RwD3D8CameraIsSphereFullyInsideFrustum, PATCH_JUMP);
|
||||
InjectHook(0x5BBCA0, &RwD3D8CameraIsBBoxFullyInsideFrustum, PATCH_JUMP);
|
||||
InjectHook(0x5BBD30, &RwD3D8DynamicVertexBufferLock, PATCH_JUMP);
|
||||
InjectHook(0x5BBEB0, &RwD3D8DynamicVertexBufferUnlock, PATCH_JUMP);
|
||||
InjectHook(0x5BBED0, &_rwIntelSSEsupported, PATCH_JUMP);
|
||||
InjectHook(0x5BBF10, &RwImageSetFromRaster, PATCH_JUMP);
|
||||
InjectHook(0x5BBF50, &RwRasterSetFromImage, PATCH_JUMP);
|
||||
InjectHook(0x5BBF80, &RwImageFindRasterFormat, PATCH_JUMP);
|
||||
InjectHook(0x5BBFF0, &RwFrameRegisterPluginStream, PATCH_JUMP);
|
||||
InjectHook(0x5BC020, &_rwFrameListDeinitialize, PATCH_JUMP);
|
||||
InjectHook(0x5BC050, &_rwFrameListStreamRead, PATCH_JUMP);
|
||||
InjectHook(0x5BC300, &RpLightSetRadius, PATCH_JUMP);
|
||||
InjectHook(0x5BC320, &RpLightSetColor, PATCH_JUMP);
|
||||
InjectHook(0x5BC370, &RpLightGetConeAngle, PATCH_JUMP);
|
||||
InjectHook(0x5BC5B0, &RpLightRegisterPlugin, PATCH_JUMP);
|
||||
InjectHook(0x5BC5E0, &RpLightStreamRead, PATCH_JUMP);
|
||||
InjectHook(0x5BC780, &RpLightDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5BC7C0, &RpLightCreate, PATCH_JUMP);
|
||||
InjectHook(0x5BE280, &_rwD3D8TexDictionaryEnableRasterFormatConversion, PATCH_JUMP);
|
||||
InjectHook(0x5BF110, &RwOsGetFileInterface, PATCH_JUMP);
|
||||
InjectHook(0x5C1720, &RwFreeListDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5C1790, &RwFreeListCreate, PATCH_JUMP);
|
||||
InjectHook(0x5C19F0, &RwFreeListPurge, PATCH_JUMP);
|
||||
InjectHook(0x5C1B90, &RwFreeListPurgeAllFreeLists, PATCH_JUMP);
|
||||
InjectHook(0x5C1D40, &RwFreeListForAllUsed, PATCH_JUMP);
|
||||
InjectHook(0x5C2780, &_rxPipelineClose, PATCH_JUMP);
|
||||
InjectHook(0x5C27E0, &_rxPipelineOpen, PATCH_JUMP);
|
||||
InjectHook(0x5C2AD0, &RxHeapGetGlobalHeap, PATCH_JUMP);
|
||||
InjectHook(0x5C2AE0, &RxPacketCreate, PATCH_JUMP);
|
||||
InjectHook(0x5C2B10, &RxClusterSetExternalData, PATCH_JUMP);
|
||||
InjectHook(0x5C2B70, &RxClusterSetData, PATCH_JUMP);
|
||||
InjectHook(0x5C2BD0, &RxClusterInitializeData, PATCH_JUMP);
|
||||
InjectHook(0x5C2C40, &RxClusterResizeData, PATCH_JUMP);
|
||||
InjectHook(0x5C2C90, &RxClusterLockWrite, PATCH_JUMP);
|
||||
InjectHook(0x5C2D60, &RxPipelineExecute, PATCH_JUMP);
|
||||
InjectHook(0x5C2E00, &RxPipelineCreate, PATCH_JUMP);
|
||||
InjectHook(0x5C2E70, &_rxPipelineDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5C3080, &RwResourcesFreeResEntry, PATCH_JUMP);
|
||||
InjectHook(0x5C30F0, &_rwResourcesPurge, PATCH_JUMP);
|
||||
InjectHook(0x5C3170, &RwResourcesAllocateResEntry, PATCH_JUMP);
|
||||
InjectHook(0x5C3360, &RwResourcesEmptyArena, PATCH_JUMP);
|
||||
InjectHook(0x5C3450, &_rwPluginRegistryOpen, PATCH_JUMP);
|
||||
InjectHook(0x5C3480, &_rwPluginRegistryClose, PATCH_JUMP);
|
||||
InjectHook(0x5C3590, &_rwPluginRegistryGetPluginOffset, PATCH_JUMP);
|
||||
InjectHook(0x5C35C0, &_rwPluginRegistryAddPlugin, PATCH_JUMP);
|
||||
InjectHook(0x5C37F0, &_rwPluginRegistryInitObject, PATCH_JUMP);
|
||||
InjectHook(0x5C3850, &_rwPluginRegistryDeInitObject, PATCH_JUMP);
|
||||
InjectHook(0x5C3880, &_rwPluginRegistryCopyObject, PATCH_JUMP);
|
||||
InjectHook(0x5C3910, &RwErrorSet, PATCH_JUMP);
|
||||
InjectHook(0x5C3970, &_rwerror, PATCH_JUMP);
|
||||
InjectHook(0x5C3980, &_rwPluginRegistryAddPluginStream, PATCH_JUMP);
|
||||
InjectHook(0x5C39C0, &_rwPluginRegistryAddPlgnStrmlwysCB, PATCH_JUMP);
|
||||
InjectHook(0x5C39F0, &_rwPluginRegistryAddPlgnStrmRightsCB, PATCH_JUMP);
|
||||
InjectHook(0x5C3A20, & _rwPluginRegistryReadDataChunks, PATCH_JUMP);
|
||||
InjectHook(0x5C3B50, & _rwPluginRegistryInvokeRights, PATCH_JUMP);
|
||||
InjectHook(0x5C3BA0, &_rwPluginRegistryGetSize, PATCH_JUMP);
|
||||
InjectHook(0x5C3BE0, &_rwPluginRegistryWriteDataChunks, PATCH_JUMP);
|
||||
InjectHook(0x5C3CB0, &_rwPluginRegistrySkipDataChunks, PATCH_JUMP);
|
||||
InjectHook(0x5C3D30, &RwCameraStreamRead, PATCH_JUMP);
|
||||
InjectHook(0x5C5570, &RwBBoxCalculate, PATCH_JUMP);
|
||||
InjectHook(0x5C72B0, &RwImageResample, PATCH_JUMP);
|
||||
InjectHook(0x5C7B30, &RwImageCreateResample, PATCH_JUMP);
|
||||
InjectHook(0x5D9240, &RxRenderStateVectorSetDefaultRenderStateVector, PATCH_JUMP);
|
||||
InjectHook(0x5D9340, &RxRenderStateVectorCreate, PATCH_JUMP);
|
||||
InjectHook(0x5D9410, &RxRenderStateVectorDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5D9460, &RxRenderStateVectorLoadDriverState, PATCH_JUMP);
|
||||
InjectHook(0x5D95D0, &_rxEmbeddedPacketBetweenPipelines, PATCH_JUMP);
|
||||
InjectHook(0x5D9740, &_rxEmbeddedPacketBetweenNodes, PATCH_JUMP);
|
||||
InjectHook(0x5D9810, &_rxPacketDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5C8B10, &_rpMaterialListDeinitialize, PATCH_JUMP);
|
||||
InjectHook(0x5C8B70, &_rpMaterialListInitialize, PATCH_JUMP);
|
||||
InjectHook(0x5C8B80, &_rpMaterialListGetMaterial, PATCH_JUMP);
|
||||
InjectHook(0x5C8B90, &_rpMaterialListAppendMaterial, PATCH_JUMP);
|
||||
InjectHook(0x5C8C50, &_rpMaterialListFindMaterialIndex, PATCH_JUMP);
|
||||
InjectHook(0x5C8C80, &_rpMaterialListStreamRead, PATCH_JUMP);
|
||||
InjectHook(0x5C8FE0, &_rpMeshHeaderCreate, PATCH_JUMP);
|
||||
InjectHook(0x5C8FF0, &_rpMeshClose, PATCH_JUMP);
|
||||
InjectHook(0x5C9020, &_rpMeshOpen, PATCH_JUMP);
|
||||
InjectHook(0x5C9140, &_rpBuildMeshCreate, PATCH_JUMP);
|
||||
InjectHook(0x5C9220, &_rpBuildMeshDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5C9260, &_rpMeshDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5C92A0, &_rpBuildMeshAddTriangle, PATCH_JUMP);
|
||||
InjectHook(0x5C9380, &_rpMeshHeaderForAllMeshes, PATCH_JUMP);
|
||||
InjectHook(0x5C93C0, &_rpMeshWrite, PATCH_JUMP);
|
||||
InjectHook(0x5C9510, &_rpMeshRead, PATCH_JUMP);
|
||||
InjectHook(0x5C96E0, &_rpMeshSize, PATCH_JUMP);
|
||||
InjectHook(0x5C9730, &RpBuildMeshGenerateDefaultTriStrip, PATCH_JUMP);
|
||||
InjectHook(0x5CAE10, &_rpTriListMeshGenerate, PATCH_JUMP);
|
||||
InjectHook(0x5CB230, &_rpMeshOptimise, PATCH_JUMP);
|
||||
InjectHook(0x5CB2B0, &RpWorldSectorRegisterPlugin, PATCH_JUMP);
|
||||
InjectHook(0x5CB2E0, &RpWorldSectorRegisterPluginStream, PATCH_JUMP);
|
||||
InjectHook(0x5CB630, &RpWorldSetDefaultSectorPipeline, PATCH_JUMP);
|
||||
InjectHook(0x5CB670, &RpAtomicSetDefaultPipeline, PATCH_JUMP);
|
||||
InjectHook(0x5CDEE0, &RpHAnimStdKeyFrameToMatrix, PATCH_JUMP);
|
||||
InjectHook(0x5CE000, &RpHAnimStdKeyFrameInterpolate, PATCH_JUMP);
|
||||
InjectHook(0x5CE420, &RpHAnimStdKeyFrameBlend, PATCH_JUMP);
|
||||
InjectHook(0x5CE820, &RpHAnimStdKeyFrameStreamRead, PATCH_JUMP);
|
||||
InjectHook(0x5CE8C0, &RpHAnimStdKeyFrameStreamWrite, PATCH_JUMP);
|
||||
InjectHook(0x5CE930, &RpHAnimStdKeyFrameStreamGetSize, PATCH_JUMP);
|
||||
InjectHook(0x5CE950, &RpHAnimStdKeyFrameMulRecip, PATCH_JUMP);
|
||||
InjectHook(0x5CEAB0, &RpHAnimStdKeyFrameAdd, PATCH_JUMP);
|
||||
InjectHook(0x5D1070, &RxHeapFree, PATCH_JUMP);
|
||||
InjectHook(0x5D1260, &RxHeapAlloc, PATCH_JUMP);
|
||||
InjectHook(0x5D14D0, &RxHeapRealloc, PATCH_JUMP);
|
||||
InjectHook(0x5D1680, &_rxHeapReset, PATCH_JUMP);
|
||||
InjectHook(0x5D16F0, &RxHeapDestroy, PATCH_JUMP);
|
||||
InjectHook(0x5D1750, &RxHeapCreate, PATCH_JUMP);
|
||||
InjectHook(0x5D1EC0, &RxPipelineNodeFindOutputByName, PATCH_JUMP);
|
||||
InjectHook(0x5D1F20, &RxPipelineNodeFindInput, PATCH_JUMP);
|
||||
InjectHook(0x5D1F30, &RxPipelineNodeRequestCluster, PATCH_JUMP);
|
||||
InjectHook(0x5D1FA0, &RxLockedPipeUnlock, PATCH_JUMP);
|
||||
InjectHook(0x5D29F0, &RxPipelineLock, PATCH_JUMP);
|
||||
InjectHook(0x5D2B10, &RxPipelineFindNodeByName, PATCH_JUMP);
|
||||
InjectHook(0x5D2BA0, &RxLockedPipeAddFragment, PATCH_JUMP);
|
||||
InjectHook(0x5D2EE0, &RxLockedPipeAddPath, PATCH_JUMP);
|
||||
InjectHook(0x5D31C0, &RxNodeDefinitionGetImmRenderSetup, PATCH_JUMP);
|
||||
InjectHook(0x5D35C0, &RxNodeDefinitionGetImmMangleTriangleIndices, PATCH_JUMP);
|
||||
InjectHook(0x5D3C60, &RxNodeDefinitionGetCullTriangle, PATCH_JUMP);
|
||||
InjectHook(0x5D4F80, &RxNodeDefinitionGetClipTriangle, PATCH_JUMP);
|
||||
InjectHook(0x5D51C0, &RxNodeDefinitionGetSubmitTriangle, PATCH_JUMP);
|
||||
InjectHook(0x5D5400, &RxNodeDefinitionGetImmInstance, PATCH_JUMP);
|
||||
InjectHook(0x5D6000, &RxNodeDefinitionGetTransform, PATCH_JUMP);
|
||||
InjectHook(0x5D61C0, &RxNodeDefinitionGetImmStash, PATCH_JUMP);
|
||||
InjectHook(0x5D6470, &RxNodeDefinitionGetImmMangleLineIndices, PATCH_JUMP);
|
||||
InjectHook(0x5D7230, &RxNodeDefinitionGetClipLine, PATCH_JUMP);
|
||||
InjectHook(0x5D74C0, &RxNodeDefinitionGetSubmitLine, PATCH_JUMP);
|
||||
InjectHook(0x5D9C90, &_rwD3D8LightsOpen, PATCH_JUMP);
|
||||
InjectHook(0x5D9EF0, &_rwD3D8LightsClose, PATCH_JUMP);
|
||||
InjectHook(0x5D9F80, &_rwD3D8LightsGlobalEnable, PATCH_JUMP);
|
||||
InjectHook(0x5DA210, &_rwD3D8LightLocalEnable, PATCH_JUMP);
|
||||
InjectHook(0x5DA450, &_rwD3D8LightsEnable, PATCH_JUMP);
|
||||
InjectHook(0x5DAAC0, &RxNodeDefinitionGetD3D8WorldSectorAllInOne, PATCH_JUMP);
|
||||
InjectHook(0x5DC500, &RxNodeDefinitionGetD3D8AtomicAllInOne, PATCH_JUMP);
|
||||
InjectHook(0x5DCC50, &RxNodeDefinitionGetWorldSectorInstance, PATCH_JUMP);
|
||||
InjectHook(0x5DCD80, &RxNodeDefinitionGetWorldSectorEnumerateLights, PATCH_JUMP);
|
||||
InjectHook(0x5DD800, &RxNodeDefinitionGetAtomicInstance, PATCH_JUMP);
|
||||
InjectHook(0x5DD9B0, &RxNodeDefinitionGetAtomicEnumerateLights, PATCH_JUMP);
|
||||
InjectHook(0x5DDAA0, &RxNodeDefinitionGetMaterialScatter, PATCH_JUMP);
|
||||
InjectHook(0x5DF040, &RxNodeDefinitionGetLight, PATCH_JUMP);
|
||||
InjectHook(0x5DF560, &RxNodeDefinitionGetPostLight, PATCH_JUMP);
|
||||
InjectHook(0x5DFC60, &RxD3D8AllInOneSetRenderCallBack, PATCH_JUMP);
|
||||
ENDPATCHES
|
||||
#endif
|
@ -2814,7 +2814,7 @@ CAutomobile::ProcessBuoyancy(void)
|
||||
CVector impulse, point;
|
||||
|
||||
if(mod_Buoyancy.ProcessBuoyancy(this, m_fBuoyancy, &point, &impulse)){
|
||||
m_flagD8 = true;
|
||||
bTouchingWater = true;
|
||||
ApplyMoveForce(impulse);
|
||||
ApplyTurnForce(impulse, point);
|
||||
|
||||
@ -2899,7 +2899,7 @@ CAutomobile::ProcessBuoyancy(void)
|
||||
}
|
||||
}else{
|
||||
bIsInWater = false;
|
||||
m_flagD8 = false;
|
||||
bTouchingWater = false;
|
||||
|
||||
static RwRGBA splashCol = {155, 155, 185, 196};
|
||||
static RwRGBA smokeCol = {255, 255, 255, 255};
|
||||
|
@ -70,7 +70,7 @@ CBoat::CBoat(int mi, uint8 owner) : CVehicle(owner)
|
||||
unk1 = 0.0f;
|
||||
m_bIsAnchored = true;
|
||||
field_2C4 = -9999.99f;
|
||||
m_flagD8 = true;
|
||||
bTouchingWater = true;
|
||||
field_2CC = 0.0f;
|
||||
field_2D0 = 0;
|
||||
m_nNumWakePoints = 0;
|
||||
|
@ -26,7 +26,7 @@ cBuoyancy::ProcessBuoyancy(CPhysical *phys, float buoyancy, CVector *point, CVec
|
||||
{
|
||||
m_numSteps = 2.0f;
|
||||
|
||||
if(!CWaterLevel::GetWaterLevel(phys->GetPosition(), &m_waterlevel, phys->m_flagD8))
|
||||
if(!CWaterLevel::GetWaterLevel(phys->GetPosition(), &m_waterlevel, phys->bTouchingWater))
|
||||
return false;
|
||||
m_matrix = phys->GetMatrix();
|
||||
|
||||
|
@ -130,7 +130,8 @@ public:
|
||||
int8 m_nGettingInFlags;
|
||||
int8 m_nGettingOutFlags;
|
||||
uint8 m_nNumMaxPassengers;
|
||||
char field_1CD[19];
|
||||
char field_1CD[3];
|
||||
float field_1D0[4];
|
||||
CEntity *m_pCurGroundEntity;
|
||||
CFire *m_pCarFire;
|
||||
float m_fSteerAngle;
|
||||
|
Loading…
Reference in New Issue
Block a user