The importance of Mc2m to the project is difficult if not impossible to overstate. What he did was entirely unglamorous but utterly necessary for development to continue.
Rewriting core sections to any codebase is generally a suicide watch position. It was bad enough that I didn't want to touch it, and indeed for a quite a while I simply hadn't. Mc2m was however completely undeterred and armed only with a promise that I would actually do something with the game if the savefiles started working again, he set off.
Four betas went by with content nearly exclusively being adds or changes to the new save/load code. Sometimes seemingly basic things take forever to fix, but for the most part, you wouldn't know it.
Another problem child of the game has been identified and is in, more or less, the same process of purging. This time, the rendering code, or perhaps the lack of it depending on how you choose to view it, is the issue at hand.
For ages, we've been using an immediate rendering mode with no central authority. Nearly every source file had some part of the rendering code in it. This leads to issues; "code bloat" and "ball of mud" come to mind. A lot of this sort of crap:
Code:
if (fileindex % 2 == 0) {
glBegin(GL_QUADS);
glColor3ub(8, 20, 80); glVertex2i(button->x, button->y);
glColor3ub(8, 20, 0); glVertex2i(button->x + button->width, button->y);
glColor3ub(8, 20, 80); glVertex2i(button->x + button->width, button->y + button->height);
glColor3ub(8, 20, 0); glVertex2i(button->x, button->y + button->height);
glEnd();
} else {
glBegin(GL_QUADS);
glColor3ub(8, 20, 0); glVertex2i(button->x, button->y);
glColor3ub(8, 20, 80); glVertex2i(button->x + button->width, button->y);
glColor3ub(8, 20, 0); glVertex2i(button->x + button->width, button->y + button->height);
glColor3ub(8, 20, 80); glVertex2i(button->x, button->y + button->height);
glEnd();
}
This is actual code from the file server interface. There's a whole bunch like it, but instead of in one easy to maintain area, it's simply replicated all over the place.
This is not great. Looking at the potential of other platforms or other rendering options such as DirectX, presently we'd have to jump all over the place to add the needed code to handle it.
So I've been simplifying it:
Code:
if (fileindex % 2 == 0) g_renderer->RectFill(button, "DarkPanelB", "DarkPanelA");
else g_renderer->RectFill(button, "DarkPanelA", "DarkPanelB");
Two things are corrected here. The first is the mess from before. But also is the fact that it wasn't ever using theme file settings.
I've gone through a lot of code thus far and have found that a quite a number of systems are not in fact customizable despite being in the themes table.
This has led to some... growth of the themes table. You can now change a lot more than you used to:
Code:
NAME: Uplink Blue
AUTHOR: Chris Delay
COMMENT: The standard blue Uplink theme
; COLOURNAME RED GREEN BLUE ALPHA
; =======================================================
Background 0 0 0 255
DefaultText 255 255 255 255
DimmedText 153 153 153 255
MenuText 255 255 255 255
TitleText 255 255 255 255
TextBorder 255 255 255 255
ButtonNormalA 0 0 179 255
ButtonNormalB 0 0 102 255
ButtonHighlightedA 128 128 255 255
ButtonHighlightedB 51 51 230 255
ButtonClickedA 179 179 255 255
ButtonClickedB 128 128 255 255
PanelBackgroundA 8 20 0 255
PanelBackgroundB 8 20 124 255
PanelBorder 79 138 214 255
PanelHighlightA 18 41 41 255
PanelHighlightB 18 41 163 255
PanelHighlightBorder 255 255 255 255
InterfaceSeperator 255 255 255 255
InterfaceObjectBoxA 153 153 153 255
InterfaceObjectBoxB 102 102 102 255
DarkPanelA 8 20 0 255
DarkPanelB 8 20 80 255
SecurityButton 51 51 179 255
SecurityButtonDisabled 0 0 77 255
WorldMapNode 255 255 255 255
WorldMapTraceActive 255 0 0 255
DataData 26 204 26 217
DataProgram 204 26 26 217
DataLibrary 204 102 26 217
DataLibrarySource 51 204 204 217
DataSource 26 26 204 217
DataProject 102 26 204 217
DataSession 204 26 204 217
DataUnknown 102 102 102 217
DataOpenSlot 77 77 128 217
DataHighlight 153 153 204 217
DataFadeTo 77 77 204 217
TaskBackgroundA 153 153 153 255
TaskBackgroundB 102 102 102 255
TaskTitleA 51 51 102 217
TaskTitleB 77 77 128 217
TaskNormalA 128 128 153 217
TaskNormalB 179 179 153 217
TaskHighlightA 51 51 128 217
TaskHighlightB 128 128 153 217
TaskClickedA 51 51 102 217
TaskClickedB 77 77 128 217
DictionaryA 0 14 59 255
DictionaryB 36 72 146 255
DictionaryC 82 134 206 255
DictionaryD 73 122 194 255
MotionNone 51 51 51 255
MotionFew 230 230 51 255
MotionMany 255 77 77 255
PasswordBoxBackground 33 179 212 255
LanBackground 0 0 0 255
LanLink 0 128 153 255
LockdownBackground 102 0 0 255
GraphAxis 255 255 255 255
GraphLine 51 51 255 255
As you can see, alpha is now supported, as well as a number of interface elements historically unsupported.
This is, I should note, scratching the surface of something else we're planning to allow more customization of you game experience.
We'll have something more fun and friendlier to use to report on the lines of customization later.