This commit is contained in:
Filip Gawin 2020-04-18 12:08:38 +02:00
commit 2b1570de70
32 changed files with 201 additions and 467 deletions

2
librw

@ -1 +1 @@
Subproject commit 7bd6d4649e575e0a2a5f046fdf0d687cea87ca84 Subproject commit 4893889621621c077690d522e7e9a10249a65a85

View File

@ -1,4 +1,4 @@
Librw = os.getenv("LIBRW") Librw = os.getenv("LIBRW") or "librw"
workspace "re3" workspace "re3"
configurations { "Debug", "Release", "ReleaseFH", "DebugRW", "ReleaseRW" } configurations { "Debug", "Release", "ReleaseFH", "DebugRW", "ReleaseRW" }
@ -54,8 +54,8 @@ workspace "re3"
filter "configurations:Debug or Release" filter "configurations:Debug or Release"
files { "src/fakerw/*.*" } files { "src/fakerw/*.*" }
includedirs { "src/fakerw" } includedirs { "src/fakerw" }
includedirs { "librw" } includedirs { Librw }
libdirs { path.join("librw", "lib/win-x86-d3d9/%{cfg.buildcfg}") } libdirs { path.join(Librw, "lib/win-x86-d3d9/%{cfg.buildcfg}") }
links { "rw", "d3d9" } links { "rw", "d3d9" }
filter {} filter {}
@ -106,31 +106,33 @@ project "re3"
defines { "DEBUG", "LIBRW", "RW_D3D9" } defines { "DEBUG", "LIBRW", "RW_D3D9" }
staticruntime "off" staticruntime "off"
symbols "Full" symbols "Full"
setpaths("$(GTA_III_RE_DIR)/", "re3.exe", "") setpaths("$(GTA_III_RE_DIR)/", "$(TargetFileName)", "")
filter "configurations:Release" filter "configurations:Release"
defines { "NDEBUG", "LIBRW", "RW_D3D9" } defines { "NDEBUG", "LIBRW", "RW_D3D9" }
optimize "On" optimize "On"
staticruntime "off" staticruntime "off"
symbols "Full" symbols "Full"
setpaths("$(GTA_III_RE_DIR)/", "re3.exe", "") setpaths("$(GTA_III_RE_DIR)/", "$(TargetFileName)", "")
filter "configurations:ReleaseFH" filter "configurations:ReleaseFH"
defines { "NDEBUG" } defines { "NDEBUG" }
symbols "Full" symbols "Full"
optimize "off" optimize "off"
staticruntime "on" staticruntime "on"
setpaths("$(GTA_III_RE_DIR)/", "re3.exe", "") setpaths("$(GTA_III_RE_DIR)/", "$(TargetFileName)", "")
filter "configurations:DebugRW" filter "configurations:DebugRW"
defines { "DEBUG" } defines { "DEBUG" }
staticruntime "on" staticruntime "on"
symbols "On" symbols "On"
setpaths("$(GTA_III_RE_DIR)/", "re3.exe", "") setpaths("$(GTA_III_RE_DIR)/", "$(TargetFileName)", "")
linkoptions "/SECTION:_rwcseg,ER!W /MERGE:_rwcseg=.text"
filter "configurations:ReleaseRW" filter "configurations:ReleaseRW"
defines { "NDEBUG" } defines { "NDEBUG" }
optimize "On" optimize "On"
staticruntime "on" staticruntime "on"
setpaths("$(GTA_III_RE_DIR)/", "re3.exe", "") setpaths("$(GTA_III_RE_DIR)/", "$(TargetFileName)", "")
linkoptions "/SECTION:_rwcseg,ER!W /MERGE:_rwcseg=.text"

View File

@ -143,28 +143,17 @@ public:
int32 m_nSampleIndex; int32 m_nSampleIndex;
uint8 m_bBankIndex; uint8 m_bBankIndex;
bool m_bIs2D; bool m_bIs2D;
uint8 field_14; // unused
uint8 field_15; // unused
int32 m_nReleasingVolumeModificator; int32 m_nReleasingVolumeModificator;
int32 m_nFrequency; int32 m_nFrequency;
uint8 m_bVolume; uint8 m_bVolume;
uint8 field_25; // unused
uint8 field_26; // unused
uint8 field_27; // unused
float m_fDistance; float m_fDistance;
int32 m_nLoopCount; int32 m_nLoopCount;
int32 m_nLoopStart; int32 m_nLoopStart;
int32 m_nLoopEnd; int32 m_nLoopEnd;
uint8 m_bEmittingVolume; uint8 m_bEmittingVolume;
uint8 field_45; // unused
uint8 field_46; // unused
uint8 field_47; // unused
float m_fSpeedMultiplier; float m_fSpeedMultiplier;
float m_fSoundIntensity; float m_fSoundIntensity;
bool m_bReleasingSoundFlag; bool m_bReleasingSoundFlag;
uint8 field_57; // unused
uint8 field_58; // unused
uint8 field_59; // unused
CVector m_vecPos; CVector m_vecPos;
bool m_bReverbFlag; bool m_bReverbFlag;
uint8 m_bLoopsRemaining; uint8 m_bLoopsRemaining;
@ -173,15 +162,8 @@ public:
int32 m_nReleasingVolumeDivider; int32 m_nReleasingVolumeDivider;
bool m_bIsProcessed; bool m_bIsProcessed;
bool m_bLoopEnded; bool m_bLoopEnded;
uint8 field_82; // unused
uint8 field_83; // unused
int32 m_nCalculatedVolume; int32 m_nCalculatedVolume;
int8 m_nVolumeChange; int8 m_nVolumeChange;
uint8 field_89; // unused
uint8 field_90; // unused
uint8 field_91; // unused
// no methods
}; };
static_assert(sizeof(tSound) == 92, "tSound: error"); static_assert(sizeof(tSound) == 92, "tSound: error");
@ -197,12 +179,8 @@ public:
bool m_bIsUsed; bool m_bIsUsed;
uint8 m_bStatus; uint8 m_bStatus;
int16 m_awAudioEvent[NUM_AUDIOENTITY_EVENTS]; int16 m_awAudioEvent[NUM_AUDIOENTITY_EVENTS];
//uint8 gap_18[2];
float m_afVolume[NUM_AUDIOENTITY_EVENTS]; float m_afVolume[NUM_AUDIOENTITY_EVENTS];
uint8 m_AudioEvents; uint8 m_AudioEvents;
uint8 field_25[3];
// no methods
}; };
static_assert(sizeof(tAudioEntity) == 40, "tAudioEntity: error"); static_assert(sizeof(tAudioEntity) == 40, "tAudioEntity: error");
@ -216,8 +194,6 @@ public:
float m_fDistance; float m_fDistance;
uint8 m_bVolume; uint8 m_bVolume;
int8 m_nProcess; int8 m_nProcess;
// no methods
}; };
static_assert(sizeof(tPedComment) == 28, "tPedComment: error"); static_assert(sizeof(tPedComment) == 28, "tPedComment: error");
@ -244,18 +220,12 @@ class cMissionAudio
public: public:
CVector m_vecPos; CVector m_vecPos;
bool m_bPredefinedProperties; bool m_bPredefinedProperties;
//uint8 gap_13[3];
int m_nSampleIndex; int m_nSampleIndex;
uint8 m_bLoadingStatus; uint8 m_bLoadingStatus;
uint8 m_bPlayStatus; uint8 m_bPlayStatus;
uint8 field_22; // todo find a name uint8 field_22; // todo find a name
uint8 field_23; // unused
int32 m_nMissionAudioCounter; int32 m_nMissionAudioCounter;
bool m_bIsPlayed; bool m_bIsPlayed;
uint8 field_29; // unused
uint8 field_30; // unused
uint8 field_31; // unused
// no methods
}; };
static_assert(sizeof(cMissionAudio) == 32, "cMissionAudio: error"); static_assert(sizeof(cMissionAudio) == 32, "cMissionAudio: error");
@ -305,17 +275,11 @@ public:
uint8 m_bActiveSamples; uint8 m_bActiveSamples;
uint8 field_4; // unused uint8 field_4; // unused
bool m_bDynamicAcousticModelingStatus; bool m_bDynamicAcousticModelingStatus;
uint8 field_6; // unused
uint8 field_7; // unused
float m_fSpeedOfSound; float m_fSpeedOfSound;
bool m_bTimerJustReset; bool m_bTimerJustReset;
uint8 field_13; // unused
uint8 field_14; // unused
uint8 field_15; // unused
int32 m_nTimer; int32 m_nTimer;
tSound m_sQueueSample; tSound m_sQueueSample;
bool m_bActiveSampleQueue; bool m_bActiveSampleQueue;
uint8 gap_109[3]; // unused
tSound m_asSamples[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS]; tSound m_asSamples[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS];
uint8 m_abSampleQueueIndexTable[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS]; uint8 m_abSampleQueueIndexTable[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS];
uint8 m_bSampleRequestQueuesStatus[NUM_SOUNDS_SAMPLES_BANKS]; uint8 m_bSampleRequestQueuesStatus[NUM_SOUNDS_SAMPLES_BANKS];
@ -341,7 +305,6 @@ public:
uint8 m_bTimeSpent; uint8 m_bTimeSpent;
uint8 m_bUserPause; uint8 m_bUserPause;
uint8 m_bPreviousUserPause; uint8 m_bPreviousUserPause;
uint8 field_19195; // unused
uint32 m_FrameCounter; uint32 m_FrameCounter;
cAudioManager(); cAudioManager();

View File

@ -6909,7 +6909,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
CVector cp3 = tmp_matrix * CVector(pColModel->boundingBox.min.x, pColModel->boundingBox.max.y, pColModel->boundingBox.min.z); CVector cp3 = tmp_matrix * CVector(pColModel->boundingBox.min.x, pColModel->boundingBox.max.y, pColModel->boundingBox.min.z);
CVector cp4 = tmp_matrix * CVector(pColModel->boundingBox.min.x, pColModel->boundingBox.min.y, pColModel->boundingBox.max.z); CVector cp4 = tmp_matrix * CVector(pColModel->boundingBox.min.x, pColModel->boundingBox.min.y, pColModel->boundingBox.max.z);
int16 collisions; int16 collisions;
CWorld::FindObjectsIntersectingAngledCollisionBox(pColModel->boundingBox, tmp_matrix, pos, CWorld::FindObjectsIntersectingAngledCollisionBox(pColModel->boundingBox, tmp_matrix, newPosition,
min(cp1.x, min(cp2.x, min(cp3.x, cp4.x))), min(cp1.x, min(cp2.x, min(cp3.x, cp4.x))),
min(cp1.y, min(cp2.y, min(cp3.y, cp4.y))), min(cp1.y, min(cp2.y, min(cp3.y, cp4.y))),
max(cp1.x, max(cp2.x, max(cp3.x, cp4.x))), max(cp1.x, max(cp2.x, max(cp3.x, cp4.x))),

View File

@ -112,20 +112,17 @@ public:
}; };
bool m_bFirstCapture; bool m_bFirstCapture;
char _pad0[3];
#ifdef __DINPUT_INCLUDED__ #ifdef __DINPUT_INCLUDED__
DIJOYSTATE2 m_OldState; DIJOYSTATE2 m_OldState;
DIJOYSTATE2 m_NewState; DIJOYSTATE2 m_NewState;
#else #else
uint8 ___padd[0x110 * 2]; uint32 ___padd[0x110 / 4 * 2];
#endif #endif
wchar m_aActionNames[MAX_CONTROLLERACTIONS][ACTIONNAME_LENGTH]; wchar m_aActionNames[MAX_CONTROLLERACTIONS][ACTIONNAME_LENGTH];
bool m_aButtonStates[MAX_BUTTONS]; bool m_aButtonStates[MAX_BUTTONS];
char _pad1[3];
tControllerConfigBind m_aSettings[MAX_CONTROLLERACTIONS][MAX_CONTROLLERTYPES]; tControllerConfigBind m_aSettings[MAX_CONTROLLERACTIONS][MAX_CONTROLLERTYPES];
bool m_aSimCheckers[MAX_SIMS][MAX_CONTROLLERTYPES]; bool m_aSimCheckers[MAX_SIMS][MAX_CONTROLLERTYPES];
bool m_bMouseAssociated; bool m_bMouseAssociated;
char _pad2[3];
CControllerConfigManager(); CControllerConfigManager();

View File

@ -118,7 +118,7 @@ const CRGBA TEXT_COLOR = CRGBA(150, 110, 30, 255);
const CRGBA TEXT_COLOR = CRGBA(235, 170, 50, 255); // PC briefs text color const CRGBA TEXT_COLOR = CRGBA(235, 170, 50, 255); // PC briefs text color
#endif #endif
const float menuXYpadding = MENUACTION_POS_Y; // *(float*)0x5F355C; // not original name const float menuXYpadding = MENUACTION_POS_Y; // TODO this is non-existant, remove it
float MENU_TEXT_SIZE_X = SMALLTEXT_X_SCALE; float MENU_TEXT_SIZE_X = SMALLTEXT_X_SCALE;
float MENU_TEXT_SIZE_Y = SMALLTEXT_Y_SCALE; float MENU_TEXT_SIZE_Y = SMALLTEXT_Y_SCALE;
@ -754,9 +754,9 @@ CMenuManager::Draw()
#ifdef FIX_BUGS #ifdef FIX_BUGS
// Label is wrapped from right by StretchX(40)px, but wrapped from left by 40px. And this is only place R* didn't use StretchX in here. // Label is wrapped from right by StretchX(40)px, but wrapped from left by 40px. And this is only place R* didn't use StretchX in here.
CFont::PrintString(MENU_X_LEFT_ALIGNED(MENU_X_MARGIN), MENU_Y(menuXYpadding), str); CFont::PrintString(MENU_X_LEFT_ALIGNED(MENU_X_MARGIN), MENU_Y(MENUACTION_POS_Y), str);
#else #else
CFont::PrintString(MENU_X_MARGIN, menuXYpadding, str); CFont::PrintString(MENU_X_MARGIN, MENUACTION_POS_Y, str);
#endif #endif
} }
@ -3181,7 +3181,7 @@ CMenuManager::PrintBriefs()
CFont::SetRightJustifyOff(); CFont::SetRightJustifyOff();
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X * 0.7), MENU_Y(MENU_TEXT_SIZE_Y * 0.9)); // second mulipliers are double, idk why CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X * 0.7), MENU_Y(MENU_TEXT_SIZE_Y * 0.9)); // second mulipliers are double, idk why
float nextY = 40.0f; float nextY = BRIEFS_TOP_MARGIN;
CRGBA newColor; CRGBA newColor;
for (int i = 4; i >= 0; i--) { for (int i = 4; i >= 0; i--) {
tPreviousBrief &brief = CMessages::PreviousBriefs[i]; tPreviousBrief &brief = CMessages::PreviousBriefs[i];
@ -3214,8 +3214,8 @@ CMenuManager::PrintBriefs()
newColor.a = FadeIn(255); newColor.a = FadeIn(255);
CFont::SetColor(newColor); CFont::SetColor(newColor);
#endif #endif
CFont::PrintString(MENU_X_LEFT_ALIGNED(50.0f), nextY, gUString); CFont::PrintString(MENU_X_LEFT_ALIGNED(BRIEFS_LINE_X), nextY, gUString);
nextY += MENU_Y(menuXYpadding); nextY += MENU_Y(BRIEFS_LINE_HEIGHT);
} }
} }
@ -3252,6 +3252,9 @@ void
CMenuManager::PrintStats() CMenuManager::PrintStats()
{ {
int rowNum = ConstructStatLine(99999); int rowNum = ConstructStatLine(99999);
#ifdef GTA3_1_1_PATCH
CFont::SetFontStyle(FONT_BANK);
#endif
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X * 0.7), MENU_Y(MENU_TEXT_SIZE_Y * 0.9)); // second mulipliers are double, idk why CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X * 0.7), MENU_Y(MENU_TEXT_SIZE_Y * 0.9)); // second mulipliers are double, idk why
float nextYChange, y, alphaMult; float nextYChange, y, alphaMult;

View File

@ -68,6 +68,10 @@
#define STATS_RATING_X 24.0f #define STATS_RATING_X 24.0f
#define STATS_RATING_Y 20.0f #define STATS_RATING_Y 20.0f
#define BRIEFS_TOP_MARGIN 40.0f
#define BRIEFS_LINE_X 50.0f
#define BRIEFS_LINE_HEIGHT 60.0f
#define CONTSETUP_STANDARD_ROW_HEIGHT 10.7f #define CONTSETUP_STANDARD_ROW_HEIGHT 10.7f
#define CONTSETUP_CLASSIC_ROW_HEIGHT 9.0f #define CONTSETUP_CLASSIC_ROW_HEIGHT 9.0f
#define CONTSETUP_BOUND_HIGHLIGHT_HEIGHT 10 #define CONTSETUP_BOUND_HIGHLIGHT_HEIGHT 10

View File

@ -155,7 +155,6 @@ public:
uint8 DisablePlayerControls; uint8 DisablePlayerControls;
int8 bApplyBrakes; int8 bApplyBrakes;
char CheatString[12]; char CheatString[12];
char _pad0[3];
int32 LastTimeTouched; int32 LastTimeTouched;
int32 AverageWeapon; int32 AverageWeapon;
int32 AverageEntries; int32 AverageEntries;

View File

