{"id":141,"date":"2024-07-08T16:13:49","date_gmt":"2024-07-08T16:13:49","guid":{"rendered":"https:\/\/blogs.scummvm.org\/kunxl\/?p=141"},"modified":"2024-07-08T21:17:58","modified_gmt":"2024-07-08T21:17:58","slug":"refactoring-week","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/kunxl\/2024\/07\/08\/refactoring-week\/","title":{"rendered":"Lot of Refactoring"},"content":{"rendered":"<p>This week, work was somewhat slow. I started my week with finishing up restoring the feature to dump QML output to an XML file, which aids in visually comparing what is loaded from the QML file. This task primarily involved rewriting all the save script methods using <code>Common::SeekableWriteStream<\/code>. There were nearly 200 methods that needed rewriting.<\/p>\n<p>Another task was fixing the loading of previous games such as Pilots3D and Pilots. Sev significantly contributed to this by implementing the reading of tag IDs based on the game target. Additionally, I made a simple fix in the <code>qdFileManager<\/code>class to address an issue where the wrong number of resource packs were stored due to zero-based indexing. You can check this commit for details on the fix.<\/p>\n<figure id=\"attachment_149\" aria-describedby=\"caption-attachment-149\" style=\"width: 2032px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-149 size-full\" src=\"https:\/\/blogs.scummvm.org\/kunxl\/wp-content\/uploads\/sites\/75\/2024\/07\/Screenshot-2024-07-08-at-9.55.04-PM.png\" alt=\"\" width=\"2032\" height=\"1065\" srcset=\"https:\/\/blogs.scummvm.org\/kunxl\/wp-content\/uploads\/sites\/75\/2024\/07\/Screenshot-2024-07-08-at-9.55.04-PM.png 2032w, https:\/\/blogs.scummvm.org\/kunxl\/wp-content\/uploads\/sites\/75\/2024\/07\/Screenshot-2024-07-08-at-9.55.04-PM-300x157.png 300w, https:\/\/blogs.scummvm.org\/kunxl\/wp-content\/uploads\/sites\/75\/2024\/07\/Screenshot-2024-07-08-at-9.55.04-PM-1024x537.png 1024w, https:\/\/blogs.scummvm.org\/kunxl\/wp-content\/uploads\/sites\/75\/2024\/07\/Screenshot-2024-07-08-at-9.55.04-PM-768x403.png 768w, https:\/\/blogs.scummvm.org\/kunxl\/wp-content\/uploads\/sites\/75\/2024\/07\/Screenshot-2024-07-08-at-9.55.04-PM-1536x805.png 1536w, https:\/\/blogs.scummvm.org\/kunxl\/wp-content\/uploads\/sites\/75\/2024\/07\/Screenshot-2024-07-08-at-9.55.04-PM-480x252.png 480w, https:\/\/blogs.scummvm.org\/kunxl\/wp-content\/uploads\/sites\/75\/2024\/07\/Screenshot-2024-07-08-at-9.55.04-PM-960x503.png 960w\" sizes=\"auto, (max-width: 2032px) 100vw, 2032px\" \/><figcaption id=\"caption-attachment-149\" class=\"wp-caption-text\">Intro Video of Pilots-3d<\/figcaption><\/figure>\n<p>Lastly, I worked on implementing video playback. Initially, this seemed straightforward, but it required a more sophisticated approach. My first method involved setting up a new rendering loop inside the existing one to play each video. However, Sev pointed out that this was not how the original engine rendered video. Instead of creating a new rendering loop in the <code>play()<\/code> method of the video player class, I needed to use the existing loop and write an <code>update()<\/code>method to run on each cycle. In each iteration, we would check if the video had stopped and then continue with the usual engine processes.<\/p>\n<p>This is all for this week.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week, work was somewhat slow. I started my week with finishing up restoring the feature to dump QML output to an XML file, which aids in visually comparing what is loaded from the QML file. This task primarily involved rewriting all the save script methods using Common::SeekableWriteStream. There were nearly 200 methods that needed [&hellip;]<\/p>\n","protected":false},"author":23,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-141","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/kunxl\/wp-json\/wp\/v2\/posts\/141","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/kunxl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/kunxl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/kunxl\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/kunxl\/wp-json\/wp\/v2\/comments?post=141"}],"version-history":[{"count":7,"href":"https:\/\/blogs.scummvm.org\/kunxl\/wp-json\/wp\/v2\/posts\/141\/revisions"}],"predecessor-version":[{"id":151,"href":"https:\/\/blogs.scummvm.org\/kunxl\/wp-json\/wp\/v2\/posts\/141\/revisions\/151"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/kunxl\/wp-json\/wp\/v2\/media?parent=141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/kunxl\/wp-json\/wp\/v2\/categories?post=141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/kunxl\/wp-json\/wp\/v2\/tags?post=141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}