From 4f64bdc41c888ac3decf5a7c28e1f3ebce56d7d0 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 7 Mar 2006 05:21:32 +0000 Subject: [PATCH] More Win64 updates --- include/SDL_config_win32.h | 4 +++- src/timer/win32/SDL_systimer.c | 6 +++--- src/video/gapi/SDL_gapivideo.c | 2 +- src/video/wincommon/SDL_sysevents.c | 2 +- src/video/wincommon/SDL_wingl.c | 2 +- src/video/windib/SDL_dibevents.c | 2 +- src/video/windib/SDL_dibvideo.c | 6 +++--- src/video/windx5/SDL_dx5video.c | 14 +++++++------- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/include/SDL_config_win32.h b/include/SDL_config_win32.h index 389e670d6..036791dc8 100644 --- a/include/SDL_config_win32.h +++ b/include/SDL_config_win32.h @@ -150,7 +150,9 @@ typedef unsigned int uintptr_t; #define SDL_VIDEO_OPENGL_WGL 1 #endif -/* Enable assembly routines */ +/* Enable assembly routines (Win64 doesn't have inline asm) */ +#ifndef _WIN64 #define SDL_ASSEMBLY_ROUTINES 1 +#endif #endif /* _SDL_config_win32_h */ diff --git a/src/timer/win32/SDL_systimer.c b/src/timer/win32/SDL_systimer.c index e78884a21..f82f4ad97 100644 --- a/src/timer/win32/SDL_systimer.c +++ b/src/timer/win32/SDL_systimer.c @@ -128,7 +128,7 @@ void SDL_SYS_TimerQuit(void) /* Forward declaration because this is called by the timer callback */ int SDL_SYS_StartTimer(void); -static VOID CALLBACK TimerCallbackProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime) +static VOID CALLBACK TimerCallbackProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) { Uint32 ms; @@ -170,8 +170,8 @@ void SDL_SYS_StopTimer(void) /* Data to handle a single periodic alarm */ static UINT timerID = 0; -static void CALLBACK HandleAlarm(UINT uID, UINT uMsg, DWORD dwUser, - DWORD dw1, DWORD dw2) +static void CALLBACK HandleAlarm(UINT uID, UINT uMsg, DWORD_PTR dwUser, + DWORD_PTR dw1, DWORD_PTR dw2) { SDL_ThreadedTimerCheck(); } diff --git a/src/video/gapi/SDL_gapivideo.c b/src/video/gapi/SDL_gapivideo.c index 4b5a150af..d79a7b582 100644 --- a/src/video/gapi/SDL_gapivideo.c +++ b/src/video/gapi/SDL_gapivideo.c @@ -710,7 +710,7 @@ SDL_Surface *GAPI_SetVideoMode(_THIS, SDL_Surface *current, style = 0; if (!SDL_windowid) - SetWindowLongPtr(SDL_Window, GWL_STYLE, style); + SetWindowLong(SDL_Window, GWL_STYLE, style); /* Allocate bitmap */ if(gapiBuffer) diff --git a/src/video/wincommon/SDL_sysevents.c b/src/video/wincommon/SDL_sysevents.c index 31ac3182d..859f211a6 100644 --- a/src/video/wincommon/SDL_sysevents.c +++ b/src/video/wincommon/SDL_sysevents.c @@ -562,7 +562,7 @@ LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) Aparently it's too difficult for MS to check inside their function, so I have to do it here. */ - style = GetWindowLongPtr(hwnd, GWL_STYLE); + style = GetWindowLong(hwnd, GWL_STYLE); AdjustWindowRect( &size, style, diff --git a/src/video/wincommon/SDL_wingl.c b/src/video/wincommon/SDL_wingl.c index 28f7b91c1..2efb69821 100644 --- a/src/video/wincommon/SDL_wingl.c +++ b/src/video/wincommon/SDL_wingl.c @@ -45,7 +45,7 @@ static int WIN_GL_ResetWindow(_THIS) /* Save the existing window attributes */ LONG style; RECT rect = { 0, 0, 0, 0 }; - style = GetWindowLongPtr(SDL_Window, GWL_STYLE); + style = GetWindowLong(SDL_Window, GWL_STYLE); GetWindowRect(SDL_Window, &rect); DestroyWindow(SDL_Window); SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, diff --git a/src/video/windib/SDL_dibevents.c b/src/video/windib/SDL_dibevents.c index 5b51c3105..7d4d9fda9 100644 --- a/src/video/windib/SDL_dibevents.c +++ b/src/video/windib/SDL_dibevents.c @@ -392,7 +392,7 @@ static SDL_keysym *TranslateKey(WPARAM vkey, UINT scancode, SDL_keysym *keysym, Uint16 wchars[2]; GetKeyboardState(keystate); - if (SDL_ToUnicode(vkey, scancode, keystate, wchars, sizeof(wchars)/sizeof(wchars[0]), 0) == 1) + if (SDL_ToUnicode((UINT)vkey, scancode, keystate, wchars, sizeof(wchars)/sizeof(wchars[0]), 0) == 1) { keysym->unicode = wchars[0]; } diff --git a/src/video/windib/SDL_dibvideo.c b/src/video/windib/SDL_dibvideo.c index 1a58e0713..9e78f0111 100644 --- a/src/video/windib/SDL_dibvideo.c +++ b/src/video/windib/SDL_dibvideo.c @@ -647,7 +647,7 @@ SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current, screen_pal = DIB_CreatePalette(bpp); } - style = GetWindowLongPtr(SDL_Window, GWL_STYLE); + style = GetWindowLong(SDL_Window, GWL_STYLE); style &= ~(resizestyle|WS_MAXIMIZE); if ( (video->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) { style &= ~windowstyle; @@ -677,7 +677,7 @@ SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current, /* DJM: Don't piss of anyone who has setup his own window */ if ( !SDL_windowid ) - SetWindowLongPtr(SDL_Window, GWL_STYLE, style); + SetWindowLong(SDL_Window, GWL_STYLE, style); /* Delete the old bitmap if necessary */ if ( screen_bmp != NULL ) { @@ -780,7 +780,7 @@ SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current, bounds.top = SDL_windowY; bounds.right = SDL_windowX+video->w; bounds.bottom = SDL_windowY+video->h; - AdjustWindowRectEx(&bounds, GetWindowLongPtr(SDL_Window, GWL_STYLE), FALSE, 0); + AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0); width = bounds.right-bounds.left; height = bounds.bottom-bounds.top; if ( (flags & SDL_FULLSCREEN) ) { diff --git a/src/video/windx5/SDL_dx5video.c b/src/video/windx5/SDL_dx5video.c index 362ecf044..94b73a8a4 100644 --- a/src/video/windx5/SDL_dx5video.c +++ b/src/video/windx5/SDL_dx5video.c @@ -1123,7 +1123,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, } #endif /* !NO_CHANGEDISPLAYSETTINGS */ - style = GetWindowLongPtr(SDL_Window, GWL_STYLE); + style = GetWindowLong(SDL_Window, GWL_STYLE); style &= ~(resizestyle|WS_MAXIMIZE); if ( video->flags & SDL_FULLSCREEN ) { style &= ~windowstyle; @@ -1148,7 +1148,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, /* DJM: Don't piss of anyone who has setup his own window */ if ( !SDL_windowid ) - SetWindowLongPtr(SDL_Window, GWL_STYLE, style); + SetWindowLong(SDL_Window, GWL_STYLE, style); /* Resize the window (copied from SDL WinDIB driver) */ if ( !SDL_windowid && !IsZoomed(SDL_Window) ) { @@ -1178,7 +1178,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, bounds.top = SDL_windowY; bounds.right = SDL_windowX+video->w; bounds.bottom = SDL_windowY+video->h; - AdjustWindowRectEx(&bounds, GetWindowLongPtr(SDL_Window, GWL_STYLE), FALSE, 0); + AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0); width = bounds.right-bounds.left; height = bounds.bottom-bounds.top; if ( (flags & SDL_FULLSCREEN) ) { @@ -1217,7 +1217,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, } /* Set the appropriate window style */ - style = GetWindowLongPtr(SDL_Window, GWL_STYLE); + style = GetWindowLong(SDL_Window, GWL_STYLE); style &= ~(resizestyle|WS_MAXIMIZE); if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) { style &= ~windowstyle; @@ -1239,7 +1239,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, } /* DJM: Don't piss of anyone who has setup his own window */ if ( !SDL_windowid ) - SetWindowLongPtr(SDL_Window, GWL_STYLE, style); + SetWindowLong(SDL_Window, GWL_STYLE, style); /* Set DirectDraw sharing mode.. exclusive when fullscreen */ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) { @@ -1264,7 +1264,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, bounds.top = 0; bounds.right = GetSystemMetrics(SM_CXSCREEN); bounds.bottom = GetSystemMetrics(SM_CYSCREEN); - AdjustWindowRectEx(&bounds, GetWindowLongPtr(SDL_Window, GWL_STYLE), FALSE, 0); + AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0); SetWindowPos(SDL_Window, HWND_TOPMOST, bounds.left, bounds.top, bounds.right - bounds.left, @@ -1581,7 +1581,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, bounds.top = SDL_windowY; bounds.right = SDL_windowX+video->w; bounds.bottom = SDL_windowY+video->h; - AdjustWindowRectEx(&bounds, GetWindowLongPtr(SDL_Window, GWL_STYLE), FALSE, 0); + AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), FALSE, 0); width = bounds.right-bounds.left; height = bounds.bottom-bounds.top; if ( center ) {