@ -31,22 +31,13 @@ public:
uint32 m_nLastBumpPlayerCarTimer; uint32 m_nLastBumpPlayerCarTimer;
uint32 m_nUnusedTaxiTimer; uint32 m_nUnusedTaxiTimer;
bool m_bUnusedTaxiThing; bool m_bUnusedTaxiThing;
int8 field_197;
int8 field_198;
int8 field_199;
uint32 m_nNextSexFrequencyUpdateTime; uint32 m_nNextSexFrequencyUpdateTime;
uint32 m_nNextSexMoneyUpdateTime; uint32 m_nNextSexMoneyUpdateTime;
int32 m_nSexFrequency; int32 m_nSexFrequency;
CCivilianPed *m_pHooker; CCivilianPed *m_pHooker;
int8 m_WBState; // eWastedBustedState int8 m_WBState; // eWastedBustedState
int8 field_217;
int8 field_218;
int8 field_219;
uint32 m_nWBTime; uint32 m_nWBTime;
bool m_bInRemoteMode; bool m_bInRemoteMode;
int8 field_225;
int8 field_226;
int8 field_227;
uint32 m_nTimeLostRemoteCar; uint32 m_nTimeLostRemoteCar;
uint32 m_nTimeLastHealthLoss; uint32 m_nTimeLastHealthLoss;
uint32 m_nTimeLastArmourLoss; uint32 m_nTimeLastArmourLoss;
@ -54,8 +45,6 @@ public:
int32 m_nUpsideDownCounter; int32 m_nUpsideDownCounter;
int32 field_248; int32 field_248;
int16 m_nTrafficMultiplier; int16 m_nTrafficMultiplier;
int8 field_254;
int8 field_255;
float m_fRoadDensity; float m_fRoadDensity;
uint32 m_nPreviousTimeRewardedForExplosion; uint32 m_nPreviousTimeRewardedForExplosion;
int32 m_nExplosionsSinceLastReward; int32 m_nExplosionsSinceLastReward;
@ -90,7 +79,6 @@ public:
void FindClosestCarSectorList(CPtrList&, CPed*, float, float, float, float, float*, CVehicle**); void FindClosestCarSectorList(CPtrList&, CPed*, float, float, float, float, float*, CVehicle**);
~CPlayerInfo() { }; ~CPlayerInfo() { };
void dtor(void) { this->CPlayerInfo::~CPlayerInfo(); }
}; };
static_assert(sizeof(CPlayerInfo) == 0x13C, "CPlayerInfo: error"); static_assert(sizeof(CPlayerInfo) == 0x13C, "CPlayerInfo: error");

View File

