Open jesse-wei opened 11 months ago
We have to use BMP for performance reasons. We had originally used JavaFX's Rectangle, but this ended up being unusably slow.
I had to have done something wrong... there's just no way a good implementation that uses Rectangle would be slower than literally saving BMP files to disk and reading them into memory. Also, as shown above (hardcoded BMP fields), BMP is not maintainable. This should be looked into.
Reference issues
20
Summary
Want to support sprites of different sizes (e.g., 8x8 and 32x32).
Basic examples
The VGA resolution is 640x480. For 32x32 sprites, the screen would be 20 sprites x 15 sprites. Therefore,
smem.mem
would contain 300 lines (as opposed to 1200 lines for normal 16x16 sprites). The program would need to be able to parse this and render the 32x32 sprites correctly.The sprite size would be automatically computed based on the number of lines in
smem.mem
, similar to the above calculation.If the number of lines is not valid, the program should print a useful message and quit.
Drawbacks
No drawbacks, besides making the code more complicated.
Additional context
The most relevant file is VGADisplayBMPController.java (screen logic). Additionally, as mentioned above, there needs to be some code (run during initialization) that gets the number of lines in the ScreenMemory file to set the sprite size.
Specific notes about VGADisplayBMPController.java: