Converting the display code is very slow going. Unfortunately, I'm having to combat the elegance of C and undoing several "optimizations". Basically, the game keeps the player information as an int[100], and also keeps a backup in another int[100]. So when it comes time to update the display, it loops over each element, compares it to the backup, then updates it (if necessary). This makes the display for active spells actually elegant:
for(int i =0; i <>
if( c[i+spellOffset] != cbak[i+spellOffset] )
botsub( i+spellOffset, screenX, screenY, "%-3d" );
Very nice elegant way of looping over the data, but hell to convert if you actually use a structure (unless you also union it with a big int[], which I'm refusing to do). So the new version involves a switch on the int, which will eventually be converted into a switch on an enumeration of active spells.
No comments:
Post a Comment