Neverhood

From ScummVM :: Wiki
Revision as of 21:59, 30 May 2013 by Eriktorbjorn (talk | contribs) (Added multiline macro issue)
Jump to navigation Jump to search
Neverhood
Engine developer johndoe
Companies that used it The Neverhood, Inc.
Games that use it The Neverhood
Date added to ScummVM 2013-05-15
First release containing it None

Known issues

  • There are some function-like preprocessor macros, e.g. SetUpdateHandler(), SetMessageHandler(), and NextState(), which are not correctly used. Example:

#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);

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:

Error #137: UNADDRESSABLE ACCESS: reading 0x0aa7f4f0-0x0aa7f4f4 4 byte(s)

  1. 0 Neverhood::Scene::draw [scummvm\engines\neverhood\scene.cpp:83]
  2. 1 Neverhood::Module::draw [scummvm\engines\neverhood\module.cpp:45]
  3. 2 Neverhood::Module::draw [scummvm\engines\neverhood\module.cpp:45]
  4. 3 Neverhood::NeverhoodEngine::mainLoop [scummvm\engines\neverhood\neverhood.cpp:171]
  5. 4 Neverhood::NeverhoodEngine::run [scummvm\engines\neverhood\neverhood.cpp:120]
  6. 5 runGame [scummvm\base\main.cpp:226]
  7. 6 scummvm_main [scummvm\base\main.cpp:452]
  8. 7 SDL_main [scummvm\backends\platform\sdl\win32\win32-main.cpp:60]
  9. 8 WinMain [scummvm\backends\platform\sdl\win32\win32-main.cpp:44]

Note: @0:01:01.153 in thread 5420 Note: next higher malloc: 0x0aa7f558-0x0aa7f594 Note: prev lower malloc: 0x0aa7f488-0x0aa7f4c0 Note: instruction: mov (%ecx) -> %edx

  • Uninitialised variables in the sound code, as indicated by Valgrind. These both happen in the navigation scene outside of the starting building, and may be at least partly related to playTwoSounds():
==26398== Conditional jump or move depends on uninitialised value(s)
==26398==    at 0x88DBBBB: Neverhood::SoundItem::update() (sound.cpp:235)
==26398==    by 0x88DC2F7: Neverhood::SoundMan::update() (sound.cpp:352)
==26398==    by 0x88D695F: Neverhood::NeverhoodEngine::mainLoop() (neverhood.cpp:175)
==26398==    by 0x88D66AF: Neverhood::NeverhoodEngine::run() (neverhood.cpp:120)
==26398==    by 0x805084A: runGame(PluginSubclass<MetaEngine> const*, OSystem&, Common::String const&) (main.cpp:226)
==26398==    by 0x8051489: scummvm_main (main.cpp:452)
==26398==    by 0x804F5DF: main (posix-main.cpp:45)

==26398== Conditional jump or move depends on uninitialised value(s)
==26398==    at 0x88DBBC7: Neverhood::SoundItem::update() (sound.cpp:236)
==26398==    by 0x88DC2F7: Neverhood::SoundMan::update() (sound.cpp:352)
==26398==    by 0x88D695F: Neverhood::NeverhoodEngine::mainLoop() (neverhood.cpp:175)
==26398==    by 0x88D66AF: Neverhood::NeverhoodEngine::run() (neverhood.cpp:120)
==26398==    by 0x805084A: runGame(PluginSubclass<MetaEngine> const*, OSystem&, Common::String const&) (main.cpp:226)
==26398==    by 0x8051489: scummvm_main (main.cpp:452)
==26398==    by 0x804F5DF: main (posix-main.cpp:45)