Showing posts with label debugging. Show all posts
Showing posts with label debugging. Show all posts

Wednesday, July 16, 2014

Toolbar and memory leaks

Hi guys! :)

During the last week, the most spectacular part of my progress was the implementation of some functionalities on the toolbar. Now, you can switch between normal, colorful display, and "mono-color" mode, which is there to support players with seeing difficulties. Let me illustrate it with two pictures:


Pretty kind of the original developers, isn't it? :) Besides that, thanks to ScummVM's another great feature, now you can enable this colorblind mode not just by clinking the purple sphere on the toolbar (next to Vincent's inventory), but you can also configure the engine right from the launcher, so it always runs in this mode.


To do so, I only had to add this static array to detection.h:

static const ADExtraGuiOptionsMap optionsList[] = {
  {
   GAMEOPTION_COLOR_BLIND_DEFAULT_OFF,
   {
    _s("Color Blind Mode"),
    _s("Enable Color Blind Mode by default"),
    "enable_color_blind",
    false
   }
  },

  AD_EXTRA_GUI_OPTIONS_TERMINATOR
};

And just pass it as an argument to the constructor of my subclass of AdvancedMetaEngine. It's quite awesomely simple, isn't it? :)

Another feature I added is that now you can also switch between speech-only and text-only mode using the little ear and eye icons next to the main switch on the right side of the toolbar. Of course, you can still stick with both, simply clicking on the mouth icon above the two. :)

Besides that, my last week mostly spent with fixing various newly found bugs and patching up the engine in different places so it (hopefully) leaks less memory now.
In practice, I will keep on doing that during the next week, since now (many many thanks to Arnaud) all the scenes in the game are reachable and most of them are fully or at least partially translated too. So we are absolutely not far from saying that the game is in a completable state, but there are still a lot of showstopping bugs what need to be tended

See you soon! :)

Tuesday, July 8, 2014

Save and load system

Hi everybody! :)

My last week's progress is mainly centered around the save and load system. I had a couple of difficulties, but now CGE2 engine supports almost every Advanced Engine Features. I only left out "Return to Launcher" support, since the engine still have a lot of memory leak issues (even through I managed to solve a couple of them) needed to be fixed before that.


So as I said, now it's possible to load a gamestate via the launcher, or even do saving or loading in-game. I plan to also implement an autosave functionality, similar to the one implemented in CGE1, but for now it works and that's totally enough for debugging and the translation works of Arnaud.
I've got a couple of hardships during the implementation of this subsystem, but ScummVM's built-in Common::Serializer class helped me a lot and spared me a great deal of time by hiding the actual stream operations behind an abstract interface. Since the original game only supports saving when exiting the game, and loading when starting it, I had to make so modifications in the engine itself to make it possible to save/load anytime during gameplay. But knowing the internal workings of the engine, it was quite straightforward. The hardest part was to rework Spare and the way it's used, so now it's not just a temporary container for some of the sprites in the game, but a big catalog, which stores every Sprite used by the engine, all the time, so most of the synchronization work is to keep Spare up to date.

Otherwise, I mostly spent my time with annoying and hard to find bugfixes like this miracle.

During the past week, Arnaud went on a translation-frenzy. :D Thanks to him, almost all of the scenes of the game (Warning, spoiler alert!) are reachable/finishable. I just can't express my gratitude toward him. :)

My plans for the upcoming week is more bugfixes and even more taking care of various Valgrind errors, provided generously by David, what I am still really thankful for. :)

See you soon!