Fix cursor problems found by buffer and by rvl2 as described in http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=34823&highlight=

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2669 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2009-08-29 23:33:59 +00:00
parent 5f1f6b1b18
commit 34d47c1cff
5 changed files with 46 additions and 2 deletions

View File

@ -1,5 +1,7 @@
Changes in 1.6 (??.??.2009)
- Fix cursor problems found by buffer and by rvl2 as described in http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=34823&highlight=
- Change debug data to draw using lines instead of arrows, which is much faster. Patch by pc0de
- Fix a bug with FPS camera animator causing stutters. Patch by FuzzYspo0N

View File

@ -582,6 +582,7 @@ void CIrrDeviceWin32::resizeIfNecessary()
os::Printer::log(tmp);
getVideoDriver()->OnResize(irr::core::dimension2du((u32)r.right, (u32)r.bottom));
getWin32CursorControl()->OnResize(getVideoDriver()->getScreenSize());
}
Resized = false;

View File

@ -16,6 +16,7 @@
#if !defined(_IRR_XBOX_PLATFORM_)
#include <windows.h>
#include <mmsystem.h> // For JOYCAPS
#include <Windowsx.h>
#endif
@ -244,13 +245,32 @@ namespace irr
UseReferenceRect = false;
}
/** Used to notify the cursor that the window was resized. */
virtual void OnResize(const core::dimension2d<u32>& size)
{
if (size.Width!=0)
InvWindowSize.Width = 1.0f / size.Width;
else
InvWindowSize.Width = 0.f;
if (size.Height!=0)
InvWindowSize.Height = 1.0f / size.Height;
else
InvWindowSize.Height = 0.f;
}
private:
//! Updates the internal cursor position
void updateInternalCursorPosition()
{
POINT p;
GetCursorPos(&p);
if (!GetCursorPos(&p))
{
DWORD xy = GetMessagePos();
p.x = GET_X_LPARAM(xy);
p.y = GET_Y_LPARAM(xy);
}
if (UseReferenceRect)
{

View File

@ -617,6 +617,7 @@ void CIrrDeviceWinCE::resizeIfNecessary()
os::Printer::log(tmp);
getVideoDriver()->OnResize(irr::core::dimension2d<irr::u32>(r.right, r.bottom));
getWin32CursorControl()->OnResize(getVideoDriver()->getScreenSize());
}
Resized = false;

View File

@ -202,13 +202,33 @@ namespace irr
UseReferenceRect = false;
}
/** Used to notify the cursor that the window was resized. */
virtual void OnResize(const core::dimension2d<u32>& size)
{
if (size.Width!=0)
InvWindowSize.Width = 1.0f / size.Width;
else
InvWindowSize.Width = 0.f;
if (size.Height!=0)
InvWindowSize.Height = 1.0f / size.Height;
else
InvWindowSize.Height = 0.f;
}
private:
//! Updates the internal cursor position
void updateInternalCursorPosition()
{
POINT p;
GetCursorPos(&p);
if (!GetCursorPos(&p))
{
DWORD xy = GetMessagePos();
p.x = GET_X_LPARAM(xy);
p.y = GET_Y_LPARAM(xy);
}
RECT rect;
if (UseReferenceRect)