2001-02-19 21:15:25 +00:00
|
|
|
/*
|
2001-05-24 19:22:35 +00:00
|
|
|
screen.c
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
master for refresh, status bar, console, chat, notify, etc
|
|
|
|
|
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
2003-01-15 15:31:36 +00:00
|
|
|
|
2022-03-07 14:32:44 +00:00
|
|
|
#include <stdlib.h>
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2003-09-04 18:59:39 +00:00
|
|
|
#include "QF/image.h"
|
2001-04-15 21:11:41 +00:00
|
|
|
#include "QF/sys.h"
|
|
|
|
|
2012-02-14 08:28:09 +00:00
|
|
|
#include "r_internal.h"
|
2019-07-08 16:00:47 +00:00
|
|
|
#include "vid_sw.h"
|
2001-08-10 00:28:57 +00:00
|
|
|
|
2002-12-11 16:45:40 +00:00
|
|
|
/* SCREEN SHOTS */
|
2012-02-18 13:28:42 +00:00
|
|
|
tex_t *
|
2022-03-09 05:26:16 +00:00
|
|
|
capture_bgr_8 (void)
|
2012-01-05 10:19:37 +00:00
|
|
|
{
|
|
|
|
int count, x, y;
|
|
|
|
tex_t *tex;
|
|
|
|
const byte *src;
|
|
|
|
byte *dst;
|
|
|
|
|
|
|
|
count = vid.width * vid.height;
|
2021-01-24 15:54:41 +00:00
|
|
|
tex = malloc (sizeof (tex_t) + count * 3);
|
|
|
|
tex->data = (byte *) (tex + 1);
|
2012-01-05 10:19:37 +00:00
|
|
|
SYS_CHECKMEM (tex);
|
|
|
|
tex->width = vid.width;
|
|
|
|
tex->height = vid.height;
|
|
|
|
tex->format = tex_rgb;
|
|
|
|
tex->palette = 0;
|
|
|
|
src = vid.buffer;
|
|
|
|
for (y = 0; y < tex->height; y++) {
|
|
|
|
dst = tex->data + (tex->height - 1 - y) * tex->width * 3;
|
|
|
|
for (x = 0; x < tex->width; x++) {
|
|
|
|
*dst++ = vid.basepal[*src * 3 + 2]; // blue
|
|
|
|
*dst++ = vid.basepal[*src * 3 + 1]; // green
|
|
|
|
*dst++ = vid.basepal[*src * 3 + 0]; // red
|
|
|
|
src++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return tex;
|
|
|
|
}
|
2022-03-09 05:26:16 +00:00
|
|
|
|
|
|
|
tex_t *
|
|
|
|
capture_bgr_16 (void)
|
|
|
|
{
|
|
|
|
return capture_bgr_8 ();//FIXME
|
|
|
|
}
|
|
|
|
|
|
|
|
tex_t *
|
|
|
|
capture_bgr_32 (void)
|
|
|
|
{
|
|
|
|
return capture_bgr_8 ();//FIXME
|
|
|
|
}
|
|
|
|
|
|
|
|
tex_t *
|
|
|
|
sw_SCR_CaptureBGR (void)
|
|
|
|
{
|
|
|
|
return sw_ctx->draw->capture_bgr ();
|
|
|
|
}
|