Commit Graph

5279 Commits

Author SHA1 Message Date
Johannes Schickel
919e577ba6 SDL: Fix invalid memory access in getSystemLanguage.
A call to setlocale can invalidate the string a previous setlocale call
returned. Instead of saving a pointer we copy the returned string now. This,
for example, fixes invalid memory access on my system.

See de8da01b0e for the commit introducing the
invalid memory access.
2013-11-03 18:47:03 +01:00
D G Turner
de8da01b0e SDL: Remove side effect of setlocale() call to get Language.
This is to fix bug #3615148 -  "ALL: sscanf("%f"), atof() etc. not
portable due to Locale"

The side effect of setlocale("") is to change the active locale
from the default of "C" to the detected system locale, but this
changes the behaviour of sscanf() and several other functions
in a system dependent and non-portable way. This has caused
bugs in the ZVISION engine when running Zork Nemesis.

The solution is to restore the default "C" locale after the call
to get the language.

Thanks to criezy for working out this fix.
2013-11-03 17:10:18 +00:00
Strangerke
97d28f0e72 AMIGAOS4: Make use of updated function names (SDK53.24) and remove unused code
Courtesy of Raziel^
2013-10-25 21:11:12 +02:00
Johannes Schickel
092d36f392 SDL: Reduce code duplication a bit.
Now instead of initializing this in OSystem_SDL::initSDL (and in subclasses
overwriting this) we simply initialize it in OSystem_SDL::init.
2013-10-23 22:59:13 +02:00
Johannes Schickel
c323dedf3c SDL: Fix default graphics mode for switchable case.
The former code (incorrectly) assumed that the getDefaultGraphicsMode returns
the index in the table returned by getSupportedGraphicsModes. Now the correct
ID is searched and then used.
2013-10-23 22:59:09 +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
a9cb67df08 SDL: Only allow switching of SurfaceSDL <-> OpenGL when no custom manager is used. 2013-10-23 22:59:02 +02:00
Johannes Schickel
38543f772c SDL: Make setupGraphicsModes non-virtual.
The logic of switching the managers is pretty much fixed at the same level
and cannot be easily overwritten.
2013-10-23 22:58:57 +02:00
Johannes Schickel
17cb26b93c SDL: Simplify initial graphics manager selection for OpenGL. 2013-10-23 22:58:53 +02:00
Johannes Schickel
4080a7a3f6 SDL: Get rid of _glModesCount. 2013-10-23 22:58:50 +02:00
Johannes Schickel
c5e2b5158c SDL: Get rid of loop in OSystem_SDL::setGraphicsMode. 2013-10-23 22:58:46 +02:00
Johannes Schickel
e91300f70c SDL: Clean up graphics mode handling for OpenGL backend.
Instead of custom memory management Common::Array is used now.
2013-10-23 22:58:42 +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
f20471d962 Merge pull request #408 from lordhoto/opengl-replacement
OpenGL revamp
2013-10-20 06:20:46 -07:00
Johannes Schickel
05c347fc8a OPENGL/SDL: Add screenshot support. 2013-10-19 22:18:22 +02:00
Johannes Schickel
37f7123552 TIZEN: Add some further OpenGL related changes by Chris. 2013-10-19 22:18:22 +02:00
Johannes Schickel
bb1d49ba9c OPENGL: Limit maximum Surface size to maximum texture size.
This is mostly aimed at old graphics chips. For example, wjp's old laptop
only supports 1024x1024 textures but has a 1280x800 screen. Switching to
fullscreen would create a bigger overlay than supported. Now it will get
limited to an smaller resolution and then scaled too.

Alternatively we could think of tiling surfaces into textures. But then
handling scaling would be more complicated since it might result in
artifacts on texture tile borders.
2013-10-19 22:18:15 +02:00
Johannes Schickel
53f9c0d69b SDL: Send EVENT_SCREEN_CHANGED after receiving SDL_VIDEORESIZE when necessary.
This fixes some ugly crashes when resizing the window in OpenGL mode.
2013-10-19 22:17:42 +02:00
Johannes Schickel
20e4a7f0ce TIZEN: Adapt to new OpenGL code.
Thanks to Chris Warren-Smith for testing this a bit.
2013-10-19 22:17:42 +02:00
Johannes Schickel
decc013e53 OPENGL: Implement dirty rect handling. 2013-10-19 22:17:42 +02:00
Johannes Schickel
50a86463c1 SDL: Use OSD in OpenGL SDL backend. 2013-10-19 22:17:42 +02:00
Johannes Schickel
cc9c991d77 OPENGL: Add OSD support. 2013-10-19 22:17:39 +02:00
Johannes Schickel
5ce830b976 SDL: Add a OpenGL SDL backend and hook it into the SDL backend.
The hooking code is nearly exactly the old hooking code. Only the OpenGL SDL
creation has been adapted since it uses a different constructor now.
2013-10-19 22:14:24 +02:00
Johannes Schickel
46323074e7 OPENGL: Add new generic OpenGL (ES) backend.
This backend is based on ideas of the old OpenGL backend, of the Android GL
backend and of the iPhone GL backend.
2013-10-19 22:12:01 +02:00
D G Turner
51cb755726 ANDROID: Really fix compilation.
The vanilla android toolchain even is unhappy when unknown folders are
present in the resources directory, so have moved the ouya specific
resources out to another directory.
2013-10-09 23:26:58 +01:00
D G Turner
2648062dcf ANDROID: Fix compilation.
The aapt throws an "invalid resource directory name" if the
resource directory name is not known to the tools. Unfortunately,
"values-television" is an OUYA specific addition and thus breaks
with the standard vanilla Android toolchain.
2013-10-09 06:53:53 +01:00
David Turner
d4d90b3f07 Merge pull request #372 from zeldin/ouya
Basic OUYA support
2013-10-08 18:26:49 -07:00
Johannes Schickel
8a6e57cba1 BACKENDS: Remove OpenGL and OpenGL SDL backend.
This breaks our Tizen port.
2013-10-05 00:20:02 +02:00
Eugene Sandulenko
8098ed9b46 EVENTS: Initialize class variable. CID 1002944 2013-09-22 11:47:37 +03:00
Torbjörn Andersson
a8ff238e7a TIZEN: Silence cppcheck warning in scanStringUntil()
This is consistent with scanString(), and I have verified that the
included test cases still work.
2013-08-23 22:37:50 +02:00
Marcus Comstedt
7a1ffe8c59 ANDROID: Add some margins when screen is a TV 2013-08-18 15:21:18 +02:00
Chris Warren-Smith
1f4feaffb0 TIZEN: updates for tizen 2.2 SDK 2013-08-17 08:52:14 +10:00
Johannes Schickel
6713743441 VKEYBD: Make code agnostic of OverlayColor.
This removes the use of OverlayColor in vkeybd and supports both 16 and 32bit
overlays.
2013-08-16 05:34:38 +02:00
Johannes Schickel
7c58e9a6d5 DC: Use const version of ConfigManager::getGameDomains.
This should fix compilation for the DC port.
2013-08-13 00:26:58 +02:00
Marcus Comstedt
bb39cbcba4 ANDROID: Enter main menu on middle mouse press 2013-08-08 15:16:06 +02:00
Marcus Comstedt
a50ede203b ANDROID: Add support for joystick motion 2013-08-08 14:53:36 +02:00
Marcus Comstedt
1b69f8aede ANDROID: Add gamepad button support 2013-08-08 14:08:30 +02:00
Johannes Schickel
952a119ae1 IPHONE: Fix accidental double free.
This was a copy&paste error. I also adapted the comment to be more clear.
2013-08-07 21:41:24 +02:00
Marcus Comstedt
9a888ed1c8 ANDROID: Add OUYA icon and intent 2013-08-07 17:19:24 +02:00
Johannes Schickel
911c74e82c VKEYBD: Do not access Surface::pixels anymore. 2013-08-06 03:51:12 +02:00
Johannes Schickel
c28f3baa77 N64: Do not access Surface::pixels anymore. 2013-08-06 03:51:12 +02:00
Johannes Schickel
30d2eb7a97 DC: Do not access Surface::pixels directly. 2013-08-06 03:51:12 +02:00
Johannes Schickel
d9b90d67d3 ANDROID: Do not access Surface::pixels directly. 2013-08-06 03:51:12 +02:00
Johannes Schickel
9179f0b78f PSP: Do not access Surface::pixels directly. 2013-08-06 03:51:11 +02:00
Johannes Schickel
09f7e4d5d4 IPHONE: Do not access Surface::pixels directly. 2013-08-06 03:51:11 +02:00
Johannes Schickel
6d86a66493 NDS: Do not access Surface::pixels directly. 2013-08-06 03:51:11 +02:00
Johannes Schickel
6639958d7a PS2: Do not access Surface::pixels directly. 2013-08-06 03:30:38 +02:00
Johannes Schickel
0f050fe797 WII: Do not access Surface::pixels directly. 2013-08-06 03:29:16 +02:00
Johannes Schickel
9a80fa88e0 SDL: Do not set Surface::pixels directly anymore. 2013-08-03 04:14:08 +02:00