[Scummvm-devel] PROPOSAL: Removing (f)printf usage
Johannes Schickel
lordhoto at scummvm.org
Sun Nov 7 03:03:47 CET 2010
On 11/07/2010 02:58 AM, Max Horn wrote:
> 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.
LogMessageType please and not ConsoleMsgType :-).
>
> 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 :)
I see I formerly thought it was just using OSystem::quit there... but it
seems I misremembered. Anyway yeah I see then why we want to have that
method :-). From your mail I didn't get the real idea behind that (maybe
I missed lines? ;-P).
// Johannes
More information about the Scummvm-devel
mailing list