fix PNG screenshots under AMD64, fix 8bpp screenshots under X
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2437 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
22360e35dd
commit
6c8223f606
2 changed files with 4 additions and 4 deletions
|
@ -719,7 +719,7 @@ int Image_WritePNG (char *filename, int compression, qbyte *pixels, int width, i
|
||||||
png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
|
png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
|
||||||
png_write_info(png_ptr, info_ptr);
|
png_write_info(png_ptr, info_ptr);
|
||||||
|
|
||||||
row_pointers = BZ_Malloc (4 * height);
|
row_pointers = BZ_Malloc (sizeof(png_byte *) * height);
|
||||||
for (i = 0; i < height; i++)
|
for (i = 0; i < height; i++)
|
||||||
row_pointers[height - i - 1] = pixels + i * width * 3;
|
row_pointers[height - i - 1] = pixels + i * width * 3;
|
||||||
png_write_image(png_ptr, row_pointers);
|
png_write_image(png_ptr, row_pointers);
|
||||||
|
|
|
@ -404,7 +404,7 @@ void ResetFrameBuffer(void)
|
||||||
if (!x_framebuffer[0])
|
if (!x_framebuffer[0])
|
||||||
Sys_Error("VID: XCreateImage failed\n");
|
Sys_Error("VID: XCreateImage failed\n");
|
||||||
|
|
||||||
vid.buffer = (qbyte*) (x_framebuffer[0]);
|
vid.buffer = (qbyte*) (x_framebuffer[0]->data);
|
||||||
vid.conbuffer = vid.buffer;
|
vid.conbuffer = vid.buffer;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -806,8 +806,6 @@ void SWVID_SetPalette(unsigned char *palette)
|
||||||
|
|
||||||
if (x_visinfo->class == PseudoColor && x_visinfo->depth == 8)
|
if (x_visinfo->class == PseudoColor && x_visinfo->depth == 8)
|
||||||
{
|
{
|
||||||
if (palette != vid_curpal)
|
|
||||||
memcpy(vid_curpal, palette, 768);
|
|
||||||
for (i=0 ; i<256 ; i++)
|
for (i=0 ; i<256 ; i++)
|
||||||
{
|
{
|
||||||
colors[i].pixel = i;
|
colors[i].pixel = i;
|
||||||
|
@ -819,6 +817,8 @@ void SWVID_SetPalette(unsigned char *palette)
|
||||||
XStoreColors(vid_dpy, x_cmap, colors, 256);
|
XStoreColors(vid_dpy, x_cmap, colors, 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (palette != vid_curpal)
|
||||||
|
memcpy(vid_curpal, palette, 768);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called at shutdown
|
// Called at shutdown
|
||||||
|
|
Loading…
Reference in a new issue