1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Fix Win32 build by removing WPARAM/LPARAM clash

This commit is contained in:
Mathieu Schroeter 2017-12-01 13:52:36 +01:00
parent 3688d68d10
commit 8f5cfdfaa0
5 changed files with 20 additions and 20 deletions

View File

@ -48,11 +48,11 @@ struct Rect {
typedef Uint32 ColorRef;
#if defined(_WIN64)
typedef unsigned __int64 WPARAM;
typedef __int64 LPARAM;
typedef unsigned __int64 WParam;
typedef __int64 LParam;
#else
typedef Uint32 WPARAM;
typedef Sint32 LPARAM;
typedef Uint32 WParam;
typedef Sint32 LParam;
#endif
#undef LOWORD

View File

@ -4929,10 +4929,10 @@ CEvent::DemoPlayStop ()
void
CEvent::WinToSDLEvent (
Uint32 msg, WPARAM wParam, LPARAM lParam, SDL_Event & event)
Uint32 msg, WParam wParam, LParam lParam, SDL_Event & event)
{
#define GET_X_LPARAM(lp) ((Sint32) (Sint16) LOWORD (lp))
#define GET_Y_LPARAM(lp) ((Sint32) (Sint16) HIWORD (lp))
#define GET_X_LParam(lp) ((Sint32) (Sint16) LOWORD (lp))
#define GET_Y_LParam(lp) ((Sint32) (Sint16) HIWORD (lp))
// clang-format off
static const std::unordered_map<Uint32, SDL_Keysym> keycodes = {
@ -4997,8 +4997,8 @@ CEvent::WinToSDLEvent (
msg == EV_LBUTTONDOWN ? SDL_MOUSEBUTTONDOWN : SDL_MOUSEBUTTONUP;
event.button.button = SDL_BUTTON_LEFT;
// TODO: wParam CTRL or SHIFT
event.button.x = GET_X_LPARAM (lParam);
event.button.y = GET_Y_LPARAM (lParam);
event.button.x = GET_X_LParam (lParam);
event.button.y = GET_Y_LParam (lParam);
break;
case EV_RBUTTONUP:
@ -5007,15 +5007,15 @@ CEvent::WinToSDLEvent (
msg == EV_RBUTTONDOWN ? SDL_MOUSEBUTTONDOWN : SDL_MOUSEBUTTONUP;
event.button.button = SDL_BUTTON_RIGHT;
// TODO: wParam CTRL or SHIFT
event.button.x = GET_X_LPARAM (lParam);
event.button.y = GET_Y_LPARAM (lParam);
event.button.x = GET_X_LParam (lParam);
event.button.y = GET_Y_LParam (lParam);
break;
case EV_MOUSEMOVE:
event.type = SDL_MOUSEMOTION;
// TODO: wParam CTRL or SHIFT
event.motion.x = GET_X_LPARAM (lParam);
event.motion.y = GET_Y_LPARAM (lParam);
event.motion.x = GET_X_LParam (lParam);
event.motion.y = GET_Y_LParam (lParam);
break;
}
}
@ -5032,8 +5032,8 @@ CEvent::DemoStep ()
{
Uint32 time = 0;
Uint32 message = 0;
WPARAM wParam = 0;
LPARAM lParam = 0;
WParam wParam = 0;
LParam lParam = 0;
if (m_phase == EV_PHASE_INIT)
{

View File

@ -61,8 +61,8 @@ typedef struct {
typedef struct {
Sint32 time;
Uint32 message;
Uint32 wParam; // WPARAM
Uint32 lParam; // LPARAM
Uint32 wParam; // WParam
Uint32 lParam; // LParam
} DemoEvent;
struct DemoSDLEvent {
@ -182,7 +182,7 @@ protected:
bool DemoPlayStart (const std::string * demoFile = nullptr);
void DemoPlayStop ();
static void
WinToSDLEvent (Uint32 msg, WPARAM wParam, LPARAM lParam, SDL_Event & event);
WinToSDLEvent (Uint32 msg, WParam wParam, LParam lParam, SDL_Event & event);
void DemoRecEvent (const SDL_Event & event);
protected:

View File

@ -48,7 +48,7 @@ OutputDebug (const char * pMessage)
// Conversion de la position de la souris.
Point
ConvLongToPos (LPARAM lParam)
ConvLongToPos (LParam lParam)
{
Point pos;

View File

@ -28,7 +28,7 @@
extern void OutputDebug (const char * pMessage);
extern Point ConvLongToPos (LPARAM lParam);
extern Point ConvLongToPos (LParam lParam);
extern void InitRandom ();
extern Sint32 Random (Sint32 min, Sint32 max);