Commit graph

46 commits

Author SHA1 Message Date
Ben Castricum
da55658a80 SDL: Fix mouse trailing part of bug #7141
Overlays are shown with _currentShakePos offset too, so no need to
compensate the mousepointer position for overlays. This compensation
was done inconsistently in draw/undraw mouse causing the mouse trails.
2016-07-01 08:26:03 +02:00
Eugene Sandulenko
3e568910c8 GCW0: Disable triple buffering.
Too many artifacts. It is not possible with current ScummVM
drawing approaches.
2016-04-10 16:36:42 +02:00
Eugene Sandulenko
a7930f2af7 GCW0: Enable triple buffering 2016-04-10 15:09:14 +02:00
Johannes Schickel
fd688b73d7 SDL: Work around bug #7038 by limiting mode reset to Win32.
Bug is: "IRIX: X BadMatch when trying to start any 640x480 game".

40e019efd4 introduced resetting the pixel depth
when unloading modes for SDL output. This was required to make mode listing
for OpenGL work on Win8+.

This causes issues on non-Win32 platforms though. SDL might not give us a valid
a pixel depth, causing the resetting to fail. A particular example is X11 on
IRIX, when only 16bit output modes work. Initially SDL tells us that the pixel
depth is 32bit. Trying to set this up causes a crash though.

Since there is no way to validate SDL's return value, we simply limit the reset
to platforms where it is actually required, i.e. Win32.
2016-02-17 16:17:39 +01:00
Johannes Schickel
366e164705 SDL: Implement initial support for resizable window with SDL2.
The code is disabled for now.
2015-12-18 19:12:11 +01:00
Johannes Schickel
5d48e211aa SDL: Fix mouse emulation with SDL2.
The mouse emulation via keyboard (or other means) was broken with
079037b739.
2015-12-13 21:30:25 +01:00
Johannes Schickel
cbc517f14f SDL: Fix warpMouse for SDL2.
Thanks to bgK for noticing.
2015-12-13 15:44:42 +01:00
Johannes Schickel
457640a162 SDL: Prevent cursor from leaving screen area in fullscreen with SDL2. 2015-12-08 15:43:36 +01:00
Johannes Schickel
079037b739 SDL: Prevent graphics stretching in fullscreen when using SDL2.
As a side effect we get better coordinates from mouse move events in
fullscreen, i.e. we do not get actual window coordinates but something close
to actual viewport coordinates. The easily noticable issue is that mouse
coordinates inside black bars are outside of the viewport. For example, the
x coordinate can get negative when there's a black bar at the left side.
2015-12-08 15:41:10 +01:00
Johannes Schickel
ed698701d7 SDL: Fix compilation with SDL2. 2015-05-20 00:27:23 +02:00
Littleboy
40e019efd4 SDL: Restore the original video mode when unloading the Surface graphics manager
We set a custom video mode that might have a different BPP from the default. To ensure that other graphics managers will get the proper results when listing available video modes, we need to restore the initial BPP when unloading.

