[Scummvm-devel] PROPOSAL: Removing (f)printf usage

Max Horn max at quendi.de
Sun Nov 7 02:58:46 CET 2010


Hi Johannes,

thanks for the feedback! Since nobody seems to have much of an opinion on the API, I'll just do it according to your comments:
 OSystem:: logMessage(ConsoleMsgType type, const char *msg);
with
 enum ConsoleMsgType { ERROR, WARNING, DEBUG };
and no OSystem::flushLog() method. It's trivial to adjust these things once we have them anyway.


Am 07.11.2010 um 02:30 schrieb Johannes Schickel:

[...]

>> 2)  OSystem::fatalError()
>> This would by called as last thing by error(), and by default would invoke OSystem::quit() followed by exit(1). Look at the end of our current error() function in common/textconsole.cpp to get an idea of what other things backends might do there.
>> 2b) Alternatively, this function could be part of OSystem::logToConsole, and triggered by message type FATAL_ERROR.
> 
> I don't see why we should have this right now though? I.e. what is the 
> possible benefit here? That the backend can still show some "Ooops. 
> Something went seriously wrong." message?

No. The purpose would be, as I stated, to do what our current error() method does in its second half, right after the following comment, just without tons of #ifdefs:
	// TODO: Add a OSystem::fatalError() method and invoke it here.
	// The default implementation would just call OSystem::quit().
Please look at common/textconsole.cpp, I don't like pasting the 39 lines of evil hackery here :)


Cheers,
Max



More information about the Scummvm-devel mailing list