<?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>soledad penadés &#187; c</title>
	<atom:link href="http://soledadpenades.com/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://soledadpenades.com</link>
	<description>repeat 4[fd 100 rt 90]</description>
	<lastBuildDate>Sun, 29 Jan 2012 23:03:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Misclinklanea, 2</title>
		<link>http://soledadpenades.com/2010/09/11/misclinklanea-2/</link>
		<comments>http://soledadpenades.com/2010/09/11/misclinklanea-2/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 20:38:32 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Misclinklanea]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[live wallpapers]]></category>
		<category><![CDATA[ndk]]></category>
		<category><![CDATA[opengov]]></category>
		<category><![CDATA[renderscript]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wi-fi]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=2899</guid>
		<description><![CDATA[Broadcom open source their wireless drivers. YES! The driver, while still a work in progress, is released as full source and uses the native mac80211 stack. It supports multiple current chips (BCM4313, BCM43224, BCM43225) as well as providing a framework for supporting additional chips in the future, including mac80211-aware embedded chips. Having working, native drivers [...]]]></description>
			<content:encoded><![CDATA[<p>Broadcom <a href="http://thread.gmane.org/gmane.linux.kernel.wireless.general/55418">open source their wireless drivers</a>. YES!</p>
<blockquote><p>The driver, while still a work in progress, is released as full source and uses the<br />
native mac80211 stack.   It supports multiple current chips (BCM4313, BCM43224, BCM43225) as well as providing a framework for supporting additional chips in the future, including mac80211-aware embedded chips.</p></blockquote>
<p>Having working, native drivers without nasty work-arounds is an excellent news for me &#8211;now I can recommend Linux even more strongly to people who complain about Windows XP. They won&#8217;t get blocked by a non-working wi-fi driver right after wubi does its marvellous job.</p>
<p>Also, it makes the experience of getting new hardware in the future a tad more relaxed. Less problems to worry about :-)</p>
<p>One note of warning before you all jump into the closest LiveCD: it seems the drivers are only for relatively new hardware; older chips will still require the nasty b43-fwcutter technique in order to get a semiworking driver:</p>
<blockquote><p>This is limited to newer chips. Can you at least authorize redistribution of firmware blobs for older chips so that b43-fwcutter won&#8217;t be needed anymore? I have such a laptop myself with one of the older chips, and I remember the pains of having to download it after booting from a LiveCD. <a href="http://thread.gmane.org/gmane.linux.kernel.wireless.general/55418">#</a></p></blockquote>
<p>~</p>
<p>UK Government are asking the public their opinion on <a href="http://innovate.direct.gov.uk/blog/open-source-software-licensing">the most suitable open source license</a> for government-funded projects. Some commenters suggest MIT/BSD, upon the basis that anything GPL will prevent private/closed initiatives from taking part due to their companies&#8217; policies against anything &#8216;GPL viral&#8217;, but I think that&#8217;s silly. Anything government funded belongs to us (the people and the companies); if you use something <em>public</em>, the least you can do is return <em>something</em> to the public. GPL all the way in my opinion.</p>
<p>I wonder when will we see something similar in Spain. There have been several government-sponsored Linux distributions but it looked more like branding and theming and less about developing actual software. Hmm&#8230;</p>
<p>~</p>
<p><a href="http://parlvid.mysociety.org:81/os/">mySociety&#8217;s cached Ordenance Survey open data</a> (from public sources). Includes postcode information, amongst others.</p>
<p><a href="http://www.mysociety.org/">mySociety</a> are cool.</p>
<p>~</p>
<p>Has anyone noticed that <a href="http://petitions.number10.gov.uk/">Number 10&#8242;s petitions website</a> has been suspended until further notice?</p>
<blockquote><p>Existing e-petitions, submitted to the previous administration, will not be carried forward to the new administration as part of this process. E-petitions that were live at the time of the election announcement on 6 April, when the e-petitions system was suspended, will therefore not be reopened for signatures. We are issuing responses to petitions that had exceeded the 500 signatures threshold as of 6 April 2010 and these can be viewed on the HMG e-petitions responses page.</p>
<p>We will welcome resubmission on issues of concern to the improved e-petitions system when it is launched later in 2010.</p></blockquote>
<p>Later in 2010? Like&#8230; now?</p>
<p>~</p>
<p><a href="http://developer.android.com/resources/dashboard/platform-versions.html">Android platform versions chart</a>. Quite interesting. I thought there would be a majority of devices running 1.6 or older versions of the system, but it seems that 2.x devices are dominant. Which is good if you want to do things like live wallpapers (although it seems that some 2.1 capable devices such as <a href="http://en.wikipedia.org/wiki/HTC_Legend">HTC Legend</a><a href="http://twitter.com/anhelido/status/21932748807"> can not run live wallpapers</a>, which is odd!)</p>
<p>~</p>
<p><a href="http://documentcloud.github.com/underscore/">Underscore</a>, a functional programming library for JavaScript, <q>without extending any of the built-in JavaScript objects</q>. Example from their docs:</p>
<div class="syhi_block"><code><span style="color: #003366; font-weight: bold;">var</span> lyrics <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span>line <span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> words <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;I'm a lumberjack and I'm okay&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; <span style="color: #009900;">&#123;</span>line <span style="color: #339933;">:</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> words <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;I sleep all night and I work all day&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; <span style="color: #009900;">&#123;</span>line <span style="color: #339933;">:</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">,</span> words <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;He's a lumberjack and he's okay&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; <span style="color: #009900;">&#123;</span>line <span style="color: #339933;">:</span> <span style="color: #CC0000;">4</span><span style="color: #339933;">,</span> words <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;He sleeps all night and he works all day&quot;</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
_<span style="color: #009900;">&#40;</span>lyrics<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">chain</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; .<span style="color: #660066;">map</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> line.<span style="color: #660066;">words</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; .<span style="color: #660066;">flatten</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; .<span style="color: #660066;">reduce</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>counts<span style="color: #339933;">,</span> word<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; counts<span style="color: #009900;">&#91;</span>word<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>counts<span style="color: #009900;">&#91;</span>word<span style="color: #009900;">&#93;</span> <span style="color: #339933;">||</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> counts<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></code></div>
<p>Might be useful.</p>
 <p><a href="http://soledadpenades.com/?flattrss_redirect&amp;id=2899&amp;md5=d801ec96a1b0c6ecba19ba21bc514523" title="Flattr" target="_blank"><img src="http://soledadpenades.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2010/09/11/misclinklanea-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A nosy look into LiveWallpapers.apk</title>
		<link>http://soledadpenades.com/2010/09/10/a-nosy-look-into-livewallpapers-apk/</link>
		<comments>http://soledadpenades.com/2010/09/10/a-nosy-look-into-livewallpapers-apk/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 23:38:04 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[live wallpapers]]></category>
		<category><![CDATA[ndk]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[shaders]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=2910</guid>
		<description><![CDATA[It first seemed that the Galaxy wallpaper was implemented in C + OpenGL (with Java calls, of course). From our tests, using Canvas was not an option, since there were just too many particles for poor humble Canvas. And it also looked like it was using the NDK, I thought upon reading this post. Then [...]]]></description>
			<content:encoded><![CDATA[<p>It first seemed that the Galaxy wallpaper was implemented in C + OpenGL (with Java calls, of course). From our tests, using Canvas was not an option, since there were just too many particles for poor humble Canvas.</p>
<p>And it also looked like it was using the NDK, I thought upon reading this <a href="http://forum.xda-developers.com/showpost.php?p=5304616&#038;postcount=9">post</a>. </p>
<p>Then somebody at that forum suggested they are implemented with Processing, which made me kind of laugh internally. But the very same source he used (Romain Guy&#8217;s blog post about <a href="http://www.curious-creature.org/2010/01/07/nexus-one-live-wallpapers/">live wallpapers</a>) denies that and gives some details about the Android implementation:</p>
<p><span id="more-2910"></span></p>
<blockquote><p>The prototypes are written in Processing. I did port Processing to Android to run live wallpapers and performance was not on par with what we wanted, so we implemented something called RenderScript <a href="http://www.curious-creature.org/2010/01/07/nexus-one-live-wallpapers/comment-page-1/#comment-3125">#</a></p></blockquote>
<p>Digging deeper, I downloaded the <strong>/system/apps/LiveWallpaper.apk</strong> file from the phone to my computer (using the DDMS perspective from within Eclipse), uncompressed it (it&#8217;s a ZIP file in disguise) and inspected its contents to see if I could locate where was the code the guy in the first post shown. And I indeed could :-)</p>
<p>The .rs files (for &#8220;RenderScript&#8221;, I deduct) are all in <strong>res/raw</strong>. They have names such as galaxy.rs, grass.rs, nexus.rs and so on. And they look like this:</p>
<div class="syhi_block"><code><span style="color: #339933;">#pragma version(1)</span><br />
<span style="color: #339933;">#pragma stateVertex(PVBkOrtho)</span><br />
<span style="color: #339933;">#pragma stateRaster(parent)</span><br />
<span style="color: #339933;">#pragma stateFragment(PFBackground)</span><br />
<span style="color: #339933;">#pragma stateStore(PFSBackground)</span><br />
<br />
<span style="color: #339933;">#define ELLIPSE_RATIO 0.892f</span><br />
<br />
<span style="color: #339933;">#define PI 3.1415f</span><br />
<span style="color: #339933;">#define TWO_PI 6.283f</span><br />
<span style="color: #339933;">#define ELLIPSE_TWIST 0.023333333f</span><br />
<br />
<span style="color: #993333;">float</span> angle<span style="color: #339933;">;</span><br />
<br />
<span style="color: #808080; font-style: italic;">/**<br />
&nbsp;* Script initialization. Called automatically.<br />
&nbsp;*/</span><br />
<span style="color: #993333;">void</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; angle <span style="color: #339933;">=</span> <span style="color:#800080;">50.0f</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #808080; font-style: italic;">/**<br />
&nbsp;* Helper function to generate the stars.<br />
&nbsp;*/</span><br />
<span style="color: #993333;">float</span> randomGauss<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #993333;">float</span> x1<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #993333;">float</span> x2<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #993333;">float</span> w <span style="color: #339933;">=</span> <span style="color: #0000dd;">2</span>.<span style="color: #202020;">f</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>w <span style="color: #339933;">&gt;=</span> <span style="color:#800080;">1.0f</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; x1 <span style="color: #339933;">=</span> <span style="color:#800080;">2.0f</span> <span style="color: #339933;">*</span> randf2<span style="color: #009900;">&#40;</span><span style="color:#800080;">0.0f</span><span style="color: #339933;">,</span> <span style="color:#800080;">1.0f</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color:#800080;">1.0f</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; x2 <span style="color: #339933;">=</span> <span style="color:#800080;">2.0f</span> <span style="color: #339933;">*</span> randf2<span style="color: #009900;">&#40;</span><span style="color:#800080;">0.0f</span><span style="color: #339933;">,</span> <span style="color:#800080;">1.0f</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color:#800080;">1.0f</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; w <span style="color: #339933;">=</span> x1 <span style="color: #339933;">*</span> x1 <span style="color: #339933;">+</span> x2 <span style="color: #339933;">*</span> x2<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; w <span style="color: #339933;">=</span> sqrtf<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color:#800080;">2.0</span> <span style="color: #339933;">*</span> logf<span style="color: #009900;">&#40;</span>w<span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> w<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> x1 <span style="color: #339933;">*</span> w<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #993333;">float</span> gSpeed<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">12000</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #808080; font-style: italic;">/**<br />
&nbsp;* Generates the properties for a given star.<br />
&nbsp;*/</span><br />
<span style="color: #993333;">void</span> createParticle<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> Particles_s <span style="color: #339933;">*</span>part<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> idx<span style="color: #339933;">,</span> <span style="color: #993333;">float</span> scale<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #993333;">float</span> d <span style="color: #339933;">=</span> fabsf<span style="color: #009900;">&#40;</span>randomGauss<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> State<span style="color: #339933;">-&gt;</span>galaxyRadius <span style="color: #339933;">*</span> <span style="color:#800080;">0.5f</span> <span style="color: #339933;">+</span> randf<span style="color: #009900;">&#40;</span><span style="color:#800080;">64.0f</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #993333;">float</span> id <span style="color: #339933;">=</span> d <span style="color: #339933;">/</span> State<span style="color: #339933;">-&gt;</span>galaxyRadius<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #993333;">float</span> z <span style="color: #339933;">=</span> randomGauss<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color:#800080;">0.4f</span> <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span><span style="color:#800080;">1.0f</span> <span style="color: #339933;">-</span> id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #993333;">float</span> p <span style="color: #339933;">=</span> <span style="color: #339933;">-</span>d <span style="color: #339933;">*</span> ELLIPSE_TWIST<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #993333;">int</span> r<span style="color: #339933;">,</span>g<span style="color: #339933;">,</span>b<span style="color: #339933;">,</span>a<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>d <span style="color: #339933;">&lt;</span> State<span style="color: #339933;">-&gt;</span>galaxyRadius <span style="color: #339933;">*</span> <span style="color:#800080;">0.33f</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; r <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">220</span> <span style="color: #339933;">+</span> id <span style="color: #339933;">*</span> <span style="color: #0000dd;">35</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; g <span style="color: #339933;">=</span> <span style="color: #0000dd;">220</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; b <span style="color: #339933;">=</span> <span style="color: #0000dd;">220</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; r <span style="color: #339933;">=</span> <span style="color: #0000dd;">180</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; g <span style="color: #339933;">=</span> <span style="color: #0000dd;">180</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; b <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span><span style="color: #009900;">&#41;</span> clampf<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">140</span>.<span style="color: #202020;">f</span> <span style="color: #339933;">+</span> id <span style="color: #339933;">*</span> <span style="color: #0000dd;">115</span>.<span style="color: #202020;">f</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">140</span>.<span style="color: #202020;">f</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">255</span>.<span style="color: #202020;">f</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Stash point size * 10 in Alpha</span><br />
&nbsp; &nbsp; a <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span>randf2<span style="color: #009900;">&#40;</span><span style="color:#800080;">1.2f</span><span style="color: #339933;">,</span> <span style="color:#800080;">2.1f</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #0000dd;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; part<span style="color: #339933;">-&gt;</span>color <span style="color: #339933;">=</span> r <span style="color: #339933;">|</span> g<span style="color: #339933;">&lt;&lt;</span><span style="color: #0000dd;">8</span> <span style="color: #339933;">|</span> b<span style="color: #339933;">&lt;&lt;</span><span style="color: #0000dd;">16</span> <span style="color: #339933;">|</span> a<span style="color: #339933;">&lt;&lt;</span><span style="color: #0000dd;">24</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>d <span style="color: #339933;">&gt;</span> State<span style="color: #339933;">-&gt;</span>galaxyRadius <span style="color: #339933;">*</span> <span style="color:#800080;">0.15f</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; z <span style="color: #339933;">*=</span> <span style="color:#800080;">0.6f</span> <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span><span style="color:#800080;">1.0f</span> <span style="color: #339933;">-</span> id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; z <span style="color: #339933;">*=</span> <span style="color:#800080;">0.72f</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Map to the projection coordinates (viewport.x = -1.0 -&gt; 1.0)</span><br />
&nbsp; &nbsp; d <span style="color: #339933;">=</span> mapf<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color:#800080;">4.0f</span><span style="color: #339933;">,</span> State<span style="color: #339933;">-&gt;</span>galaxyRadius <span style="color: #339933;">+</span> <span style="color:#800080;">4.0f</span><span style="color: #339933;">,</span> <span style="color:#800080;">0.0f</span><span style="color: #339933;">,</span> scale<span style="color: #339933;">,</span> d<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; part<span style="color: #339933;">-&gt;</span>position.<span style="color: #202020;">x</span> <span style="color: #339933;">=</span> randf<span style="color: #009900;">&#40;</span>TWO_PI<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; part<span style="color: #339933;">-&gt;</span>position.<span style="color: #202020;">y</span> <span style="color: #339933;">=</span> d<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; gSpeed<span style="color: #009900;">&#91;</span>idx<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> randf2<span style="color: #009900;">&#40;</span><span style="color:#800080;">0.0015f</span><span style="color: #339933;">,</span> <span style="color:#800080;">0.0025f</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span><span style="color:#800080;">0.5f</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>scale <span style="color: #339933;">/</span> d<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color:#800080;">0.8f</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; part<span style="color: #339933;">-&gt;</span>position.<span style="color: #202020;">z</span> <span style="color: #339933;">=</span> z <span style="color: #339933;">/</span> <span style="color:#800080;">5.0f</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// etc</span></code></div>
<p>It might be <em>baptised</em> as RenderScript but it no doubt smells like C from a couple of miles away: #pragma&#8217;s, #define&#8217;s, struct&#8217;s and -&gt;&#8217;s for pointing to members? You can&#8217;t help thinking it&#8217;s C, no matter how hard you try.</p>
<p>More deductions: either this RenderScript uses a gcc compiler in the very phone (not <em>that unlikely</em> since it&#8217;s a Linux system after all?) or it parses the contents of the script on loading time. Then it&#8217;s &#8220;just&#8221; a wrapper for OpenGL calls and generally cumbersome stuff such as preparing textures, vertex shaders etc (I can see something related to vertex shaders in the galaxy wallpaper, for example).</p>
<p>I&#8217;ve copy-pasted the full <a href="http://gist.github.com/574518">galaxy.rs source code</a> into a gist, just in case you want to see the whole thing but don&#8217;t have a phone and a DDMS environment handy :-)</p>
 <p><a href="http://soledadpenades.com/?flattrss_redirect&amp;id=2910&amp;md5=bb52c65d0de20134aefe093a9704bfba" title="Flattr" target="_blank"><img src="http://soledadpenades.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2010/09/10/a-nosy-look-into-livewallpapers-apk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>to_the_beat sources + introducing sorollet</title>
		<link>http://soledadpenades.com/2009/02/23/to_the_beat-sources-introducing-sorollet/</link>
		<comments>http://soledadpenades.com/2009/02/23/to_the_beat-sources-introducing-sorollet/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 21:11:00 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[64k intro]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[demoscene]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[real time]]></category>
		<category><![CDATA[sorollet]]></category>
		<category><![CDATA[sound synthesis]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=887</guid>
		<description><![CDATA[I have just set up a page for to_the_beat, the 64k intro I released at past euskal 16. Since the intro graphics are quite basic, I decided to focus on the software synth the intro uses (sorollet) instead and reveal some of its not very complicated secrets. The sources of the intro and synth are [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/imgs/to_the_beat01.png" alt="to_the_beat" /></p>
<p>I have just set up a page for <a href="http://soledadpenades.com/projects/demoscene/to_the_beat/">to_the_beat</a>, the 64k intro I released at past euskal 16.</p>
<p>Since the intro graphics are quite basic, I decided to focus on the software synth the intro uses (<em>sorollet</em>) instead and reveal some of its not very complicated secrets.</p>
<p>The sources of the intro and synth are also available so that you can learn what <em>NOT</em> to do when coding real time stuff ;-)</p>
<p>Joking aside, if you want to see the source of a small software synth, this might be useful, since I haven&#8217;t optimised it too much and it&#8217;s still pretty readable I think.</p>
<p>Let&#8217;s see what happens in future versions&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2009/02/23/to_the_beat-sources-introducing-sorollet/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Improving mesh subdivision</title>
		<link>http://soledadpenades.com/2004/04/19/improving-mesh-subdivision/</link>
		<comments>http://soledadpenades.com/2004/04/19/improving-mesh-subdivision/#comments</comments>
		<pubDate>Mon, 19 Apr 2004 10:44:16 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[demoscene]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[mesh subdivision]]></category>
		<category><![CDATA[opengl]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Well, I have found the mysterious bug that we always have when we code something. The mesh subdivision algorithm is recursive, as you could imagine viewing the images. In each pass, it divides each face in three more faces. So we have the old face and two new ones, and then we assign the appropriate [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I have found the mysterious bug that we always have when we code something. The mesh subdivision algorithm is recursive, as you could imagine viewing the images. In each pass, it divides each face in three more faces. So we have the old face and two new ones, and then we assign the appropriate vertices to each face. In the next iteration we have to subdivide too the faces we had created previously, but I had forgotten to change the <em>maximumFaces</em> index, so it didn&#8217;t divide properly. As you can see in the next images, I have fixed it!! :-)</p>
<p>Mesh subdivision with 2 passes<br />
<img alt="mesh subdivision 2 passes (fixed)" src="http://www.soledadpenades.com/imgs/mesh_sdv_2passes_fixed_lw.png" /></p>
<p>Mesh subdivision with 3 passes<br />
<img alt="mesh subdivision 3 passes (fixed)" src="http://www.soledadpenades.com/imgs/mesh_sdv_3passes_fixed_lw.png" /></p>
<p>Mesh subdivision with 5 passes<br />
<img alt="mesh subdivision 5 passes (fixed)" src="http://www.soledadpenades.com/imgs/mesh_sdv_5passes_fixed_lw.png" /></p>
<p>Next step is playing with the vertices! ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2004/04/19/improving-mesh-subdivision/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

