This commit is contained in:
Fire-Head 2019-06-11 12:30:53 +03:00
parent be7e94981a
commit 87655bc1cf
3 changed files with 174 additions and 174 deletions

View file

@ -138,6 +138,8 @@ void re3_debug(char *format, ...);
void re3_trace(const char *filename, unsigned int lineno, const char *func, char *format, ...);
void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func);
#define DEBUGBREAK() __debugbreak();
#define debug(f, ...) re3_debug("[DBG]: " f, __VA_ARGS__)
#define DEV(f, ...) re3_debug("[DEV]: " f, __VA_ARGS__)
#define TRACE(f, ...) re3_trace(__FILE__, __LINE__, __FUNCTION__, f, __VA_ARGS__)

View file

@ -1,7 +1,6 @@
#define _WIN32_WINDOWS 0x0410
#define _WIN32_WINDOWS 0x0500
#define WINVER 0x0500
#define DIRECTINPUT_VERSION 0x0800
#define WM_GRAPHNOTIFY WM_USER+13
#include <winerror.h>
#include <windows.h>
@ -24,6 +23,8 @@
#include <DShow.h>
#pragma warning( pop )
#define WM_GRAPHNOTIFY WM_USER+13
#pragma comment( lib, "d3d8.lib" )
#pragma comment( lib, "ddraw.lib" )
#pragma comment( lib, "Winmm.lib" )
@ -67,25 +68,6 @@ static RwBool &defaultFullscreenRes = *(RwBool*)0x60EFFC;
static const RwChar *AppClassName = RWSTRING("Grand theft auto 3");
/* platform specfic global data */
typedef struct
{
HWND window;
HINSTANCE instance;
RwBool fullScreen;
RwV2d lastMousePos;
DWORD field_14;
LPDIRECTINPUT8 dinterface;
LPDIRECTINPUTDEVICE8 mouse;
LPDIRECTINPUTDEVICE8 joy1;
LPDIRECTINPUTDEVICE8 joy2;
}
psGlobalType;
//static psGlobalType PsGlobal;
static psGlobalType &PsGlobal = *(psGlobalType*)0x72CF60;
@ -121,9 +103,6 @@ IMediaEventEx *pME = NULL;
IVideoWindow *pVW = NULL;
IMediaSeeking *pMS = NULL;
/**/
DWORD dwDXVersion;
DWORD _dwMemTotalPhys;
DWORD &_dwMemAvailPhys = *(DWORD*)0x70F29C;
@ -142,27 +121,6 @@ WRAPPER const Char *GetLevelSplashScreen(Int32 number) { EAXJMP(0x48D750); }
void LoadingScreen(char const *msg1, char const *msg2, char const *screen);
CSprite2d *LoadSplash(const char *name);
void InitialiseLanguage();
RwBool _psSetVideoMode(RwInt32 subSystem, RwInt32 videoMode);
void CenterVideo(void);
void CloseClip(void);
HRESULT _InputInitialise();
HRESULT _InputInitialiseMouse();
HRESULT CapturePad(Int32 padID);
void _InputInitialiseJoys();
HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num);
HRESULT _InputAddJoys();
HRESULT _InputGetMouseState(DIMOUSESTATE2 *state);
void _InputShutdown();
BOOL CALLBACK _InputEnumDevicesCallback( const DIDEVICEINSTANCE* pdidInstance, VOID* pContext );
BOOL _InputTranslateKey(RsKeyCodes *rs, UINT flag, UINT key);
void _InputTranslateShiftKeyUpDown(RsKeyCodes *rs);;
BOOL _InputTranslateShiftKey(RsKeyCodes *rs, UINT key, bool bDown);
BOOL _InputIsExtended(INT flag);
/**/
enum eJoypadState
{
JOYPAD_UNUSED,
@ -2312,7 +2270,7 @@ HRESULT _InputInitialiseMouse()
RwV2d leftStickPos;
RwV2d rightStickPos;
HRESULT CapturePad(Int32 padID)
HRESULT CapturePad(RwInt32 padID)
{
HRESULT hr;
DIJOYSTATE2 js;
@ -2522,7 +2480,7 @@ HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num)
if( FAILED( lpDevice->SetProperty( DIPROP_RANGE, (LPCDIPROPHEADER)&range ) ) )
return S_FALSE;
else
AllValidWinJoys.m_aJoys[num].m_bHasAxisR = 1; // r rightStickPos.y
AllValidWinJoys.m_aJoys[num].m_bHasAxisR = true; // r rightStickPos.y
}
}

View file

@ -30,6 +30,25 @@ enum eWinVersion
extern RwUInt32 &gGameState;
/* platform specfic global data */
typedef struct
{
HWND window;
HINSTANCE instance;
RwBool fullScreen;
RwV2d lastMousePos;
DWORD field_14;
LPDIRECTINPUT8 dinterface;
LPDIRECTINPUTDEVICE8 mouse;
LPDIRECTINPUTDEVICE8 joy1;
LPDIRECTINPUTDEVICE8 joy2;
}
psGlobalType;
#define PSGLOBAL(var) (((psGlobalType *)(RsGlobal.ps))->var)
#ifdef __cplusplus
extern "C"
{
@ -38,6 +57,27 @@ extern "C"
extern LRESULT CALLBACK
MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam);
RwBool IsForegroundApp();
HRESULT _InputInitialise();
HRESULT _InputInitialiseMouse();
HRESULT CapturePad(RwInt32 padID);
void _InputInitialiseJoys();
HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num);
HRESULT _InputAddJoys();
HRESULT _InputGetMouseState(DIMOUSESTATE2 *state);
void _InputShutdown();
BOOL CALLBACK _InputEnumDevicesCallback( const DIDEVICEINSTANCE* pdidInstance, VOID* pContext );
BOOL _InputTranslateKey(RsKeyCodes *rs, UINT flag, UINT key);
void _InputTranslateShiftKeyUpDown(RsKeyCodes *rs);;
BOOL _InputTranslateShiftKey(RsKeyCodes *rs, UINT key, bool bDown);
BOOL _InputIsExtended(INT flag);
void InitialiseLanguage();
RwBool _psSetVideoMode(RwInt32 subSystem, RwInt32 videoMode);
void CenterVideo(void);
void CloseClip(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */