1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 18:10:00 +00:00

Merge branch 'master' into master

This commit is contained in:
Fire_Head 2019-10-27 06:36:58 +03:00 committed by GitHub
commit 6a46cc6c3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 2873 additions and 327 deletions

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

@ -5,11 +5,11 @@
enum eControllerType enum eControllerType
{ {
KEYBOARD, KEYBOARD = 0,
OPTIONAL_EXTRA, OPTIONAL_EXTRA,
MOUSE, MOUSE,
JOYSTICK, JOYSTICK,
TOTAL_CONTROLLER_TYPES MAX_CONTROLLERTYPES,
}; };
enum e_ControllerAction enum e_ControllerAction
@ -28,8 +28,6 @@ enum e_ControllerAction
PED_JUMPING, PED_JUMPING,
PED_SPRINT, PED_SPRINT,
PED_LOOKBEHIND, PED_LOOKBEHIND,
//PED_DUCK, // VC
//PED_ANSWER_PHONE, // VC
VEHICLE_ACCELERATE, VEHICLE_ACCELERATE,
VEHICLE_BRAKE, VEHICLE_BRAKE,
VEHICLE_CHANGE_RADIO_STATION, VEHICLE_CHANGE_RADIO_STATION,
@ -52,18 +50,49 @@ enum e_ControllerAction
NETWORK_TALK, NETWORK_TALK,
PED_1RST_PERSON_LOOK_UP, PED_1RST_PERSON_LOOK_UP,
PED_1RST_PERSON_LOOK_DOWN, PED_1RST_PERSON_LOOK_DOWN,
_CONTROLLERACTION_36, // Unused
CONTROLLERACTION_36, // unk, unused?
TOGGLE_DPAD, TOGGLE_DPAD,
SWITCH_DEBUG_CAM_ON, SWITCH_DEBUG_CAM_ON,
TAKE_SCREEN_SHOT, TAKE_SCREEN_SHOT,
SHOW_MOUSE_POINTER_TOGGLE, SHOW_MOUSE_POINTER_TOGGLE,
MAX_CONTROLLERACTIONS,
};
TOTAL_CONTROL_ACTIONS 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 CMouseControllerState;
class CControllerState;
#define JOY_BUTTONS 16
#define MAX_BUTTONS (JOY_BUTTONS+1)
#define ACTIONNAME_LENGTH 40 #define ACTIONNAME_LENGTH 40
@ -72,38 +101,97 @@ class CControllerConfigManager
public: public:
struct tControllerConfigBind struct tControllerConfigBind
{ {
RsKeyCodes m_Key; int32 m_Key;
int32 m_ContSetOrder; int32 m_ContSetOrder;
tControllerConfigBind()
{
m_Key = 0;
m_ContSetOrder = 0;
}
}; };
bool firstCapture; bool m_bFirstCapture;
char _pad0[3];
#ifdef __DINPUT_INCLUDED__
DIJOYSTATE2 m_OldState; DIJOYSTATE2 m_OldState;
DIJOYSTATE2 m_NewState; DIJOYSTATE2 m_NewState;
wchar m_aActionNames[TOTAL_CONTROL_ACTIONS][ACTIONNAME_LENGTH]; #endif
bool m_aButtonStates[17]; wchar m_aActionNames[MAX_CONTROLLERACTIONS][40];
tControllerConfigBind m_aSettings[TOTAL_CONTROL_ACTIONS][TOTAL_CONTROLLER_TYPES]; bool m_aButtonStates[MAX_BUTTONS];
uint8 m_aSimCheckers[4][4]; char _pad1[3];
tControllerConfigBind m_aSettings[MAX_CONTROLLERACTIONS][MAX_CONTROLLERTYPES];
bool m_aSimCheckers[MAX_SIMS][MAX_CONTROLLERTYPES];
bool m_bMouseAssociated; bool m_bMouseAssociated;
char _pad2[3];
void UpdateJoyButtonState(int padnumber); CControllerConfigManager();
void UpdateJoyInConfigMenus_ButtonDown(int button, int padnumber);
void AffectControllerStateOn_ButtonDown(int button, eControllerType type); void MakeControllerActionsBlank();
void UpdateJoyInConfigMenus_ButtonUp(int button, int padnumber);
void AffectControllerStateOn_ButtonUp(int button, int padnumber);
int32 GetJoyButtonJustDown(); int32 GetJoyButtonJustDown();
void LoadSettings(int32 file);
void SaveSettings(int32 file); void SaveSettings(int32 file);
void MakeControllerActionsBlank(); void LoadSettings(int32 file);
void InitDefaultControlConfiguration(); void InitDefaultControlConfiguration();
void InitDefaultControlConfigMouse(CMouseControllerState const &mousestate); void InitDefaultControlConfigMouse(CMouseControllerState const &availableButtons);
void InitDefaultControlConfigJoyPad(unsigned int buttons); void InitDefaultControlConfigJoyPad(uint32 buttons);
void ClearSimButtonPressCheckers(); 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 AffectPadFromKeyBoard();
void AffectPadFromMouse(); void AffectPadFromMouse();
void ClearSettingsAssociatedWithAction(int, int);
void GetWideStringOfCommandKeys(uint16, wchar*, uint16); 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); VALIDATE_SIZE(CControllerConfigManager, 0x143C);

