Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Rewrite bitmap class #63

Open
melody-rs opened this issue May 25, 2022 · 0 comments
Open

Rewrite bitmap class #63

melody-rs opened this issue May 25, 2022 · 0 comments
Assignees

Comments

@melody-rs
Copy link
Member

One big regret I have about the graphics pipeline, specifically the Bitmap class implementation, is that I didn't take the actual real-world usage of it into account. Bitmaps in Enterbrain's engine represent CPU-side 2D images, and as the rest of the engine is entirely rendering on the CPU, it's no surprise that manipulating Bitmaps down to the pixel level and rendering them using Sprites can be freely mixed at any point in the game loop. I tried my best to preserve this freedom granted by the RGSS API, but in practice most Bitmaps are loaded once and never touched again. A better design would have exploited this fact more.

From what I can gather at the moment, mkxp stores bitmaps both on the GPU and the CPU, updating the CPU side image whenever the GPU side texture is modified. This is nice for using something like get_pixel, however that is a pretty rarely used function.

This is likely what Ancurio is referring to when they said is that I didn't take the actual real-world usage of it into account.

What I may end up doing is ditching the CPU side image entirely in favor of fetching the texture from the GPU when getting a pixel. I have no idea how viable, slow, or bad of an idea that would be, but it is worth a shot.

@melody-rs melody-rs self-assigned this May 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant