Artsy fartsy

I've been working on a few functions for rendering onto tiles recently. Yesterday was the turn of a rectangle filler. The traditional routine of double-looping over a pixel-plotter would be slow in every case, but for tiled surfaces it's positively evil, so I made something that divides the rectangle in 5 areas and fills them using by words or better. Yes, this is a little tricky but I figured the speed increase of up to 300 would be worth it.

For testing purposes, I filled each region with a different color so that ifwhen something went wrong, I could easily identify the problem. When playing around with the test app, I more or less accidentally came up with this:

accidental mondriaan

Hmmm ... Mondriaany.

Anyway, it seems that this thing went alright. So now tonclib also has plot, hline, vline, line, rect and frame functions for 4bpp tiled modes. No, there's no blitting yet. In anyone wants that, I'm going to insist on some mental hazard pay.

grit 0.8

It's time for another Grit release. There are three important changes compared to previous versions.

First, palette merging is in (and there was much rejoicing). If you use the -pS option, a shared palette will be created and used in the graphics. Note that I still think palette merging should be performed on the images themselves and not in the output phase. If anyone's interested, I do have a small app that can do just this.

Another big change is that handling of shared data is now done correctly. The previous version required two runs for this: one for the non-shared stuff, and then another for the tileset itself. You also had to take care to disable the shared item for the individual runs, otherwise the (useless) intermediates would be exported as well. Grit 0.8 fixes all this. You can provide multiple images and request a shared tileset and/or palette (with -pS, -gS, or -fx) and it should work right. Grit will export the individual parts first and save exporting the shared data for the end. For example, if you have 5 files to be converted to maps with a shared tileset, you'll get 5 maps, and one tileset and palette (instead of 5 of each like 0.7 did). You can tune the shared output names with -S and -O (uppercase s and o) if necessary.

Thirdly, there is a new binary file-type available. I'm calling it GRF, for Grit RIFF File. This places the graphics, maps and palette in RIFF chunks. The idea behind this was to have related data in a single file instead of three different binaries. The chunked data-format also allows easier extension and it's easy to make a generic loader for it too. For details (including such a loader), see the the manual. The -ftr option creates a GRF file, and you can also create GRF-formatted C/asm arrays using -fr.

I've also added something I like to call ‘fake’ compression, -Z0 (Z zero). This adds a header word to the data similar to the ones that the compressed data have. This consistency of data-formats is essential for the generic data-loader.


As I mentioned before, there is also a proper demo project to show how you can use grit and its various options. Take note of how it uses a separate makefile to prepare the graphics. This way you can keep the main makefile pretty clean and it makes it easier to insert customized conversion rules. Note: to build the demo project, make sure GRIT points to the updated binary.


Linkies

And this year^Hdecade's award for irony goes to ...

Expelled : No intelligence allowed! Give them a hearty round of scorn and ridicule, folks.


OK, perhaps a bit of backstory is in order here.

There's this strange thing going on in the USA known as the Creation-evolution controversy. In a nutshell, on one side you have the Theory of Evolution, accepted by all but a fraction of the scientists and supported by evidence from multiple fields; and on the other you have groups (usually motivated by their religion or ignorance and frequently both) screaming “nuh-uh!”, backed up by arguments ranging from utterly insane, to fabrications, misunderstandings, red herrings, and “I dunno, Magic Man dun it”. No, I'm not embellishing here: there are long lists of creationists claims that often make no sense at all, but are still used even after being debunked decades ago. As an example how silly these can be, consider the Banana argument. And no, this is not a parody; they're absolutely serious.

After the scientists got so fed up by the constant misrepresentations that they won't even debate anymore and several defeats in courts, the creationists came up with a new strategy: Intelligent Design (ID). They've been quite clever with this, actually. For one, they're leaving the Bible out of it and claiming that life's complexity can only come about through an intelligent, yet unnamed (wink, wink), designer. They also claim that all they want is a fair hearing; that the scientists are being mean with their insistence on evidence and refusal to accept bogus reasoning.


Enter Expelled. You'd have to read the wikipedia page for details, but the idea behind the movie is to highlight this repression by scientists; that the evolutionists are actively ‘expelling’ people critical of evolution. It so happens that they've interviewed a number of evolutionary biologists (under false pretenses) for their views on the subject. This is now widely regarded as a bad move.

You see, one of them happened to be PZ Myers, a vocal critic of creationism and other irrationality on his blog pharyngula. You can see how hostile he is in this video (I'd point to the Expelled trailers with the interview, but they pulled it). Ever since the interview, he and other science-bloggers have been keeping an eye on the movie, pointing out flaws in the producers' arguments whenever they went public with anything.

And now it gets interesting. About two weeks ago, there was a screening of the movie in Minneapolis. He reserved a place via their website, went to the theatre … but was barred from entering. To spell it out: here's a movie accusing evolutionists of expelling their critics, expelling their critics. And then lying about it afterwards! Repeatedly! Seriously, you just can't make this stuff up.

Naturally, this is now all over the blogosphere. The original account has well over 1600 comments. Many other science bloggers have commented on it as well. Greg Laden's blog has a list of over 100 links, including to stories from the NY Times and Salon. Another interesting detail is that Myers was accompanied by Richard Dawkins (yes, that Richard Dawkins), who did get in. The two had a nice little discussion afterwards, which can be seen here.


Other interesting links