Merge branch releases/1.8 revisions r5369:r5387 into trunk.
- Fix bug in cursor positions when compiled with newer Windows SDK's (v110 in VS2012) and running on Systems >= Windows Vista in windowed mode. - IOSOperator::getSysteMemory() no longer returns incorrect values with >2GB. - Spelling fixes and documenation git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5388 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
bd9ff4940b
commit
49cc0f54ad
@ -164,6 +164,9 @@ should now be fps independentn
|
|||||||
|
|
||||||
--------------------------
|
--------------------------
|
||||||
Changes in 1.8.5
|
Changes in 1.8.5
|
||||||
|
- Fix bug in cursor positions when compiled with newer Windows SDK's (v110 in VS2012) and running on Systems >= Windows Vista in windowed mode.
|
||||||
|
Thanks @Mustapha Tachouct for the bugreport and patch proposal. Also thanks @BakeMyCake for an earlier report.
|
||||||
|
- IOSOperator::getSysteMemory() no longer returns incorrect values with >2GB. Thanks @Eduline - human development for report and patch.
|
||||||
- Increase KEY_KEY_CODES_COUNT to fix problem with laptop keyboards which return the keycode 0xff for the function key. Thx @Klokancz for bugreport and patch.
|
- Increase KEY_KEY_CODES_COUNT to fix problem with laptop keyboards which return the keycode 0xff for the function key. Thx @Klokancz for bugreport and patch.
|
||||||
- Fix bug when calling activateJoysticks on windows several times. It had appened joystick information instead of replacing it, thereby increasing joystick number on each call.
|
- Fix bug when calling activateJoysticks on windows several times. It had appened joystick information instead of replacing it, thereby increasing joystick number on each call.
|
||||||
Only happened compiling with _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ (which is the default). Linux and SDL implementation not affected.
|
Only happened compiling with _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ (which is the default). Linux and SDL implementation not affected.
|
||||||
|
@ -38,10 +38,10 @@ public:
|
|||||||
virtual bool getProcessorSpeedMHz(u32* MHz) const = 0;
|
virtual bool getProcessorSpeedMHz(u32* MHz) const = 0;
|
||||||
|
|
||||||
//! Get the total and available system RAM
|
//! Get the total and available system RAM
|
||||||
/** \param Total: will contain the total system memory
|
/** \param totalBytes: will contain the total system memory in bytes
|
||||||
\param Avail: will contain the available memory
|
\param availableBytes: will contain the available memory in bytes
|
||||||
\return True if successful, false if not */
|
\return True if successful, false if not */
|
||||||
virtual bool getSystemMemory(u32* Total, u32* Avail) const = 0;
|
virtual bool getSystemMemory(u32* totalBytes, u32* availableBytes) const = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1955,6 +1955,22 @@ void CIrrDeviceWin32::ReportLastWinApiError()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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()
|
||||||
|
{
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
// Convert an Irrlicht texture to a Windows cursor
|
// Convert an Irrlicht texture to a Windows cursor
|
||||||
// Based on http://www.codeguru.com/cpp/w-p/win32/cursors/article.php/c4529/
|
// 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)
|
HCURSOR CIrrDeviceWin32::TextureToCursor(HWND hwnd, irr::video::ITexture * tex, const core::rect<s32>& sourceRect, const core::position2d<s32> &hotspot)
|
||||||
|
@ -118,13 +118,16 @@ namespace irr
|
|||||||
return CIrrDeviceStub::checkSuccessiveClicks(mouseX, mouseY, inputEvent );
|
return CIrrDeviceStub::checkSuccessiveClicks(mouseX, mouseY, inputEvent );
|
||||||
}
|
}
|
||||||
|
|
||||||
//! switchs to fullscreen
|
//! Switch to fullscreen
|
||||||
bool switchToFullScreen(bool reset=false);
|
bool switchToFullScreen(bool reset=false);
|
||||||
|
|
||||||
//! Check for and show last Windows API error to help internal debugging.
|
//! Check for and show last Windows API error to help internal debugging.
|
||||||
//! Does call GetLastError and on errors formats the errortext and displays it in a messagebox.
|
//! Does call GetLastError and on errors formats the error text and displays it in a messagebox.
|
||||||
static void ReportLastWinApiError();
|
static void ReportLastWinApiError();
|
||||||
|
|
||||||
|
//! Same function Windows offers in VersionHelpers.h, but we can't use that as it's not available before SDK 8.1
|
||||||
|
static bool isWindowsVistaOrGreater();
|
||||||
|
|
||||||
// convert an Irrlicht texture to a windows cursor
|
// convert an Irrlicht texture to a windows cursor
|
||||||
HCURSOR TextureToCursor(HWND hwnd, irr::video::ITexture * tex, const core::rect<s32>& sourceRect, const core::position2d<s32> &hotspot);
|
HCURSOR TextureToCursor(HWND hwnd, irr::video::ITexture * tex, const core::rect<s32>& sourceRect, const core::position2d<s32> &hotspot);
|
||||||
|
|
||||||
@ -282,15 +285,21 @@ namespace irr
|
|||||||
{
|
{
|
||||||
if (!fullscreen)
|
if (!fullscreen)
|
||||||
{
|
{
|
||||||
|
s32 paddingBorder = 0;
|
||||||
|
#if defined (SM_CXPADDEDBORDER)
|
||||||
|
if (CIrrDeviceWin32::isWindowsVistaOrGreater())
|
||||||
|
paddingBorder = GetSystemMetrics(SM_CXPADDEDBORDER);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (resizable)
|
if (resizable)
|
||||||
{
|
{
|
||||||
BorderX = GetSystemMetrics(SM_CXSIZEFRAME);
|
BorderX = GetSystemMetrics(SM_CXSIZEFRAME) + paddingBorder;
|
||||||
BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYSIZEFRAME);
|
BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYSIZEFRAME) + paddingBorder;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BorderX = GetSystemMetrics(SM_CXDLGFRAME);
|
BorderX = GetSystemMetrics(SM_CXDLGFRAME) + paddingBorder;
|
||||||
BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYDLGFRAME);
|
BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYDLGFRAME) + paddingBorder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -206,16 +206,16 @@ bool COSOperator::getProcessorSpeedMHz(u32* MHz) const
|
|||||||
bool COSOperator::getSystemMemory(u32* Total, u32* Avail) const
|
bool COSOperator::getSystemMemory(u32* Total, u32* Avail) const
|
||||||
{
|
{
|
||||||
#if defined(_IRR_WINDOWS_API_) && !defined (_IRR_XBOX_PLATFORM_)
|
#if defined(_IRR_WINDOWS_API_) && !defined (_IRR_XBOX_PLATFORM_)
|
||||||
MEMORYSTATUS MemoryStatus;
|
MEMORYSTATUSEX MemoryStatusEx;
|
||||||
MemoryStatus.dwLength = sizeof(MEMORYSTATUS);
|
MemoryStatusEx.dwLength = sizeof(MEMORYSTATUSEX);
|
||||||
|
|
||||||
// cannot fail
|
// cannot fail
|
||||||
GlobalMemoryStatus(&MemoryStatus);
|
GlobalMemoryStatusEx(&MemoryStatusEx);
|
||||||
|
|
||||||
if (Total)
|
if (Total)
|
||||||
*Total = (u32)(MemoryStatus.dwTotalPhys>>10);
|
*Total = (u32)(MemoryStatusEx.ullTotalPhys>>10);
|
||||||
if (Avail)
|
if (Avail)
|
||||||
*Avail = (u32)(MemoryStatus.dwAvailPhys>>10);
|
*Avail = (u32)(MemoryStatusEx.ullAvailPhys>>10);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ bool COSOperator::getSystemMemory(u32* Total, u32* Avail) const
|
|||||||
*Avail = (u32)((ps*(long long)ap)>>10);
|
*Avail = (u32)((ps*(long long)ap)>>10);
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
// TODO: implement for non-availablity of symbols/features
|
// TODO: implement for non-availability of symbols/features
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
#elif defined(_IRR_OSX_PLATFORM_)
|
#elif defined(_IRR_OSX_PLATFORM_)
|
||||||
|
@ -132,7 +132,7 @@ inline u32 getTextureSizeFromSurfaceSize(u32 size)
|
|||||||
wchar_t currentchar = ch;
|
wchar_t currentchar = ch;
|
||||||
|
|
||||||
if ( IsDBCSLeadByte((BYTE) ch))
|
if ( IsDBCSLeadByte((BYTE) ch))
|
||||||
continue; // surragate pairs unsupported
|
continue; // surrogate pairs unsupported
|
||||||
|
|
||||||
// get the dimensions
|
// get the dimensions
|
||||||
SIZE size;
|
SIZE size;
|
||||||
@ -144,9 +144,9 @@ inline u32 getTextureSizeFromSurfaceSize(u32 size)
|
|||||||
|
|
||||||
if (GetCharABCWidthsW(dc, currentchar, currentchar, &abc)) // for unicode fonts, get overhang, underhang, width
|
if (GetCharABCWidthsW(dc, currentchar, currentchar, &abc)) // for unicode fonts, get overhang, underhang, width
|
||||||
{
|
{
|
||||||
size.cx = abc.abcB;
|
size.cx = abc.abcB; // full font width (ignoring padding/underhang )
|
||||||
fa.underhang = abc.abcA;
|
fa.underhang = abc.abcA; // underhang/padding left - can also be negative (in which case it's overhang left)
|
||||||
fa.overhang = abc.abcC;
|
fa.overhang = abc.abcC; // overhang/padding right - can also be negative (in which case it's underhand right)
|
||||||
|
|
||||||
if (abc.abcB-abc.abcA+abc.abcC<1)
|
if (abc.abcB-abc.abcA+abc.abcC<1)
|
||||||
continue; // nothing of width 0
|
continue; // nothing of width 0
|
||||||
@ -236,7 +236,7 @@ inline u32 getTextureSizeFromSurfaceSize(u32 size)
|
|||||||
{
|
{
|
||||||
s32 currentArea = (*it).getValue();
|
s32 currentArea = (*it).getValue();
|
||||||
wchar_t wch = (*it).getKey();
|
wchar_t wch = (*it).getKey();
|
||||||
// sloppy but I couldnt be bothered rewriting it
|
// sloppy but I couldn't be bothered rewriting it
|
||||||
if (Areas[currentArea].sourceimage == currentImage)
|
if (Areas[currentArea].sourceimage == currentImage)
|
||||||
{
|
{
|
||||||
// draw letter
|
// draw letter
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Tool for creating Irrlicht bitmap+vector fonts,
|
Tool for creating Irrlicht bitmap+vector fonts,
|
||||||
started by Gaz Davidson in December 2006
|
started by Gaz Davidson in December 2006
|
||||||
|
|
||||||
Due to my laziness and Microsoft's unituitive API, surragate pairs and
|
Due to my laziness and Microsoft's unintuitive API, surrogate pairs and
|
||||||
nonspacing diacritical marks are not supported!
|
nonspacing diacritical marks are not supported!
|
||||||
|
|
||||||
Linux bitmap font support added by Neil Burlock Oct 2008
|
Linux bitmap font support added by Neil Burlock Oct 2008
|
||||||
|
Loading…
x
Reference in New Issue
Block a user