View file

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

View file

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

View file

@ -1,56 +1,5 @@
#pragma once #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 { enum {
PLAYERCONTROL_ENABLED = 0, PLAYERCONTROL_ENABLED = 0,
PLAYERCONTROL_DISABLED_1 = 1, PLAYERCONTROL_DISABLED_1 = 1,
@ -302,6 +251,29 @@ public:
bool GetLeftMouseJustDown() { return !!(NewMouseControllerState.LMB && !OldMouseControllerState.LMB); } bool GetLeftMouseJustDown() { return !!(NewMouseControllerState.LMB && !OldMouseControllerState.LMB); }
bool GetRightMouseJustDown() { return !!(NewMouseControllerState.RMB && !OldMouseControllerState.RMB); } bool GetRightMouseJustDown() { return !!(NewMouseControllerState.RMB && !OldMouseControllerState.RMB); }
bool GetMiddleMouseJustDown() { return !!(NewMouseControllerState.MMB && !OldMouseControllerState.MMB); } 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 GetMouseX() { return NewMouseControllerState.x; }
float GetMouseY() { return NewMouseControllerState.y; } float GetMouseY() { return NewMouseControllerState.y; }
@ -354,6 +326,52 @@ public:
bool GetRightWinJustDown() { return !!(NewKeyState.RWIN && !OldKeyState.RWIN); } bool GetRightWinJustDown() { return !!(NewKeyState.RWIN && !OldKeyState.RWIN); }
bool GetAppsJustDown() { return !!(NewKeyState.APPS && !OldKeyState.APPS); } 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 // pad
bool GetTriangleJustDown() { return !!(NewState.Triangle && !OldState.Triangle); } bool GetTriangleJustDown() { return !!(NewState.Triangle && !OldState.Triangle); }
@ -370,13 +388,6 @@ public:
bool GetRightShoulder2JustDown() { return !!(NewState.RightShoulder2 && !OldState.RightShoulder2); } bool GetRightShoulder2JustDown() { return !!(NewState.RightShoulder2 && !OldState.RightShoulder2); }
bool GetStartJustDown() { return !!(NewState.Start && !OldState.Start); } 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 GetTriangle() { return !!NewState.Triangle; }
bool GetCircle() { return !!NewState.Circle; } bool GetCircle() { return !!NewState.Circle; }
bool GetCross() { return !!NewState.Cross; } bool GetCross() { return !!NewState.Cross; }
@ -392,8 +403,6 @@ public:
bool ArePlayerControlsDisabled(void) { return DisablePlayerControls != PLAYERCONTROL_ENABLED; } bool ArePlayerControlsDisabled(void) { return DisablePlayerControls != PLAYERCONTROL_ENABLED; }
}; };
VALIDATE_SIZE(CPad, 0xFC); VALIDATE_SIZE(CPad, 0xFC);
extern CPad *Pads; //[2] 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); TransformRadarPointToScreenSpace(out, in);
float angle; float angle;
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1) if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN)
angle = PI + FindPlayerHeading(); angle = PI + FindPlayerHeading();
#ifdef FIX_BUGS #ifdef FIX_BUGS
else if (TheCamera.GetLookDirection() != LOOKING_FORWARD) else if (TheCamera.GetLookDirection() != LOOKING_FORWARD)
@ -1081,14 +1081,14 @@ void CRadar::TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D
s = -Sin(TheCamera.GetForward().Heading()); s = -Sin(TheCamera.GetForward().Heading());
c = Cos(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; s = 0.0f;
c = 1.0f; c = 1.0f;
} }
else if (TheCamera.GetLookDirection() != LOOKING_FORWARD) { else if (TheCamera.GetLookDirection() != LOOKING_FORWARD) {
CVector 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 = TheCamera.Cams[TheCamera.ActiveCam].CamTargetEntity->GetForward();
forward.Normalise(); // a bit useless... 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) void CRadar::TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D &in)
{ {
float s, c; 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; s = 0.0f;
c = 1.0f; c = 1.0f;
} }
@ -1131,7 +1131,7 @@ void CRadar::TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D
else { else {
CVector 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 = TheCamera.Cams[TheCamera.ActiveCam].CamTargetEntity->GetForward();
forward.Normalise(); // a bit useless... forward.Normalise(); // a bit useless...
} }

View file

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

View file

@ -4646,10 +4646,10 @@ CPed::SetAttack(CEntity *victim)
CPad::GetPad(0)->ResetAverageWeapon(); CPad::GetPad(0)->ResetAverageWeapon();
if ((curWeapon->m_eWeaponFire == WEAPON_FIRE_INSTANT_HIT || GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER) if ((curWeapon->m_eWeaponFire == WEAPON_FIRE_INSTANT_HIT || GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER)
&& TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16FIRSTPERSON_34 && TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON
&& TheCamera.PlayerWeaponMode.Mode != CCam::MODE_FIRSTPERSONPEDONPC_41 && TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON_RUNABOUT
&& TheCamera.PlayerWeaponMode.Mode != CCam::MODE_SNIPER && TheCamera.PlayerWeaponMode.Mode != CCam::MODE_SNIPER
&& TheCamera.PlayerWeaponMode.Mode != CCam::MODE_SNIPER_RUN_AROUND && TheCamera.PlayerWeaponMode.Mode != CCam::MODE_SNIPER_RUNABOUT
&& CheckForPointBlankPeds(victimPed) != 0) { && CheckForPointBlankPeds(victimPed) != 0) {
ClearAimFlag(); ClearAimFlag();
@ -9191,10 +9191,10 @@ CPed::ProcessControl(void)
if (!nearPed->bIsLooking && nearPed->m_nPedState != PED_ATTACK) { if (!nearPed->bIsLooking && nearPed->m_nPedState != PED_ATTACK) {
int16 camMode = TheCamera.Cams[TheCamera.ActiveCam].Mode; int16 camMode = TheCamera.Cams[TheCamera.ActiveCam].Mode;
if (camMode != CCam::MODE_SNIPER if (camMode != CCam::MODE_SNIPER
&& camMode != CCam::MODE_ROCKET && camMode != CCam::MODE_ROCKETLAUNCHER
&& camMode != CCam::MODE_M16FIRSTPERSON_34 && camMode != CCam::MODE_M16_1STPERSON
&& camMode != CCam::MODE_FIRSTPERSON && camMode != CCam::MODE_1STPERSON
&& camMode != CCam::MODE_M16FIRSTPERSON_44 && camMode != CCam::MODE_HELICANNON_1STPERSON
&& !TheCamera.Cams[TheCamera.ActiveCam].GetWeaponFirstPersonOn()) { && !TheCamera.Cams[TheCamera.ActiveCam].GetWeaponFirstPersonOn()) {
nearPed->SetLookFlag(this, true); nearPed->SetLookFlag(this, true);
@ -10333,7 +10333,7 @@ CPed::ProcessControl(void)
lbAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LB); lbAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_LB);
if (lbAssoc && if (lbAssoc &&
TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_FIRSTPERSON TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON
&& TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking == LOOKING_LEFT) { && TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking == LOOKING_LEFT) {
lbAssoc->blendDelta = -1000.0f; lbAssoc->blendDelta = -1000.0f;
} }
@ -10378,7 +10378,7 @@ CPed::ProcessControl(void)
lbAssoc->blendDelta = -4.0f; lbAssoc->blendDelta = -4.0f;
} else { } else {
if ((TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_FIRSTPERSON if ((TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_1STPERSON
|| TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking != LOOKING_LEFT) || TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking != LOOKING_LEFT)
&& (!lbAssoc || lbAssoc->blendAmount < 1.0f)) { && (!lbAssoc || lbAssoc->blendAmount < 1.0f)) {
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_LB, 4.0f); CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_LB, 4.0f);

View file

@ -121,15 +121,15 @@ void CHud::Draw()
int32 WeaponType = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_eWeaponType; int32 WeaponType = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_eWeaponType;
int32 Mode = TheCamera.Cams[TheCamera.ActiveCam].Mode; int32 Mode = TheCamera.Cams[TheCamera.ActiveCam].Mode;
if (Mode == CCam::MODE_SNIPER || Mode == CCam::MODE_ROCKET || Mode == CCam::MODE_M16FIRSTPERSON_34 || Mode == CCam::MODE_EDITOR) if (Mode == CCam::MODE_SNIPER || Mode == CCam::MODE_ROCKETLAUNCHER || Mode == CCam::MODE_M16_1STPERSON || Mode == CCam::MODE_EDITOR)
Mode_FirstPerson = 1; Mode_FirstPerson = 1;
if (Mode == CCam::MODE_FIRSTPERSONPEDONPC_41 || Mode == CCam::MODE_SNIPER_RUN_AROUND) if (Mode == CCam::MODE_M16_1STPERSON_RUNABOUT || Mode == CCam::MODE_SNIPER_RUNABOUT)
Mode_RunAround = 1; Mode_RunAround = 1;
/* /*
Draw Crosshairs Draw Crosshairs
*/ */
if (TheCamera.Cams->Using3rdPersonMouseCam() && (!CPad::GetPad(0)->GetLookBehindForPed() || TheCamera.m_bPlayerIsInGarage) || Mode == CCam::MODE_FIRSTPERSONPEDONPC_40) { if (TheCamera.Cams->Using3rdPersonMouseCam() && (!CPad::GetPad(0)->GetLookBehindForPed() || TheCamera.m_bPlayerIsInGarage) || Mode == CCam::MODE_1STPERSON_RUNABOUT) {
if (CWorld::Players[CWorld::PlayerInFocus].m_pPed) { if (CWorld::Players[CWorld::PlayerInFocus].m_pPed) {
int32 State = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_nPedState; int32 State = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_nPedState;
if (State != PED_ENTER_CAR && State != PED_CARJACK) { if (State != PED_ENTER_CAR && State != PED_CARJACK) {
@ -180,8 +180,8 @@ void CHud::Draw()
} }
} }
else { else {
if (Mode == CCam::MODE_M16FIRSTPERSON_34 || if (Mode == CCam::MODE_M16_1STPERSON ||
Mode == CCam::MODE_FIRSTPERSONPEDONPC_41 || Mode == CCam::MODE_M16_1STPERSON_RUNABOUT ||
Mode == CCam::MODE_EDITOR) { Mode == CCam::MODE_EDITOR) {
rect.left = (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(32.0f); rect.left = (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(32.0f);
rect.top = (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(32.0f); rect.top = (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(32.0f);
@ -189,7 +189,7 @@ void CHud::Draw()
rect.bottom = (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(32.0f); rect.bottom = (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(32.0f);
Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255)); Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255));
} }
else if (Mode == CCam::MODE_ROCKET_RUN_AROUND) { else if (Mode == CCam::MODE_ROCKETLAUNCHER_RUNABOUT) {
rect.left = (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(32.0f * 0.7f); rect.left = (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(32.0f * 0.7f);
rect.top = (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(32.0f * 0.7f); rect.top = (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(32.0f * 0.7f);
rect.right = (SCREEN_WIDTH / 2) + SCREEN_SCALE_X(32.0f * 0.7f); rect.right = (SCREEN_WIDTH / 2) + SCREEN_SCALE_X(32.0f * 0.7f);
@ -197,7 +197,7 @@ void CHud::Draw()
Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255)); Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255));
} }
else if (Mode == CCam::MODE_ROCKET || Mode == CCam::MODE_SNIPER_RUN_AROUND) { else if (Mode == CCam::MODE_ROCKETLAUNCHER || Mode == CCam::MODE_SNIPER_RUNABOUT) {
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE);
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDONE); RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDONE);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDONE); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDONE);

View file

@ -353,7 +353,7 @@ CRenderer::SetupEntityVisibility(CEntity *ent)
}else{ }else{
if(mi->m_type != MITYPE_SIMPLE){ if(mi->m_type != MITYPE_SIMPLE){
if(FindPlayerVehicle() == ent && if(FindPlayerVehicle() == ent &&
TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_FIRSTPERSON){ TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON){
// Player's vehicle in first person mode // Player's vehicle in first person mode
if(TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking == LOOKING_FORWARD || if(TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking == LOOKING_FORWARD ||
ent->GetModelIndex() == MI_RHINO || ent->GetModelIndex() == MI_RHINO ||
@ -642,8 +642,8 @@ CRenderer::ScanWorld(void)
RwV3dTransformPoints((RwV3d*)vectors, (RwV3d*)vectors, 9, cammatrix); RwV3dTransformPoints((RwV3d*)vectors, (RwV3d*)vectors, 9, cammatrix);
m_loadingPriority = false; m_loadingPriority = false;
if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1 || if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN ||
TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWNPED){ TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOP_DOWN_PED){
CRect rect; CRect rect;
int x1, x2, y1, y2; int x1, x2, y1, y2;
LimitFrustumVector(vectors[CORNER_FAR_TOPLEFT], vectors[CORNER_CAM], -100.0f); LimitFrustumVector(vectors[CORNER_FAR_TOPLEFT], vectors[CORNER_CAM], -100.0f);
@ -753,8 +753,8 @@ CRenderer::RequestObjectsInFrustum(void)
vectors[CORNER_PRIO_RIGHT].z = vectors[CORNER_LOD_RIGHT].z; vectors[CORNER_PRIO_RIGHT].z = vectors[CORNER_LOD_RIGHT].z;
RwV3dTransformPoints((RwV3d*)vectors, (RwV3d*)vectors, 9, cammatrix); RwV3dTransformPoints((RwV3d*)vectors, (RwV3d*)vectors, 9, cammatrix);
if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1 || if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN ||
TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWNPED){ TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOP_DOWN_PED){
CRect rect; CRect rect;
int x1, x2, y1, y2; int x1, x2, y1, y2;
LimitFrustumVector(vectors[CORNER_FAR_TOPLEFT], vectors[CORNER_CAM], -100.0f); LimitFrustumVector(vectors[CORNER_FAR_TOPLEFT], vectors[CORNER_CAM], -100.0f);

View file

@ -532,8 +532,8 @@ CShadows::StoreCarLightShadow(CAutomobile *pCar, int32 nID, RwTexture *pTexture,
float fDistToCamSqr = (*pPosn - TheCamera.GetPosition()).MagnitudeSqr2D(); float fDistToCamSqr = (*pPosn - TheCamera.GetPosition()).MagnitudeSqr2D();
bool bSpecialCam = TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1 bool bSpecialCam = TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN
|| TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWNPED || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOP_DOWN_PED
|| CCutsceneMgr::IsRunning(); || CCutsceneMgr::IsRunning();
float fDrawDistance = 27.0f; float fDrawDistance = 27.0f;

View file

@ -98,8 +98,8 @@ CVisibilityPlugins::SetRenderWareCamera(RwCamera *camera)
ms_pCamera = camera; ms_pCamera = camera;
ms_pCameraPosn = RwMatrixGetPos(RwFrameGetMatrix(RwCameraGetFrame(camera))); ms_pCameraPosn = RwMatrixGetPos(RwFrameGetMatrix(RwCameraGetFrame(camera)));
if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1 || if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN ||
TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWNPED) TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOP_DOWN_PED)
ms_cullCompsDist = 1000000.0f; ms_cullCompsDist = 1000000.0f;
else else
ms_cullCompsDist = sq(TheCamera.LODDistMultiplier * 20.0f); ms_cullCompsDist = sq(TheCamera.LODDistMultiplier * 20.0f);

View file

@ -180,6 +180,14 @@ enum RsKeyCodes
rsAPPS = 1055, rsAPPS = 1055,
rsNULL = 1056, rsNULL = 1056,
rsMOUSELEFTBUTTON = 1,
rsMOUSMIDDLEBUTTON = 2,
rsMOUSERIGHTBUTTON = 3,
rsMOUSEWHEELUPBUTTON = 4,
rsMOUSEWHEELDOWNBUTTON = 5,
rsMOUSEX1BUTTON = 6,
rsMOUSEX2BUTTON = 7,
}; };
typedef enum RsKeyCodes RsKeyCodes; typedef enum RsKeyCodes RsKeyCodes;

View file

@ -115,38 +115,11 @@ DWORD _dwMemAvailVideo;
DWORD &_dwOperatingSystemVersion = *(DWORD*)0x70F290; DWORD &_dwOperatingSystemVersion = *(DWORD*)0x70F290;
RwUInt32 &gGameState = *(RwUInt32*)0x8F5838; RwUInt32 &gGameState = *(RwUInt32*)0x8F5838;
CJoySticks AllValidWinJoys;
enum eJoypadState
{
JOYPAD_UNUSED,
JOYPAD_ATTACHED,
};
struct tJoy
{
eJoypadState m_State;
bool m_bInitialised;
bool m_bHasAxisZ;
bool m_bHasAxisR;
char _pad0;
int32 m_nVendorID;
int32 m_nProductID;
};
class CJoySticks
{
public:
tJoy m_aJoys[2];
CJoySticks();
void ClearJoyInfo(int joyID);
};
static CJoySticks AllValidWinJoys;
CJoySticks::CJoySticks() CJoySticks::CJoySticks()
{ {
for (int i = 0; i < _TODOCONST(2); i++) for (int i = 0; i < MAX_JOYSTICKS; i++)
{ {
ClearJoyInfo(i); ClearJoyInfo(i);
} }
@ -154,7 +127,6 @@ CJoySticks::CJoySticks()
void CJoySticks::ClearJoyInfo(int joyID) void CJoySticks::ClearJoyInfo(int joyID)
{ {
m_aJoys[joyID].m_State = JOYPAD_UNUSED; m_aJoys[joyID].m_State = JOYPAD_UNUSED;
m_aJoys[joyID].m_bInitialised = false; m_aJoys[joyID].m_bInitialised = false;
m_aJoys[joyID].m_bHasAxisZ = false; m_aJoys[joyID].m_bHasAxisZ = false;
@ -641,14 +613,14 @@ psInitialise(void)
GetVersionEx(&verInfo); GetVersionEx(&verInfo);
_dwOperatingSystemVersion = 0; _dwOperatingSystemVersion = OS_WIN95;
if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
{ {
if ( verInfo.dwMajorVersion == 4 ) if ( verInfo.dwMajorVersion == 4 )
{ {
debug("Operating System is WinNT\n"); debug("Operating System is WinNT\n");
_dwOperatingSystemVersion = oS_WINNT; _dwOperatingSystemVersion = OS_WINNT;
} }
else if ( verInfo.dwMajorVersion == 5 ) else if ( verInfo.dwMajorVersion == 5 )
{ {
@ -2337,12 +2309,12 @@ HRESULT CapturePad(RwInt32 padID)
if( FAILED( hr = (*pPad)->GetDeviceState( sizeof(DIJOYSTATE2), &js ) ) ) if( FAILED( hr = (*pPad)->GetDeviceState( sizeof(DIJOYSTATE2), &js ) ) )
return hr; // The device should have been acquired during the Poll() return hr; // The device should have been acquired during the Poll()
if ( ControlsManager.firstCapture == true ) if ( ControlsManager.m_bFirstCapture == true )
{ {
memcpy(&ControlsManager.m_OldState, &js, sizeof(DIJOYSTATE2)); memcpy(&ControlsManager.m_OldState, &js, sizeof(DIJOYSTATE2));
memcpy(&ControlsManager.m_NewState, &js, sizeof(DIJOYSTATE2)); memcpy(&ControlsManager.m_NewState, &js, sizeof(DIJOYSTATE2));
ControlsManager.firstCapture = false; ControlsManager.m_bFirstCapture = false;
} }
else else
{ {

View file

@ -24,11 +24,13 @@ enum eWinVersion
{ {
OS_WIN95 = 0, OS_WIN95 = 0,
OS_WIN98, OS_WIN98,
oS_WINNT, OS_WINNT,
OS_WIN2000, OS_WIN2000,
OS_WINXP, OS_WINXP,
}; };
extern DWORD &_dwOperatingSystemVersion;
extern RwUInt32 &gGameState; extern RwUInt32 &gGameState;
/* platform specfic global data */ /* platform specfic global data */
@ -50,6 +52,41 @@ psGlobalType;
#define PSGLOBAL(var) (((psGlobalType *)(RsGlobal.ps))->var) #define PSGLOBAL(var) (((psGlobalType *)(RsGlobal.ps))->var)
enum eJoypads
{
JOYSTICK1 = 0,
JOYSTICK2,
MAX_JOYSTICKS
};
enum eJoypadState
{
JOYPAD_UNUSED,
JOYPAD_ATTACHED,
};
struct tJoy
{
eJoypadState m_State;
bool m_bInitialised;
bool m_bHasAxisZ;
bool m_bHasAxisR;
char _pad0;
int m_nVendorID;
int m_nProductID;
};
class CJoySticks
{
public:
tJoy m_aJoys[MAX_JOYSTICKS];
CJoySticks();
void ClearJoyInfo(int joyID);
};
extern CJoySticks AllValidWinJoys;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {

View file

@ -2934,7 +2934,7 @@ CAutomobile::DoDriveByShootings(void)
bool lookingLeft = false; bool lookingLeft = false;
bool lookingRight = false; bool lookingRight = false;
if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1){ if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN){
if(CPad::GetPad(0)->GetLookLeft()) if(CPad::GetPad(0)->GetLookLeft())
lookingLeft = true; lookingLeft = true;
if(CPad::GetPad(0)->GetLookRight()) if(CPad::GetPad(0)->GetLookRight())
@ -2956,7 +2956,7 @@ CAutomobile::DoDriveByShootings(void)
CAnimManager::AddAnimation(pDriver->GetClump(), ASSOCGRP_STD, ANIM_DRIVEBY_L); CAnimManager::AddAnimation(pDriver->GetClump(), ASSOCGRP_STD, ANIM_DRIVEBY_L);
else else
anim->SetRun(); anim->SetRun();
}else if(pDriver->m_pMyVehicle->pPassengers[0] == nil || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_FIRSTPERSON){ }else if(pDriver->m_pMyVehicle->pPassengers[0] == nil || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON){
anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_L); anim = RpAnimBlendClumpGetAssociation(pDriver->GetClump(), ANIM_DRIVEBY_L);
if(anim) if(anim)
anim->blendDelta = -1000.0f; anim->blendDelta = -1000.0f;