@ -625,218 +625,113 @@ CTheZones::InitialiseAudioZoneArray(void)
} }
void void
CTheZones::SaveAllZones(uint8 *buffer, uint32 *length) CTheZones::SaveAllZones(uint8 *buffer, uint32 *size)
{ {
INITSAVEBUF
int i; int i;
*length = 8 + 12 + *size = SAVE_HEADER_SIZE
NUMZONES*56 + 2*NUMZONES*58 + 4 + + sizeof(int32) // GetIndexForZonePointer
NUMMAPZONES*56 + NUMAUDIOZONES*2 + 4; + sizeof(m_CurrLevel) + sizeof(FindIndex)
+ sizeof(int16) // padding
+ sizeof(ZoneArray) + sizeof(ZoneInfoArray)
+ sizeof(TotalNumberOfZones) + sizeof(TotalNumberOfZoneInfos)
+ sizeof(MapZoneArray) + sizeof(AudioZoneArray)
+ sizeof(TotalNumberOfMapZones) + sizeof(NumberOfAudioZones);
buffer[0] = 'Z'; WriteSaveHeader(buffer, 'Z', 'N', 'S', '\0', *size - SAVE_HEADER_SIZE);
buffer[1] = 'N';
buffer[2] = 'S';
buffer[3] = '\0';
*(uint32*)(buffer+4) = *length - 8;
buffer += 8;
*(int32*)(buffer) = GetIndexForZonePointer(m_pPlayersZone); WriteSaveBuf(buffer, GetIndexForZonePointer(m_pPlayersZone));
*(int32*)(buffer+4) = m_CurrLevel; WriteSaveBuf(buffer, m_CurrLevel);
*(int16*)(buffer+8) = FindIndex; WriteSaveBuf(buffer, FindIndex);
*(int16*)(buffer+10) = 0; WriteSaveBuf(buffer, (int16)0); // padding
buffer += 12;
for(i = 0; i < NUMZONES; i++){ for(i = 0; i < ARRAY_SIZE(ZoneArray); i++){
memcpy(buffer, ZoneArray[i].name, 8); CZone *zone = WriteSaveBuf(buffer, ZoneArray[i]);
*(float*)(buffer+8) = ZoneArray[i].minx; zone->child = (CZone*)GetIndexForZonePointer(ZoneArray[i].child);
*(float*)(buffer+12) = ZoneArray[i].miny; zone->parent = (CZone*)GetIndexForZonePointer(ZoneArray[i].parent);
*(float*)(buffer+16) = ZoneArray[i].minz; zone->next = (CZone*)GetIndexForZonePointer(ZoneArray[i].next);
*(float*)(buffer+20) = ZoneArray[i].maxx;
*(float*)(buffer+24) = ZoneArray[i].maxy;
*(float*)(buffer+28) = ZoneArray[i].maxz;
*(int32*)(buffer+32) = ZoneArray[i].type;
*(int32*)(buffer+36) = ZoneArray[i].level;
*(int16*)(buffer+40) = ZoneArray[i].zoneinfoDay;
*(int16*)(buffer+42) = ZoneArray[i].zoneinfoNight;
*(int32*)(buffer+44) = GetIndexForZonePointer(ZoneArray[i].child);
*(int32*)(buffer+48) = GetIndexForZonePointer(ZoneArray[i].parent);
*(int32*)(buffer+52) = GetIndexForZonePointer(ZoneArray[i].next);
buffer += 56;
} }
for(i = 0; i < 2*NUMZONES; i++){ for(i = 0; i < ARRAY_SIZE(ZoneInfoArray); i++)
*(int16*)(buffer) = ZoneInfoArray[i].carDensity; WriteSaveBuf(buffer, ZoneInfoArray[i]);
*(int16*)(buffer+2) = ZoneInfoArray[i].carThreshold[0];
*(int16*)(buffer+4) = ZoneInfoArray[i].carThreshold[1]; WriteSaveBuf(buffer, TotalNumberOfZones);
*(int16*)(buffer+6) = ZoneInfoArray[i].carThreshold[2]; WriteSaveBuf(buffer, TotalNumberOfZoneInfos);
*(int16*)(buffer+8) = ZoneInfoArray[i].carThreshold[3];
*(int16*)(buffer+10) = ZoneInfoArray[i].carThreshold[4]; for(i = 0; i < ARRAY_SIZE(MapZoneArray); i++) {
*(int16*)(buffer+12) = ZoneInfoArray[i].carThreshold[5]; CZone* zone = WriteSaveBuf(buffer, MapZoneArray[i]);
*(int16*)(buffer+14) = ZoneInfoArray[i].copThreshold;
*(int16*)(buffer+16) = ZoneInfoArray[i].gangThreshold[0]; /*
*(int16*)(buffer+18) = ZoneInfoArray[i].gangThreshold[1]; The call of GetIndexForZonePointer is wrong, as it is
*(int16*)(buffer+20) = ZoneInfoArray[i].gangThreshold[2]; meant for a different array, but the game doesn't brake
*(int16*)(buffer+22) = ZoneInfoArray[i].gangThreshold[3]; if those fields are nil. Let's make sure they are.
*(int16*)(buffer+24) = ZoneInfoArray[i].gangThreshold[4]; */
*(int16*)(buffer+26) = ZoneInfoArray[i].gangThreshold[5]; assert(MapZoneArray[i].child == nil);
*(int16*)(buffer+28) = ZoneInfoArray[i].gangThreshold[6]; assert(MapZoneArray[i].parent == nil);
*(int16*)(buffer+30) = ZoneInfoArray[i].gangThreshold[7]; assert(MapZoneArray[i].next == nil);
*(int16*)(buffer+32) = ZoneInfoArray[i].gangThreshold[8]; zone->child = (CZone*)GetIndexForZonePointer(MapZoneArray[i].child);
*(uint16*)(buffer+34) = ZoneInfoArray[i].pedDensity; zone->parent = (CZone*)GetIndexForZonePointer(MapZoneArray[i].parent);
*(uint16*)(buffer+36) = ZoneInfoArray[i].copDensity; zone->next = (CZone*)GetIndexForZonePointer(MapZoneArray[i].next);
*(uint16*)(buffer+38) = ZoneInfoArray[i].gangDensity[0];
*(uint16*)(buffer+40) = ZoneInfoArray[i].gangDensity[1];
*(uint16*)(buffer+42) = ZoneInfoArray[i].gangDensity[2];
*(uint16*)(buffer+44) = ZoneInfoArray[i].gangDensity[3];
*(uint16*)(buffer+46) = ZoneInfoArray[i].gangDensity[4];
*(uint16*)(buffer+48) = ZoneInfoArray[i].gangDensity[5];
*(uint16*)(buffer+50) = ZoneInfoArray[i].gangDensity[6];
*(uint16*)(buffer+52) = ZoneInfoArray[i].gangDensity[7];
*(uint16*)(buffer+54) = ZoneInfoArray[i].gangDensity[8];
*(uint16*)(buffer+56) = ZoneInfoArray[i].pedGroup;
buffer += 58;
} }
*(uint16*)(buffer) = TotalNumberOfZones; for(i = 0; i < ARRAY_SIZE(AudioZoneArray); i++)
*(uint16*)(buffer+2) = TotalNumberOfZoneInfos; WriteSaveBuf(buffer, AudioZoneArray[i]);
buffer += 4;
for(i = 0; i < NUMMAPZONES; i++){ WriteSaveBuf(buffer, TotalNumberOfMapZones);
memcpy(buffer, MapZoneArray[i].name, 8); WriteSaveBuf(buffer, NumberOfAudioZones);
*(float*)(buffer+8) = MapZoneArray[i].minx;
*(float*)(buffer+12) = MapZoneArray[i].miny;
*(float*)(buffer+16) = MapZoneArray[i].minz;
*(float*)(buffer+20) = MapZoneArray[i].maxx;
*(float*)(buffer+24) = MapZoneArray[i].maxy;
*(float*)(buffer+28) = MapZoneArray[i].maxz;
*(int32*)(buffer+32) = MapZoneArray[i].type;
*(int32*)(buffer+36) = MapZoneArray[i].level;
*(int16*)(buffer+40) = MapZoneArray[i].zoneinfoDay;
*(int16*)(buffer+42) = MapZoneArray[i].zoneinfoNight;
#ifdef STANDALONE
// BUG: GetIndexForZonePointer uses ZoneArray
// so indices will be unpredictable with different memory layout
assert(0);
#endif
*(int32*)(buffer+44) = GetIndexForZonePointer(MapZoneArray[i].child);
*(int32*)(buffer+48) = GetIndexForZonePointer(MapZoneArray[i].parent);
*(int32*)(buffer+52) = GetIndexForZonePointer(MapZoneArray[i].next);
buffer += 56;
}
for(i = 0; i < NUMAUDIOZONES; i++){ VALIDATESAVEBUF(*size)
*(int16*)buffer = AudioZoneArray[i];
buffer += 2;
}
*(uint16*)(buffer) = TotalNumberOfMapZones;
*(uint16*)(buffer+2) = NumberOfAudioZones;
} }
void void
CTheZones::LoadAllZones(uint8 *buffer, uint32 length) CTheZones::LoadAllZones(uint8 *buffer, uint32 size)
{ {
INITSAVEBUF
int i; int i;
assert(length == 8 + 12 + CheckSaveHeader(buffer, 'Z', 'N', 'S', '\0', size - SAVE_HEADER_SIZE);
NUMZONES*56 + 2*NUMZONES*58 + 4 +
NUMMAPZONES*56 + NUMAUDIOZONES*2 + 4);
assert(buffer[0] == 'Z');
assert(buffer[1] == 'N');
assert(buffer[2] == 'S');
assert(buffer[3] == '\0');
assert(*(uint32*)(buffer+4) == length - 8);
buffer += 8;
m_pPlayersZone = GetPointerForZoneIndex(*(int32*)(buffer)); m_pPlayersZone = GetPointerForZoneIndex(ReadSaveBuf<int32>(buffer));
m_CurrLevel = (eLevelName)*(int32*)(buffer+4); m_CurrLevel = ReadSaveBuf<eLevelName>(buffer);
FindIndex = *(int16*)(buffer+8); FindIndex = ReadSaveBuf<int16>(buffer);
assert(*(int16*)(buffer+10) == 0); ReadSaveBuf<int16>(buffer);
buffer += 12;
for(i = 0; i < NUMZONES; i++){ for(i = 0; i < ARRAY_SIZE(ZoneArray); i++){
memcpy(ZoneArray[i].name, buffer, 8); ZoneArray[i] = ReadSaveBuf<CZone>(buffer);
ZoneArray[i].minx = *(float*)(buffer+8);
ZoneArray[i].miny = *(float*)(buffer+12); ZoneArray[i].child = GetPointerForZoneIndex((int32)ZoneArray[i].child);
ZoneArray[i].minz = *(float*)(buffer+16); ZoneArray[i].parent = GetPointerForZoneIndex((int32)ZoneArray[i].parent);
ZoneArray[i].maxx = *(float*)(buffer+20); ZoneArray[i].next = GetPointerForZoneIndex((int32)ZoneArray[i].next);
ZoneArray[i].maxy = *(float*)(buffer+24);
ZoneArray[i].maxz = *(float*)(buffer+28);
ZoneArray[i].type = (eZoneType)*(int32*)(buffer+32);
ZoneArray[i].level = (eLevelName)*(int32*)(buffer+36);
ZoneArray[i].zoneinfoDay = *(int16*)(buffer+40);
ZoneArray[i].zoneinfoNight = *(int16*)(buffer+42);
ZoneArray[i].child = GetPointerForZoneIndex(*(int32*)(buffer+44));
ZoneArray[i].parent = GetPointerForZoneIndex(*(int32*)(buffer+48));
ZoneArray[i].next = GetPointerForZoneIndex(*(int32*)(buffer+52));
buffer += 56;
} }
for(i = 0; i < 2*NUMZONES; i++){ for(i = 0; i < ARRAY_SIZE(ZoneInfoArray); i++)
ZoneInfoArray[i].carDensity = *(int16*)(buffer); ZoneInfoArray[i] = ReadSaveBuf<CZoneInfo>(buffer);
ZoneInfoArray[i].carThreshold[0] = *(int16*)(buffer+2);
ZoneInfoArray[i].carThreshold[1] = *(int16*)(buffer+4); TotalNumberOfZones = ReadSaveBuf<int16>(buffer);
ZoneInfoArray[i].carThreshold[2] = *(int16*)(buffer+6); TotalNumberOfZoneInfos = ReadSaveBuf<int16>(buffer);
ZoneInfoArray[i].carThreshold[3] = *(int16*)(buffer+8);
ZoneInfoArray[i].carThreshold[4] = *(int16*)(buffer+10); for(i = 0; i < ARRAY_SIZE(MapZoneArray); i++){
ZoneInfoArray[i].carThreshold[5] = *(int16*)(buffer+12); MapZoneArray[i] = ReadSaveBuf<CZone>(buffer);
ZoneInfoArray[i].copThreshold = *(int16*)(buffer+14);
ZoneInfoArray[i].gangThreshold[0] = *(int16*)(buffer+16); /*
ZoneInfoArray[i].gangThreshold[1] = *(int16*)(buffer+18); The call of GetPointerForZoneIndex is wrong, as it is
ZoneInfoArray[i].gangThreshold[2] = *(int16*)(buffer+20); meant for a different array, but the game doesn't brake
ZoneInfoArray[i].gangThreshold[3] = *(int16*)(buffer+22); if save data stored is -1.
ZoneInfoArray[i].gangThreshold[4] = *(int16*)(buffer+24); */
ZoneInfoArray[i].gangThreshold[5] = *(int16*)(buffer+26); MapZoneArray[i].child = GetPointerForZoneIndex((int32)MapZoneArray[i].child);
ZoneInfoArray[i].gangThreshold[6] = *(int16*)(buffer+28); MapZoneArray[i].parent = GetPointerForZoneIndex((int32)MapZoneArray[i].parent);
ZoneInfoArray[i].gangThreshold[7] = *(int16*)(buffer+30); MapZoneArray[i].next = GetPointerForZoneIndex((int32)MapZoneArray[i].next);
ZoneInfoArray[i].gangThreshold[8] = *(int16*)(buffer+32); assert(MapZoneArray[i].child == nil);
ZoneInfoArray[i].pedDensity = *(uint16*)(buffer+34); assert(MapZoneArray[i].parent == nil);
ZoneInfoArray[i].copDensity = *(uint16*)(buffer+36); assert(MapZoneArray[i].next == nil);
ZoneInfoArray[i].gangDensity[0] = *(uint16*)(buffer+38);
ZoneInfoArray[i].gangDensity[1] = *(uint16*)(buffer+40);
ZoneInfoArray[i].gangDensity[2] = *(uint16*)(buffer+42);
ZoneInfoArray[i].gangDensity[3] = *(uint16*)(buffer+44);
ZoneInfoArray[i].gangDensity[4] = *(uint16*)(buffer+46);
ZoneInfoArray[i].gangDensity[5] = *(uint16*)(buffer+48);
ZoneInfoArray[i].gangDensity[6] = *(uint16*)(buffer+50);
ZoneInfoArray[i].gangDensity[7] = *(uint16*)(buffer+52);
ZoneInfoArray[i].gangDensity[8] = *(uint16*)(buffer+54);
ZoneInfoArray[i].pedGroup = *(uint16*)(buffer+56);
buffer += 58;
} }
TotalNumberOfZones = *(uint16*)(buffer); for(i = 0; i < ARRAY_SIZE(AudioZoneArray); i++)
TotalNumberOfZoneInfos = *(uint16*)(buffer+2); AudioZoneArray[i] = ReadSaveBuf<int16>(buffer);
buffer += 4;
for(i = 0; i < NUMMAPZONES; i++){ TotalNumberOfMapZones = ReadSaveBuf<uint16>(buffer);
memcpy(MapZoneArray[i].name, buffer, 8); NumberOfAudioZones = ReadSaveBuf<uint16>(buffer);
MapZoneArray[i].minx = *(float*)(buffer+8);
MapZoneArray[i].miny = *(float*)(buffer+12);
MapZoneArray[i].minz = *(float*)(buffer+16);
MapZoneArray[i].maxx = *(float*)(buffer+20);
MapZoneArray[i].maxy = *(float*)(buffer+24);
MapZoneArray[i].maxz = *(float*)(buffer+28);
MapZoneArray[i].type = (eZoneType)*(int32*)(buffer+32);
MapZoneArray[i].level = (eLevelName)*(int32*)(buffer+36);
MapZoneArray[i].zoneinfoDay = *(int16*)(buffer+40);
MapZoneArray[i].zoneinfoNight = *(int16*)(buffer+42);
#ifdef STANDALONE
// BUG: GetPointerForZoneIndex uses ZoneArray
// so pointers will be unpredictable with different memory layout
assert(0);
#endif
MapZoneArray[i].child = GetPointerForZoneIndex(*(int32*)(buffer+44));
MapZoneArray[i].parent = GetPointerForZoneIndex(*(int32*)(buffer+48));
MapZoneArray[i].next = GetPointerForZoneIndex(*(int32*)(buffer+52));
buffer += 56;
}
for(i = 0; i < NUMAUDIOZONES; i++){ VALIDATESAVEBUF(size)
AudioZoneArray[i] = *(int16*)buffer;
buffer += 2;
}
TotalNumberOfMapZones = *(uint16*)(buffer);
NumberOfAudioZones = *(uint16*)(buffer+2);
} }

View File

@ -1,5 +1,5 @@
#ifndef MASTER
#include "common.h" #include "common.h"
#ifndef MASTER
#include "Font.h" #include "Font.h"
#include "Frontend.h" #include "Frontend.h"
#include "Timer.h" #include "Timer.h"

View File

@ -201,40 +201,9 @@ RwInt32 RwImageStreamGetSize(const RwImage * image);
RwImage *RwImageStreamRead(RwStream * stream); RwImage *RwImageStreamRead(RwStream * stream);
const RwImage *RwImageStreamWrite(const RwImage * image, RwStream * stream); const RwImage *RwImageStreamWrite(const RwImage * image, RwStream * stream);
// TODO: this is kind hard...
RwImage *RwImageFindRasterFormat(RwImage *ipImage,RwInt32 nRasterType, RwInt32 *npWidth,RwInt32 *npHeight, RwInt32 *npDepth,RwInt32 *npFormat) RwImage *RwImageFindRasterFormat(RwImage *ipImage,RwInt32 nRasterType, RwInt32 *npWidth,RwInt32 *npHeight, RwInt32 *npDepth,RwInt32 *npFormat)
{ {
// very dumb implementation for now return Raster::imageFindRasterFormat(ipImage, nRasterType, npWidth, npHeight, npDepth, npFormat) ? ipImage : nil;
// this is also platform specific
if((nRasterType&rwRASTERTYPEMASK) != rwRASTERTYPETEXTURE){
*npFormat = 0;
return nil;
}
*npWidth = ipImage->width;
*npHeight = ipImage->height;
switch(ipImage->depth){
case 4:
case 8:
*npDepth = 8;
*npFormat = Raster::C8888 | Raster::PAL8;
break;
case 16:
*npDepth = 16;
*npFormat = Raster::C1555;
break;
case 24:
*npDepth = 32;
*npFormat = Raster::C888;
break;
case 32:
*npDepth = 32;
*npFormat = Raster::C8888;
break;
default:
assert(0 && "invalid depth");
return nil;
}
return ipImage;
} }
@ -269,11 +238,7 @@ RwInt32 RwRasterRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObj
RwInt32 RwRasterGetPluginOffset(RwUInt32 pluginID); RwInt32 RwRasterGetPluginOffset(RwUInt32 pluginID);
RwBool RwRasterValidatePlugins(const RwRaster * raster); RwBool RwRasterValidatePlugins(const RwRaster * raster);
// TODO: let's hope this works RwRaster *RwRasterSetFromImage(RwRaster *raster, RwImage *image) { return raster->setFromImage(image); }
RwRaster *RwRasterSetFromImage(RwRaster *raster, RwImage *image) {
engine->driver[raster->platform]->rasterFromImage(raster, image);
return raster;
}

View File

@ -55,20 +55,20 @@ public:
int8 bUseVehicleColours : 1; int8 bUseVehicleColours : 1;
int8 m_obj_flag80 : 1; int8 m_obj_flag80 : 1;
int8 m_nBonusValue; int8 m_nBonusValue;
int8 field_173;
float m_fCollisionDamageMultiplier; float m_fCollisionDamageMultiplier;
uint8 m_nCollisionDamageEffect; uint8 m_nCollisionDamageEffect;
uint8 m_nSpecialCollisionResponseCases; uint8 m_nSpecialCollisionResponseCases;
bool m_bCameraToAvoidThisObject; bool m_bCameraToAvoidThisObject;
// this batch is unused
int8 field_17B; int8 field_17B;
int8 field_17C; int8 field_17C;
int8 field_17D; int8 field_17D;
int8 field_17E; int8 field_17E;
int8 field_17F; int8 field_17F;
uint32 m_nEndOfLifeTime; uint32 m_nEndOfLifeTime;
int16 m_nRefModelIndex; int16 m_nRefModelIndex;
int8 field_186;
int8 field_187;
CEntity *m_pCurSurface; CEntity *m_pCurSurface;
CEntity *m_pCollidingEntity; CEntity *m_pCollidingEntity;
int8 m_colour1, m_colour2; int8 m_colour1, m_colour2;

View File

@ -53,14 +53,12 @@ public:
uint8 m_nSkipFrames; uint8 m_nSkipFrames;
uint16 m_nFrameCounter; uint16 m_nFrameCounter;
uint16 m_nState; uint16 m_nState;
char _pad0[2];
CVector m_vecTarget; CVector m_vecTarget;
float m_fRandVal; float m_fRandVal;
float m_fSize; float m_fSize;
CRGBA m_Color; CRGBA m_Color;
uint8 m_bRemove; uint8 m_bRemove;
int8 m_nCreationChance; int8 m_nCreationChance;
char _pad1[2];
static CParticleObject *pCloseListHead; static CParticleObject *pCloseListHead;
static CParticleObject *pFarListHead; static CParticleObject *pFarListHead;

View File

@ -13,17 +13,13 @@ class CCopPed : public CPed
{ {
public: public:
int16 m_wRoadblockNode; int16 m_wRoadblockNode;
int8 field_1342;
int8 field_1343;
float m_fDistanceToTarget; float m_fDistanceToTarget;
int8 m_bIsInPursuit; bool m_bIsInPursuit;
int8 m_bIsDisabledCop; bool m_bIsDisabledCop;
int8 field_1350; int8 field_1350;
bool m_bBeatingSuspect; bool m_bBeatingSuspect;
int8 m_bStopAndShootDisabledZone; bool m_bStopAndShootDisabledZone;
int8 m_bZoneDisabled; bool m_bZoneDisabled;
int8 field_1354;
int8 field_1355;
int32 field_1356; int32 field_1356;
eCopType m_nCopType; eCopType m_nCopType;
int8 field_1364; int8 field_1364;

View File

@ -301,95 +301,92 @@ public:
float m_fCollisionSpeed; float m_fCollisionSpeed;
// cf. https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_sa/game_sa/CPed.h from R* // cf. https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_sa/game_sa/CPed.h from R*
uint8 bIsStanding : 1; uint32 bIsStanding : 1;
uint8 m_ped_flagA2 : 1; // bWasStanding? uint32 m_ped_flagA2 : 1; // bWasStanding?
uint8 bIsAttacking : 1; // doesn't reset after fist fight uint32 bIsAttacking : 1; // doesn't reset after fist fight
uint8 bIsPointingGunAt : 1; uint32 bIsPointingGunAt : 1;
uint8 bIsLooking : 1; uint32 bIsLooking : 1;
uint8 bKeepTryingToLook : 1; // if we can't look somewhere due to unreachable angles uint32 bKeepTryingToLook : 1; // if we can't look somewhere due to unreachable angles
uint8 bIsRestoringLook : 1; uint32 bIsRestoringLook : 1;
uint8 bIsAimingGun : 1; uint32 bIsAimingGun : 1;
uint8 bIsRestoringGun : 1; uint32 bIsRestoringGun : 1;
uint8 bCanPointGunAtTarget : 1; uint32 bCanPointGunAtTarget : 1;
uint8 bIsTalking : 1; uint32 bIsTalking : 1;
uint8 bIsInTheAir : 1; uint32 bIsInTheAir : 1;
uint8 bIsLanding : 1; uint32 bIsLanding : 1;
uint8 bIsRunning : 1; // on some conditions uint32 bIsRunning : 1; // on some conditions
uint8 bHitSomethingLastFrame : 1; uint32 bHitSomethingLastFrame : 1;
uint8 bVehEnterDoorIsBlocked : 1; // because someone else enters/exits from there uint32 bVehEnterDoorIsBlocked : 1; // because someone else enters/exits from there
uint8 bCanPedEnterSeekedCar : 1; uint32 bCanPedEnterSeekedCar : 1;
uint8 bRespondsToThreats : 1; uint32 bRespondsToThreats : 1;
uint8 bRenderPedInCar : 1; uint32 bRenderPedInCar : 1;
uint8 bChangedSeat : 1; uint32 bChangedSeat : 1;
uint8 bUpdateAnimHeading : 1; uint32 bUpdateAnimHeading : 1;
uint8 bBodyPartJustCameOff : 1; uint32 bBodyPartJustCameOff : 1;
uint8 bIsShooting : 1; uint32 bIsShooting : 1;
uint8 bFindNewNodeAfterStateRestore : 1; uint32 bFindNewNodeAfterStateRestore : 1;
uint8 bHasACamera : 1; // does ped possess a camera to document accidents involves fire/explosion uint32 bHasACamera : 1; // does ped possess a camera to document accidents involves fire/explosion
uint8 bGonnaInvestigateEvent : 1; uint32 bGonnaInvestigateEvent : 1;
uint8 bPedIsBleeding : 1; uint32 bPedIsBleeding : 1;
uint8 bStopAndShoot : 1; // Ped cannot reach target to attack with fist, need to use gun uint32 bStopAndShoot : 1; // Ped cannot reach target to attack with fist, need to use gun
uint8 bIsPedDieAnimPlaying : 1; uint32 bIsPedDieAnimPlaying : 1;
uint8 bUsePedNodeSeek : 1; uint32 bUsePedNodeSeek : 1;
uint8 bObjectiveCompleted : 1; uint32 bObjectiveCompleted : 1;
uint8 bScriptObjectiveCompleted : 1; uint32 bScriptObjectiveCompleted : 1;
uint8 bKindaStayInSamePlace : 1; uint32 bKindaStayInSamePlace : 1;
uint8 bBeingChasedByPolice : 1; // Unused VC leftover. Should've been set for criminal/gang members uint32 bBeingChasedByPolice : 1; // Unused VC leftover. Should've been set for criminal/gang members
uint8 bNotAllowedToDuck : 1; uint32 bNotAllowedToDuck : 1;
uint8 bCrouchWhenShooting : 1; uint32 bCrouchWhenShooting : 1;
uint8 bIsDucking : 1; uint32 bIsDucking : 1;
uint8 bGetUpAnimStarted : 1; uint32 bGetUpAnimStarted : 1;
uint8 bDoBloodyFootprints : 1; uint32 bDoBloodyFootprints : 1;
uint8 bFleeAfterExitingCar : 1; uint32 bFleeAfterExitingCar : 1;
uint8 bWanderPathAfterExitingCar : 1; uint32 bWanderPathAfterExitingCar : 1;
uint8 bIsLeader : 1; uint32 bIsLeader : 1;
uint8 bDontDragMeOutCar : 1; // unfinished feature uint32 bDontDragMeOutCar : 1; // unfinished feature
uint8 m_ped_flagF8 : 1; uint32 m_ped_flagF8 : 1;
uint8 bWillBeQuickJacked : 1; uint32 bWillBeQuickJacked : 1;
uint8 bCancelEnteringCar : 1; // after door is opened or couldn't be opened due to it's locked uint32 bCancelEnteringCar : 1; // after door is opened or couldn't be opened due to it's locked
uint8 bObstacleShowedUpDuringKillObjective : 1; uint32 bObstacleShowedUpDuringKillObjective : 1;
uint8 bDuckAndCover : 1; uint32 bDuckAndCover : 1;
uint8 bStillOnValidPoly : 1; // set if the polygon the ped is on is still valid for collision uint32 bStillOnValidPoly : 1; // set if the polygon the ped is on is still valid for collision
uint8 bAllowMedicsToReviveMe : 1; uint32 bAllowMedicsToReviveMe : 1;
uint8 bResetWalkAnims : 1; uint32 bResetWalkAnims : 1;
uint8 bStartWanderPathOnFoot : 1; // exits the car if he's in it, reset after path found uint32 bStartWanderPathOnFoot : 1; // exits the car if he's in it, reset after path found
uint8 bOnBoat : 1; // not just driver, may be just standing uint32 bOnBoat : 1; // not just driver, may be just standing
uint8 bBusJacked : 1; uint32 bBusJacked : 1;
uint8 bGonnaKillTheCarJacker : 1; // only set when car is jacked from right door and when arrested by police uint32 bGonnaKillTheCarJacker : 1; // only set when car is jacked from right door and when arrested by police
uint8 bFadeOut : 1; uint32 bFadeOut : 1;
uint8 bKnockedUpIntoAir : 1; // has ped been knocked up into the air by a car collision uint32 bKnockedUpIntoAir : 1; // has ped been knocked up into the air by a car collision
uint8 bHitSteepSlope : 1; // has ped collided/is standing on a steep slope (surface type) uint32 bHitSteepSlope : 1; // has ped collided/is standing on a steep slope (surface type)
uint8 bCullExtraFarAway : 1; // special ped only gets culled if it's extra far away (for roadblocks) uint32 bCullExtraFarAway : 1; // special ped only gets culled if it's extra far away (for roadblocks)
uint8 bClearObjective : 1; uint32 bClearObjective : 1;
uint8 bTryingToReachDryLand : 1; // has ped just exited boat and trying to get to dry land uint32 bTryingToReachDryLand : 1; // has ped just exited boat and trying to get to dry land
uint8 bCollidedWithMyVehicle : 1; uint32 bCollidedWithMyVehicle : 1;
uint8 bRichFromMugging : 1; // ped has lots of cash cause they've been mugging people uint32 bRichFromMugging : 1; // ped has lots of cash cause they've been mugging people
uint8 bChrisCriminal : 1; // Is a criminal as killed during Chris' police mission (should be counted as such) uint32 bChrisCriminal : 1; // Is a criminal as killed during Chris' police mission (should be counted as such)
uint8 bShakeFist : 1; // test shake hand at look entity uint32 bShakeFist : 1; // test shake hand at look entity
uint8 bNoCriticalHits : 1; // if set, limbs won't came off uint32 bNoCriticalHits : 1; // if set, limbs won't came off
uint8 bVehExitWillBeInstant : 1; uint32 bVehExitWillBeInstant : 1;
uint8 bHasAlreadyBeenRecorded : 1; uint32 bHasAlreadyBeenRecorded : 1;
uint8 bFallenDown : 1; uint32 bFallenDown : 1;
#ifdef VC_PED_PORTS #ifdef VC_PED_PORTS
uint8 bSomeVCflag1 : 1; uint32 bSomeVCflag1 : 1;
#else #else
uint8 m_ped_flagI20 : 1; uint32 m_ped_flagI20 : 1;
#endif #endif
uint8 m_ped_flagI40 : 1; // bMakePedsRunToPhonesToReportCrimes makes use of this as runover by car indicator uint32 m_ped_flagI40 : 1; // bMakePedsRunToPhonesToReportCrimes makes use of this as runover by car indicator
uint8 m_ped_flagI80 : 1; // KANGAROO_CHEAT define makes use of this as cheat toggle uint32 m_ped_flagI80 : 1; // KANGAROO_CHEAT define makes use of this as cheat toggle
uint8 stuff10[3];
uint8 CharCreatedBy; uint8 CharCreatedBy;
uint8 field_161;
uint8 pad_162[2];
eObjective m_objective; eObjective m_objective;
eObjective m_prevObjective; eObjective m_prevObjective;
CPed *m_pedInObjective; CPed *m_pedInObjective;
@ -424,8 +421,6 @@ public:
uint16 m_nPathNodes; uint16 m_nPathNodes;
int16 m_nCurPathNode; int16 m_nCurPathNode;
int8 m_nPathDir; int8 m_nPathDir;
private:
int8 _pad2B5[3];
public: public:
CPathNode *m_pLastPathNode; CPathNode *m_pLastPathNode;
CPathNode *m_pNextPathNode; CPathNode *m_pNextPathNode;
@ -436,7 +431,6 @@ public:
int16 m_routePointsPassed; int16 m_routePointsPassed;
int16 m_routeType; // See PedRouteType int16 m_routeType; // See PedRouteType
int16 m_routePointsBeingPassed; int16 m_routePointsBeingPassed;
uint16 field_2D2;
CVector2D m_moved; CVector2D m_moved;
float m_fRotationCur; float m_fRotationCur;
float m_fRotationDest; float m_fRotationDest;
@ -450,10 +444,8 @@ public:
CEntity *m_pSeekTarget; CEntity *m_pSeekTarget;
CVehicle *m_pMyVehicle; CVehicle *m_pMyVehicle;
bool bInVehicle; bool bInVehicle;
uint8 pad_315[3];
float m_distanceToCountSeekDone; float m_distanceToCountSeekDone;
bool bRunningToPhone; bool bRunningToPhone;
uint8 field_31D;
int16 m_phoneId; int16 m_phoneId;
eCrimeType m_crimeToReportOnPhone; eCrimeType m_crimeToReportOnPhone;
uint32 m_phoneTalkTimer; uint32 m_phoneTalkTimer;
@ -468,7 +460,6 @@ public:
uint32 m_collidingThingTimer; uint32 m_collidingThingTimer;
CEntity *m_pCollidingEntity; CEntity *m_pCollidingEntity;
uint8 m_stateUnused; uint8 m_stateUnused;
uint8 pad_351[3];
uint32 m_timerUnused; uint32 m_timerUnused;
CVector2D *m_wanderRangeBounds; // array with 2 CVector2D (actually unused CRange2D class) - unused CVector2D *m_wanderRangeBounds; // array with 2 CVector2D (actually unused CRange2D class) - unused
CWeapon m_weapons[WEAPONTYPE_TOTAL_INVENTORY_WEAPONS]; CWeapon m_weapons[WEAPONTYPE_TOTAL_INVENTORY_WEAPONS];
@ -483,7 +474,6 @@ public:
uint8 m_fightButtonPressure; uint8 m_fightButtonPressure;
FightState m_fightState; FightState m_fightState;
bool m_takeAStepAfterAttack; bool m_takeAStepAfterAttack;
uint8 pad_4B3;
CFire *m_pFire; CFire *m_pFire;
CEntity *m_pLookTarget; CEntity *m_pLookTarget;
float m_fLookDirection; float m_fLookDirection;
@ -502,11 +492,9 @@ public:
uint8 m_panicCounter; uint8 m_panicCounter;
bool m_deadBleeding; bool m_deadBleeding;
int8 m_bodyPartBleeding; // PedNode, but -1 if there isn't int8 m_bodyPartBleeding; // PedNode, but -1 if there isn't
uint8 m_field_4F3;
CPed *m_nearPeds[10]; CPed *m_nearPeds[10];
uint16 m_numNearPeds; uint16 m_numNearPeds;
int8 m_lastWepDam; int8 m_lastWepDam;
uint8 pad_51F;
uint32 m_lastSoundStart; uint32 m_lastSoundStart;
uint32 m_soundStart; uint32 m_soundStart;
uint16 m_lastQueuedSound; uint16 m_lastQueuedSound;

View File

@ -23,20 +23,13 @@ public:
uint32 m_nHitAnimDelayTimer; uint32 m_nHitAnimDelayTimer;
float m_fAttackButtonCounter; float m_fAttackButtonCounter;
bool m_bHaveTargetSelected; // may have better name bool m_bHaveTargetSelected; // may have better name
int8 field_1381;
int8 field_1382;
int8 field_1383;
CEntity *m_pEvadingFrom; // is this CPhysical? CEntity *m_pEvadingFrom; // is this CPhysical?
int32 m_nTargettableObjects[4]; int32 m_nTargettableObjects[4];
bool m_bAdrenalineActive; bool m_bAdrenalineActive;
bool m_bHasLockOnTarget; bool m_bHasLockOnTarget;
int8 field_1406;
int8 field_1407;
uint32 m_nAdrenalineTime; uint32 m_nAdrenalineTime;
bool m_bCanBeDamaged; bool m_bCanBeDamaged;
int8 field_1413; int8 field_1413;
int8 field_1414;
int8 field_1415;
CVector m_vecSafePos[6]; // safe places from the player, for example behind a tree CVector m_vecSafePos[6]; // safe places from the player, for example behind a tree
CPed *m_pPedAtSafePos[6]; CPed *m_pPedAtSafePos[6];
float m_fWalkAngle; float m_fWalkAngle;

View File

@ -1050,7 +1050,7 @@ CPopulation::TestSafeForRealObject(CDummyObject *dummy)
if (maxY >= NUMSECTORS_Y) maxY = NUMSECTORS_Y; if (maxY >= NUMSECTORS_Y) maxY = NUMSECTORS_Y;
#endif #endif
static CColPoint aTempColPoints; static CColPoint aTempColPoints[MAX_COLLISION_POINTS];
for (int curY = minY; curY <= maxY; curY++) { for (int curY = minY; curY <= maxY; curY++) {
for (int curX = minX; curX <= maxX; curX++) { for (int curX = minX; curX <= maxX; curX++) {
@ -1061,7 +1061,7 @@ CPopulation::TestSafeForRealObject(CDummyObject *dummy)
if (veh->m_scanCode != CWorld::GetCurrentScanCode()) { if (veh->m_scanCode != CWorld::GetCurrentScanCode()) {
if (veh->GetIsTouching(colCentre, colRadius)) { if (veh->GetIsTouching(colCentre, colRadius)) {
veh->m_scanCode = CWorld::GetCurrentScanCode(); veh->m_scanCode = CWorld::GetCurrentScanCode();
if (CCollision::ProcessColModels(dummy->GetMatrix(), *dummyCol, veh->GetMatrix(), *veh->GetColModel(), &aTempColPoints, nil, nil) > 0) if (CCollision::ProcessColModels(dummy->GetMatrix(), *dummyCol, veh->GetMatrix(), *veh->GetColModel(), aTempColPoints, nil, nil) > 0)
return false; return false;
} }
} }
@ -1072,7 +1072,7 @@ CPopulation::TestSafeForRealObject(CDummyObject *dummy)
if (veh->m_scanCode != CWorld::GetCurrentScanCode()) { if (veh->m_scanCode != CWorld::GetCurrentScanCode()) {
if (veh->GetIsTouching(colCentre, colRadius)) { if (veh->GetIsTouching(colCentre, colRadius)) {
veh->m_scanCode = CWorld::GetCurrentScanCode(); veh->m_scanCode = CWorld::GetCurrentScanCode();
if (CCollision::ProcessColModels(dummy->GetMatrix(), *dummyCol, veh->GetMatrix(), *veh->GetColModel(), &aTempColPoints, nil, nil) > 0) if (CCollision::ProcessColModels(dummy->GetMatrix(), *dummyCol, veh->GetMatrix(), *veh->GetColModel(), aTempColPoints, nil, nil) > 0)
return false; return false;
} }
} }

View File

@ -13,7 +13,6 @@ public:
uint8 m_nTriIndex; uint8 m_nTriIndex;
bool m_bActive; bool m_bActive;
bool m_bShattered; bool m_bShattered;
char _pad0[1];
CFallingGlassPane() { } CFallingGlassPane() { }
~CFallingGlassPane() { } ~CFallingGlassPane() { }

View File

@ -24,7 +24,6 @@ public:
uint16 m_nZRotationTimer; uint16 m_nZRotationTimer;
float m_fCurrentZRadius; float m_fCurrentZRadius;
uint16 m_nZRadiusTimer; uint16 m_nZRadiusTimer;
char _pad0[2];
float m_fSize; float m_fSize;
float m_fExpansionRate; float m_fExpansionRate;
uint16 m_nFadeToBlackTimer; uint16 m_nFadeToBlackTimer;
@ -36,7 +35,6 @@ public:
int16 m_nRotationStep; int16 m_nRotationStep;
int16 m_nRotation; int16 m_nRotation;
RwRGBA m_Color; RwRGBA m_Color;
char _pad1[2];
CParticle *m_pNext; CParticle *m_pNext;
CParticle() CParticle()

View File

@ -46,7 +46,6 @@ struct tParticleSystemData
uint16 m_nFinalAnimationFrame; uint16 m_nFinalAnimationFrame;
uint16 m_nAnimationSpeed; uint16 m_nAnimationSpeed;
uint16 m_nRotationSpeed; uint16 m_nRotationSpeed;
char _pad1[2];
float m_fGravitationalAcceleration; float m_fGravitationalAcceleration;
int32 m_nFrictionDecceleration; int32 m_nFrictionDecceleration;
int32 m_nLifeSpan; int32 m_nLifeSpan;
@ -60,7 +59,6 @@ struct tParticleSystemData
RwRGBA m_RenderColouring; RwRGBA m_RenderColouring;
uint8 m_InitialColorVariation; uint8 m_InitialColorVariation;
RwRGBA m_FadeDestinationColor; RwRGBA m_FadeDestinationColor;
char _pad2[3];
uint32 m_ColorFadeTime; uint32 m_ColorFadeTime;
RwRaster **m_ppRaster; RwRaster **m_ppRaster;

View File

@ -194,8 +194,6 @@ CRenderer::RenderRoads(void)
DeActivateDirectional(); DeActivateDirectional();
SetAmbientColours(); SetAmbientColours();
ThePaths.m_pathNodes[-1].group = 6;
for(i = 0; i < ms_nNoOfVisibleEntities; i++){ for(i = 0; i < ms_nNoOfVisibleEntities; i++){
t = (CTreadable*)ms_aVisibleEntityPtrs[i]; t = (CTreadable*)ms_aVisibleEntityPtrs[i];
if(t->IsBuilding() && t->GetIsATreadable()){ if(t->IsBuilding() && t->GetIsATreadable()){

View File

@ -46,7 +46,6 @@ public:
uint8 bRendered : 1; uint8 bRendered : 1;
//uint8 bDrawOnBuildings : 1; //uint8 bDrawOnBuildings : 1;
} m_nFlags; } m_nFlags;
char _pad0;
RwTexture *m_pTexture; RwTexture *m_pTexture;
CStoredShadow() CStoredShadow()
@ -58,11 +57,9 @@ class CPolyBunch
{ {
public: public:
int16 m_nNumVerts; int16 m_nNumVerts;
char _pad0[2];
CVector m_aVerts[7]; CVector m_aVerts[7];
uint8 m_aU[7]; uint8 m_aU[7];
uint8 m_aV[7]; uint8 m_aV[7];
char _pad1[2];
CPolyBunch *m_pNext; CPolyBunch *m_pNext;
CPolyBunch() CPolyBunch()
@ -82,7 +79,6 @@ public:
float m_fZDistance; float m_fZDistance;
float m_fScale; float m_fScale;
uint8 m_nType; uint8 m_nType;
char _pad0;
int16 m_nIntensity; // unsigned ? int16 m_nIntensity; // unsigned ?
uint8 m_nRed; uint8 m_nRed;
uint8 m_nGreen; uint8 m_nGreen;
@ -90,7 +86,6 @@ public:
bool m_bJustCreated; bool m_bJustCreated;
bool m_bRendered; bool m_bRendered;
bool m_bTemp; bool m_bTemp;
char _pad1[2];
RwTexture *m_pTexture; RwTexture *m_pTexture;
CStaticShadow() CStaticShadow()
@ -113,7 +108,6 @@ public:
uint8 m_nRed; uint8 m_nRed;
uint8 m_nGreen; uint8 m_nGreen;
uint8 m_nBlue; uint8 m_nBlue;
char _pad0[2];
uint32 m_nTimeCreated; uint32 m_nTimeCreated;
uint32 m_nLifeTime; uint32 m_nLifeTime;
RwTexture *m_pTexture; RwTexture *m_pTexture;

View File

@ -13,7 +13,6 @@ public:
int32 m_nId; int32 m_nId;
int16 m_nCur; int16 m_nCur;
char _pad0[2];
uint32 m_nTimeCreated; uint32 m_nTimeCreated;
CVector m_avecPos[NUM_SEGMENTPOINTS]; CVector m_avecPos[NUM_SEGMENTPOINTS];
CVector m_avecVelocity[NUM_SEGMENTPOINTS]; CVector m_avecVelocity[NUM_SEGMENTPOINTS];

View File

@ -91,7 +91,8 @@ DefinedState(void)
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE); RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
#ifdef LIBRW #ifdef LIBRW
#pragma message (" TODO: alphatest func") rw::SetRenderState(rw::ALPHATESTFUNC, rw::ALPHAGREATEREQUAL);
rw::SetRenderState(rw::ALPHATESTREF, 3);
#else #else
// D3D stuff // D3D stuff
RwD3D8SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATER); RwD3D8SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATER);

View File

@ -1,40 +0,0 @@
#ifndef LIBRW
#include "common.h"
#include "rwcore.h"
#include "rpworld.h"
#include "rpmatfx.h"
#include "rpskin.h"
#include "rphanim.h"
#include "rtbmp.h"
typedef RwV3d *(*rwVectorsMultFn) (RwV3d * pointsOut,
const RwV3d * pointsIn,
RwInt32 numPoints,
const RwMatrix * matrix);
#ifndef RWLIBS
#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();
RwInt32 _rwD3D8FindCorrectRasterFormat(RwRasterType type, RwInt32 flags);
}
#endif
#endif

View File

@ -86,7 +86,11 @@ C_PcSave::PopulateSlotInfo()
SlotSaveDate[i][0] = '\0'; SlotSaveDate[i][0] = '\0';
} }
for (int i = 0; i < SLOT_COUNT; i++) { for (int i = 0; i < SLOT_COUNT; i++) {
#ifdef FIX_BUGS
char savename[MAX_PATH];
#else
char savename[52]; char savename[52];
#endif
struct { struct {
int size; int size;
wchar FileName[24]; wchar FileName[24];

View File

@ -92,7 +92,6 @@ public:
uint8 bWaterTight : 1; // no damage for non-player peds uint8 bWaterTight : 1; // no damage for non-player peds
uint8 bNotDamagedUpsideDown : 1; uint8 bNotDamagedUpsideDown : 1;
uint8 bMoreResistantToDamage : 1; uint8 bMoreResistantToDamage : 1;
uint8 field_4DB;
CEntity *m_pBombRigger; CEntity *m_pBombRigger;
int16 field_4E0; int16 field_4E0;
uint16 m_hydraulicState; uint16 m_hydraulicState;

View File

@ -70,7 +70,6 @@ public:
static bool ScriptHeliOn; static bool ScriptHeliOn;
CHeli(int32 id, uint8 CreatedBy); CHeli(int32 id, uint8 CreatedBy);
CHeli* ctor(int, uint8);
// from CEntity // from CEntity
void SetModelIndex(uint32 id); void SetModelIndex(uint32 id);

View File

@ -33,8 +33,6 @@ public:
int16 m_nPlaneId; int16 m_nPlaneId;
int16 m_isFarAway; int16 m_isFarAway;
int16 m_nCurPathNode; int16 m_nCurPathNode;
char field_654;
char field_655;
float m_fSpeed; float m_fSpeed;
uint32 m_nFrameWhenHit; uint32 m_nFrameWhenHit;
bool m_bHasBeenHit; bool m_bHasBeenHit;

View File

@ -130,7 +130,6 @@ public:
int8 m_nGettingInFlags; int8 m_nGettingInFlags;
int8 m_nGettingOutFlags; int8 m_nGettingOutFlags;
uint8 m_nNumMaxPassengers; uint8 m_nNumMaxPassengers;
char field_1CD[3];
float field_1D0[4]; float field_1D0[4];
CEntity *m_pCurGroundEntity; CEntity *m_pCurGroundEntity;
CFire *m_pCarFire; CFire *m_pCarFire;
@ -180,7 +179,6 @@ public:
int16 m_nRoadblockNode; int16 m_nRoadblockNode;
float m_fHealth; // 1000.0f = full health. 250.0f = fire. 0 -> explode float m_fHealth; // 1000.0f = full health. 250.0f = fire. 0 -> explode
uint8 m_nCurrentGear; uint8 m_nCurrentGear;
int8 field_205[3];
float m_fChangeGearTime; float m_fChangeGearTime;
uint32 m_nGunFiringTime; // last time when gun on vehicle was fired (used on boats) uint32 m_nGunFiringTime; // last time when gun on vehicle was fired (used on boats)
uint32 m_nTimeOfDeath; uint32 m_nTimeOfDeath;
@ -296,7 +294,6 @@ class cVehicleParams
{ {
public: public:
bool m_bDistanceCalculated; bool m_bDistanceCalculated;
char gap_1[3];
float m_fDistance; float m_fDistance;
CVehicle *m_pVehicle; CVehicle *m_pVehicle;
cTransmission *m_pTransmission; cTransmission *m_pTransmission;

View File

@ -4,7 +4,6 @@ class CWeaponEffects
{ {
public: public:
bool m_bActive; bool m_bActive;
char _pad[3];
CVector m_vecPos; CVector m_vecPos;
uint8 m_nRed; uint8 m_nRed;
uint8 m_nGreen; uint8 m_nGreen;