Fix: SDL device can support FPS camera animator again

Also no longer restricting mouse position to 0-windowsize (restriction for other devices got removed earlier)
And adding some commented out lines to Makesfile for easier testing of SDL. We probably should use some parameter which can be passed to Makefiles for that in the future.
Note: This does not fix all cursor troubles for SDL - it still does not support relative rectangle
Bit arguably how to handle setting/getting mouse position for SDL, for example it still doesn't support a reference rectangle.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6424 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2022-09-22 21:47:19 +00:00
parent a69969d6f9
commit 1803413b49
4 changed files with 5 additions and 9 deletions

View File

@ -1,6 +1,7 @@
--------------------------
Changes in 1.9 (not yet released)
- Fix MouseButtonStates for mouse events in CIrrDeviceSDL when middle or right button are released.
- CGUIContextMenu no longer marks EMIE_MOUSE_MOVED as handled
- core::array::linear_search and linear_reverse_search can now work with any types as long as corresponding operator== is implemented.
- Add checks for sane image sizes in some image loaders (so far: bmp, jpg, tga, png).

View File

@ -25,6 +25,7 @@ all: all_linux
# target specific settings
all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht
all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lXext -lX11 -lXcursor
#all_linux: LDFLAGS += `sdl-config --libs`
all_linux clean_linux: SYSTEM=Linux
all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc
all_win32 clean_win32 static_win32: SUF=.exe

View File

@ -25,6 +25,7 @@ all: all_linux
# target specific settings
all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht
all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lXext -lX11 -lXcursor
#all_linux: LDFLAGS += `sdl-config --libs`
all_linux clean_linux: SYSTEM=Linux
all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc
all_win32 clean_win32 static_win32: SUF=.exe

View File

@ -143,6 +143,8 @@ namespace irr
virtual void setPosition(s32 x, s32 y) IRR_OVERRIDE
{
SDL_WarpMouse( x, y );
CursorPos.X = x;
CursorPos.Y = y;
}
//! Returns the current position of the mouse cursor.
@ -172,15 +174,6 @@ namespace irr
{
CursorPos.X = Device->MouseX;
CursorPos.Y = Device->MouseY;
if (CursorPos.X < 0)
CursorPos.X = 0;
if (CursorPos.X > (s32)Device->Width)
CursorPos.X = Device->Width;
if (CursorPos.Y < 0)
CursorPos.Y = 0;
if (CursorPos.Y > (s32)Device->Height)
CursorPos.Y = Device->Height;
}
CIrrDeviceSDL* Device;