{"id":53,"date":"2023-06-25T05:43:01","date_gmt":"2023-06-25T05:43:01","guid":{"rendered":"https:\/\/blogs.scummvm.org\/hax0kartik\/?p=53"},"modified":"2023-06-25T05:43:01","modified_gmt":"2023-06-25T05:43:01","slug":"more-graphical-fixes","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/hax0kartik\/2023\/06\/25\/more-graphical-fixes\/","title":{"rendered":"More Graphical fixes"},"content":{"rendered":"<p>Hi all, the blog post for this week will be relatively short as I have been sick lately, however, I did fix a few things.<\/p>\n<h4>Fixing texture rotation<\/h4>\n<p>At the start of the week, I tackled the problem of the missing texture rotation due to which tiles were incorrectly rendered as below.<\/p>\n<figure id=\"attachment_55\" aria-describedby=\"caption-attachment-55\" style=\"width: 580px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-55 size-large\" src=\"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/Screenshot-from-2023-06-25-08-19-43-1024x612.png\" alt=\"\" width=\"580\" height=\"347\" srcset=\"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/Screenshot-from-2023-06-25-08-19-43-1024x612.png 1024w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/Screenshot-from-2023-06-25-08-19-43-300x179.png 300w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/Screenshot-from-2023-06-25-08-19-43-768x459.png 768w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/Screenshot-from-2023-06-25-08-19-43-1200x718.png 1200w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/Screenshot-from-2023-06-25-08-19-43.png 1284w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><figcaption id=\"caption-attachment-55\" class=\"wp-caption-text\">Incorrectly rendered tiles<\/figcaption><\/figure>\n<p>I tried fixing this using the <code>rotoscale<\/code> function, however, that gave a weird &#8220;boxy&#8221; look to the rotated tiles. For example, in the following picture, it is particularly noticeable in the grass texture at the bottom left of the screen.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-56 aligncenter\" src=\"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image-1-1024x506.png\" alt=\"\" width=\"580\" height=\"287\" srcset=\"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image-1-1024x506.png 1024w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image-1-300x148.png 300w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image-1-768x380.png 768w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image-1-1200x593.png 1200w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image-1.png 1305w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/p>\n<p>This was intriguing as this function was already being used by other engines such as WinterMute and they did not seem to have come across this problem. To dig deeper, I dumped the texture to a png file after rotation and &#8211; apparently the rotated texture had different dimensions(32&#215;33) as compared to the original texture(32&#215;32). I was, however, not able to fix this.<\/p>\n<p>FractureHill, the developer for the &#8220;Nancy Drew&#8221; engine confirmed that he had the same issue and ended up rolling his own implementation for rotating textures. So, I copied the relevant code, optimized it a bit, and voila &#8211; it worked perfectly! \ud83d\ude42<\/p>\n<figure id=\"attachment_57\" aria-describedby=\"caption-attachment-57\" style=\"width: 580px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-57\" src=\"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image-2-1024x478.png\" alt=\"\" width=\"580\" height=\"271\" srcset=\"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image-2-1024x478.png 1024w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image-2-300x140.png 300w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image-2-768x359.png 768w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image-2.png 1192w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><figcaption id=\"caption-attachment-57\" class=\"wp-caption-text\">No more &#8220;boxy&#8221; look!<\/figcaption><\/figure>\n<h4>Miscellaneous other graphical fixes<\/h4>\n<p>There are some other small fixes that I made this week, most noticeably I fixed a bug due to which border tiles were missing from some scenes.<\/p>\n<figure id=\"attachment_58\" aria-describedby=\"caption-attachment-58\" style=\"width: 580px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-58 size-large\" src=\"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image1-1024x611.png\" alt=\"\" width=\"580\" height=\"346\" srcset=\"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image1-1024x611.png 1024w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image1-300x179.png 300w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image1-768x458.png 768w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image1-1200x715.png 1200w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image1.png 1278w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><figcaption id=\"caption-attachment-58\" class=\"wp-caption-text\">Missing tiles at the bottom<\/figcaption><\/figure>\n<figure id=\"attachment_59\" aria-describedby=\"caption-attachment-59\" style=\"width: 580px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-59 size-large\" src=\"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image2-1024x611.png\" alt=\"\" width=\"580\" height=\"346\" srcset=\"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image2-1024x611.png 1024w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image2-300x179.png 300w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image2-768x458.png 768w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image2-1200x715.png 1200w, https:\/\/blogs.scummvm.org\/hax0kartik\/wp-content\/uploads\/sites\/68\/2023\/06\/image2.png 1278w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><figcaption id=\"caption-attachment-59\" class=\"wp-caption-text\">No more missing tiles!<\/figcaption><\/figure>\n<p>That is all for this week. Next week I will focus on getting saves to work correctly. Please look forward to my future blog posts and thanks for reading! \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi all, the blog post for this week will be relatively short as I have been sick lately, however, I did fix a few things. Fixing texture rotation At the start of the week, I tackled the problem of the missing texture rotation due to which tiles were incorrectly rendered as below. I tried fixing [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-53","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/comments?post=53"}],"version-history":[{"count":3,"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/posts\/53\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/posts\/53\/revisions\/63"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/media?parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/categories?post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/tags?post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}