mirror of
https://github.com/halpz/re3.git
synced 2025-06-30 09:26:24 +00:00
64-bit on Windows
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
// Functions that's different on glfw and win but have same signature, should be located on platform.h.
|
||||
|
||||
#ifdef _WIN32
|
||||
// This only has <windef.h> as Win header.
|
||||
// This only has <windef.h> as Windows header, which is lighter (as long as WITHWINDOWS isn't defined / <Windows.h> isn't included).
|
||||
#include "win.h"
|
||||
extern DWORD _dwOperatingSystemVersion;
|
||||
#else
|
||||
|
@ -63,7 +63,7 @@ static psGlobalType PsGlobal;
|
||||
#undef MAKEPOINTS
|
||||
#define MAKEPOINTS(l) (*((POINTS /*FAR*/ *)&(l)))
|
||||
|
||||
unsigned long _dwMemAvailPhys;
|
||||
size_t _dwMemAvailPhys;
|
||||
RwUInt32 gGameState;
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -19,7 +19,12 @@
|
||||
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4005)
|
||||
|
||||
#ifdef USE_D3D9
|
||||
#include <d3d9.h>
|
||||
#else
|
||||
#include <d3d8.h>
|
||||
#endif
|
||||
#include <ddraw.h>
|
||||
#include <dinput.h>
|
||||
#include <DShow.h>
|
||||
@ -27,7 +32,9 @@
|
||||
|
||||
#define WM_GRAPHNOTIFY WM_USER+13
|
||||
|
||||
#ifndef USE_D3D9
|
||||
#pragma comment( lib, "d3d8.lib" )
|
||||
#endif
|
||||
#pragma comment( lib, "ddraw.lib" )
|
||||
#pragma comment( lib, "Winmm.lib" )
|
||||
#pragma comment( lib, "dxguid.lib" )
|
||||
@ -102,7 +109,7 @@ IMediaSeeking *pMS = nil;
|
||||
|
||||
DWORD dwDXVersion;
|
||||
SIZE_T _dwMemTotalPhys;
|
||||
SIZE_T _dwMemAvailPhys;
|
||||
size_t _dwMemAvailPhys;
|
||||
SIZE_T _dwMemTotalVirtual;
|
||||
SIZE_T _dwMemAvailVirtual;
|
||||
DWORD _dwMemTotalVideo;
|
||||
@ -453,6 +460,16 @@ DWORD GetDXVersion()
|
||||
dwDXVersion = 0x700;
|
||||
pDD7->Release();
|
||||
|
||||
#ifdef USE_D3D9
|
||||
HINSTANCE hD3D9DLL = LoadLibrary("D3D9.DLL");
|
||||
if (hD3D9DLL != nil) {
|
||||
FreeLibrary(hDDrawDLL);
|
||||
FreeLibrary(hD3D9DLL);
|
||||
|
||||
dwDXVersion = 0x900;
|
||||
return dwDXVersion;
|
||||
}
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// DirectX 8.0 Checks
|
||||
@ -502,6 +519,7 @@ DWORD GetDXVersion()
|
||||
/*
|
||||
*****************************************************************************
|
||||
*/
|
||||
#ifndef _WIN64
|
||||
static char cpuvendor[16] = "UnknownVendr";
|
||||
__declspec(naked) const char * _psGetCpuVendr()
|
||||
{
|
||||
@ -575,6 +593,7 @@ void _psPrintCpuInfo()
|
||||
if ( FeaturesEx & 0x80000000 )
|
||||
debug("with 3DNow");
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
*****************************************************************************
|
||||
@ -650,9 +669,9 @@ psInitialize(void)
|
||||
|
||||
gGameState = GS_START_UP;
|
||||
TRACE("gGameState = GS_START_UP");
|
||||
|
||||
#ifndef _WIN64
|
||||
_psPrintCpuInfo();
|
||||
|
||||
#endif
|
||||
OSVERSIONINFO verInfo;
|
||||
verInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
|
||||
@ -1298,8 +1317,11 @@ RwBool IsForegroundApp()
|
||||
|
||||
UINT GetBestRefreshRate(UINT width, UINT height, UINT depth)
|
||||
{
|
||||
#ifdef USE_D3D9
|
||||
LPDIRECT3D9 d3d = Direct3DCreate9(D3D_SDK_VERSION);
|
||||
#else
|
||||
LPDIRECT3D8 d3d = Direct3DCreate8(D3D_SDK_VERSION);
|
||||
|
||||
#endif
|
||||
ASSERT(d3d != nil);
|
||||
|
||||
UINT refreshRate = INT_MAX;
|
||||
@ -1312,14 +1334,21 @@ UINT GetBestRefreshRate(UINT width, UINT height, UINT depth)
|
||||
else
|
||||
format = D3DFMT_R5G6B5;
|
||||
|
||||
#ifdef USE_D3D9
|
||||
UINT modeCount = d3d->GetAdapterModeCount(GcurSel, format);
|
||||
#else
|
||||
UINT modeCount = d3d->GetAdapterModeCount(GcurSel);
|
||||
|
||||
#endif
|
||||
|
||||
for ( UINT i = 0; i < modeCount; i++ )
|
||||
{
|
||||
D3DDISPLAYMODE mode;
|
||||
|
||||
#ifdef USE_D3D9
|
||||
d3d->EnumAdapterModes(GcurSel, format, i, &mode);
|
||||
#else
|
||||
d3d->EnumAdapterModes(GcurSel, i, &mode);
|
||||
|
||||
#endif
|
||||
if ( mode.Width == width && mode.Height == height && mode.Format == format )
|
||||
{
|
||||
if ( mode.RefreshRate == 0 )
|
||||
@ -1612,7 +1641,7 @@ CommandLineToArgv(RwChar *cmdLine, RwInt32 *argCount)
|
||||
RwInt32 i, len;
|
||||
RwChar *res, *str, **aptr;
|
||||
|
||||
len = strlen(cmdLine);
|
||||
len = (int)strlen(cmdLine);
|
||||
|
||||
/*
|
||||
* Count the number of arguments...
|
||||
@ -1700,11 +1729,11 @@ void InitialiseLanguage()
|
||||
{
|
||||
WORD primUserLCID = PRIMARYLANGID(GetSystemDefaultLCID());
|
||||
WORD primSystemLCID = PRIMARYLANGID(GetUserDefaultLCID());
|
||||
WORD primLayout = PRIMARYLANGID((DWORD)GetKeyboardLayout(0));
|
||||
WORD primLayout = PRIMARYLANGID((DWORD_PTR)GetKeyboardLayout(0));
|
||||
|
||||
WORD subUserLCID = SUBLANGID(GetSystemDefaultLCID());
|
||||
WORD subSystemLCID = SUBLANGID(GetUserDefaultLCID());
|
||||
WORD subLayout = SUBLANGID((DWORD)GetKeyboardLayout(0));
|
||||
WORD subLayout = SUBLANGID((DWORD_PTR)GetKeyboardLayout(0));
|
||||
|
||||
if ( primUserLCID == LANG_GERMAN
|
||||
|| primSystemLCID == LANG_GERMAN
|
||||
|
@ -9,8 +9,12 @@
|
||||
#endif /* (!defined(RSREGSETBREAKALLOC)) */
|
||||
|
||||
#ifndef _INC_WINDOWS
|
||||
#define _X86_
|
||||
#include <windef.h>
|
||||
#ifdef _WIN64
|
||||
#define _AMD64_
|
||||
#else
|
||||
#define _X86_
|
||||
#endif
|
||||
#include <windef.h>
|
||||
#endif
|
||||
|
||||
enum eWinVersion
|
||||
|
Reference in New Issue
Block a user