d'oh, dunno why I did 8 bit that way, put /it/ back to the old shared buffer

way because it always worked and it really doesn't need the slowdown.
This commit is contained in:
Bill Currie 2002-08-21 05:15:08 +00:00
parent be75ff490f
commit 84afd9e299

View file

@ -208,23 +208,6 @@ xlib_rgb24 (int r, int g, int b)
return p; return p;
} }
static void
st1_fixup (XImage *framebuf, int x, int y, int width, int height)
{
int yi;
unsigned char *src;
PIXEL8 *dest;
if (x < 0 || y < 0)
return;
for (yi = y; yi < (y + height); yi++) {
src = &((byte *)vid.buffer)[yi * vid.width];
dest = (PIXEL8 *) &framebuf->data[yi * framebuf->bytes_per_line];
memcpy (dest, src, width);
}
}
static void static void
st2_fixup (XImage *framebuf, int x, int y, int width, int height) st2_fixup (XImage *framebuf, int x, int y, int width, int height)
{ {
@ -384,13 +367,19 @@ x11_init_buffers (void)
else else
ResetFrameBuffer (); ResetFrameBuffer ();
current_framebuffer = 0;
vid.direct = 0; vid.direct = 0;
vid.rowbytes = vid.width; vid.rowbytes = vid.width;
if (vid.buffer) if (x_visinfo->depth != 8) {
free (vid.buffer); if (vid.buffer)
vid.buffer = calloc (vid.width, vid.height); free (vid.buffer);
if (!vid.buffer) vid.buffer = calloc (vid.width, vid.height);
Sys_Error ("Not enough memory for video mode"); if (!vid.buffer)
Sys_Error ("Not enough memory for video mode");
} else {
vid.buffer = x_framebuffer[current_framebuffer]->data;
}
vid.conbuffer = vid.buffer; vid.conbuffer = vid.buffer;
vid.conwidth = vid.width; vid.conwidth = vid.width;
@ -398,8 +387,6 @@ x11_init_buffers (void)
vid.conrowbytes = vid.rowbytes; vid.conrowbytes = vid.rowbytes;
vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0); vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0);
current_framebuffer = 0;
} }
static void static void
@ -644,10 +631,6 @@ VID_Update (vrect_t *rects)
while (rects) { while (rects) {
switch (x_visinfo->depth) { switch (x_visinfo->depth) {
case 8:
st1_fixup (x_framebuffer[current_framebuffer],
rects->x, rects->y, rects->width, rects->height);
break;
case 16: case 16:
st2_fixup (x_framebuffer[current_framebuffer], st2_fixup (x_framebuffer[current_framebuffer],
rects->x, rects->y, rects->width, rects->height); rects->x, rects->y, rects->width, rects->height);