This fixes an issue when switching to OpenGL on Windows 8 and later. On those OSes, fullscreen OpenGL only has a 32bpp mode. It is correctly listed in the options but we call SLD_SetVideoMode later in the surface graphics manager. When we list the mode again after a switch, the internally selected BPP is still 16 and we fail to find any available fullscreen modes.
2015-05-16 01:29:15 -04:00
Johannes Schickel
627d766325 SDL: Add basic abstraction class for the SDL window. 2015-02-16 01:03:29 +01:00
Johannes Schickel
8530997fff SDL: Add experimental support for SDL2.
This is based upon skristiansson's change set to make ScummVM work with SDL2.
2015-01-25 20:23:25 +01:00
Johannes Schickel
3a2db0135d SDL: Refactor WM specific functionality into SdlGraphicsManager. 2015-01-25 18:57:38 +01:00
Johannes Schickel
63304ee9ec SDL: Make GPL headers consistent in themselves. 2014-02-18 02:39:38 +01:00
Johannes Schickel
2fe303ce3f Merge pull request #409 from lordhoto/rtti
Enable RTTI and clean up the code by exploiting the availability of dynamic_cast.
2014-01-23 15:23:12 -08:00
Einar Johan Trøan Sømåen
6677a973c2 SDL: Avoid having SDL_SRCALPHA set even if we have alpha in the pixelformat. 2014-01-11 16:36:04 +01:00
Johannes Schickel
0c7f795c5b SDL: Silence unused variable warning when scalers are disabled. 2014-01-07 01:47:43 +01:00
Johannes Schickel
97953ff40d SDL: Fix return value of getDefaultGraphicsMode when scalers are disabled. 2014-01-07 01:46:28 +01:00
Johannes Schickel
cfa6b1b4ae SDL: Further small cleanup related to manager switching. 2013-10-24 00:09:17 +02:00
Johannes Schickel
ea6d38d5f3 SDL: Make activateManager/deactivateManager SdlGraphicsManager specific.
We can do this now that we can use virtual inheritance and dynamic_cast
because we enabled RTTI.
2013-10-24 00:06:32 +02:00
Johannes Schickel
d34c9d5bcb SDL: Do not require a static graphics mode list in OpenGL and SurfaceSDL. 2013-10-23 22:59:06 +02:00
Johannes Schickel
1a56b521b5 SDL: Always initialize video subsystem in initSDL. 2013-10-23 22:58:38 +02:00
Johannes Schickel
6e46e9dfaf SDL: Clean up graphics manager switching slighty.
Sadly this also requires us to extend GraphicsManager for this SDL specific
feature. However, since that's only used in the SDL backend and Tizen it
should be fine for now...
2013-10-23 22:58:34 +02:00
Johannes Schickel
9a80fa88e0 SDL: Do not set Surface::pixels directly anymore. 2013-08-03 04:14:08 +02:00
Johannes Schickel
f386e15b6f SDL: Take advantage of Surface::getPixels. 2013-08-03 04:02:54 +02:00
Johannes Schickel
b7706acb41 SDL: Prefer getBasePtr over direct Surface::pixels access. 2013-08-03 04:02:49 +02:00
Sven Hesse
989ea7cb56 JANITORIAL: Remove trailing whitespace 2013-07-14 19:01:47 +02:00
Johannes Schickel
8d6aa77769 GUI: Cleanup EventRecorder::getSurface.
Formerly the function created a SDL_Surface by hand. Instead now it uses
SDL_CreateRGBSurface (which is used in the SDL backend anyway and yields
the same results).

This should fix PS3 port compilation.
2013-07-04 15:43:17 +02:00
Eugene Sandulenko
b286a6d033 RECORDER: Fix guard ifdef 2013-07-04 14:54:56 +03:00
Eugene Sandulenko
f59512c47e RECORDER: Implement Events Recorder 2013-05-17 00:18:09 +03:00
Johannes Schickel
9f22d60adf SDL: Silence C++ narrowing warnings. 2013-01-09 07:24:37 +01:00
Johannes Schickel
aec9b9e22a ALL: Let overlay related methods in OSystem take a void * and use a proper pitch values.
This is a first step to get rid of OverlayColor, which is a requirement for
proper 4Bpp overlay support.
2012-06-16 04:17:14 +02:00
Johannes Schickel
d27d951d0b BACKENDS: Make OSystem::setMouseCursor take a "const void *" buffer.
This is mainly for consistency with OSystem::copyRectToScreen.
2012-06-16 03:28:42 +02:00
Johannes Schickel
31880186e1 BACKENDS: Let copyRectToScreen take a "const void *" instead of "const byte *" as buffer.
This removes the need to convert the parameter to copyRectToScreen to
"const byte *", which is commonly used in games, which use Graphics::Surface
to store their graphics data.
2012-06-16 02:18:01 +02:00
Johannes Schickel
a401f0a19e ALL: Replace cursorTargetScale in OSystem API with a simple "do not scale" logic.
All uses of the old target scale API actually wanted to disallow scaling of
the mouse cursor. This commit adapts our API to this and thus simplifies
backend implementations.

Some backends, most notable the Wii and Android, did some implementation of
the cursor target scale, which I didn't adapt yet. I added a TODO for the
porters there.
2012-06-03 02:02:57 +02:00
Max Horn
5de3f9c765 ALL: Correct spelling of "Mac OS X" in various places 2012-05-31 10:30:29 +02:00
Johannes Schickel
223794fb38 ALL: Make use of defined() for the preprocessor consistent.
This does not change the use of defined for some NDS source files, since they
seem to be (based on?) third party code.
2012-03-17 22:02:44 +01:00
David-John Willis
69683b8ee0 SURFACESDL: Stop forceful resetting of _videoMode.hardware* when calling SurfaceSdlGraphicsManager::loadGFXMode() for the GPH backend.
* Note: This really should be cleaned up and all backends that have a custom loadGFXMode() really should setup their own _videoMode.hardware* settings. Assuming the overlay will always match the hardware is flawed logic on devices with fixed hardware screens.
* Just done for the GPH backend for now to cut down on the regresion risk to other backends near the 1.4.0 release cycle.
2011-10-03 12:24:25 +01:00
Johannes Schickel
0f6e231356 SDL: Implement a hellish workaround to fix bug #3368143.
The bug in question is "SDL/OpenGL: Crash when switching renderer backend". To
fix it I added a stupid graphics state copying to the SDL backend, in case the
graphics manager is switched. The implementation of this is considered a pure
workaround, no one should ever do it like this in reality... I just want to
die when looking at this... Not sure why I actually committed it.

Anyway it at least makes the OpenGL backend testable for those who do not
want to fiddle with the config file directly.
2011-08-11 04:28:44 +02:00
Johannes Schickel
fd61a83bb5 SDL: Slight clean up in the surface based graphics manager. 2011-08-09 00:04:19 +02:00
Johannes Schickel
04ab0e58b4 SDL: Take advantage of SdlGraphicsManager.
This gets rid of the hacks, where SdlEventSource added events with custom type
numbers to pass SDL_VIDEOEXPOSE and SDL_VIDEORESIZE to the graphics manager.

Furthermore it get rids of the uninituitive and hard to trace way of assigning
the proper mouse coordinates to mouse related events. Formerly it passed the
real screen coordinates through the even dispatching api to the graphics
manager (at least hopefully ;-) and let that handle creating a new event with
the proper coordinates. Now instead SdlEventSource handles the proper
coordinate setup itself.

Since this is a behavior change and I can not test all the SDL based small
devices ports this commit might break compilation for them and more serve it
might also break mouse position behavior. If any of that occurs I am sorry
about it.
2011-08-09 00:03:11 +02:00
Johannes Schickel
0630a88a04 SDL: Let SDL based graphics managers inherit from SdlGraphicsManager.
This also adapts port I can not test (not even the compilation). So if this
breaks anything I am sorry about it.
2011-08-09 00:03:11 +02:00
Bastien Bouclet
0b1cb0ebbb SDL: Remove an unnecessary memset 2011-07-02 22:14:13 +02:00
Bastien Bouclet
a360a64dd7 SDL: Set a black palette by default.
This fixes white flashing screens when using SDL 1.3.
SDL 1.3 palettes are all white by default, whereas
SDL 1.2 palettes are all black ...
2011-07-02 22:01:45 +02:00
Johannes Schickel
1c21232416 SDL: Rename SdlGraphicsManager to SurfaceSdlGraphicsManager to reflect its purpose.
Hopefully I catched all uses of the old name in our ports...
2011-06-19 20:10:21 +02:00
Renamed from backends/graphics/sdl/sdl-graphics.cpp (Browse further)