Commit Graph

6363 Commits

Author SHA1 Message Date
Bastien Bouclet
8e4697946e OPENGL: Always clear the whole backbuffer
Previously we were clearing the whole backbuffer for 3 frames after a
window size change, and then only clearing the game area. This assumes
the OpenGL driver uses at most 3 render buffer and uses them in
sequential order. This does not seem to be the case on Linux when using
an Intel integrated GPU.
Instead we now clear the whole backbuffer on each frame to make sure
there are no leftovers remaining on the screen. All semi-recent GPUs
should have hardware clear anyway so this should not impact negatively
performance.

Possibly fixes #10025.
2017-08-05 08:36:32 +02:00
Frank Richter
0f93962ef4 Windows: Use GetUserDefaultUILanguage() instead of GetThreadLocale().
The thread locale concerns display options (e.g. date formatting) not
the display language. There are typically, but not necessarily the same,
as Windows allows them to be configured separately.
2017-08-01 08:55:48 +02:00
Bastien Bouclet
8c587b54ab SDL: Make the window size when exiting fullscreen workaround macOS specific
The call to SDL_SetWindowSize works around a macOS specific SDL2 bug.
Fixes the window not restoring to its previous position when exiting
fullscreen on Linux/X11.
2017-07-29 17:25:37 +02:00
Thierry Crozat
00bbb73ce5 SDL: Make sure we get the correct window size with SDL2
When updating or recreating the window, if we changed the window
size at the same time we also toggle between OpenGL and non
OpenGL mode, or toggle fullscreen mode, we may have a pending
SDL resize event with the wrong size. So we need to make sure to
append another one with the correct size to end up with the correct
size. This fixes bug #9971.
2017-07-27 21:05:44 +01:00
Schrijvers Luc
a2792531f6 NETWORKING: fix missing SIOCGIFCONF for Haiku (#973) 2017-07-17 21:35:23 +02:00
Eugene Sandulenko
940b2a20f1 Revert "COMMON: Change way the Singleton instances are instantiated"
This reverts commit eefa72afa1.

With this patch ConfigManager is broken.
2017-07-10 21:17:41 +02:00
Thierry Crozat
eefa72afa1 COMMON: Change way the Singleton instances are instantiated
This fixes tons of warnings with clang from a recent xcode version on
macOS (and possibly other systems) complaining that an instantiation
of _singleton is required but no definition is available.
2017-07-10 21:11:20 +02:00
Colin Snover
065dd9671e SDL: Fix compilation with SDL1.2 2017-07-06 19:27:52 -05:00
Colin Snover
332fabcb8a SDL: Only recreate SDL2 window when necessary
Destroying and recreating the SDL window whenever the video mode
changes in SDL2 is not necessary and causes several problems:

1. In windowed mode, the game window shifts position;
2. In fullscreen mode in macOS, every time the window is
   recreated, it causes the OS to play its switch-to-fullscreen
   animation again and emit system alert noises;
3. The window content flickers; and
4. The engine loses events from the old destroyed window.

This patch changes the SDL backend code to avoid destroying and
recreating the SDL window when using SDL2, except when switching
OpenGL modes, since there is no way to change the OpenGL feature
of a window.

There are still some outstanding issues with OpenGL where window
size ends up getting reset even though the user has resized it;
this will probably need to be addressed at some point in another
patch.

Thanks to @bgK and @criezy for their feedback which made this
patch much better.

Co-Authored-By: Bastien Bouclet <bastien.bouclet@gmail.com>
2017-07-06 19:11:54 -05:00
lubomyr
4d53bdc7fe ANDROIDSDL: implemented checking and fixing sdcard path 2017-06-25 10:50:36 +02:00
Colin Snover
2d3c86187f MACOSX: Fix flipped return value of openUrl 2017-05-21 19:37:14 -05:00
Colin Snover
fa0bb7dd5a BACKENDS: Compress screenshots using PNG if available
Closes gh-948.
2017-05-21 15:55:39 -05:00
Bastien Bouclet
23abcffbc5 OPENGL: Don't update the cursor's texture when the cursor is invisible
Updating the cursor's texture is not necessary if it is not going to be drawn.

Fixes glDrawArrays sometimes failing due to using a framebuffer with an
incomplete color attachment. In SCI32 games, the framebuffer is incomplete
because the engine does not define pixel data for the cursor.
2017-05-08 06:50:30 +02:00
Thierry Crozat
9a8aea0585 CLOUD: Fix compilation with old curl vesions 2017-04-29 22:10:16 +01:00
Thierry Crozat
442edb6ccc MACOSX: Expand ~ in default screenshot path
When using SDL to save the screenshot, using a told results in
an error.
2017-04-26 08:39:06 +01:00
Kirben
ec0b1dec9d WINDOWS: Fix warning under mingw-w64. 2017-04-24 11:22:44 +10:00
Kirben
b46a1b688d WINDOWS: Hopefully fix mingw compilation. 2017-04-24 10:57:02 +10:00
Thierry Crozat
a1dab31c08 WIN32: Fix compilation of getScreenshotPath (missing parenthesis) 2017-04-24 01:28:50 +01:00
Thierry Crozat
23987cc724 WIN32: Comment out code that gets the user My Pictures directory
This broke compilation on buildbot as ShlObj.h cannot be found.
A developer that has access to Windows should take a look to
properly fix this.
2017-04-24 01:21:36 +01:00
Thierry Crozat
a9ae691513 SDL: Improve debug and warning messages when saving screenshots
In particular this adds a warning when failing to save a screenshot
in OpenGL mode (there was already one in SurfaceSDL mode).
2017-04-24 01:07:16 +01:00
Thierry Crozat
e96c057c3d SDL: Allow specifying the screenshot directory in the config file
There is no GUI option to set the screenshot directory, but this
allows power users to set it if they don't want to use the default.
2017-04-24 01:07:05 +01:00
Thierry Crozat
11dd33bb73 MACOSX: Create screenshot on Desktop
This is consistent with the OS shortcut (Crtl+Shift+3) to take a
screenshot.
2017-04-24 01:06:50 +01:00
Thierry Crozat
438f23f272 SDL: Use dynamic cast instead of C cast to get screenshot path 2017-04-24 01:06:40 +01:00
Pala
3849a3e90e WINDOWS: Change location where screenshot are saved
This fixes bug #9701: WINDOWS: Flow of taking screenshots
on Windows is broken
2017-04-24 01:06:29 +01:00
Torbjörn Andersson
6cda47ca3d JANITORIAL: Remove superfluous semicolons 2017-04-18 06:49:14 +02:00
Thierry Crozat
a20d2172fa SDL: Respect OS setting for wheel scroll direction on SDL 2.0.4+
The setting was already respected on SDL < 2.0.4 (such as SDL1).
If the OS inverts the scrolling direction, this is reflected on the sign
of the y value of the SDL event. Since version 2.0.4 the SDL event
also had a flag to indicate if the direction is flipped and we were
using it to change back the y sign. That means the OS scrolling
direction setting was not respected. With this commit we now have
a consistent behaviour with all SDL versions (the OS scroll direction
setting is respected).

If our wheel events are used for something other than scrolling
however, we might want to get the actually wheel move direction
(i.e. use a Common::EVENT_WHEELDOWN when moving the wheel
down even if the OS scroll setting is to flip it). In such a case we
might want to revert this change and instead add an additional flag
to the event so that we know the scroll direction should be flipped
and use it in places where the event is used for scrolling.
2017-03-21 21:06:35 +00:00
rsn8887
96f720d93d PSP2: remove date from executable name 2017-03-06 17:10:10 -06:00
rsn8887
44de995bb6 SDL: Fix trying to init non-supported shaders (#917) 2017-03-06 08:57:21 -06:00
Eugene Sandulenko
8b8fd13d56 BACKENDS: Fix const'ness which led to warnings 2017-03-05 00:56:27 +01:00
Eugene Sandulenko
9cf5ebecdf BACKENDS: Fix crash on startup 2017-03-05 00:43:49 +01:00
Eugene Sandulenko
547e5846a1 Merge pull request #915 from rsn8887/vita
PSP2: Add Playstation Vita support
2017-03-04 22:45:01 +01:00
cpasjuste
70988527c6 PSP2: Add Playstation Vita (PSP2) support 2017-03-04 15:42:19 -06:00
Willem Jan Palenstijn
72962ae0f6 CLOUD: Fix whitespace 2017-03-04 15:09:08 +01:00
Eugene Sandulenko
cfc83b4a0a BACKENDS: NETWORKING: Fix warning 2017-03-04 14:52:51 +01:00
Alexander
302f6e6bcc CLOUD: Fix LocalWebserver::resolveAddress() on Android
No <ifaddrs.h> available on Android, thus fixed similarly to https://github.com/zlargon/lssdp/commit/9b4568
2017-03-04 19:49:28 +06:00
rsn8887
12e226922d SDL: Always use sub-pixel joystick pointer resolution 2017-03-01 09:55:20 -06:00
D G Turner
b779f20502 CLOUD: Fix GCC Unused Variable Warning.
This variable is not used as the constructors for the storage type
classes store the resulting objects into the Cloud Manager using
replaceStorage(this) instead.
2017-02-28 20:42:17 +00:00
rsn8887
58bbc0e887 SDL: fix pointer speed setting 8 (was too slow) 2017-02-27 19:59:18 -06:00
Eugene Sandulenko
8a547c8711 Merge pull request #908 from rsn8887/upstream
SDL: Fix erratic analog pointer + control options
2017-02-24 22:00:10 +01:00
rsn8887
45bd7a8b75 SDL: Fix erratic analog pointer + control options
Fixes erratic speeds in analog pointer motion
Implemented option to set analog/keyboard pointer speed
and control the analog joystick deadzone. The deadzone option appears
only if the build supports analog joystick (via JOY_ANALOG define)
2017-02-22 16:52:09 -06:00
Eugene Sandulenko
db4ef7c467 Merge pull request #909 from lubomyr/master
ANDROIDSDL: changed filename in assets file with scummvm-data for replace old data files
2017-02-22 22:04:29 +01:00
lubomyr
8a70c0c922 ANDROIDSDL: changed filename in asset file with scummvm-data for replacing old data-files 2017-02-22 22:49:47 +02:00
Eugene Sandulenko
8216fd8ea6 Merge pull request #904 from AReim1982/DevKitPPC-R28
WII: Fix compiler warnings
2017-02-21 23:30:32 +01:00
Eugene Sandulenko
8458e3deb7 Merge pull request #905 from lubomyr/master
ANDROIDSDL: added tab Control in main Options menu for switching some features
2017-02-21 23:29:51 +01:00
rsn8887
86c6c7c903 SDL: increase resolution of slow analog pointer motion 2017-02-18 19:22:04 -06:00
rsn8887
c0b095d793 SDL: Cleanup, replaced _km.multiplier with #define 2017-02-18 18:20:10 -06:00
lubomyr
cdda943c8a ANDROIDSDL: code refactoring 2017-02-19 00:27:20 +02:00
rsn8887
75004c429c SDL: improved internal joystick event handling 2017-02-18 12:00:22 -06:00
rsn8887
09a6029781 SDL: slow analog ('modifier'+stick) made slower 2017-02-18 11:59:16 -06:00
lubomyr
3f921c1195 ANDROIDSDL: config feature swap_menu_and_back renamed to swap_menu_and_back_buttons 2017-02-18 18:02:46 +02:00