Sunday, April 27, 2008

Day 87

And now for something completely different!

Kuiper is working on Windows. I don't know what, exactly, got me started on the idea, but I began today idly trying to get Rubygame to build on Windows. I followed along with the wiki instructions and made some minor changes. The biggest problem arose when I discovered that asprintf wasn't supported. So now Rubygame will incorrectly convert unicode unto UTF-8 in the unlikely event that it's given a 513-byte unicode character to convert. (It won't break, however, because snprintf is supported). Also the code wasn't freeing the result of asprintf, so I may have actually plugged a memory leak by accident.

If you're compiling Rubygame 2.x, you're probably fine with the above instructions. But I was compiling the subversion 3.0 stuff, which includes Chipmunk, and the chipmunk build process isn't integrated with the rest of it. Building Chipmunk failed with, among a litany of other warnings:

make: *** No rule to make target '{.', needed by 'chipmunk.obj'. Stop.

All the searching in the world couldn't help me build it; in the end I found a prebuilt .so file (via this thread), which I plunked down into c:\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt, and it seemed to work. Of course, if you go this route, you're probably not going to be able to use any of the chipmunk-based features of the new Rubygame, but I'm not so it wasn't a problem for me.

All this made me think that I need another metric for progress. I've got time spent, but that's pretty constant. I've been using lines of code, but all this time I only added one line of code to kuiper proper (if it can't find $HOME, it looks for $USERPROFILE, which is apparently the windows equivalent). It's killing my LOC/hour performance :)

1 comment:

Anonymous said...

A 513-byte unicode character is especially unlikely there because SDL provides the character as a 16-bit unsigned integer. :D

Good find, though! I hadn't realized asprintf was a GNU extension.