Cleaning up leftover scraps from graphics code hacking, reimplementing GrCalcScreenUpdates

This commit is contained in:
GutPuncher 2024-08-29 00:49:38 -04:00
parent 05febc9803
commit f8c9845026
No known key found for this signature in database
GPG key ID: 38CE0A7B6841D1C7

View file

@ -362,35 +362,36 @@ U0 DCBlotColor8(CDC *dc, CDC *img)
U0 GrCalcScreenUpdates() U0 GrCalcScreenUpdates()
{ {
U16 *screen, *last_screen = gr.screen_cache; U8 *screen, *last_screen = gr.screen_cache;
U64 i, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 2; U32 i, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT;
U64 x, y, w = sys_framebuffer_pitch / (sys_framebuffer_bpp / 8);
if (gr.screen_zoom == 1) if (gr.screen_zoom == 1)
screen = gr.dc2->body; screen = gr.dc2->body;
else else
screen = gr.zoomed_dc->body; screen = gr.zoomed_dc->body;
/* for (y = 0; y < GR_HEIGHT; y++)
for (i = 0; i < diffs_size; i++)
{ {
for (x = 0; x < GR_WIDTH; x++)
{
i = x + y * GR_WIDTH;
if (screen[i] != last_screen[i]) if (screen[i] != last_screen[i])
dst[i] = src[i]; {
dst = text.fb_alias + x + y * w;
src = text.raw_screen + x + y * w;
*dst = *src;
} }
*/ }
// MemCopy(gr.screen_cache, screen, diffs_size * 2); }
MemCopy(gr.screen_cache, screen, diffs_size * 2);
} }
U0 GrUpdateScreen32() U0 GrUpdateScreen32()
{ {
// U64 size, *dst; U64 size, x, y, wi, yi, w = sys_framebuffer_pitch / (sys_framebuffer_bpp / 8);
U64 size;
U32 *dst; U32 *dst;
U8 *src; U8 *src;
U64 x;
U64 y;
U64 w = sys_framebuffer_pitch / (sys_framebuffer_bpp / 8);
U64 wi;
U64 yi;
if (gr.screen_zoom == 1) if (gr.screen_zoom == 1)
{ {
@ -406,24 +407,13 @@ U0 GrUpdateScreen32()
size = src + gr.zoomed_dc->height * gr.zoomed_dc->width_internal; size = src + gr.zoomed_dc->height * gr.zoomed_dc->width_internal;
wi = gr.zoomed_dc->width_internal; wi = gr.zoomed_dc->width_internal;
yi = gr.zoomed_dc->height; yi = gr.zoomed_dc->height;
// SysLog("%d\n", wi);
// SysLog("%d\n\n", yi);
} }
// dst = text.raw_screen;
// while (src < size) // need to do 1 pixel at a time... //draw 2 pixels at a time
// *dst++ = gr_palette[*src++ & 0xFF] | gr_palette[*src++ & 0xFF] << 32;
for (y = 0; y < yi; y++) for (y = 0; y < yi; y++)
{ {
for (x = 0; x < wi; x++) for (x = 0; x < wi; x++)
{ {
// dst = text.raw_screen[x + (y * sys_framebuffer_width)]; dst = text.raw_screen + x + y * w;
dst = text.fb_alias + x + (y * w); *dst = gr_palette[src[x + y * wi] & 0xFF];
// dst = text.raw_screen + x + (y * w);
// *dst = gr_palette[*src++ & 0xFF];
// *dst = gr_palette[src[x + (y * sys_framebuffer_width)] & 0xFF];
*dst = gr_palette[src[x + (y * wi)] & 0xFF];
// *dst = 0xFFFF0000;
} }
} }