diff options
Diffstat (limited to 'backends/platform/wii/osystem.cpp')
-rw-r--r-- | backends/platform/wii/osystem.cpp | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp index 401b19b0e1..258a782cc4 100644 --- a/backends/platform/wii/osystem.cpp +++ b/backends/platform/wii/osystem.cpp @@ -19,11 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Allow use of stuff in <time.h> -#define FORBIDDEN_SYMBOL_EXCEPTION_time_h - -#define FORBIDDEN_SYMBOL_EXCEPTION_printf -#define FORBIDDEN_SYMBOL_EXCEPTION_getcwd +#define FORBIDDEN_SYMBOL_ALLOW_ALL #include <unistd.h> @@ -34,6 +30,8 @@ #include "common/config-manager.h" #include "common/textconsole.h" #include "backends/fs/wii/wii-fs-factory.h" +#include "backends/saves/default/default-saves.h" +#include "backends/timer/default/default-timer.h" #include "osystem.h" #include "options.h" @@ -96,20 +94,12 @@ OSystem_Wii::OSystem_Wii() : _padSensitivity(16), _padAcceleration(4), - _savefile(NULL), - _mixer(NULL), - _timer(NULL) { + _mixer(NULL) { } OSystem_Wii::~OSystem_Wii() { - delete _savefile; - _savefile = NULL; - delete _mixer; _mixer = NULL; - - delete _timer; - _timer = NULL; } void OSystem_Wii::initBackend() { @@ -143,14 +133,14 @@ void OSystem_Wii::initBackend() { if (!getcwd(buf, MAXPATHLEN)) strcpy(buf, "/"); - _savefile = new DefaultSaveFileManager(buf); - _timer = new DefaultTimerManager(); + _savefileManager = new DefaultSaveFileManager(buf); + _timerManager = new DefaultTimerManager(); initGfx(); initSfx(); initEvents(); - OSystem::initBackend(); + EventsBaseBackend::initBackend(); } void OSystem_Wii::quit() { @@ -175,7 +165,7 @@ void OSystem_Wii::engineDone() { bool OSystem_Wii::hasFeature(Feature f) { return (f == kFeatureFullscreenMode) || (f == kFeatureAspectRatioCorrection) || - (f == kFeatureCursorHasPalette) || + (f == kFeatureCursorPalette) || (f == kFeatureOverlaySupportsAlpha); } @@ -188,6 +178,13 @@ void OSystem_Wii::setFeatureState(Feature f, bool enable) { case kFeatureAspectRatioCorrection: _arCorrection = enable; break; + case kFeatureCursorPalette: + _cursorPaletteDisabled = !enable; + if (_texMouse.palette && !enable) { + memcpy(_texMouse.palette, _cursorPalette, 256 * 2); + _cursorPaletteDirty = true; + } + break; default: break; } @@ -199,6 +196,8 @@ bool OSystem_Wii::getFeatureState(Feature f) { return _fullscreen; case kFeatureAspectRatioCorrection: return _arCorrection; + case kFeatureCursorPalette: + return !_cursorPaletteDisabled; default: return false; } @@ -252,21 +251,11 @@ void OSystem_Wii::setWindowCaption(const char *caption) { printf("window caption: %s\n", caption); } -Common::SaveFileManager *OSystem_Wii::getSavefileManager() { - assert(_savefile); - return _savefile; -} - Audio::Mixer *OSystem_Wii::getMixer() { assert(_mixer); return _mixer; } -Common::TimerManager *OSystem_Wii::getTimerManager() { - assert(_timer); - return _timer; -} - FilesystemFactory *OSystem_Wii::getFilesystemFactory() { return &WiiFilesystemFactory::instance(); } @@ -298,6 +287,18 @@ void OSystem_Wii::showOptionsDialog() { _padAcceleration = 9 - ConfMan.getInt("wii_pad_acceleration"); } +void OSystem_Wii::logMessage(LogMessageType::Type type, const char *message) { + FILE *output = 0; + + if (type == LogMessageType::kInfo || type == LogMessageType::kDebug) + output = stdout; + else + output = stderr; + + fputs(message, output); + fflush(output); +} + #ifndef GAMECUBE Common::String OSystem_Wii::getSystemLanguage() const { const char *wiiCountries[] = { @@ -368,7 +369,7 @@ Common::String OSystem_Wii::getSystemLanguage() const { } else { // This will only happen when new languages are added to the API. warning("WII: Unknown system language: %d", langID); - return BaseBackend::getSystemLanguage(); + return EventsBaseBackend::getSystemLanguage(); } } #endif // !GAMECUBE |