mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-08 20:07:11 +00:00
Merge pull request #42 from fingolfin/no-osystem-defaults
Remove default implementation of OSystem::logMessage
This commit is contained in:
commit
158c2252ab
@ -242,6 +242,18 @@ void OSystem_IPHONE::addSysArchivesToSearchSet(Common::SearchSet &s, int priorit
|
||||
}
|
||||
}
|
||||
|
||||
void OSystem_IPHONE::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);
|
||||
}
|
||||
|
||||
void iphone_main(int argc, char *argv[]) {
|
||||
|
||||
//OSystem_IPHONE::migrateApp();
|
||||
|
@ -180,6 +180,8 @@ public:
|
||||
|
||||
virtual Common::String getDefaultConfigFileName();
|
||||
|
||||
virtual void logMessage(LogMessageType::Type type, const char *message);
|
||||
|
||||
protected:
|
||||
void internUpdateScreen();
|
||||
void dirtyFullScreen();
|
||||
|
@ -199,6 +199,7 @@ public:
|
||||
virtual Audio::Mixer *getMixer();
|
||||
virtual void getTimeAndDate(TimeDate &t) const;
|
||||
virtual void setTimerCallback(TimerProc callback, int interval);
|
||||
virtual void logMessage(LogMessageType::Type type, const char *message);
|
||||
|
||||
void rebuildOffscreenGameBuffer(void);
|
||||
void rebuildOffscreenMouseBuffer(void);
|
||||
|
@ -870,6 +870,18 @@ void OSystem_N64::getTimeAndDate(TimeDate &t) const {
|
||||
return;
|
||||
}
|
||||
|
||||
void OSystem_N64::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);
|
||||
}
|
||||
|
||||
void OSystem_N64::setTimerCallback(TimerProc callback, int interval) {
|
||||
assert (interval > 0);
|
||||
|
||||
|
@ -52,6 +52,8 @@ public:
|
||||
virtual uint32 getMillis();
|
||||
virtual void delayMillis(uint msecs);
|
||||
virtual void getTimeAndDate(TimeDate &t) const {}
|
||||
|
||||
virtual void logMessage(LogMessageType::Type type, const char *message);
|
||||
};
|
||||
|
||||
OSystem_NULL::OSystem_NULL() {
|
||||
@ -97,6 +99,18 @@ uint32 OSystem_NULL::getMillis() {
|
||||
void OSystem_NULL::delayMillis(uint msecs) {
|
||||
}
|
||||
|
||||
void OSystem_NULL::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);
|
||||
}
|
||||
|
||||
OSystem *OSystem_NULL_create() {
|
||||
return new OSystem_NULL();
|
||||
}
|
||||
|
@ -20,8 +20,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Allow use of stuff in <time.h>
|
||||
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
|
||||
#define FORBIDDEN_SYMBOL_ALLOW_ALL
|
||||
|
||||
#include <pspuser.h>
|
||||
#include <pspgu.h>
|
||||
@ -422,7 +421,15 @@ void OSystem_PSP::quit() {
|
||||
}
|
||||
|
||||
void OSystem_PSP::logMessage(LogMessageType::Type type, const char *message) {
|
||||
EventsBaseBackend::logMessage(type, message);
|
||||
FILE *output = 0;
|
||||
|
||||
if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
|
||||
output = stdout;
|
||||
else
|
||||
output = stderr;
|
||||
|
||||
fputs(message, output);
|
||||
fflush(output);
|
||||
|
||||
if (type == LogMessageType::kError)
|
||||
PspDebugTrace(false, "%s", message); // write to file
|
||||
|
@ -275,10 +275,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];
|
||||
|
@ -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>
|
||||
|
||||
@ -291,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[] = {
|
||||
|
@ -211,6 +211,8 @@ public:
|
||||
virtual FilesystemFactory *getFilesystemFactory();
|
||||
virtual void getTimeAndDate(TimeDate &t) const;
|
||||
|
||||
virtual void logMessage(LogMessageType::Type type, const char *message);
|
||||
|
||||
#ifndef GAMECUBE
|
||||
virtual Common::String getSystemLanguage() const;
|
||||
#endif // GAMECUBE
|
||||
|
@ -21,11 +21,6 @@
|
||||
*/
|
||||
|
||||
#define FORBIDDEN_SYMBOL_EXCEPTION_exit
|
||||
#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
|
||||
#define FORBIDDEN_SYMBOL_EXCEPTION_fputs
|
||||
#define FORBIDDEN_SYMBOL_EXCEPTION_fflush
|
||||
#define FORBIDDEN_SYMBOL_EXCEPTION_stdout
|
||||
#define FORBIDDEN_SYMBOL_EXCEPTION_stderr
|
||||
|
||||
#include "common/system.h"
|
||||
#include "common/events.h"
|
||||
@ -136,20 +131,6 @@ Common::String OSystem::getDefaultConfigFileName() {
|
||||
return "scummvm.ini";
|
||||
}
|
||||
|
||||
void OSystem::logMessage(LogMessageType::Type type, const char *message) {
|
||||
#if !defined(__PLAYSTATION2__) && !defined(__DS__)
|
||||
FILE *output = 0;
|
||||
|
||||
if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
|
||||
output = stdout;
|
||||
else
|
||||
output = stderr;
|
||||
|
||||
fputs(message, output);
|
||||
fflush(output);
|
||||
#endif
|
||||
}
|
||||
|
||||
Common::String OSystem::getSystemLanguage() const {
|
||||
return "en_US";
|
||||
}
|
||||
|
@ -1101,7 +1101,7 @@ public:
|
||||
* @param type the type of the message
|
||||
* @param message the message itself
|
||||
*/
|
||||
virtual void logMessage(LogMessageType::Type type, const char *message);
|
||||
virtual void logMessage(LogMessageType::Type type, const char *message) = 0;
|
||||
|
||||
/**
|
||||
* Open the log file in a way that allows the user to review it,
|
||||
|
Loading…
x
Reference in New Issue
Block a user