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

Optimize pixel calculations.

parent fe022fec
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -456,6 +456,7 @@ static void local_draw_rect(struct rectlist *rect)
int ctop = rect->rect.height;
int cbottom = -1;
int idx;
uint32_t last_pixel = 0x55555555;
if (bitmap_width != cleft || bitmap_height != ctop)
return;
......@@ -487,8 +488,8 @@ static void local_draw_rect(struct rectlist *rect)
continue;
}
}
for(yscale=0; yscale<x_cvstat.scaling*x_cvstat.vmultiplier; yscale++) {
for(xscale=0; xscale<x_cvstat.scaling; xscale++) {
if (last_pixel != rect->data[idx]) {
last_pixel = rect->data[idx];
r = rect->data[idx] >> 16 & 0xff;
g = rect->data[idx] >> 8 & 0xff;
b = rect->data[idx] & 0xff;
......@@ -508,6 +509,9 @@ static void local_draw_rect(struct rectlist *rect)
pixel |= (b << b_shift) & visual.blue_mask;
else
pixel |= (b >> (0-b_shift)) & visual.blue_mask;
}
for(yscale=0; yscale<x_cvstat.scaling*x_cvstat.vmultiplier; yscale++) {
for(xscale=0; xscale<x_cvstat.scaling; xscale++) {
#ifdef XPutPixel
XPutPixel(xim,(x+rect->rect.x)*x_cvstat.scaling+xscale,(y+rect->rect.y)*x_cvstat.scaling*x_cvstat.vmultiplier+yscale,pixel);
#else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment