{"id":193,"date":"2020-07-06T12:00:09","date_gmt":"2020-07-06T12:00:09","guid":{"rendered":"https:\/\/blogs.scummvm.org\/djsrv\/?p=193"},"modified":"2022-05-24T00:44:53","modified_gmt":"2022-05-24T00:44:53","slug":"refactoring","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/djsrv\/2020\/07\/06\/refactoring\/","title":{"rendered":"Refactoring"},"content":{"rendered":"<section class=\"body\">This last week I got some boring but important work done. After completing some odd jobs like implementing event delegation for Director 2-3 and TrueType font loading, I began refactoring the Director engine to make it flexible enough to handle Movies In A Window (MIAWs), or multiple movies running in parallel.For those not familiar, Director uses a movie metaphor for development. A movie\u2019s major components are:<\/p>\n<ul>\n<li>The cast, which contains cast members. Cast members can be visual (such as bitmaps or text), they can be sounds, or they can be scripts.<\/li>\n<li>The stage, where sprites (instances of cast members) are displayed.<\/li>\n<li>The score, a sequence of frames which dictate sprite placement, sounds, script execution, and much more.<\/li>\n<\/ul>\n<p>Previously, all these jobs were handled by an enormous Score class. This worked fine when we were only playing one movie at a time, but to support MIAWs, things needed to be a whole lot more modular. Nathanael separated rendering code into a Stage class, while I separated the Cast and Movie from the Score, which took quite a long time.<\/p>\n<p>After that, I began working on displaying movies within our classic Mac Window manager.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-194\" src=\"https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2022\/05\/warlock-window.png\" alt=\"\" width=\"1052\" height=\"824\" srcset=\"https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2022\/05\/warlock-window.png 1052w, https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2022\/05\/warlock-window-300x235.png 300w, https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2022\/05\/warlock-window-1024x802.png 1024w, https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2022\/05\/warlock-window-768x602.png 768w, https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2022\/05\/warlock-window-480x376.png 480w, https:\/\/blogs.scummvm.org\/djsrv\/wp-content\/uploads\/sites\/4\/2022\/05\/warlock-window-960x752.png 960w\" sizes=\"auto, (max-width: 1052px) 100vw, 1052px\" \/>Today I began implementing the Lingo side of MIAWs, so I hope to have more news on them soon!<\/p>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>This last week I got some boring but important work done. After completing some odd jobs like implementing event delegation for Director 2-3 and TrueType font loading, I began refactoring the Director engine to make it flexible enough to handle Movies In A Window (MIAWs), or multiple movies running in parallel.For those not familiar, Director [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-193","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/posts\/193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/comments?post=193"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/posts\/193\/revisions"}],"predecessor-version":[{"id":196,"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/posts\/193\/revisions\/196"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/media?parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/categories?post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/djsrv\/wp-json\/wp\/v2\/tags?post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}