ControllerConfig done

Fix Cam enum
This commit is contained in:
Fire-Head
2019-10-27 06:17:30 +03:00
parent 8baf410669
commit 537aaca5c2
18 changed files with 2872 additions and 275 deletions

View File

@ -102,8 +102,8 @@ CCamera::IsBoxVisible(RwV3d *box, const CMatrix *mat)
int
CCamera::GetLookDirection(void)
{
if(Cams[ActiveCam].Mode == CCam::MODE_CAMONASTRING ||
Cams[ActiveCam].Mode == CCam::MODE_FIRSTPERSON ||
if(Cams[ActiveCam].Mode == CCam::MODE_CAM_ON_A_STRING ||
Cams[ActiveCam].Mode == CCam::MODE_1STPERSON ||
Cams[ActiveCam].Mode == CCam::MODE_BEHINDBOAT ||
Cams[ActiveCam].Mode == CCam::MODE_FOLLOWPED)
return Cams[ActiveCam].DirectionWasLooking;
@ -113,7 +113,7 @@ CCamera::GetLookDirection(void)
bool
CCamera::GetLookingForwardFirstPerson()
{
return Cams[ActiveCam].Mode == CCam::MODE_FIRSTPERSON &&
return Cams[ActiveCam].Mode == CCam::MODE_1STPERSON &&
Cams[ActiveCam].DirectionWasLooking == LOOKING_FORWARD;
}
@ -1145,7 +1145,7 @@ CCam::FixCamIfObscured(CVector &TargetCoors, float TargetHeight, float TargetOri
if(Mode == MODE_BEHINDCAR)
Target.z += TargetHeight/2.0f;
if(Mode == MODE_CAMONASTRING){
if(Mode == MODE_CAM_ON_A_STRING){
UseEntityPos = true;
Target.z += TargetHeight/2.0f;
EntityPos = CamTargetEntity->GetPosition();
@ -1306,7 +1306,7 @@ CCam::Using3rdPersonMouseCam()
(Mode == MODE_FOLLOWPED ||
TheCamera.m_bPlayerIsInGarage &&
FindPlayerPed() && FindPlayerPed()->m_nPedState != PED_DRIVING &&
Mode != MODE_TOPDOWN1 && this->CamTargetEntity == FindPlayerPed());
Mode != MODE_TOPDOWN && this->CamTargetEntity == FindPlayerPed());
}
bool

View File

@ -11,14 +11,15 @@ struct CCam
{
enum
{
MODE_TOPDOWN1 = 1,
MODE_TOPDOWN2,
MODE_NONE = 0,
MODE_TOPDOWN,
MODE_GTACLASSIC,
MODE_BEHINDCAR,
MODE_FOLLOWPED,
MODE_AIMING,
MODE_DEBUG,
MODE_SNIPER,
MODE_ROCKET,
MODE_ROCKETLAUNCHER,
MODE_MODELVIEW,
MODE_BILL,
MODE_SYPHON,
@ -26,35 +27,35 @@ struct CCam
MODE_CHEESYZOOM,
MODE_WHEELCAM,
MODE_FIXED,
MODE_FIRSTPERSON,
MODE_1STPERSON,
MODE_FLYBY,
MODE_CAMONASTRING,
MODE_REACTIONCAM,
MODE_FOLLOWPEDWITHBINDING,
MODE_CHRISWITHBINDINGPLUSROTATION,
MODE_CAM_ON_A_STRING,
MODE_REACTION,
MODE_FOLLOW_PED_WITH_BIND,
MODE_CHRIS,
MODE_BEHINDBOAT,
MODE_PLAYERFALLENWATER,
MODE_CAMONTRAINROOF,
MODE_CAMRUNNINGSIDETRAIN,
MODE_BLOODONTHETRACKS,
MODE_IMTHEPASSENGERWOOWOO,
MODE_SYPHONCRIMINFRONT,
MODE_PEDSDEADBABY,
MODE_CUSHYPILLOWSARSE,
MODE_LOOKATCARS,
MODE_ARRESTCAMONE,
MODE_ARRESTCAMTWO,
MODE_M16FIRSTPERSON_34,
MODE_SPECIALFIXEDFORSYPHON,
MODE_FIGHT,
MODE_TOPDOWNPED,
MODE_SNIPER_RUN_AROUND,
MODE_ROCKET_RUN_AROUND,
MODE_FIRSTPERSONPEDONPC_40,
MODE_FIRSTPERSONPEDONPC_41,
MODE_FIRSTPERSONPEDONPC_42,
MODE_PLAYER_FALLEN_WATER,
MODE_CAM_ON_TRAIN_ROOF,
MODE_CAM_RUNNING_SIDE_TRAIN,
MODE_BLOOD_ON_THE_TRACKS,
MODE_IM_THE_PASSENGER_WOOWOO,
MODE_SYPHON_CRIM_IN_FRONT,
MODE_PED_DEAD_BABY,
MODE_PILLOWS_PAPS,
MODE_LOOK_AT_CARS,
MODE_ARRESTCAM_ONE,
MODE_ARRESTCAM_TWO,
MODE_M16_1STPERSON,
MODE_SPECIAL_FIXED_FOR_SYPHON,
MODE_FIGHT_CAM,
MODE_TOP_DOWN_PED,
MODE_SNIPER_RUNABOUT,
MODE_ROCKETLAUNCHER_RUNABOUT,
MODE_1STPERSON_RUNABOUT,
MODE_M16_1STPERSON_RUNABOUT,
MODE_FIGHT_CAM_RUNABOUT,
MODE_EDITOR,
MODE_M16FIRSTPERSON_44
MODE_HELICANNON_1STPERSON, // vice city leftover
};
bool bBelowMinDist; //used for follow ped mode

File diff suppressed because it is too large Load Diff

View File

@ -5,53 +5,191 @@
enum eControllerType
{
KEYBOARD,
KEYBOARD = 0,
OPTIONAL_EXTRA,
MOUSE,
JOYSTICK,
MAX_CONTROLLERTYPES,
};
enum e_ControllerAction
{
PED_FIREWEAPON = 0,
PED_CYCLE_WEAPON_RIGHT,
PED_CYCLE_WEAPON_LEFT,
GO_FORWARD,
GO_BACK,
GO_LEFT,
GO_RIGHT,
PED_SNIPER_ZOOM_IN,
PED_SNIPER_ZOOM_OUT,
VEHICLE_ENTER_EXIT,
CAMERA_CHANGE_VIEW_ALL_SITUATIONS,
PED_JUMPING,
PED_SPRINT,
PED_LOOKBEHIND,
VEHICLE_ACCELERATE,
VEHICLE_BRAKE,
VEHICLE_CHANGE_RADIO_STATION,
VEHICLE_HORN,
TOGGLE_SUBMISSIONS,
VEHICLE_HANDBRAKE,
PED_1RST_PERSON_LOOK_LEFT,
PED_1RST_PERSON_LOOK_RIGHT,
VEHICLE_LOOKLEFT,
VEHICLE_LOOKRIGHT,
VEHICLE_LOOKBEHIND,
VEHICLE_TURRETLEFT,
VEHICLE_TURRETRIGHT,
VEHICLE_TURRETUP,
VEHICLE_TURRETDOWN,
PED_CYCLE_TARGET_LEFT,
PED_CYCLE_TARGET_RIGHT,
PED_CENTER_CAMERA_BEHIND_PLAYER,
PED_LOCK_TARGET,
NETWORK_TALK,
PED_1RST_PERSON_LOOK_UP,
PED_1RST_PERSON_LOOK_DOWN,
_CONTROLLERACTION_36, // Unused
TOGGLE_DPAD,
SWITCH_DEBUG_CAM_ON,
TAKE_SCREEN_SHOT,
SHOW_MOUSE_POINTER_TOGGLE,
MAX_CONTROLLERACTIONS,
};
enum e_ControllerActionType
{
ACTIONTYPE_1RSTPERSON = 0,
ACTIONTYPE_3RDPERSON,
ACTIONTYPE_VEHICLE,
ACTIONTYPE_VEHICLE_3RDPERSON,
ACTIONTYPE_COMMON,
ACTIONTYPE_1RST3RDPERSON,
ACTIONTYPE_NONE,
};
enum eContSetOrder
{
SETORDER_NONE = 0,
SETORDER_1,
SETORDER_2,
SETORDER_3,
SETORDER_4,
MAX_SETORDERS,
};
enum eSimCheckers
{
SIM_X1 = 0, SIM_Y1, // DPad
SIM_X2, SIM_Y2, // LeftStick
MAX_SIMS
};
class CMouseControllerState;
class CControllerState;
#define JOY_BUTTONS 16
#define MAX_BUTTONS (JOY_BUTTONS+1)
class CControllerConfigManager
{
public:
struct tControllerConfigBind
{
RsKeyCodes m_Key;
int32 m_ContSetOrder;
int32 m_Key;
int32 m_ContSetOrder;
tControllerConfigBind()
{
m_Key = 0;
m_ContSetOrder = 0;
}
};
bool firstCapture;
bool m_bFirstCapture;
char _pad0[3];
DIJOYSTATE2 m_OldState;
DIJOYSTATE2 m_NewState;
wchar m_aActionNames[41][40];
bool m_aButtonStates[17];
#ifdef __DINPUT_INCLUDED__
DIJOYSTATE2 m_OldState;
DIJOYSTATE2 m_NewState;
#endif
wchar m_aActionNames[MAX_CONTROLLERACTIONS][40];
bool m_aButtonStates[MAX_BUTTONS];
char _pad1[3];
tControllerConfigBind m_aSettings[41][4];
uint8 m_aSimCheckers[4][4];
bool m_bMouseAssociated;
tControllerConfigBind m_aSettings[MAX_CONTROLLERACTIONS][MAX_CONTROLLERTYPES];
bool m_aSimCheckers[MAX_SIMS][MAX_CONTROLLERTYPES];
bool m_bMouseAssociated;
char _pad2[3];
void UpdateJoyButtonState(int padnumber);
void UpdateJoyInConfigMenus_ButtonDown(int button, int padnumber);
void AffectControllerStateOn_ButtonDown(int button, eControllerType type);
void UpdateJoyInConfigMenus_ButtonUp(int button, int padnumber);
void AffectControllerStateOn_ButtonUp(int button, int padnumber);
CControllerConfigManager();
void MakeControllerActionsBlank();
int32 GetJoyButtonJustDown();
void LoadSettings(int32 file);
void SaveSettings(int32 file);
void MakeControllerActionsBlank();
void InitDefaultControlConfiguration();
void InitDefaultControlConfigMouse(CMouseControllerState const &mousestate);
void InitDefaultControlConfigJoyPad(unsigned int buttons);
void ClearSimButtonPressCheckers();
void AffectPadFromKeyBoard();
void AffectPadFromMouse();
void ClearSettingsAssociatedWithAction(int, int);
void SaveSettings(int32 file);
void LoadSettings(int32 file);
void InitDefaultControlConfiguration();
void InitDefaultControlConfigMouse(CMouseControllerState const &availableButtons);
void InitDefaultControlConfigJoyPad(uint32 buttons);
void InitialiseControllerActionNameArray();
void UpdateJoyInConfigMenus_ButtonDown (int32 button, int32 padnumber);
void AffectControllerStateOn_ButtonDown (int32 button, eControllerType type);
void AffectControllerStateOn_ButtonDown_Driving (int32 button, eControllerType type, CControllerState &state);
void AffectControllerStateOn_ButtonDown_FirstPersonOnly (int32 button, eControllerType type, CControllerState &state);
void AffectControllerStateOn_ButtonDown_ThirdPersonOnly (int32 button, eControllerType type, CControllerState &state);
void AffectControllerStateOn_ButtonDown_FirstAndThirdPersonOnly (int32 button, eControllerType type, CControllerState &state);
void AffectControllerStateOn_ButtonDown_AllStates (int32 button, eControllerType type, CControllerState &state);
void AffectControllerStateOn_ButtonDown_VehicleAndThirdPersonOnly(int32 button, eControllerType type, CControllerState &state);
void UpdateJoyInConfigMenus_ButtonUp(int32 button, int32 padnumber);
void AffectControllerStateOn_ButtonUp(int32 button, eControllerType type);
void AffectControllerStateOn_ButtonUp_All_Player_States(int32 button, eControllerType type, CControllerState &state);
void AffectPadFromKeyBoard();
void AffectPadFromMouse();
void ClearSimButtonPressCheckers();
bool GetIsKeyboardKeyDown (RsKeyCodes keycode);
bool GetIsKeyboardKeyJustDown(RsKeyCodes keycode);
bool GetIsMouseButtonDown (RsKeyCodes keycode);
bool GetIsMouseButtonUp (RsKeyCodes keycode);
void DeleteMatchingCommonControls (e_ControllerAction action, int32 key, eControllerType type);
void DeleteMatching3rdPersonControls (e_ControllerAction action, int32 key, eControllerType type);
void DeleteMatching1rst3rdPersonControls (e_ControllerAction action, int32 key, eControllerType type);
void DeleteMatchingVehicleControls (e_ControllerAction action, int32 key, eControllerType type);
void DeleteMatchingVehicle_3rdPersonControls(e_ControllerAction action, int32 key, eControllerType type);
void DeleteMatching1rstPersonControls (e_ControllerAction action, int32 key, eControllerType type);
void DeleteMatchingActionInitiators (e_ControllerAction action, int32 key, eControllerType type);
bool GetIsKeyBlank(int32 key, eControllerType type);
e_ControllerActionType GetActionType(e_ControllerAction action);
void ClearSettingsAssociatedWithAction (e_ControllerAction action, eControllerType type);
wchar *GetControllerSettingTextWithOrderNumber(e_ControllerAction action, eContSetOrder setorder);
wchar *GetControllerSettingTextKeyBoard (e_ControllerAction action, eControllerType type);
wchar *GetControllerSettingTextMouse (e_ControllerAction action);
wchar *GetControllerSettingTextJoystick (e_ControllerAction action);
int32 GetNumOfSettingsForAction(e_ControllerAction action);
void GetWideStringOfCommandKeys(uint16 action, wchar *text, uint16 leight);
int32 GetControllerKeyAssociatedWithAction(e_ControllerAction action, eControllerType type);
void UpdateJoyButtonState(int32 padnumber);
bool GetIsActionAButtonCombo (e_ControllerAction action);
wchar *GetButtonComboText (e_ControllerAction action);
void SetControllerKeyAssociatedWithAction(e_ControllerAction action, int32 key, eControllerType type);
int32 GetMouseButtonAssociatedWithAction (e_ControllerAction action);
void SetMouseButtonAssociatedWithAction (e_ControllerAction action, int32 button);
void ResetSettingOrder (e_ControllerAction action);
};
VALIDATE_SIZE(CControllerConfigManager, 0x143C);

View File

@ -1467,7 +1467,7 @@ void CMenuManager::Process(void)
else {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
for (int i = 0; i < 4; i++)
ControlsManager.ClearSettingsAssociatedWithAction(m_CurrCntrlAction, i);
ControlsManager.ClearSettingsAssociatedWithAction((e_ControllerAction)m_CurrCntrlAction, (eControllerType)i);
field_534 = false;
m_bKeyChangeNotProcessed = false;
pControlEdit = nil;

View File

@ -342,6 +342,12 @@ enum
NUM_MENUROWS = 18,
};
enum eControlMethod
{
CONTROL_STANDART = 0,
CONTROL_CLASSIC,
};
struct tSkinInfo
{
int field_0;
@ -431,6 +437,9 @@ public:
int m_nCurrSaveSlot;
int m_nScreenChangeDelayTimer;
public:
bool GetIsMenuActive() {return !!m_bMenuActive;}
public:
static int32 &OS_Language;
static int8 &m_PrefsUseVibration;

View File

@ -1,56 +1,5 @@
#pragma once
// same as RW skeleton
/*
enum Key
{
// ascii...
KEY_ESC = 128,
KEY_F1 = 129,
KEY_F2 = 130,
KEY_F3 = 131,
KEY_F4 = 132,
KEY_F5 = 133,
KEY_F6 = 134,
KEY_F7 = 135,
KEY_F8 = 136,
KEY_F9 = 137,
KEY_F10 = 138,
KEY_F11 = 139,
KEY_F12 = 140,
KEY_INS = 141,
KEY_DEL = 142,
KEY_HOME = 143,
KEY_END = 144,
KEY_PGUP = 145,
KEY_PGDN = 146,
KEY_UP = 147,
KEY_DOWN = 148,
KEY_LEFT = 149,
KEY_RIGHT = 150,
// some stuff ommitted
KEY_BACKSP = 168,
KEY_TAB = 169,
KEY_CAPSLK = 170,
KEY_ENTER = 171,
KEY_LSHIFT = 172,
KEY_RSHIFT = 173,
KEY_LCTRL = 174,
KEY_RCTRL = 175,
KEY_LALT = 176,
KEY_RALT = 177,
KEY_NULL, // unused
KEY_NUMKEYS
};
*/
enum {
PLAYERCONTROL_ENABLED = 0,
PLAYERCONTROL_DISABLED_1 = 1,
@ -299,61 +248,130 @@ public:
static int32 *EditCodesForControls(int32 *pRsKeys, int32 nSize);
// mouse
bool GetLeftMouseJustDown() { return !!(NewMouseControllerState.LMB && !OldMouseControllerState.LMB); }
bool GetRightMouseJustDown() { return !!(NewMouseControllerState.RMB && !OldMouseControllerState.RMB); }
bool GetLeftMouseJustDown() { return !!(NewMouseControllerState.LMB && !OldMouseControllerState.LMB); }
bool GetRightMouseJustDown() { return !!(NewMouseControllerState.RMB && !OldMouseControllerState.RMB); }
bool GetMiddleMouseJustDown() { return !!(NewMouseControllerState.MMB && !OldMouseControllerState.MMB); }
bool GetMouseWheelUp() { return !!(NewMouseControllerState.WHEELUP && !OldMouseControllerState.WHEELUP); }
bool GetMouseWheelDown() { return !!(NewMouseControllerState.WHEELDN && !OldMouseControllerState.WHEELDN);}
bool GetMouseX1() { return !!(NewMouseControllerState.MXB1 && !OldMouseControllerState.MXB1); }
bool GetMouseX2() { return !!(NewMouseControllerState.MXB2 && !OldMouseControllerState.MXB2); }
bool GetLeftMouse() { return NewMouseControllerState.LMB; }
bool GetRightMouse() { return NewMouseControllerState.RMB; }
bool GetMiddleMouse() { return NewMouseControllerState.MMB; }
bool GetMouseWheelUp() { return NewMouseControllerState.WHEELUP; }
bool GetMouseWheelDown() { return NewMouseControllerState.WHEELDN; }
bool GetMouseX1() { return NewMouseControllerState.MXB1; }
bool GetMouseX2() { return NewMouseControllerState.MXB2; }
bool GetLeftMouseUp() { return !OldMouseControllerState.LMB; }
bool GetRightMouseUp() { return !OldMouseControllerState.RMB; }
bool GetMiddleMouseUp() { return !OldMouseControllerState.MMB; }
bool GetMouseWheelUpUp() { return !OldMouseControllerState.WHEELUP; }
bool GetMouseWheelDownUp() { return !OldMouseControllerState.WHEELDN; }
bool GetMouseX1Up() { return !OldMouseControllerState.MXB1; }
bool GetMouseX2Up() { return !OldMouseControllerState.MXB2; }
float GetMouseX() { return NewMouseControllerState.x; }
float GetMouseY() { return NewMouseControllerState.y; }
// keyboard
bool GetCharJustDown(int32 c) { return !!(NewKeyState.VK_KEYS[c] && !OldKeyState.VK_KEYS[c]); }
bool GetFJustDown(int32 n) { return !!(NewKeyState.F[n] && !OldKeyState.F[n]); }
bool GetEscapeJustDown() { return !!(NewKeyState.ESC && !OldKeyState.ESC); }
bool GetInsertJustDown() { return !!(NewKeyState.INS && !OldKeyState.INS); }
bool GetDeleteJustDown() { return !!(NewKeyState.DEL && !OldKeyState.DEL); }
bool GetHomeJustDown() { return !!(NewKeyState.HOME && !OldKeyState.HOME); }
bool GetEndJustDown() { return !!(NewKeyState.END && !OldKeyState.END); }
bool GetPageUpJustDown() { return !!(NewKeyState.PGUP && !OldKeyState.PGUP); }
bool GetPageDownJustDown() { return !!(NewKeyState.PGDN && !OldKeyState.PGDN); }
bool GetUpJustDown() { return !!(NewKeyState.UP && !OldKeyState.UP); }
bool GetDownJustDown() { return !!(NewKeyState.DOWN && !OldKeyState.DOWN); }
bool GetLeftJustDown() { return !!(NewKeyState.LEFT && !OldKeyState.LEFT); }
bool GetRightJustDown() { return !!(NewKeyState.RIGHT && !OldKeyState.RIGHT); }
bool GetScrollLockJustDown() { return !!(NewKeyState.SCROLLLOCK && !OldKeyState.SCROLLLOCK); }
bool GetPauseJustDown() { return !!(NewKeyState.PAUSE && !OldKeyState.PAUSE); }
bool GetNumLockJustDown() { return !!(NewKeyState.NUMLOCK && !OldKeyState.NUMLOCK); }
bool GetDivideJustDown() { return !!(NewKeyState.DIV && !OldKeyState.DIV); }
bool GetTimesJustDown() { return !!(NewKeyState.MUL && !OldKeyState.MUL); }
bool GetMinusJustDown() { return !!(NewKeyState.SUB && !OldKeyState.SUB); }
bool GetPlusJustDown() { return !!(NewKeyState.ADD && !OldKeyState.ADD); }
bool GetPadEnterJustDown() { return !!(NewKeyState.ENTER && !OldKeyState.ENTER); } // GetEnterJustDown
bool GetPadDelJustDown() { return !!(NewKeyState.DECIMAL && !OldKeyState.DECIMAL); }
bool GetPad1JustDown() { return !!(NewKeyState.NUM1 && !OldKeyState.NUM1); }
bool GetPad2JustDown() { return !!(NewKeyState.NUM2 && !OldKeyState.NUM2); }
bool GetPad3JustDown() { return !!(NewKeyState.NUM3 && !OldKeyState.NUM3); }
bool GetPad4JustDown() { return !!(NewKeyState.NUM4 && !OldKeyState.NUM4); }
bool GetPad5JustDown() { return !!(NewKeyState.NUM5 && !OldKeyState.NUM5); }
bool GetPad6JustDown() { return !!(NewKeyState.NUM6 && !OldKeyState.NUM6); }
bool GetPad7JustDown() { return !!(NewKeyState.NUM7 && !OldKeyState.NUM7); }
bool GetPad8JustDown() { return !!(NewKeyState.NUM8 && !OldKeyState.NUM8); }
bool GetPad9JustDown() { return !!(NewKeyState.NUM9 && !OldKeyState.NUM9); }
bool GetPad0JustDown() { return !!(NewKeyState.NUM0 && !OldKeyState.NUM0); }
bool GetBackspaceJustDown() { return !!(NewKeyState.BACKSP && !OldKeyState.BACKSP); }
bool GetTabJustDown() { return !!(NewKeyState.TAB && !OldKeyState.TAB); }
bool GetCapsLockJustDown() { return !!(NewKeyState.CAPSLOCK && !OldKeyState.CAPSLOCK); }
bool GetEnterJustDown() { return !!(NewKeyState.EXTENTER && !OldKeyState.EXTENTER); }
bool GetLeftShiftJustDown() { return !!(NewKeyState.LSHIFT && !OldKeyState.LSHIFT); }
bool GetShiftJustDown() { return !!(NewKeyState.SHIFT && !OldKeyState.SHIFT); }
bool GetRightShiftJustDown() { return !!(NewKeyState.RSHIFT && !OldKeyState.RSHIFT); }
bool GetLeftCtrlJustDown() { return !!(NewKeyState.LCTRL && !OldKeyState.LCTRL); }
bool GetRightCtrlJustDown() { return !!(NewKeyState.RCTRL && !OldKeyState.RCTRL); }
bool GetLeftAltJustDown() { return !!(NewKeyState.LALT && !OldKeyState.LALT); }
bool GetRightAltJustDown() { return !!(NewKeyState.RALT && !OldKeyState.RALT); }
bool GetLeftWinJustDown() { return !!(NewKeyState.LWIN && !OldKeyState.LWIN); }
bool GetRightWinJustDown() { return !!(NewKeyState.RWIN && !OldKeyState.RWIN); }
bool GetAppsJustDown() { return !!(NewKeyState.APPS && !OldKeyState.APPS); }
bool GetFJustDown(int32 n) { return !!(NewKeyState.F[n] && !OldKeyState.F[n]); }
bool GetEscapeJustDown() { return !!(NewKeyState.ESC && !OldKeyState.ESC); }
bool GetInsertJustDown() { return !!(NewKeyState.INS && !OldKeyState.INS); }
bool GetDeleteJustDown() { return !!(NewKeyState.DEL && !OldKeyState.DEL); }
bool GetHomeJustDown() { return !!(NewKeyState.HOME && !OldKeyState.HOME); }
bool GetEndJustDown() { return !!(NewKeyState.END && !OldKeyState.END); }
bool GetPageUpJustDown() { return !!(NewKeyState.PGUP && !OldKeyState.PGUP); }
bool GetPageDownJustDown() { return !!(NewKeyState.PGDN && !OldKeyState.PGDN); }
bool GetUpJustDown() { return !!(NewKeyState.UP && !OldKeyState.UP); }
bool GetDownJustDown() { return !!(NewKeyState.DOWN && !OldKeyState.DOWN); }
bool GetLeftJustDown() { return !!(NewKeyState.LEFT && !OldKeyState.LEFT); }
bool GetRightJustDown() { return !!(NewKeyState.RIGHT && !OldKeyState.RIGHT); }
bool GetScrollLockJustDown() { return !!(NewKeyState.SCROLLLOCK && !OldKeyState.SCROLLLOCK); }
bool GetPauseJustDown() { return !!(NewKeyState.PAUSE && !OldKeyState.PAUSE); }
bool GetNumLockJustDown() { return !!(NewKeyState.NUMLOCK && !OldKeyState.NUMLOCK); }
bool GetDivideJustDown() { return !!(NewKeyState.DIV && !OldKeyState.DIV); }
bool GetTimesJustDown() { return !!(NewKeyState.MUL && !OldKeyState.MUL); }
bool GetMinusJustDown() { return !!(NewKeyState.SUB && !OldKeyState.SUB); }
bool GetPlusJustDown() { return !!(NewKeyState.ADD && !OldKeyState.ADD); }
bool GetPadEnterJustDown() { return !!(NewKeyState.ENTER && !OldKeyState.ENTER); } // GetEnterJustDown
bool GetPadDelJustDown() { return !!(NewKeyState.DECIMAL && !OldKeyState.DECIMAL); }
bool GetPad1JustDown() { return !!(NewKeyState.NUM1 && !OldKeyState.NUM1); }
bool GetPad2JustDown() { return !!(NewKeyState.NUM2 && !OldKeyState.NUM2); }
bool GetPad3JustDown() { return !!(NewKeyState.NUM3 && !OldKeyState.NUM3); }
bool GetPad4JustDown() { return !!(NewKeyState.NUM4 && !OldKeyState.NUM4); }
bool GetPad5JustDown() { return !!(NewKeyState.NUM5 && !OldKeyState.NUM5); }
bool GetPad6JustDown() { return !!(NewKeyState.NUM6 && !OldKeyState.NUM6); }
bool GetPad7JustDown() { return !!(NewKeyState.NUM7 && !OldKeyState.NUM7); }
bool GetPad8JustDown() { return !!(NewKeyState.NUM8 && !OldKeyState.NUM8); }
bool GetPad9JustDown() { return !!(NewKeyState.NUM9 && !OldKeyState.NUM9); }
bool GetPad0JustDown() { return !!(NewKeyState.NUM0 && !OldKeyState.NUM0); }
bool GetBackspaceJustDown() { return !!(NewKeyState.BACKSP && !OldKeyState.BACKSP); }
bool GetTabJustDown() { return !!(NewKeyState.TAB && !OldKeyState.TAB); }
bool GetCapsLockJustDown() { return !!(NewKeyState.CAPSLOCK && !OldKeyState.CAPSLOCK); }
bool GetEnterJustDown() { return !!(NewKeyState.EXTENTER && !OldKeyState.EXTENTER); }
bool GetLeftShiftJustDown() { return !!(NewKeyState.LSHIFT && !OldKeyState.LSHIFT); }
bool GetShiftJustDown() { return !!(NewKeyState.SHIFT && !OldKeyState.SHIFT); }
bool GetRightShiftJustDown() { return !!(NewKeyState.RSHIFT && !OldKeyState.RSHIFT); }
bool GetLeftCtrlJustDown() { return !!(NewKeyState.LCTRL && !OldKeyState.LCTRL); }
bool GetRightCtrlJustDown() { return !!(NewKeyState.RCTRL && !OldKeyState.RCTRL); }
bool GetLeftAltJustDown() { return !!(NewKeyState.LALT && !OldKeyState.LALT); }
bool GetRightAltJustDown() { return !!(NewKeyState.RALT && !OldKeyState.RALT); }
bool GetLeftWinJustDown() { return !!(NewKeyState.LWIN && !OldKeyState.LWIN); }
bool GetRightWinJustDown() { return !!(NewKeyState.RWIN && !OldKeyState.RWIN); }
bool GetAppsJustDown() { return !!(NewKeyState.APPS && !OldKeyState.APPS); }
bool GetChar(int32 c) { return NewKeyState.VK_KEYS[c]; }
bool GetF(int32 n) { return NewKeyState.F[n]; }
bool GetEscape() { return NewKeyState.ESC; }
bool GetInsert() { return NewKeyState.INS; }
bool GetDelete() { return NewKeyState.DEL; }
bool GetHome() { return NewKeyState.HOME; }
bool GetEnd() { return NewKeyState.END; }
bool GetPageUp() { return NewKeyState.PGUP; }
bool GetPageDown() { return NewKeyState.PGDN; }
bool GetUp() { return NewKeyState.UP; }
bool GetDown() { return NewKeyState.DOWN; }
bool GetLeft() { return NewKeyState.LEFT; }
bool GetRight() { return NewKeyState.RIGHT; }
bool GetScrollLock() { return NewKeyState.SCROLLLOCK; }
bool GetPause() { return NewKeyState.PAUSE; }
bool GetNumLock() { return NewKeyState.NUMLOCK; }
bool GetDivide() { return NewKeyState.DIV; }
bool GetTimes() { return NewKeyState.MUL; }
bool GetMinus() { return NewKeyState.SUB; }
bool GetPlus() { return NewKeyState.ADD; }
bool GetPadEnter() { return NewKeyState.ENTER; } // GetEnterJustDown
bool GetPadDel() { return NewKeyState.DECIMAL; }
bool GetPad1() { return NewKeyState.NUM1; }
bool GetPad2() { return NewKeyState.NUM2; }
bool GetPad3() { return NewKeyState.NUM3; }
bool GetPad4() { return NewKeyState.NUM4; }
bool GetPad5() { return NewKeyState.NUM5; }
bool GetPad6() { return NewKeyState.NUM6; }
bool GetPad7() { return NewKeyState.NUM7; }
bool GetPad8() { return NewKeyState.NUM8; }
bool GetPad9() { return NewKeyState.NUM9; }
bool GetPad0() { return NewKeyState.NUM0; }
bool GetBackspace() { return NewKeyState.BACKSP; }
bool GetTab() { return NewKeyState.TAB; }
bool GetCapsLock() { return NewKeyState.CAPSLOCK; }
bool GetEnter() { return NewKeyState.EXTENTER; }
bool GetLeftShift() { return NewKeyState.LSHIFT; }
bool GetShift() { return NewKeyState.SHIFT; }
bool GetRightShift() { return NewKeyState.RSHIFT; }
bool GetLeftCtrl() { return NewKeyState.LCTRL; }
bool GetRightCtrl() { return NewKeyState.RCTRL; }
bool GetLeftAlt() { return NewKeyState.LALT; }
bool GetRightAlt() { return NewKeyState.RALT; }
bool GetLeftWin() { return NewKeyState.LWIN; }
bool GetRightWin() { return NewKeyState.RWIN; }
bool GetApps() { return NewKeyState.APPS; }
// pad
bool GetTriangleJustDown() { return !!(NewState.Triangle && !OldState.Triangle); }
@ -369,22 +387,15 @@ public:
bool GetRightShoulder1JustDown() { return !!(NewState.RightShoulder1 && !OldState.RightShoulder1); }
bool GetRightShoulder2JustDown() { return !!(NewState.RightShoulder2 && !OldState.RightShoulder2); }
bool GetStartJustDown() { return !!(NewState.Start && !OldState.Start); }
/*
int32 GetLeftShoulder1(void) { return NewState.LeftShoulder1; }
int32 GetLeftShoulder2(void) { return NewState.LeftShoulder2; }
int32 GetRightShoulder1(void) { return NewState.RightShoulder1; }
int32 GetRightShoulder2(void) { return NewState.RightShoulder2; }
*/
bool GetTriangle() { return !!NewState.Triangle; }
bool GetCircle() { return !!NewState.Circle; }
bool GetCross() { return !!NewState.Cross; }
bool GetSquare() { return !!NewState.Square; }
bool GetDPadUp() { return !!NewState.DPadUp; }
bool GetDPadDown() { return !!NewState.DPadDown; }
bool GetDPadLeft() { return !!NewState.DPadLeft; }
bool GetDPadRight() { return !!NewState.DPadRight; }
bool GetTriangle() { return !!NewState.Triangle; }
bool GetCircle() { return !!NewState.Circle; }
bool GetCross() { return !!NewState.Cross; }
bool GetSquare() { return !!NewState.Square; }
bool GetDPadUp() { return !!NewState.DPadUp; }
bool GetDPadDown() { return !!NewState.DPadDown; }
bool GetDPadLeft() { return !!NewState.DPadLeft; }
bool GetDPadRight() { return !!NewState.DPadRight; }
bool GetLeftShoulder1(void) { return !!NewState.LeftShoulder1; }
bool GetLeftShoulder2(void) { return !!NewState.LeftShoulder2; }
bool GetRightShoulder1(void) { return !!NewState.RightShoulder1; }
@ -392,8 +403,6 @@ public:
bool ArePlayerControlsDisabled(void) { return DisablePlayerControls != PLAYERCONTROL_ENABLED; }
};
VALIDATE_SIZE(CPad, 0xFC);
extern CPad *Pads; //[2]
#define IsButtonJustDown(pad, btn) \
(!(pad)->OldState.btn && (pad)->NewState.btn)

View File

@ -275,7 +275,7 @@ void CRadar::DrawBlips()
TransformRadarPointToScreenSpace(out, in);
float angle;
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1)
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN)
angle = PI + FindPlayerHeading();
#ifdef FIX_BUGS
else if (TheCamera.GetLookDirection() != LOOKING_FORWARD)
@ -1081,14 +1081,14 @@ void CRadar::TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D
s = -Sin(TheCamera.GetForward().Heading());
c = Cos(TheCamera.GetForward().Heading());
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1 || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWNPED) {
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOP_DOWN_PED) {
s = 0.0f;
c = 1.0f;
}
else if (TheCamera.GetLookDirection() != LOOKING_FORWARD) {
CVector forward;
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_FIRSTPERSON) {
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON) {
forward = TheCamera.Cams[TheCamera.ActiveCam].CamTargetEntity->GetForward();
forward.Normalise(); // a bit useless...
}
@ -1120,7 +1120,7 @@ WRAPPER void CRadar::TransformRealWorldPointToRadarSpace(CVector2D &out, const C
void CRadar::TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D &in)
{
float s, c;
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1 || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWNPED) {
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOP_DOWN_PED) {
s = 0.0f;
c = 1.0f;
}
@ -1131,7 +1131,7 @@ void CRadar::TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D
else {
CVector forward;
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_FIRSTPERSON) {
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON) {
forward = TheCamera.Cams[TheCamera.ActiveCam].CamTargetEntity->GetForward();
forward.Normalise(); // a bit useless...
}

View File

@ -379,9 +379,9 @@ Render2dStuff(void)
bool firstPersonWeapon = false;
int cammode = TheCamera.Cams[TheCamera.ActiveCam].Mode;
if(cammode == CCam::MODE_SNIPER ||
cammode == CCam::MODE_SNIPER_RUN_AROUND ||
cammode == CCam::MODE_ROCKET ||
cammode == CCam::MODE_ROCKET_RUN_AROUND)
cammode == CCam::MODE_SNIPER_RUNABOUT ||
cammode == CCam::MODE_ROCKETLAUNCHER ||
cammode == CCam::MODE_ROCKETLAUNCHER_RUNABOUT)
firstPersonWeapon = true;
// Draw black border for sniper and rocket launcher