{"id":49,"date":"2014-05-30T06:12:40","date_gmt":"2014-05-30T06:12:40","guid":{"rendered":"https:\/\/blogs.scummvm.org\/lukaslw\/?p=49"},"modified":"2022-05-22T06:14:33","modified_gmt":"2022-05-22T06:14:33","slug":"background-animations-2","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/lukaslw\/2014\/05\/30\/background-animations-2\/","title":{"rendered":"Background animations #2"},"content":{"rendered":"<p>Hello everyone in new weekly update.<br \/>\nThere are four types of background animations in the game:<\/p>\n<ul>\n<li>Type 0 &#8211; loop of just one sub-animation (e.g. gravedigger in loc. 1 &#8211; graveyard)<\/li>\n<\/ul>\n<ul>\n<li>Type 1 &#8211; loop with randomized sub-animation (e.g. owl in loc. 1 &#8211; graveyard)<\/li>\n<\/ul>\n<ul>\n<li>Type 2 &#8211; loop with base animation and after constant delay &#8211; change to one of another sub-animation (e.g. beggar in loc. 4 &#8211; city)<\/li>\n<\/ul>\n<ul>\n<li>Type 3 &#8211; loop of one sub-animation that is turning off for randomized amount of time (only in loc. 14 &#8211; treasury)<\/li>\n<\/ul>\n<p>I finally manage to draw background animations of all types and also to draw shadows for them:<\/p>\n<div style=\"width: 580px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-49-1\" width=\"580\" height=\"326\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/05\/The-Prince-and-the-Coward-Background-Animations-rq7yIA5Fp-c.mp4?_=1\" \/><a href=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/05\/The-Prince-and-the-Coward-Background-Animations-rq7yIA5Fp-c.mp4\">https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/05\/The-Prince-and-the-Coward-Background-Animations-rq7yIA5Fp-c.mp4<\/a><\/video><\/div>\n<p style=\"text-align: center;\"><em>(Source: https:\/\/www.youtube.com\/watch?v=rq7yIA5Fp-c)<\/em><\/p>\n<p>I also allow to cut them properly on edges of the screen while scrolling the location. I still have memory leak problems that I have to fix. Application is not crashing, but there have to be mistake somewhere. I&#8217;m using VS 2010 on Windows 7 and I don&#8217;t have ScummVM compiled with gcc on Linux, so I&#8217;m using similar tool to Valgrind for memory checking &#8211; Dr. Memory. It gives me some errors in type 1 and 3 but it looks like it is not related with randomizing of sub-animations.<\/p>\n<p>I also start working on part of code that allow drawing masks \/ overlays of background on top of other sprites (which allow to create Z axis in 2D world) and I have to say that it&#8217;s going pretty good.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello everyone in new weekly update. There are four types of background animations in the game: Type 0 &#8211; loop of just one sub-animation (e.g. gravedigger in loc. 1 &#8211; graveyard) Type 1 &#8211; loop with randomized sub-animation (e.g. owl in loc. 1 &#8211; graveyard) Type 2 &#8211; loop with base animation and after constant [&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-49","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/posts\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/comments?post=49"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/posts\/49\/revisions"}],"predecessor-version":[{"id":52,"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/posts\/49\/revisions\/52"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/media?parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/categories?post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/tags?post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}