#44273 - Ultima2876 - Tue May 31, 2005 4:30 pm
Code: |
source_variables = (spriteno * 16);
source_colltype = (obj_var[(source_variables + 0)] - ((obj_var[(source_variables + 0)] >> 8) << 8)); source_ysize = (obj_var[(source_variables + 5)] - ((obj_var[(source_variables + 5)] >> 8) << 8)); |
My game's got an FPS counter in it, and when I comment these three lines out I gain 8 FPS. For three lines of code, I think that's just wrong.
source_variables is an int, obj_var[] is an array of signed ints (in Iwram - it's 2048 elements), and spriteno is an int. The odd shifting at the end of the lines is to get rid of some bits (the wole calculation is to get just the lower 8 bits, because the upper bits contain data for another variable). I didn't think this could possibly be the source of slowdown, since the shifts are fast... anyone have a possible explanation?
Cheers.