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()
{
U16 *screen, *last_screen = gr.screen_cache;
U64 i, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 2;
U8 *screen, *last_screen = gr.screen_cache;
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)
screen = gr.dc2->body;
else
screen = gr.zoomed_dc->body;
/*
for (i = 0; i < diffs_size; i++)
for (y = 0; y < GR_HEIGHT; y++)
{
for (x = 0; x < GR_WIDTH; x++)
{
i = x + y * GR_WIDTH;
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()
{
// U64 size, *dst;
U64 size;
U64 size, x, y, wi, yi, w = sys_framebuffer_pitch / (sys_framebuffer_bpp / 8);
U32 *dst;
U8 *src;
U64 x;
U64 y;
U64 w = sys_framebuffer_pitch / (sys_framebuffer_bpp / 8);
U64 wi;
U64 yi;
if (gr.screen_zoom == 1)
{
@ -406,24 +407,13 @@ U0 GrUpdateScreen32()
size = src + gr.zoomed_dc->height * gr.zoomed_dc->width_internal;
wi = gr.zoomed_dc->width_internal;
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 (x = 0; x < wi; x++)
{
// dst = text.raw_screen[x + (y * sys_framebuffer_width)];
dst = text.fb_alias + x + (y * w);
// 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;
dst = text.raw_screen + x + y * w;
*dst = gr_palette[src[x + y * wi] & 0xFF];
}
}