Coming out of the tangled and awkward mess that constitutes the usual (and I use the term advisedly), “festive season”, I’ve had my head down with a fairly major overhaul of the game-engine.
Once I started, it was hard to stop – particularly, since once I started, the engine was pretty much broken until I was mostly done. The primary work was converting to SDL (version 2, in case you’re wondering). I spent a couple hours figuring SDL out, then dove into the conversion.
The secondary work was just as interesting, as I started doing the necessary portability work to get the engine to build and run on other platforms.
Right now, a Linux port is about 85% complete, and the SDL conversion is about 90% complete.
All that really remains for the SDL conversion are the audio module/manager and the telemetry module – plus fixing up some rather badly mangled rectangle calculations. (WIN32 rectangles are x1,y1,x2,y2 – but SDL rectangles are x,y,w,h, and it is quite amazing how reliant some of my math is on the former model still). But no, actually, that’s not all, now that I think about it. I actually need to build new interfaces/widgets as well.
I need some form of replacement interface for the listbox that I was using for character-selection, and I will need interfaces for loading and saving the game, (and another for managing options, since I’m throwing over the menu bar).
All of those are fine, though. They basically boil down to proper planning, design, and some (probably) relatively unexciting code. Maybe some new widgets, which would be neat.
It’s weird how the balance of work changes. SDL lets me load a bitmap in 3 lines (rather than 35), and paint one in 3 more lines (as opposed to 21). Yet, the lack of any API/ability to access system fonts turns into a headache which will keep biting me in the later stages.
By the way, as a convenient safety tip – if you no longer initialise the WIN32API (because you are, say, part-way through a conversion to SDL), don’t keep making WIN32API calls to HWND==0 and HINSTANCE==0. On Windows 10, at least, some of those calls go through to Windows Explorer and can seriously mess it up, even though you are a poor, unprivileged application.
As for Linux, the necessary incantations and Makefiles will compile the code, but it won’t yet link cleanly. Regrettably, there are C++ language features that don’t appear in the g++ compiler until at least version 5.2, which is hardly standard fare for Linux distributions right now. I’ve got an ad-hoc build of g++, but I think the mixed environment is a bit much to get all of the moving parts cleanly linked together.
That’s okay. I’m confident that this won’t be a major issue by the late stages before release.
HAHAHAHA! Maybe you can put that on my tombstone, because “famous last words”, am I right?
And that’s where I’m at. Looking forward to a good week.