Skip to content
Snippets Groups Projects
Commit 5bf0eba2 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix updating of bitmap_drawn() when drawing

Fixes high CPU when nothing is happening.
parent b2a77434
No related branches found
No related tags found
No related merge requests found
...@@ -854,6 +854,7 @@ bitmap_draw_vmem(int sx, int sy, int ex, int ey, struct vmem_cell *fill) ...@@ -854,6 +854,7 @@ bitmap_draw_vmem(int sx, int sy, int ex, int ey, struct vmem_cell *fill)
int coff = vmem_cell_offset(vm, 0, 0); int coff = vmem_cell_offset(vm, 0, 0);
int foff = 0; int foff = 0;
for (size_t vy = 0; vy < vheight; vy++) { for (size_t vy = 0; vy < vheight; vy++) {
int coff = vmem_cell_offset(vm, sx - 1, sy - 1 + vy);
for (size_t vx = 0; vx < vwidth; vx++) { for (size_t vx = 0; vx < vwidth; vx++) {
bitmap_drawn[coff] = fill[foff++]; bitmap_drawn[coff] = fill[foff++];
coff = vmem_next_offset(vm, coff); coff = vmem_next_offset(vm, coff);
...@@ -867,6 +868,7 @@ bitmap_draw_vmem(int sx, int sy, int ex, int ey, struct vmem_cell *fill) ...@@ -867,6 +868,7 @@ bitmap_draw_vmem(int sx, int sy, int ex, int ey, struct vmem_cell *fill)
int coff = vmem_cell_offset(vm, sx - 1, sy - 1 + vy); int coff = vmem_cell_offset(vm, sx - 1, sy - 1 + vy);
for (size_t vx = 0; vx < vwidth; vx++) { for (size_t vx = 0; vx < vwidth; vx++) {
bitmap_drawn[coff] = fill[foff++]; bitmap_drawn[coff] = fill[foff++];
coff = vmem_next_offset(vm, coff);
calc_charstate(&bs, &fill[vy * vwidth + vx], &charstate[vx], sx + vx, sy + vy); calc_charstate(&bs, &fill[vy * vwidth + vx], &charstate[vx], sx + vx, sy + vy);
} }
// Draw the characters... // Draw the characters...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment