ProcessButtonPresses and fixes

This commit is contained in:
eray orçunus 2020-03-17 21:03:13 +03:00
parent 31d16d395e
commit d5a6e17079
18 changed files with 1763 additions and 756 deletions

View File

@ -596,10 +596,10 @@ CCarCtrl::ChooseCarModel(int32 vehclass)
case TAXI:
{
if (TotalNumOfCarsOfRating[vehclass] == 0)
debug("ChooseCarModel : No cars of type %d have been declared\n");
debug("ChooseCarModel : No cars of type %d have been declared\n", vehclass);
model = CarArrays[vehclass][NextCarOfRating[vehclass]];
int32 total = TotalNumOfCarsOfRating[vehclass];
NextCarOfRating[vehclass] += 1 + CGeneral::GetRandomNumberInRange(0, total - 1);
NextCarOfRating[vehclass] += CGeneral::GetRandomNumberInRange(1, total);
while (NextCarOfRating[vehclass] >= total)
NextCarOfRating[vehclass] -= total;
//NextCarOfRating[vehclass] %= total;

View File

@ -3,7 +3,8 @@
#include "ModelIndices.h"
#include "Gangs.h"
CGangInfo(&CGangs::Gang)[NUM_GANGS] = *(CGangInfo(*)[NUM_GANGS])*(uintptr*)0x6EDF78;
//CGangInfo(&CGangs::Gang)[NUM_GANGS] = *(CGangInfo(*)[NUM_GANGS])*(uintptr*)0x6EDF78;
CGangInfo CGangs::Gang[NUM_GANGS];
CGangInfo::CGangInfo() :
m_nVehicleMI(MI_BUS),
@ -30,11 +31,11 @@ void CGangs::SetGangVehicleModel(int16 gang, int32 model)
GetGangInfo(gang)->m_nVehicleMI = model;
}
void CGangs::SetGangWeapons(int16 gang, eWeaponType weapon1, eWeaponType weapon2)
void CGangs::SetGangWeapons(int16 gang, int32 weapon1, int32 weapon2)
{
CGangInfo *gi = GetGangInfo(gang);
gi->m_Weapon1 = weapon1;
gi->m_Weapon2 = weapon2;
gi->m_Weapon1 = (eWeaponType)weapon1;
gi->m_Weapon2 = (eWeaponType)weapon2;
}
void CGangs::SetGangPedModelOverride(int16 gang, int8 ovrd)
@ -64,11 +65,11 @@ void CGangs::LoadAllGangData(uint8 *buf, uint32 size)
Initialize();
INITSAVEBUF
// original: SkipSaveBuf(buf, SAVE_HEADER_SIZE);
CheckSaveHeader(buf, 'G','N','G','\0', size - SAVE_HEADER_SIZE);
WriteSaveHeader(buf, 'G','N','G','\0', size - SAVE_HEADER_SIZE);
for (int i = 0; i < NUM_GANGS; i++)
Gang[i] = ReadSaveBuf<CGangInfo>(buf);
VALIDATESAVEBUF(size);
}

View File

@ -34,18 +34,16 @@ class CGangs
public:
static void Initialize(void);
static void SetGangVehicleModel(int16, int32);
static void SetGangWeapons(int16, eWeaponType, eWeaponType);
static void SetGangWeapons(int16, int32, int32);
static void SetGangPedModelOverride(int16, int8);
static int8 GetGangPedModelOverride(int16);
static void SaveAllGangData(uint8 *, uint32 *);
static void LoadAllGangData(uint8 *, uint32);
static int32 GetGangVehicleModel(int16 gang) { return Gang[gang].m_nVehicleMI; }
static eWeaponType GetGangWeapon1(int16 gang) { return Gang[gang].m_Weapon1; }
static eWeaponType GetGangWeapon2(int16 gang) { return Gang[gang].m_Weapon2; }
static CGangInfo* GetGangInfo(int16 gang) { return &Gang[gang]; }
static CGangInfo *GetGangInfo(int16 gang) { return &Gang[gang]; }
private:
static CGangInfo(&Gang)[NUM_GANGS];
static CGangInfo Gang[NUM_GANGS];
};

View File

@ -14,7 +14,7 @@ int32 &CGarages::BankVansCollected = *(int32 *)0x8F1B34;
bool &CGarages::BombsAreFree = *(bool *)0x95CD7A;
bool &CGarages::RespraysAreFree = *(bool *)0x95CD1D;
int32 &CGarages::CarsCollected = *(int32 *)0x880E18;
int32 (&CGarages::CarTypesCollected)[TOTAL_COLLECTCARS_GARAGES] = *(int32 (*)[TOTAL_COLLECTCARS_GARAGES])(uintptr*)0x8E286C;
int32 (&CGarages::CarTypesCollected)[TOTAL_COLLECTCARS_GARAGES] = *(int32 (*)[TOTAL_COLLECTCARS_GARAGES])*(uintptr*)0x8E286C;
int32 &CGarages::CrushedCarId = *(int32 *)0x943060;
uint32 &CGarages::LastTimeHelpMessage = *(uint32 *)0x8F1B58;
int32 &CGarages::MessageNumberInString = *(int32 *)0x885BA8;
@ -27,7 +27,7 @@ bool &CGarages::PlayerInGarage = *(bool *)0x95CD83;
int32 &CGarages::PoliceCarsCollected = *(int32 *)0x941444;
uint32 &CGarages::GarageToBeTidied = *(uint32 *)0x623570;
CGarage(&CGarages::Garages)[NUM_GARAGES] = *(CGarage(*)[NUM_GARAGES])(uintptr*)0x72BCD0;
CGarage(&CGarages::Garages)[NUM_GARAGES] = *(CGarage(*)[NUM_GARAGES])*(uintptr*)0x72BCD0;
WRAPPER void CGarages::Init(void) { EAXJMP(0x421C60); }
WRAPPER void CGarages::Update(void) { EAXJMP(0x421E40); }

View File

@ -2327,7 +2327,7 @@ void CControllerConfigManager::ResetSettingOrder(e_ControllerAction action)
bool init = false;
if (isexist)
if (!isexist)
{
for (int32 k = 0; k < MAX_CONTROLLERTYPES; k++)
{

File diff suppressed because it is too large Load Diff

View File

@ -212,7 +212,7 @@ enum eMenuAction
MENUACTION_LANG_GER,
MENUACTION_LANG_ITA,
MENUACTION_LANG_SPA,
MENUACTION_UPDATESAVE,
MENUACTION_POPULATESLOTS_CHANGEMENU,
MENUACTION_CHECKSAVE,
MENUACTION_UNK24,
MENUACTION_NEWGAME,
@ -239,7 +239,7 @@ enum eMenuAction
MENUACTION_PARSEHEAP,
MENUACTION_SHOWCULL,
MENUACTION_MEMCARDSAVECONFIRM,
MENUACTION_UPDATEMEMCARDSAVE,
MENUACTION_RESUME_FROM_SAVEZONE,
MENUACTION_UNK50,
MENUACTION_DEBUGSTREAM,
MENUACTION_MPMAP_LIBERTY,
@ -272,7 +272,7 @@ enum eMenuAction
MENUACTION_SHOWHEADBOB,
MENUACTION_UNK80,
MENUACTION_INVVERT,
MENUACTION_CANCLEGAME,
MENUACTION_CANCELGAME,
MENUACTION_MP_PLAYERNUMBER,
MENUACTION_MOUSESENS,
MENUACTION_CHECKMPGAMES,
@ -283,7 +283,7 @@ enum eMenuAction
MENUACTION_MP_LAN,
MENUACTION_MP_INTERNET,
MENUACTION_RESUME,
MENUACTION_DONTCANCLE,
MENUACTION_DONTCANCEL,
MENUACTION_SCREENRES,
MENUACTION_AUDIOHW,
MENUACTION_SPEAKERCONF,
@ -307,27 +307,37 @@ enum eCheckHover
{
HOVEROPTION_0,
HOVEROPTION_1,
HOVEROPTION_DEFAULT,
HOVEROPTION_RANDOM_ITEM,
HOVEROPTION_3,
HOVEROPTION_4,
HOVEROPTION_5,
HOVEROPTION_6,
HOVEROPTION_7,
HOVEROPTION_8,
HOVEROPTION_9,
HOVEROPTION_BACK, // used in controller setup
HOVEROPTION_10,
HOVEROPTION_11,
HOVEROPTION_12,
HOVEROPTION_13,
HOVEROPTION_14,
HOVEROPTION_15,
HOVEROPTION_16,
HOVEROPTION_17,
HOVEROPTION_18,
HOVEROPTION_OVER_SCROLL_UP,
HOVEROPTION_OVER_SCROLL_DOWN,
HOVEROPTION_CLICKED_SCROLL_UP,
HOVEROPTION_CLICKED_SCROLL_DOWN,
HOVEROPTION_HOLDING_SCROLLBAR,
HOVEROPTION_PAGEUP,
HOVEROPTION_PAGEDOWN,
HOVEROPTION_19,
HOVEROPTION_20,
HOVEROPTION_CHANGESKIN,
HOVEROPTION_INCREASE_BRIGHTNESS = 32,
HOVEROPTION_RADIO_0,
HOVEROPTION_RADIO_1,
HOVEROPTION_RADIO_2,
HOVEROPTION_RADIO_3,
HOVEROPTION_RADIO_4,
HOVEROPTION_RADIO_5,
HOVEROPTION_RADIO_6,
HOVEROPTION_RADIO_7,
HOVEROPTION_RADIO_8,
HOVEROPTION_RADIO_9,
HOVEROPTION_INCREASE_BRIGHTNESS,
HOVEROPTION_DECREASE_BRIGHTNESS,
HOVEROPTION_INCREASE_DRAWDIST,
HOVEROPTION_DECREASE_DRAWDIST,
@ -337,7 +347,7 @@ enum eCheckHover
HOVEROPTION_DECREASE_SFXVOLUME,
HOVEROPTION_INCREASE_MOUSESENS,
HOVEROPTION_DECREASE_MOUSESENS,
HOVEROPTION_42,
HOVEROPTION_NOT_HOVERING,
};
enum
@ -353,13 +363,19 @@ enum eControlMethod
struct tSkinInfo
{
int field_0;
int32 field_0;
char skinName[256];
char currSkinName[256];
char date[256];
tSkinInfo *field_304;
};
struct BottomBarOption
{
char name[8];
int32 screenId;
};
struct CMenuScreen
{
char m_ScreenName[8];
@ -387,8 +403,8 @@ public:
int32 m_nHelperTextMsgId;
bool m_bLanguageLoaded;
bool m_bMenuActive;
char field_112;
char field_113;
bool m_bMenuNotProcessed;
bool m_bWaitingForNewKeyBind;
bool m_bStartGameLoading;
bool m_bFirstTime;
bool m_bGameNotLoaded;
@ -399,46 +415,46 @@ public:
bool m_bShowMouse;
tSkinInfo m_sSkin;
tSkinInfo *m_pSelectedSkin;
tSkinInfo *field_438;
float field_43C;
int m_nCurrExSize;
int m_nSkinsTotal;
int32 m_nFirstVisibleRowOnList;
float m_nCurListItemY;
int32 m_nTotalListRow;
int32 m_nSkinsTotal;
char _unk0[4];
int m_nCurrExOption;
int32 m_nSelectedListRow;
bool m_bSkinsFound;
bool m_bQuitGameNoCD;
bool m_bRenderGameInMenu;
bool m_bSaveMenuActive;
bool m_bLoadingSavedGame;
char field_455;
char field_456;
bool m_bStartWaitingForKeyBind;
bool m_bSpritesLoaded;
CSprite2d m_aFrontEndSprites[28];
CSprite2d m_aMenuSprites[20];
int field_518;
int m_nMenuFadeAlpha;
char field_520;
char field_521;
char field_522;
char field_523;
char field_524;
int m_CurrCntrlAction;
int32 field_518;
int32 m_nMenuFadeAlpha;
bool m_bPressedPgUpOnList;
bool m_bPressedPgDnOnList;
bool m_bPressedUpOnList;
bool m_bPressedDownOnList;
bool m_bPressedScrollButton;
int32 m_CurrCntrlAction;
char _unk1[4];
int field_530;
char field_534;
char field_535;
int8 m_nCurrExLayer;
int m_nHelperTextAlpha;
int m_nMouseOldPosX;
int m_nMouseOldPosY;
int m_nHoverOption;
int m_nCurrScreen;
int m_nCurrOption;
int m_nPrevOption;
int m_nPrevScreen;
int32 field_530;
bool m_bKeyIsOK;
bool field_535;
int8 m_nCurrExLayer; // TODO: What's that?
int32 m_nHelperTextAlpha;
int32 m_nMouseOldPosX;
int32 m_nMouseOldPosY;
int32 m_nHoverOption;
int32 m_nCurrScreen;
int32 m_nCurrOption;
int32 m_nPrevOption;
int32 m_nPrevScreen;
uint32 field_558;
int m_nCurrSaveSlot;
int m_nScreenChangeDelayTimer;
int32 m_nCurrSaveSlot;
int32 m_nScreenChangeDelayTimer;
public:
bool GetIsMenuActive() {return !!m_bMenuActive;}
@ -473,8 +489,8 @@ public:
static float &menuXYpadding;
static float &actionTextScaleX;
static float &actionTextScaleY;
static int &sthWithButtons;
static int &sthWithButtons2;
static int32 &sthWithButtons;
static int32 &sthWithButtons2;
public:
static void BuildStatLine(char *text, void *stat, uint8 aFloat, void *stat2);
@ -510,7 +526,7 @@ public:
void Process();
void ProcessButtonPresses();
void ProcessOnOffMenuOptions();
static void RequestFrontEndShutdown();
static void RequestFrontEndShutDown();
static void RequestFrontEndStartUp();
void ResetHelperText();
void SaveLoadFileError_SetUpErrorScreen();
@ -526,8 +542,6 @@ public:
// New content:
uint8 GetNumberOfMenuOptions();
void SwitchToNewScreen(int32 screen);
void SetDefaultPreferences(int32 screen);
};
static_assert(sizeof(CMenuManager) == 0x564, "CMenuManager: error");

View File

@ -14,8 +14,8 @@ const CMenuScreen aScreens[] = {
// MENUPAGE_NEW_GAME = 2
{ "FET_SGA", MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 0, 1,
MENUACTION_CHANGEMENU, "FES_SNG", SAVESLOT_NONE, MENUPAGE_NEW_GAME_RELOAD,
MENUACTION_CHANGEMENU, "GMLOAD", SAVESLOT_NONE, MENUPAGE_CHOOSE_LOAD_SLOT,
MENUACTION_CHANGEMENU, "FES_DGA", SAVESLOT_NONE, MENUPAGE_CHOOSE_DELETE_SLOT,
MENUACTION_POPULATESLOTS_CHANGEMENU, "GMLOAD", SAVESLOT_NONE, MENUPAGE_CHOOSE_LOAD_SLOT,
MENUACTION_POPULATESLOTS_CHANGEMENU, "FES_DGA", SAVESLOT_NONE, MENUPAGE_CHOOSE_DELETE_SLOT,
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
},
@ -29,7 +29,7 @@ const CMenuScreen aScreens[] = {
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,
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS,
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
},
// MENUPAGE_SOUND_SETTINGS = 5
@ -41,7 +41,7 @@ const CMenuScreen aScreens[] = {
MENUACTION_DYNAMICACOUSTIC, "FET_DAM", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
MENUACTION_RADIO, "FEA_RSS", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
MENUACTION_RESTOREDEF, "FET_DEF", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
},
// MENUPAGE_GRAPHICS_SETTINGS = 6
@ -98,7 +98,7 @@ const CMenuScreen aScreens[] = {
{ "FET_NG", MENUPAGE_NEW_GAME, 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_NONE,
MENUACTION_NEWGAME, "FEM_YES", SAVESLOT_NONE, MENUPAGE_NEW_GAME_RELOAD,
},
// MENUPAGE_LOAD_SLOT_CONFIRM = 11
@ -175,15 +175,14 @@ const CMenuScreen aScreens[] = {
// MENUPAGE_SAVE = 24
#ifdef PS2_SAVE_DIALOG
{ "FET_SG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
MENUACTION_LABEL, "FES_SCG", SAVESLOT_NONE, MENUPAGE_NONE,
MENUACTION_CHANGEMENU, "FESZ_SA", SAVESLOT_NONE, MENUPAGE_CHOOSE_SAVE_SLOT,
MENUACTION_UPDATEMEMCARDSAVE, "FESZ_CA", SAVESLOT_NONE, MENUPAGE_NONE,
MENUACTION_RESUME_FROM_SAVEZONE, "FESZ_CA", SAVESLOT_NONE, MENUPAGE_NONE,
},
#else
{ "FET_SG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
MENUACTION_LABEL, "FES_SCG", SAVESLOT_NONE, MENUPAGE_NONE,
MENUACTION_UPDATESAVE, "GMSAVE", SAVESLOT_NONE, MENUPAGE_CHOOSE_SAVE_SLOT,
MENUACTION_UPDATEMEMCARDSAVE, "FESZ_CA", 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
@ -194,15 +193,15 @@ const CMenuScreen aScreens[] = {
// MENUPAGE_CHOOSE_SAVE_SLOT = 26
{ "FET_SG", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
MENUACTION_UPDATEMEMCARDSAVE, "FESZ_CA", SAVESLOT_NONE, MENUPAGE_NONE,
MENUACTION_UPDATESAVE, "FEM_SL1", SAVESLOT_1, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
MENUACTION_UPDATESAVE, "FEM_SL2", SAVESLOT_2, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
MENUACTION_UPDATESAVE, "FEM_SL3", SAVESLOT_3, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
MENUACTION_UPDATESAVE, "FEM_SL4", SAVESLOT_4, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
MENUACTION_UPDATESAVE, "FEM_SL5", SAVESLOT_5, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
MENUACTION_UPDATESAVE, "FEM_SL6", SAVESLOT_6, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
MENUACTION_UPDATESAVE, "FEM_SL7", SAVESLOT_7, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
MENUACTION_UPDATESAVE, "FEM_SL8", SAVESLOT_8, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
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,
MENUACTION_CHANGEMENU, "FEM_SL3", SAVESLOT_3, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
MENUACTION_CHANGEMENU, "FEM_SL4", SAVESLOT_4, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
MENUACTION_CHANGEMENU, "FEM_SL5", SAVESLOT_5, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
MENUACTION_CHANGEMENU, "FEM_SL6", SAVESLOT_6, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
MENUACTION_CHANGEMENU, "FEM_SL7", SAVESLOT_7, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
MENUACTION_CHANGEMENU, "FEM_SL8", SAVESLOT_8, MENUPAGE_SAVE_OVERWRITE_CONFIRM,
},
// MENUPAGE_SAVE_OVERWRITE_CONFIRM = 27
@ -298,10 +297,10 @@ const CMenuScreen aScreens[] = {
// MENUPAGE_OPTIONS = 41
{ "FET_OPT", MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 1, 4,
MENUACTION_CHANGEMENU, "FET_CTL", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
MENUACTION_CHANGEMENU, "FET_AUD", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
MENUACTION_LOADRADIO, "FET_AUD", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
MENUACTION_CHANGEMENU, "FET_DIS", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
MENUACTION_CHANGEMENU, "FET_LAN", SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS,
MENUACTION_CHANGEMENU, "FET_PSU", SAVESLOT_NONE, MENUPAGE_SKIN_SELECT,
MENUACTION_PLAYERSETUP, "FET_PSU", SAVESLOT_NONE, MENUPAGE_SKIN_SELECT,
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
},
@ -309,7 +308,7 @@ const CMenuScreen aScreens[] = {
{ "FET_QG", MENUPAGE_NONE, MENUPAGE_NONE, MENUPAGE_NONE, 2, 5,
MENUACTION_LABEL, "FEQ_SRE", SAVESLOT_NONE, MENUPAGE_NONE,
MENUACTION_CHANGEMENU, "FEM_NO", SAVESLOT_NONE, MENUPAGE_NONE,
MENUACTION_CANCLEGAME, "FEM_YES", SAVESLOT_NONE, MENUPAGE_NONE,
MENUACTION_CANCELGAME, "FEM_YES", SAVESLOT_NONE, MENUPAGE_NONE,
},
// MENUPAGE_SAVING_IN_PROGRESS = 43
@ -320,7 +319,7 @@ const CMenuScreen aScreens[] = {
// MENUPAGE_SAVE_SUCCESSFUL = 44
{ "FET_SG", MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, MENUPAGE_CHOOSE_SAVE_SLOT, 0, 0,
MENUACTION_LABEL, "FES_SSC", SAVESLOT_LABEL, MENUPAGE_NONE,
MENUACTION_UPDATEMEMCARDSAVE, "FEC_OKK", SAVESLOT_NONE, MENUPAGE_CHOOSE_SAVE_SLOT,
MENUACTION_RESUME_FROM_SAVEZONE, "FEC_OKK", SAVESLOT_NONE, MENUPAGE_CHOOSE_SAVE_SLOT,
},
// MENUPAGE_DELETING = 45
@ -380,12 +379,12 @@ const CMenuScreen aScreens[] = {
// MENUPAGE_SKIN_SELECT = 54
{ "FET_PSU", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 4, 4,
//MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_MULTIPLAYER_MAIN,
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,
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
},
// MENUPAGE_MOUSE_CONTROLS = 56

View File

@ -256,6 +256,11 @@ public:
bool GetMouseX1JustDown() { return !!(NewMouseControllerState.MXB1 && !OldMouseControllerState.MXB1); }
bool GetMouseX2JustDown() { return !!(NewMouseControllerState.MXB2 && !OldMouseControllerState.MXB2); }
bool GetLeftMouseJustUp() { return !!(!NewMouseControllerState.LMB && OldMouseControllerState.LMB); }
bool GetRightMouseJustUp() { return !!(!NewMouseControllerState.RMB && OldMouseControllerState.RMB); }
bool GetMiddleMouseJustUp() { return !!(!NewMouseControllerState.MMB && OldMouseControllerState.MMB); }
bool GetMouseWheelUpJustUp() { return !!(!NewMouseControllerState.WHEELUP && OldMouseControllerState.WHEELUP); }
bool GetMouseWheelDownJustUp() { return !!(!NewMouseControllerState.WHEELDN && OldMouseControllerState.WHEELDN); }
bool GetLeftMouse() { return NewMouseControllerState.LMB; }
bool GetRightMouse() { return NewMouseControllerState.RMB; }
@ -328,6 +333,12 @@ public:
bool GetEnterJustDown() { return GetPadEnterJustDown() || GetReturnJustDown(); }
bool GetAltJustDown() { return GetLeftAltJustDown() || GetRightAltJustDown(); }
bool GetLeftJustUp() { return !!(!NewKeyState.LEFT && OldKeyState.LEFT); }
bool GetRightJustUp() { return !!(!NewKeyState.RIGHT && OldKeyState.RIGHT); }
bool GetEnterJustUp() { return GetPadEnterJustUp() || GetReturnJustUp(); }
bool GetReturnJustUp() { return !!(!NewKeyState.EXTENTER && OldKeyState.EXTENTER); }
bool GetPadEnterJustUp() { return !!(!NewKeyState.ENTER && OldKeyState.ENTER); }
bool GetChar(int32 c) { return NewKeyState.VK_KEYS[c]; }
bool GetF(int32 n) { return NewKeyState.F[n]; }
bool GetEscape() { return NewKeyState.ESC; }
@ -392,6 +403,13 @@ public:
bool GetLeftStickXJustDown() { return !!(NewState.LeftStickX && !OldState.LeftStickX); }
bool GetLeftStickYJustDown() { return !!(NewState.LeftStickY && !OldState.LeftStickY); }
bool GetCrossJustUp() { return !!(!NewState.Cross && OldState.Cross); }
bool GetSquareJustUp() { return !!(!NewState.Square && OldState.Square); }
bool GetDPadUpJustUp() { return !!(!NewState.DPadUp && OldState.DPadUp); }
bool GetDPadDownJustUp() { return !!(!NewState.DPadDown && OldState.DPadDown); }
bool GetDPadLeftJustUp() { return !!(!NewState.DPadLeft && OldState.DPadLeft); }
bool GetDPadRightJustUp() { return !!(!NewState.DPadRight && OldState.DPadRight); }
bool GetTriangle() { return !!NewState.Triangle; }
bool GetCircle() { return !!NewState.Circle; }
bool GetCross() { return !!NewState.Cross; }

View File

@ -162,6 +162,7 @@ enum Config {
#define ASPECT_RATIO_SCALE // Not just makes everything scale with aspect ratio, also adds support for all aspect ratios
#define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC
#define PS2_SAVE_DIALOG // PS2 style save dialog with transparent black box
// #define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
// Script
#define USE_DEBUG_SCRIPT_LOADER // makes game load main_freeroam.scm by default

View File

@ -2,6 +2,7 @@
#include "ClumpModelInfo.h"
#include "PedType.h"
#include "PedStats.h"
enum PedNode {
PED_TORSO,
@ -24,7 +25,7 @@ class CPedModelInfo : public CClumpModelInfo
public:
uint32 m_animGroup;
ePedType m_pedType;
uint32 m_pedStatType;
ePedStats m_pedStatType;
uint32 m_carsCanDrive;
CColModel *m_hitColModel;
RpAtomic *m_head;

View File

@ -259,17 +259,17 @@ CCopPed::ScanForCrimes(void)
}
}
// Look for stolen cop cars (it was broken until now)
// Look for stolen cop cars
if (!m_bIsInPursuit) {
CPlayerPed *player = FindPlayerPed();
#ifdef FIX_BUGS
if ((player->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || player->m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER)
#else
if ((m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER || m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER)
#endif
&& player->m_pWanted->m_nWantedLevel == 0 && player->m_pMyVehicle) {
&& player->m_pWanted->m_nWantedLevel == 0) {
if (player->m_pMyVehicle->bIsLawEnforcer)
if (player->m_pMyVehicle
#ifdef FIX_BUGS
&& m_pMyVehicle == player->m_pMyVehicle
#endif
&& player->m_pMyVehicle->bIsLawEnforcer)
player->SetWantedLevelNoDrop(1);
}
}

View File

@ -2261,7 +2261,7 @@ CPed::SetModelIndex(uint32 mi)
RpAnimBlendClumpInit(GetClump());
RpAnimBlendClumpFillFrameArray(GetClump(), m_pFrames);
CPedModelInfo *modelInfo = (CPedModelInfo*)CModelInfo::GetModelInfo(m_modelIndex);
SetPedStats((ePedStats) modelInfo->m_pedStatType);
SetPedStats(modelInfo->m_pedStatType);
m_headingRate = m_pedStats->m_headingChangeRate;
m_animGroup = (AssocGroupId) modelInfo->m_animGroup;
CAnimManager::AddAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE);
@ -6928,11 +6928,9 @@ CPed::FinishLaunchCB(CAnimBlendAssociation *animAssoc, void *arg)
if (obstacle) {
animAssoc->flags |= ASSOC_DELETEFADEDOUT;
#ifndef VC_PED_PORTS
// ANIM_HIT_WALL in VC (which makes more sense)
CAnimBlendAssociation *handsCoverAssoc = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_HANDSCOWER, 8.0f);
#else
CAnimBlendAssociation* handsCoverAssoc = CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_HIT_WALL, 8.0f);
#endif
handsCoverAssoc->flags &= ~ASSOC_FADEOUTWHENDONE;
handsCoverAssoc->SetFinishCallback(FinishHitHeadCB, ped);
ped->bIsLanding = true;

View File

@ -4,7 +4,8 @@
#include "FileMgr.h"
#include "PedStats.h"
CPedStats *(&CPedStats::ms_apPedStats)[NUM_PEDSTATS] = *(CPedStats *(*)[NUM_PEDSTATS]) *(uintptr*)0x9404D4;
//CPedStats *(&CPedStats::ms_apPedStats)[NUM_PEDSTATS] = *(CPedStats *(*)[NUM_PEDSTATS]) *(uintptr*)0x9404D4;
CPedStats *CPedStats::ms_apPedStats[NUM_PEDSTATS];
void
CPedStats::Initialise(void)
@ -68,9 +69,9 @@ CPedStats::LoadPedStats(void)
line[linelen++] = ' ';
else
line[linelen++] = buf[bp];
line[linelen] = '\0';
}
bp++;
line[linelen] = '\0';
// skip white space
for(lp = 0; line[lp] <= ' '; lp++);
@ -107,14 +108,13 @@ CPedStats::LoadPedStats(void)
delete[] buf;
}
int32
ePedStats
CPedStats::GetPedStatType(char *name)
{
int type;
for(type = 0; type < NUM_PEDSTATS; type++)
for(uint16 type = 0; type < NUM_PEDSTATS; type++)
if(!CGeneral::faststrcmp(ms_apPedStats[type]->m_name, name))
return type;
return (ePedStats) type;
return NUM_PEDSTATS;
}

View File

@ -69,11 +69,11 @@ public:
float m_defendWeakness;
int16 m_flags;
static CPedStats* (&ms_apPedStats)[NUM_PEDSTATS];
static CPedStats *ms_apPedStats[NUM_PEDSTATS];
static void Initialise(void);
static void Shutdown(void);
static void LoadPedStats(void);
static int32 GetPedStatType(char *name);
static ePedStats GetPedStatType(char *name);
};
static_assert(sizeof(CPedStats) == 0x34, "CPedStats: error");

View File

@ -63,9 +63,9 @@ CPedType::LoadPedData(void)
line[linelen++] = ' ';
else
line[linelen++] = buf[bp];
line[linelen] = '\0';
}
bp++;
line[linelen] = '\0';
// skip white space
for(lp = 0; line[lp] <= ' '; lp++);
@ -74,7 +74,7 @@ CPedType::LoadPedData(void)
line[lp] == '#')
continue;
// FIX: game just uses line here
// Game uses just "line" here since sscanf already trims whitespace, but this is safer
sscanf(&line[lp], "%s", word);
if(strncmp(word, "Threat", 7) == 0){
@ -195,7 +195,8 @@ void
CPedType::Load(uint8 *buf, uint32 size)
{
INITSAVEBUF
CheckSaveHeader(buf, 'P','T','P','\0', size - SAVE_HEADER_SIZE);
// original: SkipSaveBuf(buf, SAVE_HEADER_SIZE);
CheckSaveHeader(buf, 'P', 'T', 'P', '\0', size - SAVE_HEADER_SIZE);
for(int i = 0; i < NUM_PEDTYPES; i++)
*ms_apPedType[i] = ReadSaveBuf<CPedType>(buf);

View File

@ -30,7 +30,8 @@
// More clearly they're transition areas between zones.
RegenerationPoint (&aSafeZones)[8] = *(RegenerationPoint(*)[8]) * (uintptr*)0x5FA578;
PedGroup (&CPopulation::ms_pPedGroups)[NUMPEDGROUPS] = *(PedGroup(*)[NUMPEDGROUPS]) * (uintptr*)0x6E9248;
//PedGroup (&CPopulation::ms_pPedGroups)[NUMPEDGROUPS] = *(PedGroup(*)[NUMPEDGROUPS]) * (uintptr*)0x6E9248;
PedGroup CPopulation::ms_pPedGroups[NUMPEDGROUPS];
bool &CPopulation::ms_bGivePedsWeapons = *(bool*)0x95CCF6;
int32 &CPopulation::m_AllRandomPedsThisType = *(int32*)0x5FA570;
float &CPopulation::PedDensityMultiplier = *(float*)0x5FA56C;
@ -80,7 +81,7 @@ CPopulation::Initialise()
ms_nNumDummy = 0;
m_AllRandomPedsThisType = -1;
PedDensityMultiplier = 1.0;
PedDensityMultiplier = 1.0f;
bZoneChangeHasHappened = false;
m_CountDownToPedsAtStart = 2;
@ -511,9 +512,9 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors)
uint32 weapon;
if (CGeneral::GetRandomNumberInRange(0, 100) >= 50)
weapon = ped->GiveWeapon(CGangs::GetGangWeapon2(pedType - PEDTYPE_GANG1), 25001);
weapon = ped->GiveWeapon(CGangs::GetGangInfo(pedType - PEDTYPE_GANG1)->m_Weapon2, 25001);
else
weapon = ped->GiveWeapon(CGangs::GetGangWeapon1(pedType - PEDTYPE_GANG1), 25001);
weapon = ped->GiveWeapon(CGangs::GetGangInfo(pedType - PEDTYPE_GANG1)->m_Weapon1, 25001);
ped->SetCurrentWeapon(weapon);
return ped;
}
@ -770,7 +771,7 @@ CPopulation::AddPedInCar(CVehicle* car)
// fall through
default:
int gangOfPed = GANG_MAFIA;
int gangOfPed = 0;
imSureThatModelIsLoaded = false;
while (gangOfPed < NUM_GANGS && CGangs::GetGangInfo(gangOfPed)->m_nVehicleMI != car->m_modelIndex)

View File

@ -33,7 +33,7 @@ struct RegenerationPoint
class CPopulation
{
public:
static PedGroup (&ms_pPedGroups)[NUMPEDGROUPS];
static PedGroup ms_pPedGroups[NUMPEDGROUPS];
static bool &ms_bGivePedsWeapons;
static int32 &m_AllRandomPedsThisType;
static float &PedDensityMultiplier;