[Scummvm-devel] setMouseCursor() keycolor

Johannes Schickel lordhoto at scummvm.org
Thu Jan 7 03:04:56 CET 2010

Marcus Comstedt wrote:
>> An assertion is certainly better than undefined behaviour, since
>> undefined behaviour can hide bugs, just like the behaviour of the SDL
>> backend did in this case.

Well we use this for other stuff too, our documentation only says which 
ranges are allowed (just think of copyRectToScreen), if the users 
violates that it's up to the backend to decide what's happening with it. 
SDL asserts in this case too. Of course with _NDEBUG or the like assert 
is a stub, thus it won't be protected. Thus the general definition says 
everything apart the defined range causes undefined behavior.

 From OSystem::copyRectToScreen:

* @note The specified destination rectangle must be completly contained
* in the visible screen space, and must be non-empty. If not, a
* backend may or may not perform clipping, trigger an assert or
* silently corrupt memory.

// Johannes

More information about the Scummvm-devel mailing list