There are many many places within a game I am developing (Tentatively called: Gulp), where I have straight up numbahs plugged into my code as apposed to using a variable that would stay around… I plan on changing this once I work out all the kinks but was wondering what kind of performance difference I could expect to see… right now I draw anywhere from 10-150 sprites to the screen and there offsets into the sprite sheet as well as the dimentions of the final image are straight up numbers, so thats 4 integers per item drawn…
So I guess my real question is how more efficient is it to aces a local integer as apposed to having the number passed in on the fly… heres an example of a single draw, the underlying code behind the method call creates a source and destination Rect to use as a mask to draw the sprite to a canvas…
g.drawPixmap(Assets.fishLeft7, drawX - (Assets.fishLeft7.getHeight()/2), drawY- (Assets.fishLeft7.getHeight()/2) , fish.sprite* 192, 0,192,86);
If you need me to clarify this, just ask, and Ill try… thanks…