Midterm

Hi everyone!

Whoops, I now realized I never made that post about gestures, I was too busy fixing up the remaining code to work with it :) . First a small recap of progress since last week: I’ve made a pull request regarding the various GUI-improvements, as can be seen on https://github.com/scummvm/scummvm/pull/361 . Also I’ve worked a bit on the other pull-request, the new version of the code in the backend checks if 32-bit is wanted (by a flag in the config file, as before), and sets the bit-depth accordingly.

As for midterm, the 32-bit code and the GUI-improvements, especially the gradient effect on the bevels, took a bit longer than expected. What’s next is to create widgets for the new touch-based theme, before working on the theme itself. From the current mockups, it seems like a scrollable canvas-type widget needs to be implemented, and also some kind of picture-button class. These need to be able to respond to gesture-events, and the other “old” widgets also need to be able to respond to these events. After that is done, work on the new theme can commence.

Until next time!

Update

Hi everyone! :)

The last week I’ve been busy working on the 32-bit mode, and submitting it as a pull request. What I did before submitting it was essentially reworking it from the ground up, removing the function setOverlayFormat, which I mentioned in the previous update, and just relying on the function setScreenFormat/( to change format on-the-fly. The request, and also a short description of what the code essentially does, can be found at https://github.com/scummvm/scummvm/pull/359 .

I got some comments on my implementation and will probably rework it quite a bit. Some changes that might be done are:

Since setScreenFormat doesn’t really use the format it is called with (it initializes a new surface and takes its properties from that), the function might be better suited to take in just the BPP which is preferred.

Of course, some cleanup, fixing formatting and such.

In order to avoid ugly if-conditions, I’ll probably split up the GraphicsMode (which currently is specified like kGfxAntialias16bit, kGfxStandard32bit and so on) into two, that specify the rendering used and the bit-depth used. Also, this will probably change setting in the configuration-file.

Furthermore, some other work on the GUI has been done, such as adding gradients to the bevels of the buttons and refactoring the code.

What I’ll get working on more during this week are gestures (swipes and such) on touch-screen based devices. I was originally planning on writing more about the general plan and outline in this blog-post, but I’ll probably do that in a day or two!

Switching!

Hi everyone! :)

Now when the switching between the 16-bit and 32-bit mode in the GUI is almost done, I’m going to write a longer blog post detailing the design, decision and implementation of the feature.

Some background: In the scummvm-master branch, the SDL-renderer for the GUI has a hardcoded bit-depth of 16-bits in some places. My intention has been to “un-hardcode” this, replacing the constants into variables that depend on the bit-depth set, so that arbitrary bit-depths can be used (although the code is focusing on 32-bits right now). The difference between 16 and 32 bits in the GUI can, as an example, be seen in the picture below, with the 32-bit rendering giving a nicer gradient, especially on the buttons – without having to resort to dithering:

32(Editor’s note: unfortunately, the image that was included here is lost and not available on archive.org)

One of the problems one runs into with switching to a 32-bit surface is that it does break games and scalers used, which assume a 16-bit surface is being used. To remedy this problem, my current solution involves switch back to a supported 16-bit format (using a new function setScreenFormat) when running a game from the launcher, and then switching back to the old 32-bit format used (using the new function setOverlayFormat) if the player enters a menu while playing, or re-enters the launcher.

This solution seems to work pretty fine, and only a couple of things need fixing now:

  • There is a bug regarding the color of the cursor when running 32-bits,
  • The background when entering the in-game menus renders incorrectly due to the switch between the different formats,
  • Swapping the theme seems to mess up the rendering for some reason?

As usual, the code can be found on my GitHub-page :) !

Current status and midterm goals

Hi everyone! :)

The last couple of days I’ve been working on fixing up the 32-bit support in the GUI, which should be mostly done in a couple of days, what’s left is a minor cursor-bug and selection of the 32-bit renderer in the GUI. We’ve also defined a couple of mid-term goals. These are:

  1. Switching between 32-bit and 16-bit renderer
  2. Change widgets to look more like the mockups ( https://github.com/scummvm/scummvm-media/tree/master/originals/gui  )
  3. Refactor gesture-code

Also, the mockups for the touch-based GUI should arrive soon!