{"id":60,"date":"2020-06-21T06:38:15","date_gmt":"2020-06-21T04:38:15","guid":{"rendered":"https:\/\/blogs.scummvm.org\/ar28\/?p=60"},"modified":"2022-04-15T06:41:02","modified_gmt":"2022-04-15T04:41:02","slug":"more-progress-on-my-task-getting-close-to-the-finish-line","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/ar28\/2020\/06\/21\/more-progress-on-my-task-getting-close-to-the-finish-line\/","title":{"rendered":"More progress on my task &#038; getting close to the finish line"},"content":{"rendered":"<p>Hello! I was not as close to finish as I had estimated before. However, I have some more good progress on my task!<\/p>\n<p>Right after my blog the previous week, I found the problem which was making me very concerned about my code. Whenever I ran ScummVM, it took about 20-30 seconds to start. I was worried that some of my code could be troublesome, but then I found out my configuration file was a little too big.<\/p>\n<p><!--more--><br \/>\nThe configuration file (scummvm.ini) stores some useful information and is often low in size (~10KB) or so. In code, we interact with this file using &#8220;ConfMan&#8221;. For my previous task, I configured this to get a boolean from the .ini file to force the RTL-based GUI.<\/p>\n<p>I think some of my temporary code would have caused this issue. The ini file was around 150MB big!<\/p>\n<p><a href=\"https:\/\/blogs.scummvm.org\/ar28\/wp-content\/uploads\/sites\/13\/2022\/04\/Untitled.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-61\" src=\"https:\/\/blogs.scummvm.org\/ar28\/wp-content\/uploads\/sites\/13\/2022\/04\/Untitled.png\" alt=\"\" width=\"597\" height=\"29\" srcset=\"https:\/\/blogs.scummvm.org\/ar28\/wp-content\/uploads\/sites\/13\/2022\/04\/Untitled.png 597w, https:\/\/blogs.scummvm.org\/ar28\/wp-content\/uploads\/sites\/13\/2022\/04\/Untitled-300x15.png 300w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><\/a><\/p>\n<p>I was curious to see what it contained, so I opened it in sublime. It took ~15 minutes to open and it had this:<\/p>\n<p><a href=\"https:\/\/blogs.scummvm.org\/ar28\/wp-content\/uploads\/sites\/13\/2022\/04\/2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-62\" src=\"https:\/\/blogs.scummvm.org\/ar28\/wp-content\/uploads\/sites\/13\/2022\/04\/2-1024x550.png\" alt=\"\" width=\"660\" height=\"354\" srcset=\"https:\/\/blogs.scummvm.org\/ar28\/wp-content\/uploads\/sites\/13\/2022\/04\/2-1024x550.png 1024w, https:\/\/blogs.scummvm.org\/ar28\/wp-content\/uploads\/sites\/13\/2022\/04\/2-300x161.png 300w, https:\/\/blogs.scummvm.org\/ar28\/wp-content\/uploads\/sites\/13\/2022\/04\/2-768x413.png 768w, https:\/\/blogs.scummvm.org\/ar28\/wp-content\/uploads\/sites\/13\/2022\/04\/2-1536x826.png 1536w, https:\/\/blogs.scummvm.org\/ar28\/wp-content\/uploads\/sites\/13\/2022\/04\/2.png 1600w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/a><\/p>\n<p>15 minutes! For my own amusement, I have saved this file in another location. I simply deleted the file and relaunched scummvm, and I was so happy when it was running smoothly! I was genuinely thinking I made a big mistake somewhere or my code is very poor. Phew!<\/p>\n<p>Apart from this little incident, this week I also enabled all engines in my project. Previously I had only enabled one to speed up compile times on my potato pc.<\/p>\n<p>The compilation times really took a lot. A lot of time. There were ~350 errors after the first time I enabled all (stable) engines. I solved all of them, and the project was now fully compilable!<\/p>\n<p>I also had to add in support for my own version of printf, which took in U32Strings. To be honest, the existing code was really confusing to me, because I hadn&#8217;t really dealt with language-feature level code before. My mentor pointed out a good StackOverflow answer, which helped a bit to understand but I was still confused.<\/p>\n<p>After getting nowhere on it for an hour or so, I thought I would just write a temporary code to get started. I passed in the code as U32String and used iterators to loop through and check for &#8220;%&#8221;, then switch according to characters. I did this only for 1 argument because I wasn&#8217;t really sure how to do it for a variable number of arguments.<\/p>\n<p>Following along slowly side-by-side with the answer from StackOverflow and the existing code of ScummVM, I was able to do it!<\/p>\n<p>So, what&#8217;s next? To adapt my code across the project, I am now nearly modifying ~210 files when compared to the master. This means that I have to be more careful of my code effects, and more testing. Even though I plan to open the PR soon, I am thinking it will be a few more days to test out everything and make sure there is no funny business (like the 150MB ini file!)<\/p>\n<p>That&#8217;s it for this week&#8217;s progress! I have one more thing to say, though. My previous task &#8211; &#8220;RTL GUI&#8221; is near merge now. My mentors have told me that now is a good time to look back and reflect on my task because I have achieved the first milestone. It&#8217;s a great idea, and I will be writing a new post regarding this, and it will be going up shortly after this post!<\/p>\n<div style=\"text-align: center;\"><b><i>Thanks for reading!<\/i><\/b><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Hello! I was not as close to finish as I had estimated before. However, I have some more good progress on my task! Right after my blog the previous week, I found the problem which was making me very concerned about my code. Whenever I ran ScummVM, it took about 20-30 seconds to start. I [&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-60","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/ar28\/wp-json\/wp\/v2\/posts\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/ar28\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/ar28\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/ar28\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/ar28\/wp-json\/wp\/v2\/comments?post=60"}],"version-history":[{"count":1,"href":"https:\/\/blogs.scummvm.org\/ar28\/wp-json\/wp\/v2\/posts\/60\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/blogs.scummvm.org\/ar28\/wp-json\/wp\/v2\/posts\/60\/revisions\/63"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/ar28\/wp-json\/wp\/v2\/media?parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/ar28\/wp-json\/wp\/v2\/categories?post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/ar28\/wp-json\/wp\/v2\/tags?post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}