MinicraftPlus / minicraft-plus-revived

Minicraft+, an extension of Notch's original minicraft project, with tons more features.
GNU General Public License v3.0
466 stars 93 forks source link

Further optimize rendering methods #579

Closed BenCheung0422 closed 5 months ago

BenCheung0422 commented 10 months ago

This change performs well together with #523 and #524. As a minor change, there is no longer an error popup when there is any explicitly or implicitly incompatible images regarding their sizes. Instead, a warning message is rendered in the terminal. Due to the change to the compatibility of the rendering of the on-screen keyboard, the textures of the special keys are updated and saved as assets instead of being constructed on demand in runtime. It is mainly because the visibility of Screen#pixels is decreased, There is no longer a light screen constructed with Screen. Instead, an object representing the overlay is present in the screen object. Other minor changes:

Some methods may be still using array looping to render.

As a result, the CPU run time has been improved. The below comparison is tested based on my personal computer. Comparing with the current implementation (with #523):

Litorom commented 5 months ago

Fix Conflicts and I’ll merge