Commit 37f8eb7d authored by hybrid's avatar hybrid

Merged revisions 4485-4509 from 1.8 branch. Cursor fix for Windows 8.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4510 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 6c21502c
......@@ -78,14 +78,14 @@ class line2d
{
// Uses the method given at:
// http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
const f32 commonDenominator = (f32)(l.end.Y - l.start.Y)*(end.X - start.X) -
(l.end.X - l.start.X)*(end.Y - start.Y);
const f32 commonDenominator = (f32)((l.end.Y - l.start.Y)*(end.X - start.X) -
(l.end.X - l.start.X)*(end.Y - start.Y));
const f32 numeratorA = (f32)(l.end.X - l.start.X)*(start.Y - l.start.Y) -
(l.end.Y - l.start.Y)*(start.X -l.start.X);
const f32 numeratorA = (f32)((l.end.X - l.start.X)*(start.Y - l.start.Y) -
(l.end.Y - l.start.Y)*(start.X -l.start.X));
const f32 numeratorB = (f32)(end.X - start.X)*(start.Y - l.start.Y) -
(end.Y - start.Y)*(start.X -l.start.X);
const f32 numeratorB = (f32)((end.X - start.X)*(start.Y - l.start.Y) -
(end.Y - start.Y)*(start.X -l.start.X));
if(equals(commonDenominator, 0.f))
{
......
......@@ -140,17 +140,31 @@ namespace irr
BOOL gotCursorInfo = GetCursorInfo(&info);
while ( gotCursorInfo )
{
if ( (visible && info.flags == CURSOR_SHOWING) // visible
|| (!visible && info.flags == 0 ) ) // hidden
#ifdef CURSOR_SUPPRESSED
// new flag for Windows 8, where cursor
// might be suppressed for touch interface
if (info.flags == CURSOR_SUPPRESSED)
{
visible=false;
break;
}
int showResult = ShowCursor(visible); // this only increases an internal display counter in windows, so it might have to be called some more
if ( showResult < 0 )
#endif
if ( (visible && info.flags == CURSOR_SHOWING) || // visible
(!visible && info.flags == 0 ) ) // hidden
{
break;
}
info.cbSize = sizeof(CURSORINFO); // yes, it really must be set each time
// this only increases an internal
// display counter in windows, so it
// might have to be called some more
const int showResult = ShowCursor(visible);
// if result has correct sign we can
// stop here as well
if (( !visible && showResult < 0 ) ||
(visible && showResult >= 0))
break;
// yes, it really must be set each time
info.cbSize = sizeof(CURSORINFO);
gotCursorInfo = GetCursorInfo(&info);
}
IsVisible = visible;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment