Open main menu

Difference between revisions of "Neverhood"

1,064 bytes added ,  21:59, 30 May 2013
Added multiline macro issue
(Added an issue with the video viewer)
(Added multiline macro issue)
Line 9: Line 9:


==Known issues==
==Known issues==
* There are some function-like preprocessor macros, e.g. SetUpdateHandler(), SetMessageHandler(), and NextState(), which are not correctly used. Example:
<code>
#define SetMessageHandler(handler)                                                                                                  \
    _messageHandlerCb = static_cast <uint32 (Entity::*)(int messageNum, const MessageParam &param, Entity *sender)> (handler);      \
    debug(5, "SetMessageHandler(" #handler ")");                                                                                    \
    _messageHandlerCbName = #handler
...
    if (getGlobalVar(V_TNT_DUMMY_BUILT))
        SetMessageHandler(&Scene1202::hmSolved);
</code>
This is bad, because while it looks like the "if" covers the entire macro, it actually only covers the first line of it. The standard trick is to put the code in the macro inside "do { ... } while (0)" (without semicolon). But it's almost midnight here, and I don't want to accidentally mess anything up. Especially when I don't know how to test it.


* Using the video viewer to watch Willie Trombone's videos crashes. This happens because _renderQueue inside Screen::update() in screen.cpp:83 points to invalid render items:
* Using the video viewer to watch Willie Trombone's videos crashes. This happens because _renderQueue inside Screen::update() in screen.cpp:83 points to invalid render items:
408

edits