TheCherno / Cherno

The Cherno engine, for Ludum Dare.
GNU General Public License v3.0
75 stars 36 forks source link

Removed the use of arraylist in Keyboard and added methods for darker or lighter colors #13

Closed thebirk closed 6 years ago

thebirk commented 10 years ago

Removed the use of arraylist in Keyboard. Had to add Keyboard.update() to the main loop since the Cherno.update() method is not super called in any way by the Main(Test) class. It might be smart making the classes extending Cherno to super call all the init(), render() and update() methods

TheCherno commented 10 years ago

Not sure why you removed the ArrayList... having an array of 65536 booleans takes up much more memory that an empty array of integers that will probably never have more than 1 or 2 integers inside it (thus taking up several bytes of memory instead of about 65,000).

thebirk commented 10 years ago

I removed the list, since I remembered you saying once that it's much faster to use an array instead of arraylists. But I totally forgot about the memory usage.

SebastienGllmt commented 10 years ago

See https://github.com/TheCherno/Cherno/pull/17