aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/cloud/cloudicon.cpp13
-rw-r--r--backends/cloud/storage.cpp11
-rw-r--r--backends/events/androidsdl/androidsdl-events.cpp5
-rw-r--r--backends/events/sdl/sdl-events.cpp40
-rw-r--r--backends/events/sdl/sdl-events.h2
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp6
-rw-r--r--backends/graphics/opengl/opengl-graphics.h8
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp6
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp4
-rw-r--r--backends/graphics/wincesdl/wincesdl-graphics.cpp2
-rw-r--r--backends/midi/timidity.cpp107
-rw-r--r--backends/platform/androidsdl/androidsdl-sdl.cpp4
-rw-r--r--backends/platform/dc/dreamcast.mk9
-rw-r--r--backends/platform/ios7/ios7_common.h4
-rw-r--r--backends/platform/ios7/ios7_osys_main.cpp9
-rw-r--r--backends/platform/ios7/ios7_osys_video.mm1
-rw-r--r--backends/platform/ios7/ios7_video.mm24
-rw-r--r--backends/platform/sdl/sdl-window.h4
-rw-r--r--backends/updates/macosx/macosx-updates.mm2
19 files changed, 134 insertions, 127 deletions
diff --git a/backends/cloud/cloudicon.cpp b/backends/cloud/cloudicon.cpp
index 972efae57b..2adc7460d2 100644
--- a/backends/cloud/cloudicon.cpp
+++ b/backends/cloud/cloudicon.cpp
@@ -118,6 +118,11 @@ void CloudIcon::update() {
break;
}
+ if (!_icon.getPixels() || !_disabledIcon.getPixels()) {
+ // Loading the icons failed. Don't try to draw them.
+ return;
+ }
+
if (_state != kHidden) {
makeAlphaIcon((_type == kDisabled ? _disabledIcon : _icon), _currentAlpha);
g_system->displayActivityIconOnOSD(&_alphaIcon);
@@ -137,11 +142,13 @@ void CloudIcon::initIcons() {
void CloudIcon::loadIcon(Graphics::Surface &icon, byte *data, uint32 size) {
Image::PNGDecoder decoder;
Common::MemoryReadStream stream(data, size);
- if (!decoder.loadStream(stream))
- error("CloudIcon::loadIcon: error decoding PNG");
+ if (!decoder.loadStream(stream)) {
+ warning("CloudIcon::loadIcon: error decoding PNG");
+ return;
+ }
const Graphics::Surface *s = decoder.getSurface();
- return icon.copyFrom(*s);
+ icon.copyFrom(*s);
}
void CloudIcon::makeAlphaIcon(const Graphics::Surface &icon, float alpha) {
diff --git a/backends/cloud/storage.cpp b/backends/cloud/storage.cpp
index 4cccacf6d6..3a9ae53a43 100644
--- a/backends/cloud/storage.cpp
+++ b/backends/cloud/storage.cpp
@@ -28,6 +28,7 @@
#include "common/debug.h"
#include "common/file.h"
#include <common/translation.h>
+#include "common/osd_message_queue.h"
namespace Cloud {
@@ -207,7 +208,7 @@ void Storage::savesSyncDefaultCallback(BoolResponse response) {
if (!response.value)
warning("SavesSyncRequest called success callback with `false` argument");
- g_system->displayMessageOnOSD(_("Saved games sync complete."));
+ Common::OSDMessageQueue::instance().addMessage(_("Saved games sync complete."));
}
void Storage::savesSyncDefaultErrorCallback(Networking::ErrorResponse error) {
@@ -218,9 +219,9 @@ void Storage::savesSyncDefaultErrorCallback(Networking::ErrorResponse error) {
printErrorResponse(error);
if (error.interrupted)
- g_system->displayMessageOnOSD(_("Saved games sync was cancelled."));
+ Common::OSDMessageQueue::instance().addMessage(_("Saved games sync was cancelled."));
else
- g_system->displayMessageOnOSD(_("Saved games sync failed.\nCheck your Internet connection."));
+ Common::OSDMessageQueue::instance().addMessage(_("Saved games sync failed.\nCheck your Internet connection."));
}
///// DownloadFolderRequest-related /////
@@ -328,7 +329,7 @@ void Storage::directoryDownloadedCallback(FileArrayResponse response) {
} else {
message = _("Download complete.");
}
- g_system->displayMessageOnOSD(message.c_str());
+ Common::OSDMessageQueue::instance().addMessage(message.c_str());
}
void Storage::directoryDownloadedErrorCallback(Networking::ErrorResponse error) {
@@ -336,7 +337,7 @@ void Storage::directoryDownloadedErrorCallback(Networking::ErrorResponse error)
_downloadFolderRequest = nullptr;
_runningRequestsMutex.unlock();
- g_system->displayMessageOnOSD(_("Download failed."));
+ Common::OSDMessageQueue::instance().addMessage(_("Download failed."));
}
} // End of namespace Cloud
diff --git a/backends/events/androidsdl/androidsdl-events.cpp b/backends/events/androidsdl/androidsdl-events.cpp
index c8a730aa8e..0adcff817e 100644
--- a/backends/events/androidsdl/androidsdl-events.cpp
+++ b/backends/events/androidsdl/androidsdl-events.cpp
@@ -66,9 +66,8 @@ bool AndroidSdlEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &
bool AndroidSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
if (false) {}
- if (ev.key.keysym.sym == SDLK_LCTRL) {
- event.type = Common::EVENT_KEYDOWN;
- event.kbd.keycode = Common::KEYCODE_F5;
+ if (ev.key.keysym.sym == SDLK_F13) {
+ event.type = Common::EVENT_MAINMENU;
return true;
} else {
// Let the events fall through if we didn't change them, this may not be the best way to
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index acc1ff5dce..5fb66a7ec4 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -110,13 +110,51 @@ SdlEventSource::~SdlEventSource() {
int SdlEventSource::mapKey(SDLKey sdlKey, SDLMod mod, Uint16 unicode) {
Common::KeyCode key = SDLToOSystemKeycode(sdlKey);
+ // Keep unicode in case it's regular ASCII text or in case we didn't get a valid keycode
+ //
+ // We need to use unicode in those cases, simply because SDL1.x passes us non-layout-adjusted keycodes.
+ // So unicode is the only way to get layout-adjusted keys.
+ if (unicode < 0x20) {
+ // don't use unicode, in case it's control characters
+ unicode = 0;
+ } else {
+ // Use unicode, in case keycode is invalid.
+ // Umlauts and others will set KEYCODE_INVALID on SDL2, so in such a case always keep unicode.
+ if (key != Common::KEYCODE_INVALID) {
+ // keycode is valid, check further also depending on modifiers
+ if (mod & (KMOD_CTRL | KMOD_ALT)) {
+ // Ctrl and/or Alt is active
+ //
+ // We need to restrict unicode to only up to 0x7E, because on macOS the option/alt key will switch to
+ // an alternate keyboard, which will cause us to receive Unicode characters for some keys, which are outside
+ // of the ASCII range (e.g. alt-x will get us U+2248). We need to return 'x' for alt-x, so using unicode
+ // in that case would break alt-shortcuts.
+ if (unicode > 0x7E)
+ unicode = 0; // do not allow any characters above 0x7E
+ } else {
+ // We must not restrict as much as when Ctrl/Alt-modifiers are active, otherwise
+ // we wouldn't let umlauts through for SDL1. For SDL1 umlauts may set for example KEYCODE_QUOTE, KEYCODE_MINUS, etc.
+ if (unicode > 0xFF)
+ unicode = 0; // do not allow any characters above 0xFF
+ }
+ }
+ }
+
+ // Attention:
+ // When using SDL1.x, we will get scancodes via sdlKey, that are raw scancodes, so NOT adjusted to keyboard layout/
+ // mapping. So for example for certain locales, we will get KEYCODE_y, when 'z' is pressed and so on.
+ // When using SDL2.x however, we will get scancodes based on the keyboard layout.
+
if (key >= Common::KEYCODE_F1 && key <= Common::KEYCODE_F9) {
return key - Common::KEYCODE_F1 + Common::ASCII_F1;
} else if (key >= Common::KEYCODE_KP0 && key <= Common::KEYCODE_KP9) {
+ if ((mod & KMOD_NUM) == 0)
+ return 0; // In case Num-Lock is NOT enabled, return 0 for ascii, so that directional keys on numpad work
return key - Common::KEYCODE_KP0 + '0';
} else if (key >= Common::KEYCODE_UP && key <= Common::KEYCODE_PAGEDOWN) {
return key;
} else if (unicode) {
+ // Return unicode in case it's stil set and wasn't filtered.
return unicode;
} else if (key >= 'a' && key <= 'z' && (mod & KMOD_SHIFT)) {
return key & ~0x20;
@@ -848,7 +886,7 @@ bool SdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
return false;
}
-void SdlEventSource::resetKeyboadEmulation(int16 x_max, int16 y_max) {
+void SdlEventSource::resetKeyboardEmulation(int16 x_max, int16 y_max) {
_km.x_max = x_max;
_km.y_max = y_max;
_km.delay_time = 25;
diff --git a/backends/events/sdl/sdl-events.h b/backends/events/sdl/sdl-events.h
index 4526065d9b..c43699420b 100644
--- a/backends/events/sdl/sdl-events.h
+++ b/backends/events/sdl/sdl-events.h
@@ -47,7 +47,7 @@ public:
/**
* Resets keyboard emulation after a video screen change
*/
- virtual void resetKeyboadEmulation(int16 x_max, int16 y_max);
+ virtual void resetKeyboardEmulation(int16 x_max, int16 y_max);
protected:
/** @name Keyboard mouse emulation
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index a0882347b5..7b41699e80 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -377,7 +377,6 @@ void OpenGLGraphicsManager::updateScreen() {
#ifdef USE_OSD
{
- Common::StackLock lock(_osdMutex);
if (_osdMessageChangeRequest) {
osdMessageUpdateSurface();
}
@@ -741,11 +740,6 @@ void OpenGLGraphicsManager::setCursorPalette(const byte *colors, uint start, uin
void OpenGLGraphicsManager::displayMessageOnOSD(const char *msg) {
#ifdef USE_OSD
- // HACK: Actually no client code should use graphics functions from
- // another thread. But the MT-32 emulator and network synchronization still do,
- // thus we need to make sure this doesn't happen while a updateScreen call is done.
- Common::StackLock lock(_osdMutex);
-
_osdMessageChangeRequest = true;
_osdMessageNextData = msg;
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index 01672f4f5c..d3f8d792ba 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -596,14 +596,6 @@ private:
kOSDIconTopMargin = 10,
kOSDIconRightMargin = 10
};
-
- /**
- * Mutex for the OSD draw calls.
- *
- * Mutex to allow displayMessageOnOSD and displayActivityIconOnOSD
- * to be used from the audio and network threads.
- */
- Common::Mutex _osdMutex;
#endif
};
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 042cd49099..8f2ff1b9fa 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -360,7 +360,7 @@ void OpenGLSdlGraphicsManager::notifyResize(const uint width, const uint height)
if (width != currentWidth || height != currentHeight)
return;
setActualScreenSize(width, height);
- _eventSource->resetKeyboadEmulation(width - 1, height - 1);
+ _eventSource->resetKeyboardEmulation(width - 1, height - 1);
#else
if (!_ignoreResizeEvents && _hwScreen && !(_hwScreen->flags & SDL_FULLSCREEN)) {
// We save that we handled a resize event here. We need to know this
@@ -523,7 +523,7 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
int actualWidth, actualHeight;
getWindowDimensions(&actualWidth, &actualHeight);
setActualScreenSize(actualWidth, actualHeight);
- _eventSource->resetKeyboadEmulation(actualWidth - 1, actualHeight - 1);
+ _eventSource->resetKeyboardEmulation(actualWidth - 1, actualHeight - 1);
return true;
#else
// WORKAROUND: Working around infamous SDL bugs when switching
@@ -569,7 +569,7 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
if (_hwScreen) {
notifyContextCreate(rgba8888, rgba8888);
setActualScreenSize(_hwScreen->w, _hwScreen->h);
- _eventSource->resetKeyboadEmulation(_hwScreen->w - 1, _hwScreen->h - 1);
+ _eventSource->resetKeyboardEmulation(_hwScreen->w - 1, _hwScreen->h - 1);
}
// Ignore resize events (from SDL) for a few frames, if this isn't
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 90d079d151..21e334d242 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -918,7 +918,7 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
// For SDL2 the output resolution might differ from the requested
// resolution. We handle resetting the keyboard emulation properly inside
// our SDL_SetVideoMode wrapper for SDL2.
- _eventSource->resetKeyboadEmulation(
+ _eventSource->resetKeyboardEmulation(
_videoMode.screenWidth * _videoMode.scaleFactor - 1,
effectiveScreenHeight() - 1);
#endif
@@ -2562,7 +2562,7 @@ void SurfaceSdlGraphicsManager::setWindowResolution(int width, int height) {
_windowHeight = height;
// We expect full screen resolution as inputs coming from the event system.
- _eventSource->resetKeyboadEmulation(_windowWidth - 1, _windowHeight - 1);
+ _eventSource->resetKeyboardEmulation(_windowWidth - 1, _windowHeight - 1);
// Calculate the "viewport" for the actual area we draw in. In fullscreen
// we can easily get a different resolution than what we requested. In
diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp
index 07f7d47262..44a1214a44 100644
--- a/backends/graphics/wincesdl/wincesdl-graphics.cpp
+++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp
@@ -934,7 +934,7 @@ bool WINCESdlGraphicsManager::loadGFXMode() {
_toolbarHigh = NULL;
// keyboard cursor control, some other better place for it?
- _eventSource->resetKeyboadEmulation(_videoMode.screenWidth * _scaleFactorXm / _scaleFactorXd - 1, _videoMode.screenHeight * _scaleFactorXm / _scaleFactorXd - 1);
+ _eventSource->resetKeyboardEmulation(_videoMode.screenWidth * _scaleFactorXm / _scaleFactorXd - 1, _videoMode.screenHeight * _scaleFactorXm / _scaleFactorXd - 1);
return true;
}
diff --git a/backends/midi/timidity.cpp b/backends/midi/timidity.cpp
index 497138850a..80dba101ed 100644
--- a/backends/midi/timidity.cpp
+++ b/backends/midi/timidity.cpp
@@ -52,24 +52,18 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/param.h>
-#include <netdb.h> /* for gethostbyname */
+#include <netdb.h> /* for getaddrinfo */
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdarg.h>
#include <stdlib.h>
#include <errno.h>
-// WORKAROUND bug #1870304: Solaris does not provide INADDR_NONE.
-#ifndef INADDR_NONE
-#define INADDR_NONE 0xffffffff
-#endif
-
// BeOS BONE uses snooze (x/1000) in place of usleep(x)
#ifdef __BEOS__
#define usleep(v) snooze(v/1000)
#endif
-
#define SEQ_MIDIPUTC 5
#define TIMIDITY_LOW_DELAY
@@ -84,7 +78,7 @@
/* default host & port */
#define DEFAULT_TIMIDITY_HOST "127.0.0.1"
-#define DEFAULT_TIMIDITY_PORT 7777
+#define DEFAULT_TIMIDITY_PORT "7777"
class MidiDriver_TIMIDITY : public MidiDriver_MPU401 {
public:
@@ -97,11 +91,8 @@ public:
void sysEx(const byte *msg, uint16 length);
private:
- /* standart routine to extract ip address from a string */
- in_addr_t host_to_addr(const char* address);
-
/* creates a tcp connection to TiMidity server, returns filedesc (like open()) */
- int connect_to_server(const char* hostname, unsigned short tcp_port);
+ int connect_to_server(const char* hostname, const char* tcp_port);
/* send command to the server; printf-like; returns reply string */
char *timidity_ctl_command(const char *fmt, ...) GCC_PRINTF(2, 3);
@@ -150,7 +141,8 @@ MidiDriver_TIMIDITY::MidiDriver_TIMIDITY() {
int MidiDriver_TIMIDITY::open() {
char *res;
char timidity_host[NI_MAXHOST];
- int timidity_port, data_port, i;
+ char timidity_port[6], data_port[6];
+ int num;
/* count ourselves open */
if (_isOpen)
@@ -166,16 +158,16 @@ int MidiDriver_TIMIDITY::open() {
/* extract control port */
if ((res = strrchr(timidity_host, ':')) != NULL) {
*res++ = '\0';
- timidity_port = atoi(res);
+ Common::strlcpy(timidity_port, res, sizeof(timidity_port));
} else {
- timidity_port = DEFAULT_TIMIDITY_PORT;
+ Common::strlcpy(timidity_port, DEFAULT_TIMIDITY_PORT, sizeof(timidity_port));
}
/*
* create control connection to the server
*/
if ((_control_fd = connect_to_server(timidity_host, timidity_port)) < 0) {
- warning("TiMidity: can't open control connection (host=%s, port=%d)", timidity_host, timidity_port);
+ warning("TiMidity: can't open control connection (host=%s, port=%s)", timidity_host, timidity_port);
return -1;
}
@@ -183,7 +175,7 @@ int MidiDriver_TIMIDITY::open() {
* "220 TiMidity++ v2.13.2 ready)" */
res = timidity_ctl_command(NULL);
if (atoi(res) != 220) {
- warning("TiMidity: bad response from server (host=%s, port=%d): %s", timidity_host, timidity_port, res);
+ warning("TiMidity: bad response from server (host=%s, port=%s): %s", timidity_host, timidity_port, res);
close_all();
return -1;
}
@@ -198,13 +190,11 @@ int MidiDriver_TIMIDITY::open() {
/* should read something like "200 63017 is ready acceptable",
* where 63017 is port for data connection */
- // FIXME: The following looks like a cheap endian test. If this is true, then
- // it should be replaced by suitable #ifdef SCUMM_LITTLE_ENDIAN.
- i = 1;
- if (*(char *)&i == 1)
- res = timidity_ctl_command("OPEN lsb");
- else
- res = timidity_ctl_command("OPEN msb");
+#ifdef SCUMM_LITTLE_ENDIAN
+ res = timidity_ctl_command("OPEN lsb");
+#else
+ res = timidity_ctl_command("OPEN msb");
+#endif
if (atoi(res) != 200) {
warning("TiMidity: bad reply for OPEN command: %s", res);
@@ -215,9 +205,15 @@ int MidiDriver_TIMIDITY::open() {
/*
* open data connection
*/
- data_port = atoi(res + 4);
+ num = atoi(res + 4);
+ if (num > 65535) {
+ warning("TiMidity: Invalid port %d given.\n", num);
+ close_all();
+ return -1;
+ }
+ snprintf(data_port, sizeof(data_port), "%d", num);
if ((_data_fd = connect_to_server(timidity_host, data_port)) < 0) {
- warning("TiMidity: can't open data connection (host=%s, port=%d)", timidity_host, data_port);
+ warning("TiMidity: can't open data connection (host=%s, port=%s)", timidity_host, data_port);
close_all();
return -1;
}
@@ -226,7 +222,7 @@ int MidiDriver_TIMIDITY::open() {
* "200 Ready data connection" */
res = timidity_ctl_command(NULL);
if (atoi(res) != 200) {
- warning("Can't connect timidity: %s\t(host=%s, port=%d)", res, timidity_host, data_port);
+ warning("Can't connect timidity: %s\t(host=%s, port=%s)", res, timidity_host, data_port);
close_all();
return -1;
}
@@ -277,46 +273,33 @@ void MidiDriver_TIMIDITY::teardown() {
close_all();
}
-in_addr_t MidiDriver_TIMIDITY::host_to_addr(const char* address) {
- in_addr_t addr;
- struct hostent *hp;
-
- /* first check if IP address is given (like 127.0.0.1)*/
- if ((addr = inet_addr(address)) != INADDR_NONE)
- return addr;
-
- /* if not, try to resolve a hostname */
- if ((hp = gethostbyname(address)) == NULL) {
- warning("TiMidity: unknown hostname: %s", address);
- return INADDR_NONE;
- }
-
- memcpy(&addr, hp->h_addr, (int)sizeof(in_addr_t) <= hp->h_length ? sizeof(in_addr_t) : hp->h_length);
-
- return addr;
-}
-
-int MidiDriver_TIMIDITY::connect_to_server(const char* hostname, unsigned short tcp_port) {
+int MidiDriver_TIMIDITY::connect_to_server(const char* hostname, const char* tcp_port) {
int fd;
- struct sockaddr_in in;
- unsigned int addr;
-
- /* create socket */
- if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- warning("TiMidity: socket(): %s", strerror(errno));
+ struct addrinfo hints;
+ struct addrinfo *result, *rp;
+
+ /* get all address(es) matching host and port */
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
+ if (getaddrinfo(hostname, tcp_port, &hints, &result) != 0) {
+ warning("TiMidity: getaddrinfo: %s\n", strerror(errno));
return -1;
}
- /* connect */
- memset(&in, 0, sizeof(in));
- in.sin_family = AF_INET;
- in.sin_port = htons(tcp_port);
- addr = host_to_addr(hostname);
- memcpy(&in.sin_addr, &addr, 4);
-
- if (connect(fd, (struct sockaddr *)&in, sizeof(in)) < 0) {
- warning("TiMidity: connect(): %s", strerror(errno));
+ /* Try all address structures we have got previously */
+ for (rp = result; rp != NULL; rp = rp->ai_next) {
+ if ((fd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) == -1)
+ continue;
+ if (connect(fd, rp->ai_addr, rp->ai_addrlen) != -1)
+ break;
::close(fd);
+ }
+
+ freeaddrinfo(result);
+
+ if (rp == NULL) {
+ warning("TiMidity: Could not connect\n");
return -1;
}
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp
index 3d0429e098..d04512475a 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.cpp
+++ b/backends/platform/androidsdl/androidsdl-sdl.cpp
@@ -20,6 +20,8 @@
*
*/
+#define FORBIDDEN_SYMBOL_EXCEPTION_getenv(a)
+
#include "common/config-manager.h"
#include "backends/platform/androidsdl/androidsdl-sdl.h"
@@ -36,7 +38,7 @@ void OSystem_ANDROIDSDL::initBackend() {
_graphicsManager = new AndroidSdlGraphicsManager(_eventSource, _window);
if (!ConfMan.hasKey("browser_lastpath"))
- ConfMan.set("browser_lastpath", "/storage");
+ ConfMan.set("browser_lastpath", getenv("SDCARD"));
if (!ConfMan.hasKey("gfx_mode"))
ConfMan.set("gfx_mode", "2x");
diff --git a/backends/platform/dc/dreamcast.mk b/backends/platform/dc/dreamcast.mk
index 9d8a53e25a..98b5bae087 100644
--- a/backends/platform/dc/dreamcast.mk
+++ b/backends/platform/dc/dreamcast.mk
@@ -6,6 +6,8 @@ ASFLAGS := $(CXXFLAGS)
dist : SCUMMVM.BIN IP.BIN plugin_dist
+clean : dcclean
+
plugin_dist : plugins
@[ -z "$(PLUGINS)" ] || for p in $(or $(PLUGINS),none); do \
t="`basename \"$$p\" | LC_CTYPE=C tr '[:lower:]' '[:upper:]'`"; \
@@ -37,3 +39,10 @@ ip.txt : $(srcdir)/backends/platform/dc/ip.txt.in
dcdist : dist
mkdir -p dcdist/scummvm
cp scummvm.elf SCUMMVM.BIN IP.BIN *.PLG dcdist/scummvm/
+
+dcclean :
+ $(RM) backends/platform/dc/plugin_head.o
+ $(RM) scummvm.bin SCUMMVM.BIN ip.txt IP.BIN *.PLG
+ $(RM_REC) dcdist
+
+.PHONY: dcclean
diff --git a/backends/platform/ios7/ios7_common.h b/backends/platform/ios7/ios7_common.h
index 12740d4ae9..3609387efd 100644
--- a/backends/platform/ios7/ios7_common.h
+++ b/backends/platform/ios7/ios7_common.h
@@ -62,7 +62,6 @@ enum UIViewTapDescription {
};
enum GraphicsModes {
- kGraphicsModeLinear = 0,
kGraphicsModeNone = 1,
kGraphicsMode2xSaI,
@@ -80,7 +79,7 @@ struct VideoContext {
VideoContext() : asprectRatioCorrection(), screenWidth(), screenHeight(), overlayVisible(false),
overlayWidth(), overlayHeight(), mouseX(), mouseY(),
mouseHotspotX(), mouseHotspotY(), mouseWidth(), mouseHeight(),
- mouseIsVisible(), graphicsMode(kGraphicsModeNone), shakeOffsetY() {
+ mouseIsVisible(), graphicsMode(kGraphicsModeNone), filtering(false), shakeOffsetY() {
}
// Game screen state
@@ -102,6 +101,7 @@ struct VideoContext {
// Misc state
GraphicsModes graphicsMode;
+ bool filtering;
int shakeOffsetY;
};
diff --git a/backends/platform/ios7/ios7_osys_main.cpp b/backends/platform/ios7/ios7_osys_main.cpp
index 25d9cbed15..3a627478f9 100644
--- a/backends/platform/ios7/ios7_osys_main.cpp
+++ b/backends/platform/ios7/ios7_osys_main.cpp
@@ -52,8 +52,7 @@
const OSystem::GraphicsMode OSystem_iOS7::s_supportedGraphicsModes[] = {
- { "none", "No filtering", kGraphicsModeNone },
- { "linear", "Linear filtering", kGraphicsModeLinear },
+ { "none", "Normal", kGraphicsModeNone },
#ifdef ENABLE_IOS7_SCALERS
#ifdef USE_SCALERS
@@ -171,6 +170,7 @@ void OSystem_iOS7::initBackend() {
bool OSystem_iOS7::hasFeature(Feature f) {
switch (f) {
case kFeatureCursorPalette:
+ case kFeatureFilteringMode:
return true;
default:
@@ -187,6 +187,9 @@ void OSystem_iOS7::setFeatureState(Feature f, bool enable) {
_mouseCursorPaletteEnabled = enable;
}
break;
+ case kFeatureFilteringMode:
+ _videoContext->filtering = enable;
+ break;
case kFeatureAspectRatioCorrection:
_videoContext->asprectRatioCorrection = enable;
break;
@@ -200,6 +203,8 @@ bool OSystem_iOS7::getFeatureState(Feature f) {
switch (f) {
case kFeatureCursorPalette:
return _mouseCursorPaletteEnabled;
+ case kFeatureFilteringMode:
+ return _videoContext->filtering;
case kFeatureAspectRatioCorrection:
return _videoContext->asprectRatioCorrection;
diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm
index 5370ef02dd..1ec0defd7e 100644
--- a/backends/platform/ios7/ios7_osys_video.mm
+++ b/backends/platform/ios7/ios7_osys_video.mm
@@ -88,7 +88,6 @@ int OSystem_iOS7::getDefaultGraphicsMode() const {
bool OSystem_iOS7::setGraphicsMode(int mode) {
switch (mode) {
case kGraphicsModeNone:
- case kGraphicsModeLinear:
case kGraphicsMode2xSaI:
case kGraphicsModeSuper2xSaI:
case kGraphicsModeSuperEagle:
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index 8dbfb71b74..5baa83e8e8 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -442,26 +442,7 @@ uint getSizeNextPOT(uint size) {
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, tex); printOpenGLError();
- GLint filter = GL_LINEAR;
-
- switch (_videoContext.graphicsMode) {
- case kGraphicsModeNone:
- filter = GL_NEAREST;
- break;
-
- case kGraphicsModeLinear:
- case kGraphicsMode2xSaI:
- case kGraphicsModeSuper2xSaI:
- case kGraphicsModeSuperEagle:
- case kGraphicsModeAdvMame2x:
- case kGraphicsModeAdvMame3x:
- case kGraphicsModeHQ2x:
- case kGraphicsModeHQ3x:
- case kGraphicsModeTV2x:
- case kGraphicsModeDotMatrix:
- filter = GL_LINEAR;
- break;
- }
+ GLint filter = _videoContext.filtering ? GL_LINEAR : GL_NEAREST;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); printOpenGLError();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); printOpenGLError();
@@ -478,9 +459,6 @@ uint getSizeNextPOT(uint size) {
int scalerScale = 1;
switch (_videoContext.graphicsMode) {
- case kGraphicsModeLinear:
- break;
-
case kGraphicsModeNone:
break;
#ifdef USE_SCALERS
diff --git a/backends/platform/sdl/sdl-window.h b/backends/platform/sdl/sdl-window.h
index 58b898f824..b62860960d 100644
--- a/backends/platform/sdl/sdl-window.h
+++ b/backends/platform/sdl/sdl-window.h
@@ -81,7 +81,7 @@ public:
SDL_Window *getSDLWindow() const { return _window; }
/**
- * Creates a new SDL window (and destroies the old one).
+ * Creates a new SDL window (and destroys the old one).
*
* @param width Width of the window.
* @param height Height of the window.
@@ -91,7 +91,7 @@ public:
bool createWindow(int width, int height, uint32 flags);
/**
- * Destroies the current SDL window.
+ * Destroys the current SDL window.
*/
void destroyWindow();
diff --git a/backends/updates/macosx/macosx-updates.mm b/backends/updates/macosx/macosx-updates.mm
index db9362a459..64dcbf62ce 100644
--- a/backends/updates/macosx/macosx-updates.mm
+++ b/backends/updates/macosx/macosx-updates.mm
@@ -103,7 +103,7 @@ void MacOSXUpdateManager::checkForUpdates() {
if (sparkleUpdater == nullptr)
return;
- [sparkleUpdater checkForUpdatesInBackground];
+ [sparkleUpdater checkForUpdates:nil];
}
void MacOSXUpdateManager::setAutomaticallyChecksForUpdates(UpdateManager::UpdateState state) {