Last time I mentioned writing a common abstraction layer for Cave Story as an intermediate step to getting it up and running on the GameCube.
I decided on SDL for handling as much of that layer as possible. This has a few advantages:
- I can test the port on Windows.
- I don’t have to write so much code.
- The process of porting to other platforms is simplified.
There are quite a lot of references to RECTs throughout the code, which I don’t yet want to convert to SDL_Rects. That may sound silly, but SDL rectangles are stored as “left, top, width and height”, whereas Windows rectangles are stored as “left, top, right and bottom”.
It’s not a large difference, but while converting a few snippets over to the SDL way isn’t at all difficult, the number of RECT references is large enough to cause a few evenings worth of tedious and error-prone work, which I would rather skip! I just want to get the game up and running with as few far-reaching changes as possible.
So instead, I convert RECTs to SDL_Rects at the last second, just before blitting.
But anyway, there is one glaring hole in my longer term plan. As far as I am aware, there is no stand alone GameCube port of SDL. If believe there’s a version for GameCube Linux, but not a stand alone library. Fortunately, porting the parts of SDL I use to the GameCube probably won’t be much more work than I would have had to do anyway.