{"id":255,"date":"2010-01-05T00:11:11","date_gmt":"2010-01-05T06:11:11","guid":{"rendered":"http:\/\/www.philhassey.com\/blog\/?p=255"},"modified":"2010-01-05T00:11:11","modified_gmt":"2010-01-05T06:11:11","slug":"seahorse-adventures-loading-tgas-and-more","status":"publish","type":"post","link":"https:\/\/www.philhassey.com\/blog\/2010\/01\/05\/seahorse-adventures-loading-tgas-and-more\/","title":{"rendered":"Seahorse Adventures &#8211; Loading TGAs (and more)"},"content":{"rendered":"<p>Here&#8217;s a screenshot. \u00a0This is my Ubuntu desktop of my work on a new iPhone game. \u00a0Take a look at it nice and big. \u00a0Below I&#8217;ll explain all of what is going on &#8230;<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2010\/01\/bsa_dev1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-256 aligncenter\" title=\"bsa_dev1\" src=\"https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2010\/01\/bsa_dev1-300x187.png\" alt=\"bsa_dev1\" width=\"300\" height=\"187\" srcset=\"https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2010\/01\/bsa_dev1-300x187.png 300w, https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2010\/01\/bsa_dev1-1024x640.png 1024w, https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2010\/01\/bsa_dev1.png 1680w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">In short, I&#8217;m working on porting my pyweek#3 team entry to the iPhone. \u00a0Here&#8217;s the details:<\/p>\n<ul>\n<li>Top left, you see Kate, my text editor. \u00a0You&#8217;ll notice I&#8217;ve got -what appears- to be python. \u00a0But that&#8217;s actually tinypyC++ code! \u00a0My converter still has some rough edges, but it&#8217;s starting to get pretty good. \u00a0If you weren&#8217;t looking to closely you might mistake that for ordinary python code! \u00a0(In fact, it should be 100% python parser friendly.) \u00a0You can see how I have to use a touch of annotation to make it all go. \u00a0But for the most part, the types get inferred. \u00a0(The C++ outputted is about 2x as long, so I&#8217;m saving a ton of keystrokes!)<\/li>\n<li>Top right, you see the level being painted. \u00a0It isn&#8217;t all working yet, but those are the basic tiles. \u00a0Interesting bit about loading the level, when I created this game I used my own level editor and library I made with pygame. \u00a0To save on disk and time I save all the levels to .tga files. \u00a0Since I&#8217;m targeting the iPhone I need an easy way to read the data from .tga files. \u00a0I don&#8217;t have SDL_image available, so a friend pointed me towards <a href=\"http:\/\/www.nothings.org\/\">this great site<\/a>. \u00a0It appears to have some awesome bits of code, including very simple and easy to use image loader that can load tga\/png\/jpg\/etc. \u00a0I think it has the most painless interface I&#8217;ve ever seen for a C-based image-loader.<\/li>\n<li>Bottom right you can see me working on tinypyC++. \u00a0As I&#8217;m working on BSA, I&#8217;m always finding new bugs in it. \u00a0Lately most of the bugs have been of the &#8220;add more graceful error handling&#8221; nature. \u00a0tinypy will point out what line (and character) an error happened on, but with a bit of extra work I&#8217;m able to add in some coherent error messages to tell the user what is going on. \u00a0In this case it was to inform the user of an undefined module name.<\/li>\n<li>Bottom left you can see the startup of the game. \u00a0I&#8217;m using <a href=\"http:\/\/www.ambiera.com\/irrklang\/\">irrKlang for all my \u00a0game audio<\/a> now. \u00a0It is not open source, but it&#8217;s &#8220;free&#8221; to use for free games, and the price is quite reasonable for commercial projects. \u00a0irrKlang is not portable to the iPhone yet, so I have to have a separate driver for my iPhone audio.<\/li>\n<\/ul>\n<p>And that&#8217;s it for today&#8217;s report!<\/p>\n<p>-Phil<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a screenshot. \u00a0This is my Ubuntu desktop of my work on a new iPhone game. \u00a0Take a look at it nice and big. \u00a0Below I&#8217;ll explain all of what is going on &#8230; In short, I&#8217;m working on porting my pyweek#3 team entry to the iPhone. \u00a0Here&#8217;s the details: Top left, you see Kate, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,24,6,19,66,3,2,9,32],"tags":[],"class_list":["post-255","post","type-post","status-publish","format-standard","hentry","category-bugs","category-c","category-development","category-gamedev","category-iphone","category-pygame","category-python","category-testing","category-tinypy"],"_links":{"self":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/comments?post=255"}],"version-history":[{"count":1,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/255\/revisions"}],"predecessor-version":[{"id":257,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/255\/revisions\/257"}],"wp:attachment":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/media?parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/categories?post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/tags?post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}