{"id":13,"date":"2013-07-14T19:24:49","date_gmt":"2013-07-14T19:24:49","guid":{"rendered":"https:\/\/blogs.scummvm.org\/rundfunk\/?p=13"},"modified":"2022-05-21T19:26:02","modified_gmt":"2022-05-21T19:26:02","slug":"switching","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/rundfunk\/2013\/07\/14\/switching\/","title":{"rendered":"Switching!"},"content":{"rendered":"<p>Hi everyone!\u00a0<img decoding=\"async\" class=\"wp-smiley\" src=\"https:\/\/web.archive.org\/web\/20140328135444im_\/http:\/\/radiorundfunk.se\/wp-includes\/images\/smilies\/icon_smile.gif\" alt=\":)\" \/><\/p>\n<p>Now when the switching between the 16-bit and 32-bit mode in the GUI is almost done, I\u2019m going to write a longer blog post detailing the design, decision and implementation of the feature.<\/p>\n<p>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 \u201cun-hardcode\u201d 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 \u2013 without having to resort to dithering:<\/p>\n<p><a href=\"https:\/\/web.archive.org\/web\/20140328135444\/http:\/\/radiorundfunk.se\/wp-content\/uploads\/2013\/07\/32.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-57\" src=\"https:\/\/web.archive.org\/web\/20140328135444im_\/http:\/\/radiorundfunk.se\/wp-content\/uploads\/2013\/07\/32-300x51.png\" alt=\"32\" width=\"300\" height=\"51\" \/>(Editor\u2019s note: unfortunately, the image that was included here is lost and not available on archive.org)<\/a><\/p>\n<p>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.<\/p>\n<p>This solution seems to work pretty fine, and only a couple of things need fixing now:<\/p>\n<ul>\n<li>There is a bug regarding the color of the cursor when running 32-bits,<\/li>\n<li>The background when entering the in-game menus renders incorrectly due to the switch between the different formats,<\/li>\n<li>Swapping the theme seems to mess up the rendering for some reason?<\/li>\n<\/ul>\n<p>As usual, the code can be found on my GitHub-page\u00a0<img decoding=\"async\" class=\"wp-smiley\" src=\"https:\/\/web.archive.org\/web\/20140328135444im_\/http:\/\/radiorundfunk.se\/wp-includes\/images\/smilies\/icon_smile.gif\" alt=\":)\" \/>\u00a0!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi everyone!\u00a0 Now when the switching between the 16-bit and 32-bit mode in the GUI is almost done, I\u2019m 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. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/rundfunk\/wp-json\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/rundfunk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/rundfunk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/rundfunk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/rundfunk\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":1,"href":"https:\/\/blogs.scummvm.org\/rundfunk\/wp-json\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":14,"href":"https:\/\/blogs.scummvm.org\/rundfunk\/wp-json\/wp\/v2\/posts\/13\/revisions\/14"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/rundfunk\/wp-json\/wp\/v2\/media?parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/rundfunk\/wp-json\/wp\/v2\/categories?post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/rundfunk\/wp-json\/wp\/v2\/tags?post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}