summaryrefslogtreecommitdiffstats
path: root/src/skel/win
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-07-04 04:00:33 +0200
committereray orçunus <erayorcunus@gmail.com>2019-07-04 04:00:33 +0200
commitcc56292bc503d5aaa96c5146480ab8bd1b6b0488 (patch)
tree77949cc32155e844b34c75f856f79ff3f3ad9cec /src/skel/win
parentEven more CPed (diff)
parentMerge pull request #107 from Nick007J/master (diff)
downloadre3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.gz
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.bz2
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.lz
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.xz
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.zst
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.zip
Diffstat (limited to 'src/skel/win')
-rw-r--r--src/skel/win/win.cpp42
-rw-r--r--src/skel/win/win.h8
2 files changed, 21 insertions, 29 deletions
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index 9638e53a..0481e104 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -626,9 +626,7 @@ psInitialise(void)
C_PcSave::SetSaveDirectory(_psGetUserFilesFolder());
-#ifndef NASTY_GAME
- InitialiseLanguage();
-#endif
+ InitialiseLanguage();
FrontEndMenuManager.LoadSettings();
@@ -1262,7 +1260,7 @@ UINT GetBestRefreshRate(UINT width, UINT height, UINT depth)
ASSERT(d3d != nil);
- INT refreshRate = -1;
+ UINT refreshRate = INT_MAX;
D3DFORMAT format;
if ( depth == 32 )
@@ -1284,12 +1282,9 @@ UINT GetBestRefreshRate(UINT width, UINT height, UINT depth)
{
if ( mode.RefreshRate == 0 )
return 0;
-#pragma warning( push )
-#pragma warning( disable : 4018)
if ( mode.RefreshRate < refreshRate && mode.RefreshRate >= 60 )
refreshRate = mode.RefreshRate;
-#pragma warning( pop )
}
}
@@ -1540,8 +1535,6 @@ CommandLineToArgv(RwChar *cmdLine, RwInt32 *argCount)
*/
void InitialiseLanguage()
{
-#pragma warning( push )
-#pragma warning( disable : 4302)
WORD primUserLCID = PRIMARYLANGID(GetSystemDefaultLCID());
WORD primSystemLCID = PRIMARYLANGID(GetUserDefaultLCID());
WORD primLayout = PRIMARYLANGID((DWORD)GetKeyboardLayout(0));
@@ -1549,7 +1542,6 @@ void InitialiseLanguage()
WORD subUserLCID = SUBLANGID(GetSystemDefaultLCID());
WORD subSystemLCID = SUBLANGID(GetUserDefaultLCID());
WORD subLayout = SUBLANGID((DWORD)GetKeyboardLayout(0));
-#pragma warning( pop )
if ( primUserLCID == LANG_GERMAN
|| primSystemLCID == LANG_GERMAN
@@ -1573,6 +1565,12 @@ void InitialiseLanguage()
|| subSystemLCID == SUBLANG_ENGLISH_AUS
|| subLayout == SUBLANG_ENGLISH_AUS )
CGame::noProstitutes = true;
+
+#ifdef NASTY_GAME
+ CGame::nastyGame = true;
+ CMenuManager::m_PrefsAllowNastyGame = true;
+ CGame::noProstitutes = false;
+#endif
int32 lang;
@@ -2420,14 +2418,10 @@ void _InputInitialiseJoys()
}
}
-#pragma warning( push )
-#pragma warning( disable : 4700)
-HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num)
+void _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num)
{
- HRESULT hr;
-
DIDEVICEOBJECTINSTANCE objInst;
-
+
objInst.dwSize = sizeof( DIDEVICEOBJECTINSTANCE );
DIPROPRANGE range;
@@ -2445,7 +2439,7 @@ HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num)
if ( SUCCEEDED( lpDevice->GetObjectInfo( &objInst, DIJOFS_X, DIPH_BYOFFSET ) ) )
{
if( FAILED( lpDevice->SetProperty( DIPROP_RANGE, (LPCDIPROPHEADER)&range ) ) )
- return S_FALSE;
+ return;
else
;
}
@@ -2457,7 +2451,7 @@ HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num)
if ( SUCCEEDED( lpDevice->GetObjectInfo( &objInst, DIJOFS_Y, DIPH_BYOFFSET ) ) )
{
if( FAILED( lpDevice->SetProperty( DIPROP_RANGE, (LPCDIPROPHEADER)&range ) ) )
- return S_FALSE;
+ return;
else
;
}
@@ -2469,7 +2463,7 @@ HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num)
if ( SUCCEEDED( lpDevice->GetObjectInfo( &objInst, DIJOFS_Z, DIPH_BYOFFSET ) ) )
{
if( FAILED( lpDevice->SetProperty( DIPROP_RANGE, (LPCDIPROPHEADER)&range ) ) )
- return S_FALSE;
+ return;
else
AllValidWinJoys.m_aJoys[num].m_bHasAxisZ = true; // z rightStickPos.x
}
@@ -2481,15 +2475,12 @@ HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num)
if ( SUCCEEDED( lpDevice->GetObjectInfo( &objInst, DIJOFS_RZ, DIPH_BYOFFSET ) ) )
{
if( FAILED( lpDevice->SetProperty( DIPROP_RANGE, (LPCDIPROPHEADER)&range ) ) )
- return S_FALSE;
+ return;
else
AllValidWinJoys.m_aJoys[num].m_bHasAxisR = true; // r rightStickPos.y
}
}
-
- return hr;
}
-#pragma warning( pop )
HRESULT _InputAddJoys()
{
@@ -2973,9 +2964,7 @@ void _InputTranslateShiftKeyUpDown(RsKeyCodes *rs)
}
}
-#pragma warning( push )
-#pragma warning( disable : 4805)
-BOOL _InputTranslateShiftKey(RsKeyCodes *rs, UINT key, bool bDown)
+BOOL _InputTranslateShiftKey(RsKeyCodes *rs, UINT key, BOOLEAN bDown)
{
*rs = rsNULL;
switch ( key )
@@ -3002,7 +2991,6 @@ BOOL _InputTranslateShiftKey(RsKeyCodes *rs, UINT key, bool bDown)
return TRUE;
}
-#pragma warning( pop )
BOOL _InputIsExtended(INT flag)
{
diff --git a/src/skel/win/win.h b/src/skel/win/win.h
index 371b9e44..69d38164 100644
--- a/src/skel/win/win.h
+++ b/src/skel/win/win.h
@@ -63,14 +63,14 @@ HRESULT _InputInitialise();
HRESULT _InputInitialiseMouse();
HRESULT CapturePad(RwInt32 padID);
void _InputInitialiseJoys();
-HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num);
+void _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 _InputTranslateShiftKey(RsKeyCodes *rs, UINT key, BOOLEAN bDown);
BOOL _InputIsExtended(INT flag);
void InitialiseLanguage();
@@ -79,6 +79,10 @@ void CenterVideo(void);
void CloseClip(void);
RwChar **_psGetVideoModeList();
+RwInt32 _psGetNumVideModes();
+
+void _psSelectScreenVM(RwInt32 videoMode);
+void HandleExit();
#ifdef __cplusplus
}