aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/wii/osystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/wii/osystem.cpp')
-rw-r--r--backends/platform/wii/osystem.cpp48
1 files changed, 20 insertions, 28 deletions
diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp
index c16578d9b3..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();
- BaseBackend::initBackend();
+ EventsBaseBackend::initBackend();
}
void OSystem_Wii::quit() {
@@ -261,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();
}
@@ -307,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[] = {
@@ -377,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