Saturday, January 31, 2015

FMod - Horrifying Code

Today, I was surveying the GalaxyGraphics code that will be extended for Gash to deal with CGA and VGA. I immediately noticed that it is a huge unreadable mess. There is stuff like this repeated all throughout the file, slightly modified sometimes:
Yep, that's a 5-deep for loop. There are all manner of crazy variables and bit twiddling (which really should have been done in C#).

I think I'll be rewriting this file/class to use these nice function calls that we have in .NET instead of copy/pasting difficult code. I may also take this opportunity to make the time-consuming stuff (decompression) not happen until the resource is called for.

No comments:

Post a Comment