TransferBoy
TransferBoy copied to clipboard
Use global rootState instead of passing it around.
"In C globals are more common especially in the era when RAM was limited. So it's not "bad" it's normal. Modern Object Oriented code would pass variables around from function to function and would feel clean but use more RAM and spend more time copying data from place to place."
Have done this for all references to RootState, and it's neither sped up nor slowed down performance significantly. There may be additional scope to this - places where I pass around a playerState reference when I might be better just passing a player number int.
Though either way you're still passing something so it might not make a difference. Hrmm. Worth a try I guess.