sync with scummvm dated 03 july 2011
This commit is contained in:
parent
60611723ff
commit
5bf4f9316b
112 changed files with 3581 additions and 1675 deletions
|
@ -31,14 +31,22 @@
|
|||
#include "backends/platform/sdl/sdl.h"
|
||||
#include "common/config-manager.h"
|
||||
#include "common/EventRecorder.h"
|
||||
#include "common/taskbar.h"
|
||||
#include "common/textconsole.h"
|
||||
|
||||
#include "backends/saves/default/default-saves.h"
|
||||
|
||||
// Audio CD support was removed with SDL 1.3
|
||||
#if SDL_VERSION_ATLEAST(1, 3, 0)
|
||||
#include "backends/audiocd/default/default-audiocd.h"
|
||||
#else
|
||||
#include "backends/audiocd/sdl/sdl-audiocd.h"
|
||||
#endif
|
||||
|
||||
#include "backends/events/sdl/sdl-events.h"
|
||||
#include "backends/mutex/sdl/sdl-mutex.h"
|
||||
#include "backends/timer/sdl/sdl-timer.h"
|
||||
#include "backends/graphics/sdl/sdl-graphics.h"
|
||||
#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
|
||||
|
||||
#include "icons/residual.xpm"
|
||||
|
||||
|
@ -111,6 +119,11 @@ void OSystem_SDL::init() {
|
|||
|
||||
if (_timerManager == 0)
|
||||
_timerManager = new SdlTimerManager();
|
||||
|
||||
#if defined(USE_TASKBAR)
|
||||
if (_taskbarManager == 0)
|
||||
_taskbarManager = new Common::TaskbarManager();
|
||||
#endif
|
||||
}
|
||||
|
||||
void OSystem_SDL::initBackend() {
|
||||
|
@ -126,23 +139,11 @@ void OSystem_SDL::initBackend() {
|
|||
|
||||
if (_graphicsManager == 0) {
|
||||
if (_graphicsManager == 0) {
|
||||
_graphicsManager = new SdlGraphicsManager(_eventSource);
|
||||
_graphicsManager = new SurfaceSdlGraphicsManager(_eventSource);
|
||||
graphicsManagerType = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Creates the backend managers, if they don't exist yet (we check
|
||||
// for this to allow subclasses to provide their own).
|
||||
if (_eventManager == 0)
|
||||
_eventManager = new DefaultEventManager(_eventSource);
|
||||
|
||||
// We have to initialize the graphics manager before the event manager
|
||||
// so the virtual keyboard can be initialized, but we have to add the
|
||||
// graphics manager as an event observer after initializing the event
|
||||
// manager.
|
||||
if (graphicsManagerType == 0)
|
||||
((SdlGraphicsManager *)_graphicsManager)->initEventObserver();
|
||||
|
||||
if (_savefileManager == 0)
|
||||
_savefileManager = new DefaultSaveFileManager();
|
||||
|
||||
|
@ -153,8 +154,15 @@ void OSystem_SDL::initBackend() {
|
|||
_mixerManager->init();
|
||||
}
|
||||
|
||||
if (_audiocdManager == 0)
|
||||
if (_audiocdManager == 0) {
|
||||
// Audio CD support was removed with SDL 1.3
|
||||
#if SDL_VERSION_ATLEAST(1, 3, 0)
|
||||
_audiocdManager = new DefaultAudioCDManager();
|
||||
#else
|
||||
_audiocdManager = new SdlAudioCDManager();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// Setup a custom program icon.
|
||||
setupIcon();
|
||||
|
@ -162,8 +170,30 @@ void OSystem_SDL::initBackend() {
|
|||
_inited = true;
|
||||
|
||||
ModularBackend::initBackend();
|
||||
|
||||
// We have to initialize the graphics manager before the event manager
|
||||
// so the virtual keyboard can be initialized, but we have to add the
|
||||
// graphics manager as an event observer after initializing the event
|
||||
// manager.
|
||||
if (graphicsManagerType == 0)
|
||||
((SurfaceSdlGraphicsManager *)_graphicsManager)->initEventObserver();
|
||||
}
|
||||
|
||||
#if defined(USE_TASKBAR)
|
||||
void OSystem_SDL::engineInit() {
|
||||
// Add the started engine to the list of recent tasks
|
||||
_taskbarManager->addRecent(ConfMan.getActiveDomainName(), ConfMan.get("description"));
|
||||
|
||||
// Set the overlay icon the current running engine
|
||||
_taskbarManager->setOverlayIcon(ConfMan.getActiveDomainName(), ConfMan.get("description"));
|
||||
}
|
||||
|
||||
void OSystem_SDL::engineDone() {
|
||||
// Remove overlay icon
|
||||
_taskbarManager->setOverlayIcon("", "");
|
||||
}
|
||||
#endif
|
||||
|
||||
void OSystem_SDL::initSDL() {
|
||||
// Check if SDL has not been initialized
|
||||
if (!_initedSDL) {
|
||||
|
@ -230,10 +260,22 @@ void OSystem_SDL::fatalError() {
|
|||
|
||||
|
||||
void OSystem_SDL::logMessage(LogMessageType::Type type, const char *message) {
|
||||
ModularBackend::logMessage(type, message);
|
||||
// First log to stdout/stderr
|
||||
FILE *output = 0;
|
||||
|
||||
if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
|
||||
output = stdout;
|
||||
else
|
||||
output = stderr;
|
||||
|
||||
fputs(message, output);
|
||||
fflush(output);
|
||||
|
||||
// Then log into file (via the logger)
|
||||
if (_logger)
|
||||
_logger->print(message);
|
||||
|
||||
// Finally, some Windows / WinCE specific logging code.
|
||||
#if defined( USE_WINDBG )
|
||||
#if defined( _WIN32_WCE )
|
||||
TCHAR buf_unicode[1024];
|
||||
|
@ -256,7 +298,7 @@ void OSystem_SDL::logMessage(LogMessageType::Type type, const char *message) {
|
|||
}
|
||||
|
||||
Common::String OSystem_SDL::getSystemLanguage() const {
|
||||
#ifdef USE_DETECTLANG
|
||||
#if defined(USE_DETECTLANG) && !defined(_WIN32_WCE)
|
||||
#ifdef WIN32
|
||||
// We can not use "setlocale" (at least not for MSVC builds), since it
|
||||
// will return locales like: "English_USA.1252", thus we need a special
|
||||
|
@ -323,7 +365,7 @@ void OSystem_SDL::setupIcon() {
|
|||
|
||||
if (sscanf(residual_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes) != 4) {
|
||||
warning("Wrong format of residual_icon[0] (%s)", residual_icon[0]);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
if ((w > 512) || (h > 512) || (ncols > 255) || (nbytes > 1)) {
|
||||
|
@ -339,6 +381,7 @@ void OSystem_SDL::setupIcon() {
|
|||
for (i = 0; i < ncols; i++) {
|
||||
unsigned char code;
|
||||
char color[32];
|
||||
memset(color, 0, sizeof(color));
|
||||
unsigned int col;
|
||||
if (sscanf(residual_icon[1 + i], "%c c %s", &code, color) != 2) {
|
||||
warning("Wrong format of residual_icon[%d] (%s)", 1 + i, residual_icon[1 + i]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue