mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-30 23:30:27 +02:00
Remove various ancient support code
This commit is contained in:
@ -528,166 +528,6 @@ bool SJoystickWin32Control::activateJoysticks(core::array<SJoystickInfo> & joyst
|
||||
}
|
||||
} // end namespace irr
|
||||
|
||||
// Get the codepage from the locale language id
|
||||
// Based on the table from http://www.science.co.il/Language/Locale-Codes.asp?s=decimal
|
||||
static unsigned int LocaleIdToCodepage(unsigned int lcid)
|
||||
{
|
||||
switch ( lcid )
|
||||
{
|
||||
case 1098: // Telugu
|
||||
case 1095: // Gujarati
|
||||
case 1094: // Punjabi
|
||||
case 1103: // Sanskrit
|
||||
case 1111: // Konkani
|
||||
case 1114: // Syriac
|
||||
case 1099: // Kannada
|
||||
case 1102: // Marathi
|
||||
case 1125: // Divehi
|
||||
case 1067: // Armenian
|
||||
case 1081: // Hindi
|
||||
case 1079: // Georgian
|
||||
case 1097: // Tamil
|
||||
return 0;
|
||||
case 1054: // Thai
|
||||
return 874;
|
||||
case 1041: // Japanese
|
||||
return 932;
|
||||
case 2052: // Chinese (PRC)
|
||||
case 4100: // Chinese (Singapore)
|
||||
return 936;
|
||||
case 1042: // Korean
|
||||
return 949;
|
||||
case 5124: // Chinese (Macau S.A.R.)
|
||||
case 3076: // Chinese (Hong Kong S.A.R.)
|
||||
case 1028: // Chinese (Taiwan)
|
||||
return 950;
|
||||
case 1048: // Romanian
|
||||
case 1060: // Slovenian
|
||||
case 1038: // Hungarian
|
||||
case 1051: // Slovak
|
||||
case 1045: // Polish
|
||||
case 1052: // Albanian
|
||||
case 2074: // Serbian (Latin)
|
||||
case 1050: // Croatian
|
||||
case 1029: // Czech
|
||||
return 1250;
|
||||
case 1104: // Mongolian (Cyrillic)
|
||||
case 1071: // FYRO Macedonian
|
||||
case 2115: // Uzbek (Cyrillic)
|
||||
case 1058: // Ukrainian
|
||||
case 2092: // Azeri (Cyrillic)
|
||||
case 1092: // Tatar
|
||||
case 1087: // Kazakh
|
||||
case 1059: // Belarusian
|
||||
case 1088: // Kyrgyz (Cyrillic)
|
||||
case 1026: // Bulgarian
|
||||
case 3098: // Serbian (Cyrillic)
|
||||
case 1049: // Russian
|
||||
return 1251;
|
||||
case 8201: // English (Jamaica)
|
||||
case 3084: // French (Canada)
|
||||
case 1036: // French (France)
|
||||
case 5132: // French (Luxembourg)
|
||||
case 5129: // English (New Zealand)
|
||||
case 6153: // English (Ireland)
|
||||
case 1043: // Dutch (Netherlands)
|
||||
case 9225: // English (Caribbean)
|
||||
case 4108: // French (Switzerland)
|
||||
case 4105: // English (Canada)
|
||||
case 1110: // Galician
|
||||
case 10249: // English (Belize)
|
||||
case 3079: // German (Austria)
|
||||
case 6156: // French (Monaco)
|
||||
case 12297: // English (Zimbabwe)
|
||||
case 1069: // Basque
|
||||
case 2067: // Dutch (Belgium)
|
||||
case 2060: // French (Belgium)
|
||||
case 1035: // Finnish
|
||||
case 1080: // Faroese
|
||||
case 1031: // German (Germany)
|
||||
case 3081: // English (Australia)
|
||||
case 1033: // English (United States)
|
||||
case 2057: // English (United Kingdom)
|
||||
case 1027: // Catalan
|
||||
case 11273: // English (Trinidad)
|
||||
case 7177: // English (South Africa)
|
||||
case 1030: // Danish
|
||||
case 13321: // English (Philippines)
|
||||
case 15370: // Spanish (Paraguay)
|
||||
case 9226: // Spanish (Colombia)
|
||||
case 5130: // Spanish (Costa Rica)
|
||||
case 7178: // Spanish (Dominican Republic)
|
||||
case 12298: // Spanish (Ecuador)
|
||||
case 17418: // Spanish (El Salvador)
|
||||
case 4106: // Spanish (Guatemala)
|
||||
case 18442: // Spanish (Honduras)
|
||||
case 3082: // Spanish (International Sort)
|
||||
case 13322: // Spanish (Chile)
|
||||
case 19466: // Spanish (Nicaragua)
|
||||
case 2058: // Spanish (Mexico)
|
||||
case 10250: // Spanish (Peru)
|
||||
case 20490: // Spanish (Puerto Rico)
|
||||
case 1034: // Spanish (Traditional Sort)
|
||||
case 14346: // Spanish (Uruguay)
|
||||
case 8202: // Spanish (Venezuela)
|
||||
case 1089: // Swahili
|
||||
case 1053: // Swedish
|
||||
case 2077: // Swedish (Finland)
|
||||
case 5127: // German (Liechtenstein)
|
||||
case 1078: // Afrikaans
|
||||
case 6154: // Spanish (Panama)
|
||||
case 4103: // German (Luxembourg)
|
||||
case 16394: // Spanish (Bolivia)
|
||||
case 2055: // German (Switzerland)
|
||||
case 1039: // Icelandic
|
||||
case 1057: // Indonesian
|
||||
case 1040: // Italian (Italy)
|
||||
case 2064: // Italian (Switzerland)
|
||||
case 2068: // Norwegian (Nynorsk)
|
||||
case 11274: // Spanish (Argentina)
|
||||
case 1046: // Portuguese (Brazil)
|
||||
case 1044: // Norwegian (Bokmal)
|
||||
case 1086: // Malay (Malaysia)
|
||||
case 2110: // Malay (Brunei Darussalam)
|
||||
case 2070: // Portuguese (Portugal)
|
||||
return 1252;
|
||||
case 1032: // Greek
|
||||
return 1253;
|
||||
case 1091: // Uzbek (Latin)
|
||||
case 1068: // Azeri (Latin)
|
||||
case 1055: // Turkish
|
||||
return 1254;
|
||||
case 1037: // Hebrew
|
||||
return 1255;
|
||||
case 5121: // Arabic (Algeria)
|
||||
case 15361: // Arabic (Bahrain)
|
||||
case 9217: // Arabic (Yemen)
|
||||
case 3073: // Arabic (Egypt)
|
||||
case 2049: // Arabic (Iraq)
|
||||
case 11265: // Arabic (Jordan)
|
||||
case 13313: // Arabic (Kuwait)
|
||||
case 12289: // Arabic (Lebanon)
|
||||
case 4097: // Arabic (Libya)
|
||||
case 6145: // Arabic (Morocco)
|
||||
case 8193: // Arabic (Oman)
|
||||
case 16385: // Arabic (Qatar)
|
||||
case 1025: // Arabic (Saudi Arabia)
|
||||
case 10241: // Arabic (Syria)
|
||||
case 14337: // Arabic (U.A.E.)
|
||||
case 1065: // Farsi
|
||||
case 1056: // Urdu
|
||||
case 7169: // Arabic (Tunisia)
|
||||
return 1256;
|
||||
case 1061: // Estonian
|
||||
case 1062: // Latvian
|
||||
case 1063: // Lithuanian
|
||||
return 1257;
|
||||
case 1066: // Vietnamese
|
||||
return 1258;
|
||||
}
|
||||
return 65001; // utf-8
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
struct SEnvMapper
|
||||
@ -699,7 +539,6 @@ namespace
|
||||
irr::core::array<SEnvMapper> EnvMap;
|
||||
|
||||
HKL KEYBOARD_INPUT_HKL=0;
|
||||
unsigned int KEYBOARD_INPUT_CODEPAGE = 1252;
|
||||
}
|
||||
|
||||
irr::CIrrDeviceWin32* getDeviceFromHWnd(HWND hWnd)
|
||||
@ -718,9 +557,6 @@ irr::CIrrDeviceWin32* getDeviceFromHWnd(HWND hWnd)
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
#ifndef WM_MOUSEWHEEL
|
||||
#define WM_MOUSEWHEEL 0x020A
|
||||
#endif
|
||||
#ifndef WHEEL_DELTA
|
||||
#define WHEEL_DELTA 120
|
||||
#endif
|
||||
@ -787,12 +623,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
// middle and extra buttons
|
||||
if (wParam & MK_MBUTTON)
|
||||
event.MouseInput.ButtonStates |= irr::EMBSM_MIDDLE;
|
||||
#if(_WIN32_WINNT >= 0x0500)
|
||||
if (wParam & MK_XBUTTON1)
|
||||
event.MouseInput.ButtonStates |= irr::EMBSM_EXTRA1;
|
||||
if (wParam & MK_XBUTTON2)
|
||||
event.MouseInput.ButtonStates |= irr::EMBSM_EXTRA2;
|
||||
#endif
|
||||
event.MouseInput.Wheel = 0.f;
|
||||
|
||||
// wheel
|
||||
@ -853,22 +687,20 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
event.KeyInput.Key = (irr::EKEY_CODE)wParam;
|
||||
event.KeyInput.PressedDown = (message==WM_KEYDOWN || message == WM_SYSKEYDOWN);
|
||||
|
||||
const UINT MY_MAPVK_VSC_TO_VK_EX = 3; // MAPVK_VSC_TO_VK_EX should be in SDK according to MSDN, but isn't in mine.
|
||||
if ( event.KeyInput.Key == irr::KEY_SHIFT )
|
||||
{
|
||||
// this will fail on systems before windows NT/2000/XP, not sure _what_ will return there instead.
|
||||
event.KeyInput.Key = (irr::EKEY_CODE)MapVirtualKey( ((lParam>>16) & 255), MY_MAPVK_VSC_TO_VK_EX );
|
||||
event.KeyInput.Key = (irr::EKEY_CODE)MapVirtualKey( ((lParam>>16) & 255), MAPVK_VSC_TO_VK_EX );
|
||||
}
|
||||
if ( event.KeyInput.Key == irr::KEY_CONTROL )
|
||||
{
|
||||
event.KeyInput.Key = (irr::EKEY_CODE)MapVirtualKey( ((lParam>>16) & 255), MY_MAPVK_VSC_TO_VK_EX );
|
||||
event.KeyInput.Key = (irr::EKEY_CODE)MapVirtualKey( ((lParam>>16) & 255), MAPVK_VSC_TO_VK_EX );
|
||||
// some keyboards will just return LEFT for both - left and right keys. So also check extend bit.
|
||||
if (lParam & 0x1000000)
|
||||
event.KeyInput.Key = irr::KEY_RCONTROL;
|
||||
}
|
||||
if ( event.KeyInput.Key == irr::KEY_MENU )
|
||||
{
|
||||
event.KeyInput.Key = (irr::EKEY_CODE)MapVirtualKey( ((lParam>>16) & 255), MY_MAPVK_VSC_TO_VK_EX );
|
||||
event.KeyInput.Key = (irr::EKEY_CODE)MapVirtualKey( ((lParam>>16) & 255), MAPVK_VSC_TO_VK_EX );
|
||||
if (lParam & 0x1000000)
|
||||
event.KeyInput.Key = irr::KEY_RMENU;
|
||||
}
|
||||
@ -878,23 +710,12 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
event.KeyInput.Shift = ((allKeys[VK_SHIFT] & 0x80)!=0);
|
||||
event.KeyInput.Control = ((allKeys[VK_CONTROL] & 0x80)!=0);
|
||||
|
||||
// Handle unicode and deadkeys in a way that works since Windows 95 and nt4.0
|
||||
// Using ToUnicode instead would be shorter, but would to my knowledge not run on 95 and 98.
|
||||
WORD keyChars[2];
|
||||
// Handle unicode and deadkeys
|
||||
WCHAR keyChars[2];
|
||||
UINT scanCode = HIWORD(lParam);
|
||||
int conversionResult = ToAsciiEx(static_cast<UINT>(wParam),scanCode,allKeys,keyChars,0,KEYBOARD_INPUT_HKL);
|
||||
int conversionResult = ToUnicodeEx(static_cast<UINT>(wParam),scanCode,allKeys,keyChars,2,0,KEYBOARD_INPUT_HKL);
|
||||
if (conversionResult == 1)
|
||||
{
|
||||
WORD unicodeChar;
|
||||
MultiByteToWideChar(
|
||||
KEYBOARD_INPUT_CODEPAGE,
|
||||
MB_PRECOMPOSED, // default
|
||||
(LPCSTR)keyChars,
|
||||
sizeof(keyChars),
|
||||
(WCHAR*)&unicodeChar,
|
||||
1 );
|
||||
event.KeyInput.Char = unicodeChar;
|
||||
}
|
||||
event.KeyInput.Char = keyChars[0];
|
||||
else
|
||||
event.KeyInput.Char = 0;
|
||||
|
||||
@ -959,7 +780,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case WM_INPUTLANGCHANGE:
|
||||
// get the new codepage used for keyboard input
|
||||
KEYBOARD_INPUT_HKL = GetKeyboardLayout(0);
|
||||
KEYBOARD_INPUT_CODEPAGE = LocaleIdToCodepage( LOWORD(KEYBOARD_INPUT_HKL) );
|
||||
return 0;
|
||||
}
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
@ -1107,9 +927,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
|
||||
SetForegroundWindow(HWnd);
|
||||
}
|
||||
|
||||
// get the codepage used for keyboard input
|
||||
KEYBOARD_INPUT_HKL = GetKeyboardLayout(0);
|
||||
KEYBOARD_INPUT_CODEPAGE = LocaleIdToCodepage( LOWORD(KEYBOARD_INPUT_HKL) );
|
||||
|
||||
// inform driver about the window size etc.
|
||||
resizeIfNecessary();
|
||||
@ -1443,229 +1261,17 @@ CIrrDeviceWin32::CCursorControl* CIrrDeviceWin32::getWin32CursorControl()
|
||||
return Win32CursorControl;
|
||||
}
|
||||
|
||||
|
||||
typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
|
||||
// Needed for old windows apis
|
||||
// depending on the SDK version and compilers some defines might be available
|
||||
// or not
|
||||
#ifndef PRODUCT_ULTIMATE
|
||||
#define PRODUCT_ULTIMATE 0x00000001
|
||||
#define PRODUCT_HOME_BASIC 0x00000002
|
||||
#define PRODUCT_HOME_PREMIUM 0x00000003
|
||||
#define PRODUCT_ENTERPRISE 0x00000004
|
||||
#define PRODUCT_HOME_BASIC_N 0x00000005
|
||||
#define PRODUCT_BUSINESS 0x00000006
|
||||
#define PRODUCT_STARTER 0x0000000B
|
||||
#endif
|
||||
#ifndef PRODUCT_ULTIMATE_N
|
||||
#define PRODUCT_BUSINESS_N 0x00000010
|
||||
#define PRODUCT_HOME_PREMIUM_N 0x0000001A
|
||||
#define PRODUCT_ENTERPRISE_N 0x0000001B
|
||||
#define PRODUCT_ULTIMATE_N 0x0000001C
|
||||
#endif
|
||||
#ifndef PRODUCT_STARTER_N
|
||||
#define PRODUCT_STARTER_N 0x0000002F
|
||||
#endif
|
||||
#ifndef PRODUCT_PROFESSIONAL
|
||||
#define PRODUCT_PROFESSIONAL 0x00000030
|
||||
#define PRODUCT_PROFESSIONAL_N 0x00000031
|
||||
#endif
|
||||
#ifndef PRODUCT_ULTIMATE_E
|
||||
#define PRODUCT_STARTER_E 0x00000042
|
||||
#define PRODUCT_HOME_BASIC_E 0x00000043
|
||||
#define PRODUCT_HOME_PREMIUM_E 0x00000044
|
||||
#define PRODUCT_PROFESSIONAL_E 0x00000045
|
||||
#define PRODUCT_ENTERPRISE_E 0x00000046
|
||||
#define PRODUCT_ULTIMATE_E 0x00000047
|
||||
#endif
|
||||
|
||||
void CIrrDeviceWin32::getWindowsVersion(core::stringc& out)
|
||||
{
|
||||
OSVERSIONINFOEX osvi;
|
||||
PGPI pGPI;
|
||||
BOOL bOsVersionInfoEx;
|
||||
OSVERSIONINFO osvi;
|
||||
|
||||
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
||||
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
GetVersionEx(&osvi);
|
||||
|
||||
bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO*) &osvi);
|
||||
if (!bOsVersionInfoEx)
|
||||
{
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
if (! GetVersionEx((OSVERSIONINFO *) &osvi))
|
||||
return;
|
||||
}
|
||||
|
||||
switch (osvi.dwPlatformId)
|
||||
{
|
||||
case VER_PLATFORM_WIN32_NT:
|
||||
if (osvi.dwMajorVersion <= 4)
|
||||
out.append("Microsoft Windows NT ");
|
||||
else
|
||||
if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0)
|
||||
out.append("Microsoft Windows 2000 ");
|
||||
else
|
||||
if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
|
||||
out.append("Microsoft Windows XP ");
|
||||
else
|
||||
if (osvi.dwMajorVersion == 6 )
|
||||
{
|
||||
if (osvi.dwMinorVersion == 0)
|
||||
{
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION)
|
||||
out.append("Microsoft Windows Vista ");
|
||||
else
|
||||
out.append("Microsoft Windows Server 2008 ");
|
||||
}
|
||||
else if (osvi.dwMinorVersion == 1)
|
||||
{
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION)
|
||||
out.append("Microsoft Windows 7 ");
|
||||
else
|
||||
out.append("Microsoft Windows Server 2008 R2 ");
|
||||
}
|
||||
else if (osvi.dwMinorVersion == 2)
|
||||
{
|
||||
out.append("Microsoft Windows 8 or later ");
|
||||
}
|
||||
}
|
||||
|
||||
if (bOsVersionInfoEx)
|
||||
{
|
||||
if (osvi.dwMajorVersion == 6)
|
||||
{
|
||||
DWORD dwType;
|
||||
pGPI = (PGPI)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetProductInfo");
|
||||
pGPI(osvi.dwMajorVersion, osvi.dwMinorVersion, 0, 0, &dwType);
|
||||
|
||||
switch (dwType)
|
||||
{
|
||||
case PRODUCT_ULTIMATE:
|
||||
case PRODUCT_ULTIMATE_E:
|
||||
case PRODUCT_ULTIMATE_N:
|
||||
out.append("Ultimate Edition ");
|
||||
break;
|
||||
case PRODUCT_PROFESSIONAL:
|
||||
case PRODUCT_PROFESSIONAL_E:
|
||||
case PRODUCT_PROFESSIONAL_N:
|
||||
out.append("Professional Edition ");
|
||||
break;
|
||||
case PRODUCT_HOME_BASIC:
|
||||
case PRODUCT_HOME_BASIC_E:
|
||||
case PRODUCT_HOME_BASIC_N:
|
||||
out.append("Home Basic Edition ");
|
||||
break;
|
||||
case PRODUCT_HOME_PREMIUM:
|
||||
case PRODUCT_HOME_PREMIUM_E:
|
||||
case PRODUCT_HOME_PREMIUM_N:
|
||||
out.append("Home Premium Edition ");
|
||||
break;
|
||||
case PRODUCT_ENTERPRISE:
|
||||
case PRODUCT_ENTERPRISE_E:
|
||||
case PRODUCT_ENTERPRISE_N:
|
||||
out.append("Enterprise Edition ");
|
||||
break;
|
||||
case PRODUCT_BUSINESS:
|
||||
case PRODUCT_BUSINESS_N:
|
||||
out.append("Business Edition ");
|
||||
break;
|
||||
case PRODUCT_STARTER:
|
||||
case PRODUCT_STARTER_E:
|
||||
case PRODUCT_STARTER_N:
|
||||
out.append("Starter Edition ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifdef VER_SUITE_ENTERPRISE
|
||||
else
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION)
|
||||
{
|
||||
#ifndef __BORLANDC__
|
||||
if( osvi.wSuiteMask & VER_SUITE_PERSONAL )
|
||||
out.append("Personal ");
|
||||
else
|
||||
out.append("Professional ");
|
||||
#endif
|
||||
}
|
||||
else if (osvi.wProductType == VER_NT_SERVER)
|
||||
{
|
||||
if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
|
||||
out.append("DataCenter Server ");
|
||||
else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
|
||||
out.append("Advanced Server ");
|
||||
else
|
||||
out.append("Server ");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
HKEY hKey;
|
||||
char szProductType[80];
|
||||
DWORD dwBufLen;
|
||||
|
||||
RegOpenKeyEx( HKEY_LOCAL_MACHINE,
|
||||
__TEXT("SYSTEM\\CurrentControlSet\\Control\\ProductOptions"),
|
||||
0, KEY_QUERY_VALUE, &hKey );
|
||||
RegQueryValueEx( hKey, __TEXT("ProductType"), NULL, NULL,
|
||||
(LPBYTE) szProductType, &dwBufLen);
|
||||
RegCloseKey( hKey );
|
||||
|
||||
|
||||
if (irr::core::stringc("WINNT").equals_ignore_case(szProductType))
|
||||
out.append("Professional ");
|
||||
if (irr::core::stringc("LANMANNT").equals_ignore_case(szProductType))
|
||||
out.append("Server ");
|
||||
if (irr::core::stringc("SERVERNT").equals_ignore_case(szProductType))
|
||||
out.append("Advanced Server ");
|
||||
}
|
||||
|
||||
// Display version, service pack (if any), and build number.
|
||||
|
||||
char tmp[255];
|
||||
|
||||
if (osvi.dwMajorVersion <= 4 )
|
||||
{
|
||||
sprintf(tmp, "version %lu.%lu %s (Build %lu)",
|
||||
osvi.dwMajorVersion,
|
||||
osvi.dwMinorVersion,
|
||||
irr::core::stringc(osvi.szCSDVersion).c_str(),
|
||||
osvi.dwBuildNumber & 0xFFFF);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(tmp, "%s (Build %lu)", irr::core::stringc(osvi.szCSDVersion).c_str(),
|
||||
osvi.dwBuildNumber & 0xFFFF);
|
||||
}
|
||||
|
||||
out.append(tmp);
|
||||
break;
|
||||
|
||||
case VER_PLATFORM_WIN32_WINDOWS:
|
||||
|
||||
if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)
|
||||
{
|
||||
out.append("Microsoft Windows 95 ");
|
||||
if ( osvi.szCSDVersion[1] == 'C' || osvi.szCSDVersion[1] == 'B' )
|
||||
out.append("OSR2 " );
|
||||
}
|
||||
|
||||
if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10)
|
||||
{
|
||||
out.append("Microsoft Windows 98 ");
|
||||
if ( osvi.szCSDVersion[1] == 'A' )
|
||||
out.append( "SE " );
|
||||
}
|
||||
|
||||
if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)
|
||||
out.append("Microsoft Windows Me ");
|
||||
|
||||
break;
|
||||
|
||||
case VER_PLATFORM_WIN32s:
|
||||
out.append("Microsoft Win32s ");
|
||||
break;
|
||||
}
|
||||
char tmp[255];
|
||||
snprintf(tmp, sizeof(tmp), "Microsoft Windows %lu.%lu %s", osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.szCSDVersion);
|
||||
out.append(tmp);
|
||||
}
|
||||
|
||||
//! Notifies the device, that it has been resized
|
||||
@ -1867,63 +1473,6 @@ void CIrrDeviceWin32::clearSystemMessages()
|
||||
{}
|
||||
}
|
||||
|
||||
// shows last error in a messagebox to help internal debugging.
|
||||
void CIrrDeviceWin32::ReportLastWinApiError()
|
||||
{
|
||||
// (based on code from ovidiucucu from http://www.codeguru.com/forum/showthread.php?t=318721)
|
||||
LPCTSTR pszCaption = __TEXT("Windows SDK Error Report");
|
||||
DWORD dwError = GetLastError();
|
||||
|
||||
if(NOERROR == dwError)
|
||||
{
|
||||
MessageBox(NULL, __TEXT("No error"), pszCaption, MB_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
const DWORD dwFormatControl = FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM;
|
||||
|
||||
LPVOID pTextBuffer = NULL;
|
||||
DWORD dwCount = FormatMessage(dwFormatControl,
|
||||
NULL,
|
||||
dwError,
|
||||
0,
|
||||
(LPTSTR) &pTextBuffer,
|
||||
0,
|
||||
NULL);
|
||||
if(0 != dwCount)
|
||||
{
|
||||
MessageBox(NULL, (LPCTSTR)pTextBuffer, pszCaption, MB_OK|MB_ICONERROR);
|
||||
LocalFree(pTextBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox(NULL, __TEXT("Unknown error"), pszCaption, MB_OK|MB_ICONERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Same function Windows offers in VersionHelpers.h, but we can't use that as it's not available in older sdk's (minimum is SDK 8.1)
|
||||
bool CIrrDeviceWin32::isWindowsVistaOrGreater()
|
||||
{
|
||||
#if (_WIN32_WINNT >= 0x0500)
|
||||
OSVERSIONINFOEX osvi;
|
||||
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
||||
osvi.dwMajorVersion = 6; // Windows Vista
|
||||
|
||||
if ( !GetVersionEx((OSVERSIONINFO*)&osvi) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return VerifyVersionInfo(&osvi, VER_MAJORVERSION, VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL)) ? true : false;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Convert an Irrlicht texture to a Windows cursor
|
||||
// Based on http://www.codeguru.com/cpp/w-p/win32/cursors/article.php/c4529/
|
||||
HCURSOR CIrrDeviceWin32::TextureToCursor(HWND hwnd, irr::video::ITexture * tex, const core::rect<s32>& sourceRect, const core::position2d<s32> &hotspot)
|
||||
|
Reference in New Issue
Block a user