Fixed windows platform x64 compatibility issues.
This commit is contained in:
parent
0d47a2c605
commit
164fd4da09
|
|
@ -1126,8 +1126,8 @@ static void IN_StartupMIDI( void )
|
||||||
//
|
//
|
||||||
if ( midiInOpen( &s_midiInfo.hMidiIn,
|
if ( midiInOpen( &s_midiInfo.hMidiIn,
|
||||||
in_mididevice->integer,
|
in_mididevice->integer,
|
||||||
( unsigned long ) MidiInProc,
|
( DWORD_PTR ) MidiInProc,
|
||||||
( unsigned long ) NULL,
|
( DWORD_PTR ) NULL,
|
||||||
CALLBACK_FUNCTION ) != MMSYSERR_NOERROR )
|
CALLBACK_FUNCTION ) != MMSYSERR_NOERROR )
|
||||||
{
|
{
|
||||||
Com_Printf( "WARNING: could not open MIDI device %d: '%s'\n", in_mididevice->integer , s_midiInfo.caps[( int ) in_mididevice->value] );
|
Com_Printf( "WARNING: could not open MIDI device %d: '%s'\n", in_mididevice->integer , s_midiInfo.caps[( int ) in_mididevice->value] );
|
||||||
|
|
|
||||||
|
|
@ -290,7 +290,7 @@ char **Sys_ListFiles( const char *directory, const char *extension, char *filter
|
||||||
char **listCopy;
|
char **listCopy;
|
||||||
char *list[MAX_FOUND_FILES];
|
char *list[MAX_FOUND_FILES];
|
||||||
struct _finddata_t findinfo;
|
struct _finddata_t findinfo;
|
||||||
int findhandle;
|
intptr_t findhandle;
|
||||||
int flag;
|
int flag;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ typedef struct
|
||||||
|
|
||||||
static WinConData s_wcd;
|
static WinConData s_wcd;
|
||||||
|
|
||||||
static LONG WINAPI ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
static LRESULT WINAPI ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
char *cmdString;
|
char *cmdString;
|
||||||
static qboolean s_timePolarity;
|
static qboolean s_timePolarity;
|
||||||
|
|
@ -131,20 +131,7 @@ static LONG WINAPI ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
{
|
{
|
||||||
SetBkColor( ( HDC ) wParam, RGB( 0x00, 0x00, 0xB0 ) );
|
SetBkColor( ( HDC ) wParam, RGB( 0x00, 0x00, 0xB0 ) );
|
||||||
SetTextColor( ( HDC ) wParam, RGB( 0xff, 0xff, 0x00 ) );
|
SetTextColor( ( HDC ) wParam, RGB( 0xff, 0xff, 0x00 ) );
|
||||||
|
return ( LRESULT ) s_wcd.hbrEditBackground;
|
||||||
#if 0 // this draws a background in the edit box, but there are issues with this
|
|
||||||
if ( ( hdcScaled = CreateCompatibleDC( ( HDC ) wParam ) ) != 0 )
|
|
||||||
{
|
|
||||||
if ( SelectObject( ( HDC ) hdcScaled, s_wcd.hbmLogo ) )
|
|
||||||
{
|
|
||||||
StretchBlt( ( HDC ) wParam, 0, 0, 512, 384,
|
|
||||||
hdcScaled, 0, 0, 512, 384,
|
|
||||||
SRCCOPY );
|
|
||||||
}
|
|
||||||
DeleteDC( hdcScaled );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return ( long ) s_wcd.hbrEditBackground;
|
|
||||||
}
|
}
|
||||||
else if ( ( HWND ) lParam == s_wcd.hwndErrorBox )
|
else if ( ( HWND ) lParam == s_wcd.hwndErrorBox )
|
||||||
{
|
{
|
||||||
|
|
@ -158,7 +145,7 @@ static LONG WINAPI ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
SetBkColor( ( HDC ) wParam, RGB( 0x80, 0x80, 0x80 ) );
|
SetBkColor( ( HDC ) wParam, RGB( 0x80, 0x80, 0x80 ) );
|
||||||
SetTextColor( ( HDC ) wParam, RGB( 0x00, 0x0, 0x00 ) );
|
SetTextColor( ( HDC ) wParam, RGB( 0x00, 0x0, 0x00 ) );
|
||||||
}
|
}
|
||||||
return ( long ) s_wcd.hbrErrorBackground;
|
return ( LRESULT ) s_wcd.hbrErrorBackground;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -188,60 +175,10 @@ static LONG WINAPI ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
// s_wcd.hbmLogo = LoadBitmap( g_wv.hInstance, MAKEINTRESOURCE( IDB_BITMAP1 ) );
|
|
||||||
// s_wcd.hbmClearBitmap = LoadBitmap( g_wv.hInstance, MAKEINTRESOURCE( IDB_BITMAP2 ) );
|
|
||||||
s_wcd.hbrEditBackground = CreateSolidBrush( RGB( 0x00, 0x00, 0xB0 ) );
|
s_wcd.hbrEditBackground = CreateSolidBrush( RGB( 0x00, 0x00, 0xB0 ) );
|
||||||
s_wcd.hbrErrorBackground = CreateSolidBrush( RGB( 0x80, 0x80, 0x80 ) );
|
s_wcd.hbrErrorBackground = CreateSolidBrush( RGB( 0x80, 0x80, 0x80 ) );
|
||||||
SetTimer( hWnd, 1, 1000, NULL );
|
SetTimer( hWnd, 1, 1000, NULL );
|
||||||
break;
|
break;
|
||||||
case WM_ERASEBKGND:
|
|
||||||
#if 0
|
|
||||||
HDC hdcScaled;
|
|
||||||
HGDIOBJ oldObject;
|
|
||||||
|
|
||||||
#if 1 // a single, large image
|
|
||||||
hdcScaled = CreateCompatibleDC( ( HDC ) wParam );
|
|
||||||
assert( hdcScaled != 0 );
|
|
||||||
|
|
||||||
if ( hdcScaled )
|
|
||||||
{
|
|
||||||
oldObject = SelectObject( ( HDC ) hdcScaled, s_wcd.hbmLogo );
|
|
||||||
assert( oldObject != 0 );
|
|
||||||
if ( oldObject )
|
|
||||||
{
|
|
||||||
StretchBlt( ( HDC ) wParam, 0, 0, s_wcd.windowWidth, s_wcd.windowHeight,
|
|
||||||
hdcScaled, 0, 0, 512, 384,
|
|
||||||
SRCCOPY );
|
|
||||||
}
|
|
||||||
DeleteDC( hdcScaled );
|
|
||||||
hdcScaled = 0;
|
|
||||||
}
|
|
||||||
#else // a repeating brush
|
|
||||||
{
|
|
||||||
HBRUSH hbrClearBrush;
|
|
||||||
RECT r;
|
|
||||||
|
|
||||||
GetWindowRect( hWnd, &r );
|
|
||||||
|
|
||||||
r.bottom = r.bottom - r.top + 1;
|
|
||||||
r.right = r.right - r.left + 1;
|
|
||||||
r.top = 0;
|
|
||||||
r.left = 0;
|
|
||||||
|
|
||||||
hbrClearBrush = CreatePatternBrush( s_wcd.hbmClearBitmap );
|
|
||||||
|
|
||||||
assert( hbrClearBrush != 0 );
|
|
||||||
|
|
||||||
if ( hbrClearBrush )
|
|
||||||
{
|
|
||||||
FillRect( ( HDC ) wParam, &r, hbrClearBrush );
|
|
||||||
DeleteObject( hbrClearBrush );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
return DefWindowProc( hWnd, uMsg, wParam, lParam );
|
|
||||||
case WM_TIMER:
|
case WM_TIMER:
|
||||||
if ( wParam == 1 )
|
if ( wParam == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user