mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Make a bit of progress cleaning up vid for plugins.
This commit is contained in:
parent
80f5cc59e9
commit
e991c1fed3
41 changed files with 195 additions and 286 deletions
|
@ -47,7 +47,7 @@ if test "x$HAVE_FBDEV" = xyes; then
|
|||
if test "x$ASM_ARCH" = "xyes"; then
|
||||
QF_NEED(swrend, [asm])
|
||||
fi
|
||||
QF_NEED(vid, [common sw])
|
||||
QF_NEED(vid, [common])
|
||||
QF_NEED(qw, [client common])
|
||||
QF_NEED(nq, [client common])
|
||||
QF_NEED(console, [client])
|
||||
|
@ -55,10 +55,10 @@ if test "x$HAVE_FBDEV" = xyes; then
|
|||
fi
|
||||
if test "x$HAVE_X" = xyes; then
|
||||
if test "x$ENABLE_clients_glx" = xyes; then
|
||||
QF_NEED(vid, [common gl x11])
|
||||
QF_NEED(vid, [common x11])
|
||||
fi
|
||||
if test "x$ENABLE_clients_glslx" = xyes; then
|
||||
QF_NEED(vid, [common glsl x11])
|
||||
QF_NEED(vid, [common x11])
|
||||
fi
|
||||
if test "x$ENABLE_clients_x11" = xyes; then
|
||||
QW_TARGETS="$QW_TARGETS qw-client-x11\$(EXEEXT)"
|
||||
|
@ -75,7 +75,7 @@ if test "x$HAVE_X" = xyes; then
|
|||
if test "x$ASM_ARCH" = "xyes"; then
|
||||
QF_NEED(swrend, [asm])
|
||||
fi
|
||||
QF_NEED(vid, [common sw x11])
|
||||
QF_NEED(vid, [common x11])
|
||||
QF_NEED(qw, [client common])
|
||||
QF_NEED(nq, [client common])
|
||||
QF_NEED(console, [client])
|
||||
|
@ -97,7 +97,7 @@ if test "x$HAVE_SDL" = xyes; then
|
|||
if test "x$ASM_ARCH" = "xyes"; then
|
||||
QF_NEED(swrend, [asm])
|
||||
fi
|
||||
QF_NEED(vid, [common sdl sw])
|
||||
QF_NEED(vid, [common sdl])
|
||||
QF_NEED(qw, [client common sdl])
|
||||
QF_NEED(nq, [client common sdl])
|
||||
QF_NEED(console, [client])
|
||||
|
@ -117,7 +117,7 @@ if test "x$HAVE_SVGA" = xyes; then
|
|||
if test "x$ASM_ARCH" = "xyes"; then
|
||||
QF_NEED(swrend, [asm])
|
||||
fi
|
||||
QF_NEED(vid, [asm common svga sw])
|
||||
QF_NEED(vid, [common svga])
|
||||
QF_NEED(qw, [client common])
|
||||
QF_NEED(nq, [client common])
|
||||
QF_NEED(console, [client])
|
||||
|
@ -134,7 +134,7 @@ fi
|
|||
# QF_NEED(alias, [gl])
|
||||
# QF_NEED(brush, [gl])
|
||||
# QF_NEED(sprite, [gl])
|
||||
# QF_NEED(vid, [common gl])
|
||||
# QF_NEED(vid, [common])
|
||||
# QF_NEED(qw, [client common])
|
||||
# QF_NEED(nq, [client common])
|
||||
# QF_NEED(console, [client])
|
||||
|
@ -230,7 +230,7 @@ QF_PROCESS_NEED_LIBS(alias, [gl glsl sw])
|
|||
QF_PROCESS_NEED_LIBS(brush, [gl glsl sw])
|
||||
QF_PROCESS_NEED_LIBS(sprite, [gl glsl sw])
|
||||
|
||||
QF_PROCESS_NEED_LIBS(vid, [asm common gl glsl sdl sw sw32 svga x11])
|
||||
QF_PROCESS_NEED_LIBS(vid, [common sdl svga x11])
|
||||
QF_PROCESS_NEED_LIBS(qw, [client common sdl server], a)
|
||||
QF_PROCESS_NEED_LIBS(nq, [client common sdl server], a)
|
||||
|
||||
|
|
|
@ -35,21 +35,13 @@
|
|||
#define VID_CBITS 6
|
||||
#define VID_GRADES (1 << VID_CBITS)
|
||||
|
||||
struct cvar_s;
|
||||
extern byte *vid_colormap;
|
||||
extern unsigned char d_15to8table[65536];
|
||||
|
||||
extern struct cvar_s *vid_fullscreen;
|
||||
extern struct cvar_s *vid_system_gamma;
|
||||
extern struct cvar_s *vid_width;
|
||||
extern struct cvar_s *vid_height;
|
||||
extern struct cvar_s *vid_bitdepth;
|
||||
|
||||
typedef struct {
|
||||
qboolean initialized;
|
||||
qboolean is8bit;
|
||||
void *buffer; // invisible buffer
|
||||
short *zbuffer;
|
||||
void *surfcache;
|
||||
byte *gammatable; // 256
|
||||
byte *basepal; // 256 * 3
|
||||
byte *palette; // 256 * 3
|
||||
byte *colormap8; // 256 * VID_GRADES size
|
||||
|
@ -80,60 +72,17 @@ typedef struct {
|
|||
|
||||
extern viddef_t viddef;
|
||||
|
||||
extern unsigned short d_8to16table[256];
|
||||
extern unsigned int d_8to24table[256];
|
||||
extern unsigned int d_8to24table[256]; //FIXME nq/qw uses
|
||||
|
||||
extern byte gammatable[256];
|
||||
extern struct cvar_s *vid_gamma;
|
||||
extern qboolean vid_gamma_avail;
|
||||
|
||||
// called at startup and after any gamma correction
|
||||
void VID_SetPalette (unsigned char *palette);
|
||||
void VID_Init8bitPalette (void);
|
||||
|
||||
// called for bonus and pain flashes, and for underwater color changes
|
||||
void VID_ShiftPalette (unsigned char *palette);
|
||||
|
||||
void VID_Init_Cvars (void);
|
||||
|
||||
// Called at startup to set up translation tables, takes 256 8 bit RGB values
|
||||
// the palette data will go away after the call, so it must be copied off if
|
||||
// the video driver will need it again
|
||||
void VID_Init (byte *palette, byte *colormap);
|
||||
|
||||
// Called at shutdown
|
||||
void VID_Shutdown (void);
|
||||
|
||||
// flushes the given rectangles from the view buffer to the screen
|
||||
void VID_Update (vrect_t *rects);
|
||||
|
||||
// sets the mode; used only by the Quake engine for resetting to mode 0 (the
|
||||
// base mode) on memory allocation failures
|
||||
// or not
|
||||
// int VID_SetMode (int modenum, unsigned char *palette);
|
||||
|
||||
void VID_InitBuffers (void);
|
||||
void VID_LockBuffer (void);
|
||||
void VID_UnlockBuffer (void);
|
||||
|
||||
qboolean VID_Is8bit (void);
|
||||
|
||||
void VID_RaiseWindow (void);
|
||||
void VID_MinimiseWindow (void);
|
||||
void VID_SetCaption (const char *text);
|
||||
// used to set window caption
|
||||
|
||||
void VID_GetWindowSize (int def_w, int def_h);
|
||||
|
||||
void VID_InitGamma (unsigned char *);
|
||||
double VID_GetGamma (void);
|
||||
qboolean VID_SetGamma (double);
|
||||
void VID_UpdateGamma (struct cvar_s *);
|
||||
|
||||
void GL_Init_Common (void);
|
||||
|
||||
void VID_MakeColormaps (int fullbrights, byte *pal);
|
||||
|
||||
void VGA_UpdatePlanarScreen (void *srcbuffer);
|
||||
|
||||
#endif // __vid_h_
|
||||
|
|
|
@ -78,4 +78,6 @@ void R_DrawAliasModel (entity_t *e);
|
|||
|
||||
void R_MarkLeaves (void);
|
||||
|
||||
void GL_Init_Common (void);
|
||||
|
||||
#endif//__r_internal_h
|
||||
|
|
27
include/vid_internal.h
Normal file
27
include/vid_internal.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ifndef __vid_internal_h
|
||||
#define __vid_internal_h
|
||||
|
||||
#include "QF/vid.h"
|
||||
#include "QF/plugin/vid_render.h"
|
||||
|
||||
extern struct cvar_s *vid_fullscreen;
|
||||
extern struct cvar_s *vid_system_gamma;
|
||||
extern struct cvar_s *vid_gamma;
|
||||
|
||||
extern byte d_15to8table[65536];
|
||||
extern unsigned short d_8to16table[256];
|
||||
|
||||
void VID_GetWindowSize (int def_w, int def_h);
|
||||
|
||||
void VID_SetPalette (unsigned char *palette);
|
||||
void VID_ShiftPalette (unsigned char *palette);
|
||||
void VID_InitGamma (unsigned char *);
|
||||
qboolean VID_SetGamma (double);
|
||||
void VID_UpdateGamma (struct cvar_s *);
|
||||
|
||||
void VID_Update (vrect_t *rects);
|
||||
void VID_LockBuffer (void);
|
||||
void VID_UnlockBuffer (void);
|
||||
void VID_InitBuffers (void);
|
||||
|
||||
#endif//__vid_internal_h
|
|
@ -48,11 +48,11 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/quakefs.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/va.h"
|
||||
#include "QF/vid.h"
|
||||
#include "QF/GL/qf_textures.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "mod_internal.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
|
||||
void
|
||||
|
@ -180,14 +180,14 @@ Mod_LoadLighting (bsp_t *bsp)
|
|||
|
||||
if (mod_lightmap_bytes > 1)
|
||||
for (i = 0; i < bsp->lightdatasize ; i++) {
|
||||
d = gammatable[*in++];
|
||||
d = vid.gammatable[*in++];
|
||||
*out++ = d;
|
||||
*out++ = d;
|
||||
*out++ = d;
|
||||
}
|
||||
else
|
||||
for (i = 0; i < bsp->lightdatasize ; i++)
|
||||
*out++ = gammatable[*in++];
|
||||
*out++ = vid.gammatable[*in++];
|
||||
dstring_delete (litfilename);
|
||||
}
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ build_skin (skin_t *skin, int cmap)
|
|||
skin->texnum = texnum;
|
||||
skin->auxtex = fb_texnum;
|
||||
}
|
||||
if (VID_Is8bit ()) {
|
||||
if (vid.is8bit) {
|
||||
build_skin_8 (s->tex, texnum, skin_cmap[cmap],
|
||||
scaled_width, scaled_height, false);
|
||||
if (s->fb)
|
||||
|
|
|
@ -47,7 +47,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/draw.h"
|
||||
#include "QF/mathlib.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/vid.h"
|
||||
#include "QF/GL/defines.h"
|
||||
#include "QF/GL/funcs.h"
|
||||
#include "QF/GL/qf_textures.h"
|
||||
|
@ -56,6 +55,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "compat.h"
|
||||
#include "r_internal.h"
|
||||
#include "sbar.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
typedef struct {
|
||||
int texnum;
|
||||
|
@ -544,7 +544,7 @@ GL_Upload8 (const byte *data, int width, int height, qboolean mipmap,
|
|||
}
|
||||
}
|
||||
|
||||
if (VID_Is8bit () && !alpha) {
|
||||
if (vid.is8bit && !alpha) {
|
||||
GL_Upload8_EXT (data, width, height, mipmap, alpha);
|
||||
} else {
|
||||
GL_Upload32 (trans, width, height, mipmap, alpha);
|
||||
|
|
|
@ -56,7 +56,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "d_iface.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_internal.h"
|
||||
#include "sbar.h"
|
||||
|
||||
#define WARP_WIDTH 320
|
||||
|
@ -100,7 +100,6 @@ VISIBLE int lm_src_blend, lm_dest_blend;
|
|||
VISIBLE float rgb_scale = 1.0;
|
||||
|
||||
VISIBLE QF_glColorTableEXT qglColorTableEXT = NULL;
|
||||
VISIBLE qboolean is8bit = false;
|
||||
|
||||
VISIBLE qboolean gl_feature_mach64 = false;
|
||||
|
||||
|
@ -520,7 +519,104 @@ CheckLights (void)
|
|||
qfglDisable (GL_LIGHTING);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
Tdfx_Init8bitPalette (void)
|
||||
{
|
||||
// Check for 8bit Extensions and initialize them.
|
||||
int i;
|
||||
|
||||
if (vid.is8bit)
|
||||
return;
|
||||
|
||||
if (QFGL_ExtensionPresent ("3DFX_set_global_palette")) {
|
||||
char *oldpal;
|
||||
GLubyte table[256][4];
|
||||
QF_gl3DfxSetPaletteEXT qgl3DfxSetPaletteEXT = NULL;
|
||||
|
||||
if (!(qgl3DfxSetPaletteEXT =
|
||||
QFGL_ExtensionAddress ("gl3DfxSetPaletteEXT"))) {
|
||||
Sys_MaskPrintf (SYS_VID, "3DFX_set_global_palette not found.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Sys_MaskPrintf (SYS_VID, "3DFX_set_global_palette.\n");
|
||||
|
||||
oldpal = (char *) d_8to24table; // d_8to24table3dfx;
|
||||
for (i = 0; i < 256; i++) {
|
||||
table[i][2] = *oldpal++;
|
||||
table[i][1] = *oldpal++;
|
||||
table[i][0] = *oldpal++;
|
||||
table[i][3] = 255;
|
||||
oldpal++;
|
||||
}
|
||||
qfglEnable (GL_SHARED_TEXTURE_PALETTE_EXT);
|
||||
qgl3DfxSetPaletteEXT ((GLuint *) table);
|
||||
vid.is8bit = true;
|
||||
} else {
|
||||
Sys_MaskPrintf (SYS_VID, "\n 3DFX_set_global_palette not found.");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
The GL_EXT_shared_texture_palette seems like an idea which is
|
||||
/almost/ a good idea, but seems to be severely broken with many
|
||||
drivers, as such it is disabled.
|
||||
|
||||
It should be noted, that a palette object extension as suggested by
|
||||
the GL_EXT_shared_texture_palette spec might be a very good idea in
|
||||
general.
|
||||
*/
|
||||
static void
|
||||
Shared_Init8bitPalette (void)
|
||||
{
|
||||
int i;
|
||||
GLubyte thePalette[256 * 3];
|
||||
GLubyte *oldPalette, *newPalette;
|
||||
|
||||
if (vid.is8bit)
|
||||
return;
|
||||
|
||||
if (QFGL_ExtensionPresent ("GL_EXT_shared_texture_palette")) {
|
||||
if (!(qglColorTableEXT = QFGL_ExtensionAddress ("glColorTableEXT"))) {
|
||||
Sys_MaskPrintf (SYS_VID, "glColorTableEXT not found.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Sys_MaskPrintf (SYS_VID, "GL_EXT_shared_texture_palette\n");
|
||||
|
||||
qfglEnable (GL_SHARED_TEXTURE_PALETTE_EXT);
|
||||
oldPalette = (GLubyte *) d_8to24table; // d_8to24table3dfx;
|
||||
newPalette = thePalette;
|
||||
for (i = 0; i < 256; i++) {
|
||||
*newPalette++ = *oldPalette++;
|
||||
*newPalette++ = *oldPalette++;
|
||||
*newPalette++ = *oldPalette++;
|
||||
oldPalette++;
|
||||
}
|
||||
qglColorTableEXT (GL_SHARED_TEXTURE_PALETTE_EXT, GL_RGB, 256, GL_RGB,
|
||||
GL_UNSIGNED_BYTE, (GLvoid *) thePalette);
|
||||
vid.is8bit = true;
|
||||
} else {
|
||||
Sys_MaskPrintf (SYS_VID,
|
||||
"\n GL_EXT_shared_texture_palette not found.");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
VID_Init8bitPalette (void)
|
||||
{
|
||||
Sys_MaskPrintf (SYS_VID, "Checking for 8-bit extension: ");
|
||||
if (vid_use8bit->int_val) {
|
||||
Tdfx_Init8bitPalette ();
|
||||
Shared_Init8bitPalette ();
|
||||
if (!vid.is8bit)
|
||||
Sys_MaskPrintf (SYS_VID, "\n 8-bit extension not found.\n");
|
||||
} else {
|
||||
Sys_MaskPrintf (SYS_VID, "disabled.\n");
|
||||
}
|
||||
}
|
||||
|
||||
static __attribute__((used)) void //FIXME
|
||||
VID_SetPalette (unsigned char *palette)
|
||||
{
|
||||
byte *pal;
|
||||
|
@ -639,119 +735,6 @@ GL_Init_Common (void)
|
|||
qfglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
}
|
||||
|
||||
VISIBLE qboolean
|
||||
VID_Is8bit (void)
|
||||
{
|
||||
return is8bit;
|
||||
}
|
||||
|
||||
static void
|
||||
Tdfx_Init8bitPalette (void)
|
||||
{
|
||||
// Check for 8bit Extensions and initialize them.
|
||||
int i;
|
||||
|
||||
if (is8bit)
|
||||
return;
|
||||
|
||||
if (QFGL_ExtensionPresent ("3DFX_set_global_palette")) {
|
||||
char *oldpal;
|
||||
GLubyte table[256][4];
|
||||
QF_gl3DfxSetPaletteEXT qgl3DfxSetPaletteEXT = NULL;
|
||||
|
||||
if (!(qgl3DfxSetPaletteEXT =
|
||||
QFGL_ExtensionAddress ("gl3DfxSetPaletteEXT"))) {
|
||||
Sys_MaskPrintf (SYS_VID, "3DFX_set_global_palette not found.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Sys_MaskPrintf (SYS_VID, "3DFX_set_global_palette.\n");
|
||||
|
||||
oldpal = (char *) d_8to24table; // d_8to24table3dfx;
|
||||
for (i = 0; i < 256; i++) {
|
||||
table[i][2] = *oldpal++;
|
||||
table[i][1] = *oldpal++;
|
||||
table[i][0] = *oldpal++;
|
||||
table[i][3] = 255;
|
||||
oldpal++;
|
||||
}
|
||||
qfglEnable (GL_SHARED_TEXTURE_PALETTE_EXT);
|
||||
qgl3DfxSetPaletteEXT ((GLuint *) table);
|
||||
is8bit = true;
|
||||
} else {
|
||||
Sys_MaskPrintf (SYS_VID, "\n 3DFX_set_global_palette not found.");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
The GL_EXT_shared_texture_palette seems like an idea which is
|
||||
/almost/ a good idea, but seems to be severely broken with many
|
||||
drivers, as such it is disabled.
|
||||
|
||||
It should be noted, that a palette object extension as suggested by
|
||||
the GL_EXT_shared_texture_palette spec might be a very good idea in
|
||||
general.
|
||||
*/
|
||||
static void
|
||||
Shared_Init8bitPalette (void)
|
||||
{
|
||||
int i;
|
||||
GLubyte thePalette[256 * 3];
|
||||
GLubyte *oldPalette, *newPalette;
|
||||
|
||||
if (is8bit)
|
||||
return;
|
||||
|
||||
if (QFGL_ExtensionPresent ("GL_EXT_shared_texture_palette")) {
|
||||
if (!(qglColorTableEXT = QFGL_ExtensionAddress ("glColorTableEXT"))) {
|
||||
Sys_MaskPrintf (SYS_VID, "glColorTableEXT not found.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Sys_MaskPrintf (SYS_VID, "GL_EXT_shared_texture_palette\n");
|
||||
|
||||
qfglEnable (GL_SHARED_TEXTURE_PALETTE_EXT);
|
||||
oldPalette = (GLubyte *) d_8to24table; // d_8to24table3dfx;
|
||||
newPalette = thePalette;
|
||||
for (i = 0; i < 256; i++) {
|
||||
*newPalette++ = *oldPalette++;
|
||||
*newPalette++ = *oldPalette++;
|
||||
*newPalette++ = *oldPalette++;
|
||||
oldPalette++;
|
||||
}
|
||||
qglColorTableEXT (GL_SHARED_TEXTURE_PALETTE_EXT, GL_RGB, 256, GL_RGB,
|
||||
GL_UNSIGNED_BYTE, (GLvoid *) thePalette);
|
||||
is8bit = true;
|
||||
} else {
|
||||
Sys_MaskPrintf (SYS_VID,
|
||||
"\n GL_EXT_shared_texture_palette not found.");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
VID_Init8bitPalette (void)
|
||||
{
|
||||
Sys_MaskPrintf (SYS_VID, "Checking for 8-bit extension: ");
|
||||
if (vid_use8bit->int_val) {
|
||||
Tdfx_Init8bitPalette ();
|
||||
Shared_Init8bitPalette ();
|
||||
if (!is8bit)
|
||||
Sys_MaskPrintf (SYS_VID, "\n 8-bit extension not found.\n");
|
||||
} else {
|
||||
Sys_MaskPrintf (SYS_VID, "disabled.\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
VID_LockBuffer (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
VID_UnlockBuffer (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height)
|
||||
{
|
||||
|
|
|
@ -70,7 +70,7 @@ GLSL_Common_Init_Cvars (void)
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
static __attribute__((used)) void //FIXME
|
||||
VID_SetPalette (unsigned char *palette)
|
||||
{
|
||||
byte *pal, *col, *ip, *op;
|
||||
|
@ -167,21 +167,6 @@ GL_Init_Common (void)
|
|||
qfglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
void
|
||||
VID_Init8bitPalette (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
VID_LockBuffer (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
VID_UnlockBuffer (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height)
|
||||
{
|
||||
|
|
|
@ -37,6 +37,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
#define NUM_MIPS 4
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
|
||||
#include "d_iface.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
typedef struct {
|
||||
vrect_t rect;
|
||||
|
@ -754,9 +755,9 @@ Draw_BlendScreen (quat_t color)
|
|||
g += (int) (color[3] * (color[1] * 256 - g));
|
||||
b += (int) (color[3] * (color[2] * 256 - b));
|
||||
|
||||
newpal[0] = gammatable[r];
|
||||
newpal[1] = gammatable[g];
|
||||
newpal[2] = gammatable[b];
|
||||
newpal[0] = vid.gammatable[r];
|
||||
newpal[1] = vid.gammatable[g];
|
||||
newpal[2] = vid.gammatable[b];
|
||||
newpal += 3;
|
||||
}
|
||||
VID_ShiftPalette (pal);
|
||||
|
|
|
@ -52,7 +52,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
|
||||
#include "compat.h"
|
||||
#include "r_internal.h"
|
||||
#include "sbar.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
/* SCREEN SHOTS */
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "d_ifacea.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
/*
|
||||
FIXME
|
||||
|
|
|
@ -54,6 +54,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
#ifdef PIC
|
||||
# undef USE_INTEL_ASM //XXX asm pic hack
|
||||
|
|
|
@ -39,6 +39,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
|
||||
static void
|
||||
|
|
|
@ -39,6 +39,8 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sys.h"
|
||||
#include "QF/vid.h"
|
||||
|
||||
#include "vid_internal.h"
|
||||
|
||||
unsigned short d_8to16table[256];
|
||||
|
||||
void
|
||||
|
|
|
@ -37,6 +37,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "d_local.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
static int miplevel;
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "d_iface.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
|
||||
void
|
||||
|
|
|
@ -37,6 +37,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
#define NUM_MIPS 4
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "d_local.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
|
||||
void
|
||||
|
|
|
@ -38,6 +38,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
static byte *r_turb_pbase;
|
||||
static void *r_turb_pdest;
|
||||
|
|
|
@ -37,6 +37,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
static int sprite_height;
|
||||
static int minindex, maxindex;
|
||||
|
|
|
@ -35,6 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "d_local.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
|
||||
void
|
||||
|
|
|
@ -47,6 +47,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
|
||||
#include "d_iface.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
typedef struct {
|
||||
vrect_t rect;
|
||||
|
@ -1225,9 +1226,9 @@ Draw_BlendScreen (quat_t color)
|
|||
g += (int) (color[3] * (color[1] * 256 - g));
|
||||
b += (int) (color[3] * (color[2] * 256 -g));
|
||||
|
||||
newpal[0] = gammatable[r];
|
||||
newpal[1] = gammatable[g];
|
||||
newpal[2] = gammatable[b];
|
||||
newpal[0] = vid.gammatable[r];
|
||||
newpal[1] = vid.gammatable[g];
|
||||
newpal[2] = vid.gammatable[b];
|
||||
newpal += 3;
|
||||
}
|
||||
VID_ShiftPalette (pal);
|
||||
|
@ -1248,10 +1249,10 @@ Draw_BlendScreen (quat_t color)
|
|||
g2 += (int) (color[3] * (color[1] - g2));
|
||||
b += (int) (color[3] * (color[2] - b));
|
||||
|
||||
rramp[i] = (gammatable[r] << 8) & 0xF800;
|
||||
gramp[i*2+0] = (gammatable[g1] << 3) & 0x07E0;
|
||||
gramp[i*2+1] = (gammatable[g2] << 3) & 0x07E0;
|
||||
bramp[i] = (gammatable[b] >> 3) & 0x001F;
|
||||
rramp[i] = (vid.gammatable[r] << 8) & 0xF800;
|
||||
gramp[i*2+0] = (vid.gammatable[g1] << 3) & 0x07E0;
|
||||
gramp[i*2+1] = (vid.gammatable[g2] << 3) & 0x07E0;
|
||||
bramp[i] = (vid.gammatable[b] >> 3) & 0x001F;
|
||||
}
|
||||
temp = vid.buffer;
|
||||
for (y = 0;y < vid.height;y++, temp += (vid.rowbytes >> 1))
|
||||
|
@ -1273,9 +1274,9 @@ Draw_BlendScreen (quat_t color)
|
|||
g += (int) (color[3] * (color[1] * 256 - g));
|
||||
b += (int) (color[3] * (color[2] * 256 - b));
|
||||
|
||||
ramp[i][0] = gammatable[r];
|
||||
ramp[i][1] = gammatable[g];
|
||||
ramp[i][2] = gammatable[b];
|
||||
ramp[i][0] = vid.gammatable[r];
|
||||
ramp[i][1] = vid.gammatable[g];
|
||||
ramp[i][2] = vid.gammatable[b];
|
||||
ramp[i][3] = 0;
|
||||
}
|
||||
temp = vid.buffer;
|
||||
|
|
|
@ -52,7 +52,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
|
||||
#include "compat.h"
|
||||
#include "r_internal.h"
|
||||
#include "sbar.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
/* SCREEN SHOTS */
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sys.h"
|
||||
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
/*
|
||||
R_LineGraph
|
||||
|
|
|
@ -36,6 +36,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "d_ifacea.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
/*
|
||||
FIXME
|
||||
|
|
|
@ -51,6 +51,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
//define PASSAGES
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
|
||||
static void
|
||||
|
|
|
@ -42,6 +42,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
|
||||
static int iskyspeed = 8;
|
||||
|
|
|
@ -41,9 +41,9 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "r_internal.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
VISIBLE unsigned short d_8to16table[256];
|
||||
unsigned char d_15to8table[65536];
|
||||
|
||||
|
||||
/*
|
||||
|
@ -191,7 +191,7 @@ VID_MakeColormap8 (void *outcolormap, byte *pal)
|
|||
|
||||
LordHavoc: makes 8bit, 16bit, and 32bit colormaps and palettes
|
||||
*/
|
||||
void
|
||||
static __attribute__((used)) void //FIXME
|
||||
VID_MakeColormaps (int fullbrights, byte *pal)
|
||||
{
|
||||
vid.fullbright = fullbrights;
|
||||
|
|
|
@ -5,24 +5,15 @@ INCLUDES= -I$(top_srcdir)/include
|
|||
lib_ldflags=-version-info $(QUAKE_LIBRARY_VERSION_INFO) \
|
||||
-rpath $(libdir) -no-undefined
|
||||
|
||||
if ASM_ARCH
|
||||
asm= libvid_asm.la
|
||||
else
|
||||
asm=
|
||||
endif
|
||||
|
||||
lib_LTLIBRARIES= @JOY_TARGETS@
|
||||
|
||||
noinst_LTLIBRARIES= @VID_TARGETS@ @vid_libs@
|
||||
|
||||
EXTRA_LTLIBRARIES= \
|
||||
libQFjs.la libQFfbdev.la libQFsvga.la libQFx11.la libQFsdl.la libQFwgl.la \
|
||||
libvid_asm.la libvid_common.la libvid_gl.la libvid_glsl.la libvid_sdl.la \
|
||||
libvid_common.la libvid_gl.la libvid_glsl.la libvid_sdl.la \
|
||||
libvid_svga.la libvid_x11.la
|
||||
|
||||
libvid_asm_la_SOURCES= d_copy.S
|
||||
libvid_asm_la_CFLAGS= @PREFER_NON_PIC@
|
||||
|
||||
joy_linux_src= joy_linux.c
|
||||
joy_win_src= joy_win.c
|
||||
joy_null_src= joy_null.c
|
||||
|
@ -92,23 +83,13 @@ libQFsdl_la_DEPENDENCIES= $(sdl_libs)
|
|||
#
|
||||
# SVGAlib
|
||||
#
|
||||
svga_libs=$(asm) libvid_common.la libvid_svga.la
|
||||
svga_libs=libvid_common.la libvid_svga.la
|
||||
libQFsvga_la_CFLAGS= @PREFER_NON_PIC@ $(SVGA_CFLAGS)
|
||||
libQFsvga_la_SOURCES= vid_svgalib.c
|
||||
libQFsvga_la_LDFLAGS= @STATIC@
|
||||
libQFsvga_la_LIBADD= $(svga_libs)
|
||||
libQFsvga_la_DEPENDENCIES= $(svga_libs)
|
||||
|
||||
#
|
||||
# 3dfx
|
||||
#
|
||||
tdfx_libs=$(asm) libvid_common.la libvid_gl.la libvid_svga.la
|
||||
libQFtdfx_la_CFLAGS= @PREFER_NON_PIC@ $(SVGA_CFLAGS)
|
||||
libQFtdfx_la_SOURCES= vid_3dfxsvga.c
|
||||
libQFtdfx_la_LDFLAGS= @STATIC@
|
||||
libQFtdfx_la_LIBADD= $(tdfx_libs)
|
||||
libQFtdfx_la_DEPENDENCIES= $(tdfx_libs)
|
||||
|
||||
#
|
||||
# OpenGL in Win32
|
||||
#
|
||||
|
|
|
@ -22,6 +22,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/vid.h"
|
||||
|
||||
#include "context_sdl.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
cvar_t *vid_bitdepth;
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "context_x11.h"
|
||||
#include "dga_check.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
static void (*event_handlers[LASTEvent]) (XEvent *);
|
||||
qboolean oktodraw = false;
|
||||
|
|
|
@ -75,11 +75,11 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/qargs.h"
|
||||
#include "QF/sound.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "context_x11.h"
|
||||
#include "dga_check.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
cvar_t *in_snd_block;
|
||||
cvar_t *in_dga;
|
||||
|
|
|
@ -45,9 +45,9 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/qargs.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/va.h"
|
||||
#include "QF/vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
/* Software and hardware gamma support */
|
||||
VISIBLE byte gammatable[256];
|
||||
|
|
|
@ -71,10 +71,10 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/qargs.h"
|
||||
#include "QF/qendian.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/vid.h"
|
||||
|
||||
#include "d_iface.h"
|
||||
#include "fbset.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
#ifndef PAGE_SIZE
|
||||
# define PAGE_SIZE (sysconf(_SC_PAGESIZE))
|
||||
|
@ -307,7 +307,6 @@ VID_SetMode (const char *name, unsigned char *palette)
|
|||
viddef.width = vmode->xres;
|
||||
viddef.height = vmode->yres;
|
||||
viddef.rowbytes = vmode->xres * (vmode->depth >> 3);
|
||||
viddef.colormap8 = (byte *) vid_colormap;
|
||||
viddef.fullbright = 256 - viddef.colormap8[256 * VID_GRADES];
|
||||
viddef.conrowbytes = viddef.rowbytes;
|
||||
viddef.numpages = 1;
|
||||
|
@ -410,15 +409,13 @@ VID_Init (byte *palette, byte *colormap)
|
|||
if (fbdev_inited)
|
||||
return;
|
||||
|
||||
vid_colormap = colormap;
|
||||
|
||||
if (COM_CheckParm ("-novideo")) {
|
||||
viddef.width = 320;
|
||||
viddef.height = 200;
|
||||
viddef.rowbytes = 320;
|
||||
viddef.aspect = ((float) viddef.height
|
||||
/ (float) viddef.width) * (4.0 / 3.0);
|
||||
viddef.colormap8 = (byte *) vid_colormap;
|
||||
viddef.colormap8 = colormap;
|
||||
viddef.fullbright = 256 - viddef.colormap8[256 * VID_GRADES];
|
||||
viddef.conrowbytes = viddef.rowbytes;
|
||||
viddef.conwidth = viddef.width;
|
||||
|
|
|
@ -162,14 +162,6 @@ glx_get_functions (void)
|
|||
use_gl_procaddress = 1;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
VID_Shutdown (void)
|
||||
{
|
||||
Sys_MaskPrintf (SYS_VID, "VID_Shutdown\n");
|
||||
X11_CloseDisplay ();
|
||||
}
|
||||
|
||||
static void
|
||||
GL_Init (void)
|
||||
{
|
||||
|
@ -240,28 +232,3 @@ VID_Init (byte *palette, byte *colormap)
|
|||
vid.initialized = true;
|
||||
vid.recalc_refdef = 1; // force a surface cache flush
|
||||
}
|
||||
|
||||
void
|
||||
VID_Init_Cvars ()
|
||||
{
|
||||
X11_Init_Cvars ();
|
||||
}
|
||||
|
||||
void
|
||||
VID_SetCaption (const char *text)
|
||||
{
|
||||
if (text && *text) {
|
||||
char *temp = strdup (text);
|
||||
|
||||
X11_SetCaption (va ("%s: %s", PACKAGE_STRING, temp));
|
||||
free (temp);
|
||||
} else {
|
||||
X11_SetCaption (va ("%s", PACKAGE_STRING));
|
||||
}
|
||||
}
|
||||
|
||||
qboolean
|
||||
VID_SetGamma (double gamma)
|
||||
{
|
||||
return X11_SetGamma (gamma);
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/vid.h"
|
||||
|
||||
#include "d_iface.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
#ifdef _WIN32 // FIXME: evil hack to get full DirectSound support with SDL
|
||||
#include <windows.h>
|
||||
|
@ -105,7 +106,6 @@ VID_Init (byte *palette, byte *colormap)
|
|||
if (!(screen = SDL_SetVideoMode (viddef.width, viddef.height, 8, flags)))
|
||||
Sys_Error ("VID: Couldn't set video mode: %s", SDL_GetError ());
|
||||
|
||||
vid_colormap = colormap;
|
||||
VID_InitGamma (palette);
|
||||
VID_SetPalette (viddef.palette);
|
||||
|
||||
|
@ -113,7 +113,7 @@ VID_Init (byte *palette, byte *colormap)
|
|||
VGA_width = viddef.width;
|
||||
VGA_height = viddef.height;
|
||||
viddef.numpages = 1;
|
||||
viddef.colormap8 = vid_colormap;
|
||||
viddef.colormap8 = colormap;
|
||||
viddef.fullbright = 256 - viddef.colormap8[256 * VID_GRADES];
|
||||
viddef.do_screen_buffer = do_screen_buffer;
|
||||
VGA_pagebase = viddef.buffer = screen->pixels;
|
||||
|
|
|
@ -74,14 +74,12 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/screen.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/va.h"
|
||||
#include "QF/vid.h"
|
||||
|
||||
#include "QF/plugin/vid_render.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "context_x11.h"
|
||||
#include "d_iface.h"
|
||||
#include "dga_check.h"
|
||||
#include "vid_internal.h"
|
||||
|
||||
int XShmGetEventBase (Display *x); // for broken X11 headers
|
||||
|
||||
|
@ -500,7 +498,7 @@ void
|
|||
VID_Init (byte *palette, byte *colormap)
|
||||
{
|
||||
viddef.numpages = 2;
|
||||
viddef.colormap8 = vid_colormap = colormap;
|
||||
viddef.colormap8 = colormap;
|
||||
viddef.fullbright = 256 - viddef.colormap8[256 * VID_GRADES];
|
||||
|
||||
srandom (getpid ());
|
||||
|
|
|
@ -53,8 +53,6 @@ cvar_t *chase_active;
|
|||
int fps_count;
|
||||
int viewentity;
|
||||
|
||||
byte *vid_colormap;
|
||||
|
||||
vid_render_data_t *r_data;
|
||||
vid_render_funcs_t *r_funcs;
|
||||
|
||||
|
|
Loading…
Reference in a new issue