Making of Panorama 2 for Linux

Bonz

Friday, June 29th

I am at work, and have nothing to do. I look at Hugi's site, and remember having read something about a Linux port of Hugi's engine, Panorama 2.

I have some free time, so, before realizing what I am doing, :-) I write to Chris Dragan, Hugi member and author of the engine... I mention some plans I have, such as using GGI for graphics, MikMod for sound, and FreeType for fonts.


Sunday, July 1st

I read Chris' response. He's a bit sceptic, because he says I am the ninth person asking for Panorama's source code. Nevertheless he just asks me if I ever did something under Linux, and I give my credentials as a GNU project developer.

I spend the afternoon looking at GGI, which I had never used in the past: what Chris doesn't know (yet), is that I never wrote anything involving graphics under Linux -- indeed all my demo coding has always been done in good old MS-DOS. Isn't it nice how us programmers trust each other? :-)



Monday, July 2nd

Panorama's source code arrives... it looks well architectured, with a completely separated portability layer that is where I will put my hands on. I write some code, get a headache because I didn't know DirectX is such a mess, I write a Makefile (no, I'm not using autoconf/automake) and finally get Panorama to compile under my beloved Linux. I get a black screen under X -- not that I expected much more: it is something to start with.


Tuesday, July 3rd

I have little time; I spend it writing the LinuxImage class. The graphics are all screwed up, there must be a bug somewhere... I also get some segmentation violations. Dah, I felt better yesterday...


Wednesday, July 4th

Great stuff today. I find the bug in the core that was screwing up the graphics, and plug in an horrible 8x8 font from GGI. It does not even support text with a transparent background, but hey the graphics show and I start understanding how the program is reacting to the mouse and keyboard.

Everything looks easier now; I implement crossfades and the mouse cursor. I understand much better the portability interface and no longer consider it messy at all.

I send Chris a patch for the bug and ask him some things about how Panorama processes events from the user.


Thursday, July 5th

Chris answers my question from yesterday, sends me updated source code for Panorama, and even congratulates with me because nobody currently had got so far with a Linux port! I'm happy. :-)

He even sends me a precompiled decryption routine so that I can try out my port with real Hugi issues (I have been using a test container so far). No source code, he says he's jealous about it. Only, I cannot use the routine because I use GCC 3.0 whose C++ ABI is not backwards compatible... I tell him about the problem, I'll see what he can do.

I start plugging FreeType in the engine.


Friday, July 6th

I finish writing the FreeType code. Gee, I did not know that FreeType was so low-level!!! It was probably the most boring part of the port, also because I'm not that much interested in fonts, but the rendering quality is surprising and well worth these 400 lines of code.

I look at MikMod too. This time it's exactly what I need, it's a child's game to interface to it, and it sounds well!

I only have to catch a bug in the event manager...


Saturday, July 7th, 3.00 pm

How stupid... ggiEventPoll is blocking and I did not know that. That's it.

There are still a few things to be done: so I add support for hidden tunes, and perfect the Makefile so that it can build binary packages. As far I am concerned, the port is done: I send the code to Chris, he will plug the decryption code and recompile everything.


Saturday, July 7th, 7.00 pm

...or so I thought. Chris sends me the source code for decryption, thanks to Adok's intercession :-) and I smooth some rough spots that the default container did not show -- the most curious one being that the magazine just did not want to quit...

The prospective of distributing the viewer before Hugi 23 becomes nearer.


Sunday, July 8th

Just to make this diary really daily, I recompile the source code with a RedHat 6.1 distro; GCC 3.0 changed a lot of things, so my pre-built binary was not compatible with Linux boxes that have an older compiler.

I suddenly remember that I have a Java project to do for an exam. :-/ Anyway, I look forward for Adok's return from the wonderful island of Kos...


Saturday, July 14th

Adok writes me an e-mail. He thanks me for having worked hard during his absence, so I come back to the program after a week of dealing with Java's extreme speed (5 seconds to press a button and have a dialog box appear... I guess they called it like coffee because you risk falling asleep!).

I add a few bells and whistles: I handle filenames with the wrong case, which caused a few problems under case-sensitive filesystems like under Unix. I also add a switch to load an arbitrary data file, and implement a check to detect when background music ends.


Saturday, July 21th

I finally compile the version that Adok will publish on Hugi's site. We agree that the version will be called beta and not an official one until Adok or Chris can test it. While I write this I am running make in the background, then I'll upload the stuff...

I hope that you who read this will all try my porting and send me lots of bug reports! :-)


                                   --
                                   |_  _  _ __
                                   |_)(_)| ) ,'
                                   -------- '-._