<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cuppadev</title>
	<atom:link href="http://www.cuppadev.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cuppadev.co.uk</link>
	<description>Cuppalicious coding!</description>
	<lastBuildDate>Sat, 14 Aug 2010 10:12:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Palettes in ScummC</title>
		<link>http://www.cuppadev.co.uk/projects/palettes-in-scummc/</link>
		<comments>http://www.cuppadev.co.uk/projects/palettes-in-scummc/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 10:10:59 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[SCUMM]]></category>
		<category><![CDATA[scummc]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=752</guid>
		<description><![CDATA[One thing which i have been meaning to incorporate into ScummC for quite a while now is better palette manipulation tools. It seems that sometime after the turn of the century, the art of making an image editor with good palette manipulation seems to have been lost. This is very unfortunate, as it makes it [...]]]></description>
			<content:encoded><![CDATA[<p>One thing which i have been meaning to incorporate into <a href="http://github.com/jamesu/scummc">ScummC</a> for quite a while now is better palette manipulation tools.</p>
<p><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/08/oquest-300x225.png" alt="" title="OpenQuest" width="300" height="225" class="aligncenter size-medium wp-image-753" /></p>
<p>It seems that sometime after the turn of the century, the art of making an image editor with good palette manipulation seems to have been lost. This is very unfortunate, as it makes it VERY hard to make graphics for scummc.</p>
<p>So i improved scummc in two ways&#8230;</p>
<h2>The palcat tool is now more useful</h2>
<p>Have tons of non-indexed graphics? Well now you can tell palcat to combine and quantise all the colours in your images, so you have a single common palette.</p>
<p><code>palcat -o out -col 32 costume1_*.bmp costume2_*.bmp</code></p>
<p>Quite commonly in scumm games, you&#8217;ll notice the room palettes will follow the same general schema:</p>
<table>
<tr>
<th>OFFS</th>
<th>SIZE</th>
<th>DESC</th>
</tr>
<tr>
<td>0</td>
<td>16</td>
<td>System Colors</td>
</tr>
<tr>
<td>16</td>
<td>X</td>
<td>Room Colors</td>
</tr>
<tr>
<td>16+X</td>
<td>Y</td>
<td>Costume Colors</td>
</tr>
</table>
<p>To reproduce with palcat, simply do:</p>
<pre>palcat -o out sys.bmp room.bmp costumes.bmp</pre>
<p>(where costumes.bmp contains your combined costume palette(s))</p>
<h2>The costume compiler helps you</h2>
<p>In scumm, costumes have a palette which indexes into the current room palette. Before you had to specify this manually, like so:</p>
<pre>palette([0-32]);</pre>
<p>Now you can pass in your combined room palette instead, like so:</p>
<pre>palette("out_blank_room.bmp");</pre>
<p>Which will match up colors in out_blank_room.bmp with your costume bitmap.</p>
<p>If you have costumes which will be re-used across rooms, i suggest you make a blank room bitmap so it won&#8217;t accidentally match colors in your room when you don&#8217;t want it to.</p>
<pre>palcat -o out sys.bmp blank_room.bmp actors.bmp</pre>
<p>I&#8217;ve incorporated the costume palette trick in the examples on my scummc fork. Feel free to <a href="http://github.com/jamesu/scummc">check it out on github</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/projects/palettes-in-scummc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Example Teambox API App: A Stat generator!</title>
		<link>http://www.cuppadev.co.uk/projects/example-teambox-api-app-a-stat-generator/</link>
		<comments>http://www.cuppadev.co.uk/projects/example-teambox-api-app-a-stat-generator/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 16:17:01 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[teambox]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=741</guid>
		<description><![CDATA[Now that Teambox has a real API, i thought i&#8217;d make something simple to demonstrate its use. What i came up with was this.. A statistics generator! For those who have used IRC in the past, you may recall the multitude of scripts available that analyse your logs and generate interesting, albeit pointless statistics about [...]]]></description>
			<content:encoded><![CDATA[<p>Now that Teambox has a real API, i thought i&#8217;d make something simple to demonstrate its use. What i came up with was this..</p>
<p><a href="http://www.cuppadev.co.uk/wp-content/uploads/2010/08/Screen-shot-2010-08-02-at-16.51.57.png"><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/08/Screen-shot-2010-08-02-at-16.51.57-300x227.png" alt="" title="Teambox Statistics Generator" width="300" height="227" class="alignnone size-medium wp-image-745" /></a></p>
<p>A statistics generator!</p>
<p>For those who have used IRC in the past, you may recall the multitude of scripts available that analyse your logs and generate interesting,<br />
albeit pointless statistics about them. </p>
<p>Borrowing from the general format of these generators, i wrote a simple ruby script which analyses recent activities in a teambox project. It will tell you such things as:</p>
<ul>
<li>Hours with the most activities in the project</li>
<li>The most active user</li>
<li>Who wrote the Longest and shortest lines, as well as the most words</li>
<li>The most popular words in the project</li>
<li>Most referenced users</li>
<li>Most referenced URL&#8217;s</li>
<li>Most popular conversation</li>
<li>Person who created the most tasks / conversations</li>
</ul>
<p>Really, everything you never wanted to know about your project!</p>
<p>It will also resolve conversation and task names, if you were ever wondering how to properly do that.</p>
<p>To use it run the script, supplying your username, password, and the project you want to examine. e.g.:</p>
<pre>
<code>
ruby teamboxstats.rb -u fred -p password teambox
</code>
</pre>
<p>Will login and dump the teambox project if you have access to it.</p>
<p>As always, feel free to <a href="http://github.com/jamesu/teamboxstats/">check out the code on github</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/projects/example-teambox-api-app-a-stat-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where is ScummC?</title>
		<link>http://www.cuppadev.co.uk/hacks/where-is-scummc/</link>
		<comments>http://www.cuppadev.co.uk/hacks/where-is-scummc/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 21:42:29 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[problem solving]]></category>
		<category><![CDATA[SCUMM]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=739</guid>
		<description><![CDATA[With the recent remakes of certain Lucasarts adventure games, i thought to myself &#8220;i wonder how the scummc compiler project is getting on?&#8221; To my shock however, it seems the scummc website suddenly died sometime last year, so nobody was able to check out and learn from the only functioning third party SCUMM compiler. Thankfully [...]]]></description>
			<content:encoded><![CDATA[<p>With the recent remakes of certain Lucasarts adventure games, i thought to myself &#8220;i wonder how the scummc compiler project is getting on?&#8221;</p>
<p>To my shock however, it seems the scummc website suddenly died sometime last year, so nobody was able to check out and learn from the only functioning third party SCUMM compiler.</p>
<p>Thankfully i was able to obtain a fairly recent copy of the files in the SVN repository, and coupled with the SVN commit logs on the mailing list i have been able to re-create the repository using GIT as far back as revision 359.</p>
<p>So what are you waiting for? Check it out on <a href="http://github.com/jamesu/scummc">github</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/where-is-scummc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t write that framework</title>
		<link>http://www.cuppadev.co.uk/hacks/dont-write-that-framework/</link>
		<comments>http://www.cuppadev.co.uk/hacks/dont-write-that-framework/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 00:28:48 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[disaster]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=728</guid>
		<description><![CDATA[Writing frameworks is a waste of time. That is the conclusion after spending most of my time on my last project writing a framework, in order to make the project &#8220;easier&#8221; to write. The trouble is every minute you divert to the framework, half of your project dies. And since there is an inherent division [...]]]></description>
			<content:encoded><![CDATA[<p>Writing frameworks is a waste of time. </p>
<p>That is the conclusion after spending most of my time on my last project <strong>writing a framework</strong>, in order to make the project &#8220;easier&#8221; to write.</p>
<p>The trouble is every minute you divert to the framework, half of your project dies. And since there is an inherent division between project and framework, by the time you have everything working you have lost your original train of thought.</p>
<p>Then you realize: the project is way <strong>behind schedule</strong>; there goes a cool feature that could gave landed you a multitude of sales. Or even worse, everyone has lost interest.</p>
<p>Instead, I suggest the following mode of thought:</p>
<ul>
<li>Find an existing framework that does most of what you require.</li>
<li>If the framework falls short, rethink your approach.</li>
<li>If you find your code has become a mess, re-factor it into a <strong>small</strong> library.</li>
</ul>
<p>Don&#8217;t be tempted to spend time writing a <strong>monolith</strong> of a framework. And beware the trap of thinking you can turn it into a product in itself; after all, there is a reason why a large proportion of frameworks are free.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/dont-write-that-framework/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Twackr: Twitter-style time tracking</title>
		<link>http://www.cuppadev.co.uk/projects/twackr-twitter-style-time-tracking/</link>
		<comments>http://www.cuppadev.co.uk/projects/twackr-twitter-style-time-tracking/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 15:02:09 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=718</guid>
		<description><![CDATA[It&#8217;s been a while since my last rails post, so i decided to try out something different. Specifically, i&#8217;ve always wanted to track my time, but i never seem to find a solution that works. The solution is either too simple and doesn&#8217;t give me any feedback, or it&#8217;s extremely complicated and hard to use. [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since my last rails post, so i decided to try out something different. </p>
<p>Specifically, i&#8217;ve always wanted to track my time, but i never seem to find a solution that works. The solution is either too simple and doesn&#8217;t give me any feedback, or it&#8217;s extremely complicated and hard to use.</p>
<p>So i set about to make a time tracking solution that was both ridiculously simple to use, and could give me some useful reports back. Thus, <a href="http://github.com/jamesu/twackr">Twackr</a> was born!</p>
<p><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/02/twackr-2-300x158.png" alt="" title="Twackr" width="300" height="158" class="alignnone size-thumbnail wp-image-720" /></p>
<p>I modelled the entry system after Twitter: at its simplest, all you need to do is type in what you are doing, and Twackr will start tracking your time instantly. When you are done, simply click on &#8220;Finish&#8221; and it will be done!</p>
<p>Already spent some time doing something but couldn&#8217;t get to Twackr? Then you can backdate entries by adding &#8220;<strong>-1H</strong>&#8220;. Still working on something? Then try &#8220;<strong>-1H+</strong>&#8220;. Blocking out some time? Then use &#8220;<strong>+1H</strong>&#8220;. Want to see if you&#8217;ll make the deadline? try typing &#8220;<strong>1H</strong>&#8220;.</p>
<p>Time can also be categorised into &#8220;Services&#8221; (<strong>#service</strong>) and &#8220;Projects&#8221; (<strong>@project</strong>). </p>
<p>You can check out a <a href="http://twackr.heroku.com/">live demo of twackr on heroku</a>. Just sign up, and check it out &#8211; it couldn&#8217;t be any simpler!</p>
<p>Like most of my other rails projects, Twackr is Open Source. So feel free to <a href="http://github.com/jamesu/twackr">fork it on github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/projects/twackr-twitter-style-time-tracking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More CSS Animations</title>
		<link>http://www.cuppadev.co.uk/hacks/more-css-animations/</link>
		<comments>http://www.cuppadev.co.uk/hacks/more-css-animations/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 20:31:28 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=711</guid>
		<description><![CDATA[A few days ago i popped across Anthony Calzadillas &#8220;Pure CSS3 AT-AT Walker&#8220;, which is a great application of using CSS3 Transforms and Animations to create a scene of an AT-AT Walker walking along in a simulated iPad. Anthony explains in great detail how he built the AT-AT, but i couldn&#8217;t help but think &#8220;I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago i popped across Anthony Calzadillas &#8220;<a href="http://anthonycalzadilla.com/css3-ATAT/index.html">Pure CSS3 AT-AT Walker</a>&#8220;, which is a great application of using CSS3 Transforms and Animations to create a scene of an AT-AT Walker walking along in a simulated iPad.</p>
<p>Anthony explains in great detail how he built the AT-AT, but i couldn&#8217;t help but think &#8220;I&#8217;ve got a better way of doing this!&#8221;. </p>
<p>Last year i made a <a href="http://www.cuppadev.co.uk/projects/css-transform-exporter-for-blender/">CSS Transform Exporter</a> for Blender, which can take any scene and generate a corresponding version in a nice and simple HTML page.</p>
<p>So it can take this:</p>
<p><a href="http://www.cuppadev.co.uk/wp-content/uploads/2010/02/atatblend.jpg"><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/02/atatblend-300x165.jpg" alt="atat in blender" title="atat in blender" width="300" height="165" class="alignnone size-thumbnail wp-image-712" /></a></p>
<p>And turn it into this:</p>
<p><a href="http://www.cuppadev.co.uk/wp-content/uploads/atat/atat.html"><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/02/atatwkit-251x200.jpg" alt="atat webkit" title="atat webkit" width="251" height="200" class="alignnone size-thumbnail wp-image-713" /></a></p>
<p>Admittedly simple, but it does show off the potential power in adopting CSS3 and HTML5. After all, who needs to use Flash when you can make everything work in actual web browser instead?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/hacks/more-css-animations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Ovi Store</title>
		<link>http://www.cuppadev.co.uk/platforms/the-ovi-store/</link>
		<comments>http://www.cuppadev.co.uk/platforms/the-ovi-store/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 01:08:49 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Platforms]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=693</guid>
		<description><![CDATA[As any mobile app developer knows, there comes a time when you need to release your creations out to the general public. On the iPhone, one has the App Store. On Android, the Android Market. On Nokia devices, the Ovi Store. Whenever i hear someone talk about the Ovi Store, they never have anything good [...]]]></description>
			<content:encoded><![CDATA[<p>As any mobile app developer knows, there comes a time when you need to release your creations out to the general public. On the iPhone, one has the App Store. On Android, the Android Market. On Nokia devices, the Ovi Store.</p>
<p>Whenever i hear someone talk about the Ovi Store, they never have <a href="http://www.techcrunch.com/2009/05/26/nokia-ovi-store-launch-is-a-complete-disaster/">anything good</a> <a href="http://shkspr.mobi/blog/index.php/2009/05/nokia-ovi-store-oh-dear/">to say</a> <a href="http://www.youtube.com/watch?v=UC8OC8XUZGg">about it</a>. Having not experienced the store myself, i remained skeptical.</p>
<p>Recently the Ovi Store on the <a href="http://maemo.nokia.com/n900/">Nokia N900</a> opened, so naturally i decided to check it out and see if it really was as bad as people suggested. What follows are my experiences, illustrated with accompanying screenshots.</p>
<h3>To Start</h3>
<p><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/01/ovi1-300x180.png" alt="Start Page" title="Start Page" width="300" height="180" class="alignnone size-thumbnail wp-image-694" /></p>
<p>First i tap on the &#8220;Ovi Store&#8221; icon on my device. After a short while, a <strong>web browser</strong> opens in fullscreen mode. So far, not bad.</p>
<p>Not sure what i want to do, i tap around the tabs (each <strong>loading a new page</strong>). Now i realise: i just saw something interesting on the last page, and want to see it again. But how do i go back? Well first i need to exit fullscreen mode. Next, i need to tap the back button. Then from the history list which appears:<br />
<img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/01/ovi2-300x180.png" alt="Browser History" title="Browser History" width="300" height="180" class="alignnone size-thumbnail wp-image-695" /></p>
<p>I must then select the previous slide. <strong>*THEN*</strong> if i am really unlucky, i get to see the page <strong>load again</strong>.</p>
<p>Now i decide i want to download a game, so i tap on the &#8220;Games&#8221; tab. The &#8220;Games&#8221; page <strong>loads</strong>, showing:</p>
<p><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/01/ovi3-300x180.png" alt="App List" title="App List" width="300" height="180" class="alignnone size-thumbnail wp-image-696" /></p>
<p>So now i think &#8220;I&#8217;ll try and download Angry Birds.&#8221; Herein lies a puzzling problem. <strong>Nothing happens</strong>. A few more taps, and the browser <strong>zooms in</strong>. Finally after a bit more tapping, i manage to get it to recognise i selected the app. The &#8220;Angry Birds&#8221; page loads.</p>
<p><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/01/ovi4-300x180.png" alt="Angry Birds Page" title="Angry Birds Page" width="300" height="180" class="alignnone size-thumbnail wp-image-697" /></p>
<p>Ok, so &#8220;Download&#8221;. But first i need to <strong>sign up</strong> for an Ovi Account!</p>
<p><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/01/ovi5-300x180.png" alt="OVI Signup" title="OVI Signup" width="300" height="180" class="alignnone size-thumbnail wp-image-698" /></p>
<p>After filling out all the forms, i get a &#8220;Thanks for signing up&#8221; page. By this time, i&#8217;ve <strong>all but forgotten</strong> what app i was going to purchase. </p>
<p><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/01/ovi2-300x180.png" alt="Browser History" title="Browser History" width="300" height="180" class="alignnone size-thumbnail wp-image-695" /></p>
<p>What would come in handy here would be&#8230; i don&#8217;t know, some sort of &#8220;Click here to continue your purchase&#8221; button perhaps? Instead, i have to use&#8230; the <strong>back button</strong>.</p>
<p>Finally, i tap the download button again. This time it loads the &#8220;Application Manager&#8221;, which after a while asks me if i want to continue installing &#8220;Angry Birds.&#8221;</p>
<p><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/01/ovi6-300x180.png" alt="App Download" title="App Download" width="300" height="180" class="alignnone size-thumbnail wp-image-699" /></p>
<p>At last, the app is installed. Eager to run it, i looked in my applications list, but couldn&#8217;t find it. Until i looked closer&#8230;</p>
<p><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/01/ovi6.7-300x180.jpg" alt="Find The App" title="Find The App" width="300" height="180" class="alignnone size-thumbnail wp-image-701" /></p>
<p>Yes, Angry Birds is represented by&#8230; a <strong>blue box</strong>.</p>
<p>Thankfully though, the app ran fine.</p>
<p><img src="http://www.cuppadev.co.uk/wp-content/uploads/2010/01/ovi7-300x180.png" alt="Running" title="Running" width="300" height="180" class="alignnone size-thumbnail wp-image-700" /></p>
<p>All in all, i found the experience of downloading my free app to be unnecessarily frustrating. I can&#8217;t help but feel that nobody was really thinking when they designed the Ovi Store. From the constant page reloading, to the confusing appearance of the app on the device itself. I&#8217;d dread to think what would happen if i tried to buy an app.</p>
<p>I can safely say that currently the criticisms i have heard of the Ovi Store are well founded.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/platforms/the-ovi-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Transform Exporter for Blender</title>
		<link>http://www.cuppadev.co.uk/projects/css-transform-exporter-for-blender/</link>
		<comments>http://www.cuppadev.co.uk/projects/css-transform-exporter-for-blender/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 18:39:38 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=684</guid>
		<description><![CDATA[Following on from Creating CSS Animations, i have decided to release the exporter script used to create the animated orange test guy. As the title implies, the exporter script runs in Blender. Simply construct a 2D scene using planes, add in an animation track, run the script and click Export. It&#8217;s as simple as that! [...]]]></description>
			<content:encoded><![CDATA[<p>Following on from <a href="http://www.cuppadev.co.uk/projects/creating-css-animations/">Creating CSS Animations</a>, i have decided to release the exporter script used to create the animated orange test guy.</p>
<p>As the title implies, the exporter script runs in Blender. Simply construct a 2D scene using planes, add in an animation track, run the script and click Export. It&#8217;s as simple as that!</p>
<p>Each plane is exported as a HTML DIV. If present, any Ipos will be exported as CSS keyframes.  </p>
<p>The exporter even supports parenting, so you can build up complex hierarchies of elements which can easily be transformed in an animation, or even javascript.</p>
<p>Note that currently the exporter only supports Webkit-based browsers (i.e. Chrome, Safari, MobileSafari). It also has limited support for Firefox (sans animations).</p>
<p>For the curious, there are 3 examples:</p>
<ul>
<li><a href="http://www.cuppadev.co.uk/wp-content/uploads/2009/12/walk.html">Walking Orange Guy</a></li>
<li><a href="http://www.cuppadev.co.uk/wp-content/uploads/2009/12/transformTest.html">Transform Test (not animated)</a></li>
<li><a href="http://www.cuppadev.co.uk/wp-content/uploads/2009/12/testImage.html">Animated Image</a></li>
</ul>
<p>As for the actual exporter script, it&#8217;s <a href="http://github.com/jamesu/csstransformexport">available on github</a>.</p>
<p>Happy animating!</p>
<p><strong>EDIT</strong>: For those of you who for whatever reason want a video demonstration, there&#8217;s a video of it in action <a href="http://www.youtube.com/watch?v=rie9glkrFKo">on youtube</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/projects/css-transform-exporter-for-blender/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Thumbnails and Palettes in glgif</title>
		<link>http://www.cuppadev.co.uk/iphone/thumbnails-and-palettes-in-glgif/</link>
		<comments>http://www.cuppadev.co.uk/iphone/thumbnails-and-palettes-in-glgif/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 23:52:32 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=664</guid>
		<description><![CDATA[Recently i incorporated support for creating thumbnails in glgif, the backend gif animation library used in Anim8gif. Rather than taking the easy route out and attempting to load the gif using UIImage, i decided to take advantage of glgif&#8217;s decode routines to create an accurate representation of the current state of the gif playback. Put [...]]]></description>
			<content:encoded><![CDATA[<p>Recently i incorporated support for creating thumbnails in <a href="http://github.com/jamesu/glgif">glgif</a>, the backend gif animation library used in <a href="http://itunes.com/apps/anim8gif">Anim8gif</a>.</p>
<p>Rather than taking the easy route out and attempting to load the gif using UIImage, i decided to take advantage of glgif&#8217;s decode routines to create an accurate representation of the current state of the gif playback. </p>
<p>Put simply, i took the palette texture which is generated for display, and decoded it into a new UIImage.</p>
<p>The actual process is triggered by assigning a delegate (thumbDelegate), which will be invoked when the next frame in the gif is decoded. The delegate is then cleared.</p>
<p>Simple, right?</p>
<h3>More Technical Details</h3>
<p>The format of a palette texture in GLES is as follows:</p>
<table style="border: 2px solid grey;">
<tr>
<td style="border: 2px solid black;padding: 3px;">Palette (16 or 256 entries)</td>
<td style="border: 2px solid black;padding: 3px;">Indexed Pixels (4bit or 8bit)</td>
</tr>
</table>
<p>The palette can either be 16 or 256 entries long, depending on the format you use. Likewise the pixel data will either use 4 bits or 8 bits. To keep things simple, glgif uses an 8bit palette with 3 8bit entries for the color (<strong>GL_PALETTE8_RGB8_OES</strong>).</p>
<p>(Note that an 8bit palette can be insufficient as a gif can actually display more than 256 colours across multiple frames, but this is a necessary trade-off for speed)</p>
<p>So in order to decode it:</p>
<ol>
<li>Read and decode the palette</li>
<li>Decode each pixel as an index into the palette</li>
<li>Using the decoded pixel data, create a new CoreGraphics bitmap context (using <strong>CGBitmapContextCreate</strong>)</li>
<li>Convert the bitmap context into a UIImage (using <strong>CGBitmapContextCreateImage</strong> and <strong>[UIImage imageWithCGImage:]</strong>)</li>
</ol>
<p>The resultant UIImage can then easily be used as a base to generate a sized down thumbnail of the gif, as illustrated below.</p>
<p><img src="http://www.cuppadev.co.uk/wp-content/uploads/2009/12/ex-thumbnails.png" alt="Example gif thumbnail" title="Example gif thumbnail" width="320" height="480" class="alignnone size-full wp-image-665" /></p>
<p>As always, the code for glgif is <a href="http://github.com/jamesu/glgif">hosted on github</a>, so feel free to check it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/iphone/thumbnails-and-palettes-in-glgif/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating CoreAnimation Animations</title>
		<link>http://www.cuppadev.co.uk/projects/creating-coreanimation-animations/</link>
		<comments>http://www.cuppadev.co.uk/projects/creating-coreanimation-animations/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 16:58:22 +0000</pubDate>
		<dc:creator>James Urquhart</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[problem solving]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.cuppadev.co.uk/?p=659</guid>
		<description><![CDATA[Moving on from Creating CSS Animations, i thought &#8220;How can i make this exporter more useful?&#8221;. The answer is of course to completely remove Webkit from the equation, which leaves us with CoreAnimation. The end result being that the animation can be directly compiled into an iPhone or Mac OS X application. Not going into [...]]]></description>
			<content:encoded><![CDATA[<p>Moving on from <a href="http://www.cuppadev.co.uk/projects/creating-css-animations/">Creating CSS Animations</a>, i thought <em>&#8220;How can i make this exporter more useful?&#8221;</em>.</p>
<p>The answer is of course to completely remove Webkit from the equation, which leaves us with CoreAnimation. The end result being that the animation can be directly compiled into an iPhone or Mac OS X application.</p>
<p>Not going <a href="http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/mac/GraphicsLayerCA.mm">into much detail</a>, <a href="http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/CoreAnimation_guide/Articles/WhatisCoreAnimation.html">CoreAnimation</a> is essentially the library used by Webkit to display and animate any elements which have been transformed by a CSS Transform.</p>
<p>The actual scene is simply constructed using transformed <strong>CALayers</strong>. As for the animation, a <strong>CAKeyframeAnimation</strong> is created and attached to each <strong>CALayer</strong>. In the case of multiple properties being animated at the same time, a <strong>CAAnimationGroup</strong> is used to group these animations together.</p>
<p>The end result is a handy animation class which creates both the scene and the related animation tracks. i.e.:</p>
<pre><code>
    CALayer *root = [self.view layer];

    // Make anim
    MyAnim *anim = [[MyAnim alloc] init];
    CALayer *animRoot = anim.root;
    [root addSublayer:animRoot];

    [anim play]; // easy!
</code></pre>
<p>As an example, the MyAnim class for the previously featured walking orange figure is as follows.</p>
<p><script src="http://gist.github.com/242862.js?file=Walking+CoreAnimation+Guy.m"></script></p>
<p>Which leads onto a repeat of the question, is there a real-world demand for such a tool yet?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cuppadev.co.uk/projects/creating-coreanimation-animations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
