mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-27 06:00:51 +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
|
if test "x$ASM_ARCH" = "xyes"; then
|
||||||
QF_NEED(swrend, [asm])
|
QF_NEED(swrend, [asm])
|
||||||
fi
|
fi
|
||||||
QF_NEED(vid, [common sw])
|
QF_NEED(vid, [common])
|
||||||
QF_NEED(qw, [client common])
|
QF_NEED(qw, [client common])
|
||||||
QF_NEED(nq, [client common])
|
QF_NEED(nq, [client common])
|
||||||
QF_NEED(console, [client])
|
QF_NEED(console, [client])
|
||||||
|
@ -55,10 +55,10 @@ if test "x$HAVE_FBDEV" = xyes; then
|
||||||
fi
|
fi
|
||||||
if test "x$HAVE_X" = xyes; then
|
if test "x$HAVE_X" = xyes; then
|
||||||
if test "x$ENABLE_clients_glx" = xyes; then
|
if test "x$ENABLE_clients_glx" = xyes; then
|
||||||
QF_NEED(vid, [common gl x11])
|
QF_NEED(vid, [common x11])
|
||||||
fi
|
fi
|
||||||
if test "x$ENABLE_clients_glslx" = xyes; then
|
if test "x$ENABLE_clients_glslx" = xyes; then
|
||||||
QF_NEED(vid, [common glsl x11])
|
QF_NEED(vid, [common x11])
|
||||||
fi
|
fi
|
||||||
if test "x$ENABLE_clients_x11" = xyes; then
|
if test "x$ENABLE_clients_x11" = xyes; then
|
||||||
QW_TARGETS="$QW_TARGETS qw-client-x11\$(EXEEXT)"
|
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
|
if test "x$ASM_ARCH" = "xyes"; then
|
||||||
QF_NEED(swrend, [asm])
|
QF_NEED(swrend, [asm])
|
||||||
fi
|
fi
|
||||||
QF_NEED(vid, [common sw x11])
|
QF_NEED(vid, [common x11])
|
||||||
QF_NEED(qw, [client common])
|
QF_NEED(qw, [client common])
|
||||||
QF_NEED(nq, [client common])
|
QF_NEED(nq, [client common])
|
||||||
QF_NEED(console, [client])
|
QF_NEED(console, [client])
|
||||||
|
@ -97,7 +97,7 @@ if test "x$HAVE_SDL" = xyes; then
|
||||||
if test "x$ASM_ARCH" = "xyes"; then
|
if test "x$ASM_ARCH" = "xyes"; then
|
||||||
QF_NEED(swrend, [asm])
|
QF_NEED(swrend, [asm])
|
||||||
fi
|
fi
|
||||||
QF_NEED(vid, [common sdl sw])
|
QF_NEED(vid, [common sdl])
|
||||||
QF_NEED(qw, [client common sdl])
|
QF_NEED(qw, [client common sdl])
|
||||||
QF_NEED(nq, [client common sdl])
|
QF_NEED(nq, [client common sdl])
|
||||||
QF_NEED(console, [client])
|
QF_NEED(console, [client])
|
||||||
|
@ -117,7 +117,7 @@ if test "x$HAVE_SVGA" = xyes; then
|
||||||
if test "x$ASM_ARCH" = "xyes"; then
|
if test "x$ASM_ARCH" = "xyes"; then
|
||||||
QF_NEED(swrend, [asm])
|
QF_NEED(swrend, [asm])
|
||||||
fi
|
fi
|
||||||
QF_NEED(vid, [asm common svga sw])
|
QF_NEED(vid, [common svga])
|
||||||
QF_NEED(qw, [client common])
|
QF_NEED(qw, [client common])
|
||||||
QF_NEED(nq, [client common])
|
QF_NEED(nq, [client common])
|
||||||
QF_NEED(console, [client])
|
QF_NEED(console, [client])
|
||||||
|
@ -134,7 +134,7 @@ fi
|
||||||
# QF_NEED(alias, [gl])
|
# QF_NEED(alias, [gl])
|
||||||
# QF_NEED(brush, [gl])
|
# QF_NEED(brush, [gl])
|
||||||
# QF_NEED(sprite, [gl])
|
# QF_NEED(sprite, [gl])
|
||||||
# QF_NEED(vid, [common gl])
|
# QF_NEED(vid, [common])
|
||||||
# QF_NEED(qw, [client common])
|
# QF_NEED(qw, [client common])
|
||||||
# QF_NEED(nq, [client common])
|
# QF_NEED(nq, [client common])
|
||||||
# QF_NEED(console, [client])
|
# 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(brush, [gl glsl sw])
|
||||||
QF_PROCESS_NEED_LIBS(sprite, [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(qw, [client common sdl server], a)
|
||||||
QF_PROCESS_NEED_LIBS(nq, [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_CBITS 6
|
||||||
#define VID_GRADES (1 << VID_CBITS)
|
#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 {
|
typedef struct {
|
||||||
qboolean initialized;
|
qboolean initialized;
|
||||||
|
qboolean is8bit;
|
||||||
void *buffer; // invisible buffer
|
void *buffer; // invisible buffer
|
||||||
short *zbuffer;
|
short *zbuffer;
|
||||||
void *surfcache;
|
void *surfcache;
|
||||||
|
byte *gammatable; // 256
|
||||||
byte *basepal; // 256 * 3
|
byte *basepal; // 256 * 3
|
||||||
byte *palette; // 256 * 3
|
byte *palette; // 256 * 3
|
||||||
byte *colormap8; // 256 * VID_GRADES size
|
byte *colormap8; // 256 * VID_GRADES size
|
||||||
|
@ -80,60 +72,17 @@ typedef struct {
|
||||||
|
|
||||||
extern viddef_t viddef;
|
extern viddef_t viddef;
|
||||||
|
|
||||||
extern unsigned short d_8to16table[256];
|
extern unsigned int d_8to24table[256]; //FIXME nq/qw uses
|
||||||
extern unsigned int d_8to24table[256];
|
|
||||||
|
|
||||||
extern byte gammatable[256];
|
|
||||||
extern struct cvar_s *vid_gamma;
|
|
||||||
extern qboolean vid_gamma_avail;
|
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);
|
void VID_Init_Cvars (void);
|
||||||
|
|
||||||
// Called at startup to set up translation tables, takes 256 8 bit RGB values
|
// 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 palette data will go away after the call, so it must be copied off if
|
||||||
// the video driver will need it again
|
// the video driver will need it again
|
||||||
void VID_Init (byte *palette, byte *colormap);
|
void VID_Init (byte *palette, byte *colormap);
|
||||||
|
|
||||||
// Called at shutdown
|
|
||||||
void VID_Shutdown (void);
|
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);
|
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_
|
#endif // __vid_h_
|
||||||
|
|
|
@ -78,4 +78,6 @@ void R_DrawAliasModel (entity_t *e);
|
||||||
|
|
||||||
void R_MarkLeaves (void);
|
void R_MarkLeaves (void);
|
||||||
|
|
||||||
|
void GL_Init_Common (void);
|
||||||
|
|
||||||
#endif//__r_internal_h
|
#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/quakefs.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
#include "QF/va.h"
|
#include "QF/va.h"
|
||||||
#include "QF/vid.h"
|
|
||||||
#include "QF/GL/qf_textures.h"
|
#include "QF/GL/qf_textures.h"
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "mod_internal.h"
|
#include "mod_internal.h"
|
||||||
|
#include "r_internal.h"
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -180,14 +180,14 @@ Mod_LoadLighting (bsp_t *bsp)
|
||||||
|
|
||||||
if (mod_lightmap_bytes > 1)
|
if (mod_lightmap_bytes > 1)
|
||||||
for (i = 0; i < bsp->lightdatasize ; i++) {
|
for (i = 0; i < bsp->lightdatasize ; i++) {
|
||||||
d = gammatable[*in++];
|
d = vid.gammatable[*in++];
|
||||||
*out++ = d;
|
*out++ = d;
|
||||||
*out++ = d;
|
*out++ = d;
|
||||||
*out++ = d;
|
*out++ = d;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for (i = 0; i < bsp->lightdatasize ; i++)
|
for (i = 0; i < bsp->lightdatasize ; i++)
|
||||||
*out++ = gammatable[*in++];
|
*out++ = vid.gammatable[*in++];
|
||||||
dstring_delete (litfilename);
|
dstring_delete (litfilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ build_skin (skin_t *skin, int cmap)
|
||||||
skin->texnum = texnum;
|
skin->texnum = texnum;
|
||||||
skin->auxtex = fb_texnum;
|
skin->auxtex = fb_texnum;
|
||||||
}
|
}
|
||||||
if (VID_Is8bit ()) {
|
if (vid.is8bit) {
|
||||||
build_skin_8 (s->tex, texnum, skin_cmap[cmap],
|
build_skin_8 (s->tex, texnum, skin_cmap[cmap],
|
||||||
scaled_width, scaled_height, false);
|
scaled_width, scaled_height, false);
|
||||||
if (s->fb)
|
if (s->fb)
|
||||||
|
|
|
@ -47,7 +47,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "QF/draw.h"
|
#include "QF/draw.h"
|
||||||
#include "QF/mathlib.h"
|
#include "QF/mathlib.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
#include "QF/vid.h"
|
|
||||||
#include "QF/GL/defines.h"
|
#include "QF/GL/defines.h"
|
||||||
#include "QF/GL/funcs.h"
|
#include "QF/GL/funcs.h"
|
||||||
#include "QF/GL/qf_textures.h"
|
#include "QF/GL/qf_textures.h"
|
||||||
|
@ -56,6 +55,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
#include "sbar.h"
|
#include "sbar.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int texnum;
|
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);
|
GL_Upload8_EXT (data, width, height, mipmap, alpha);
|
||||||
} else {
|
} else {
|
||||||
GL_Upload32 (trans, width, height, mipmap, alpha);
|
GL_Upload32 (trans, width, height, mipmap, alpha);
|
||||||
|
|
|
@ -56,7 +56,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "d_iface.h"
|
#include "d_iface.h"
|
||||||
#include "r_cvar.h"
|
#include "r_internal.h"
|
||||||
#include "sbar.h"
|
#include "sbar.h"
|
||||||
|
|
||||||
#define WARP_WIDTH 320
|
#define WARP_WIDTH 320
|
||||||
|
@ -100,7 +100,6 @@ VISIBLE int lm_src_blend, lm_dest_blend;
|
||||||
VISIBLE float rgb_scale = 1.0;
|
VISIBLE float rgb_scale = 1.0;
|
||||||
|
|
||||||
VISIBLE QF_glColorTableEXT qglColorTableEXT = NULL;
|
VISIBLE QF_glColorTableEXT qglColorTableEXT = NULL;
|
||||||
VISIBLE qboolean is8bit = false;
|
|
||||||
|
|
||||||
VISIBLE qboolean gl_feature_mach64 = false;
|
VISIBLE qboolean gl_feature_mach64 = false;
|
||||||
|
|
||||||
|
@ -520,7 +519,104 @@ CheckLights (void)
|
||||||
qfglDisable (GL_LIGHTING);
|
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)
|
VID_SetPalette (unsigned char *palette)
|
||||||
{
|
{
|
||||||
byte *pal;
|
byte *pal;
|
||||||
|
@ -639,119 +735,6 @@ GL_Init_Common (void)
|
||||||
qfglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
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
|
void
|
||||||
D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height)
|
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)
|
VID_SetPalette (unsigned char *palette)
|
||||||
{
|
{
|
||||||
byte *pal, *col, *ip, *op;
|
byte *pal, *col, *ip, *op;
|
||||||
|
@ -167,21 +167,6 @@ GL_Init_Common (void)
|
||||||
qfglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
qfglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
VID_Init8bitPalette (void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
VID_LockBuffer (void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
VID_UnlockBuffer (void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height)
|
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 "compat.h"
|
||||||
#include "d_local.h"
|
#include "d_local.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
#define NUM_MIPS 4
|
#define NUM_MIPS 4
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
||||||
|
|
||||||
#include "d_iface.h"
|
#include "d_iface.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
vrect_t rect;
|
vrect_t rect;
|
||||||
|
@ -754,9 +755,9 @@ Draw_BlendScreen (quat_t color)
|
||||||
g += (int) (color[3] * (color[1] * 256 - g));
|
g += (int) (color[3] * (color[1] * 256 - g));
|
||||||
b += (int) (color[3] * (color[2] * 256 - b));
|
b += (int) (color[3] * (color[2] * 256 - b));
|
||||||
|
|
||||||
newpal[0] = gammatable[r];
|
newpal[0] = vid.gammatable[r];
|
||||||
newpal[1] = gammatable[g];
|
newpal[1] = vid.gammatable[g];
|
||||||
newpal[2] = gammatable[b];
|
newpal[2] = vid.gammatable[b];
|
||||||
newpal += 3;
|
newpal += 3;
|
||||||
}
|
}
|
||||||
VID_ShiftPalette (pal);
|
VID_ShiftPalette (pal);
|
||||||
|
|
|
@ -52,7 +52,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
#include "sbar.h"
|
#include "vid_internal.h"
|
||||||
|
|
||||||
/* SCREEN SHOTS */
|
/* SCREEN SHOTS */
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "d_ifacea.h"
|
#include "d_ifacea.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FIXME
|
FIXME
|
||||||
|
|
|
@ -54,6 +54,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
#ifdef PIC
|
#ifdef PIC
|
||||||
# undef USE_INTEL_ASM //XXX asm pic hack
|
# undef USE_INTEL_ASM //XXX asm pic hack
|
||||||
|
|
|
@ -39,6 +39,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -39,6 +39,8 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
#include "QF/vid.h"
|
#include "QF/vid.h"
|
||||||
|
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
unsigned short d_8to16table[256];
|
unsigned short d_8to16table[256];
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -37,6 +37,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "d_local.h"
|
#include "d_local.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
static int miplevel;
|
static int miplevel;
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "d_iface.h"
|
#include "d_iface.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -37,6 +37,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "d_local.h"
|
#include "d_local.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
#define NUM_MIPS 4
|
#define NUM_MIPS 4
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "d_local.h"
|
#include "d_local.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -38,6 +38,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "d_local.h"
|
#include "d_local.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
static byte *r_turb_pbase;
|
static byte *r_turb_pbase;
|
||||||
static void *r_turb_pdest;
|
static void *r_turb_pdest;
|
||||||
|
|
|
@ -37,6 +37,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "d_local.h"
|
#include "d_local.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
static int sprite_height;
|
static int sprite_height;
|
||||||
static int minindex, maxindex;
|
static int minindex, maxindex;
|
||||||
|
|
|
@ -35,6 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "d_local.h"
|
#include "d_local.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -47,6 +47,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
||||||
|
|
||||||
#include "d_iface.h"
|
#include "d_iface.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
vrect_t rect;
|
vrect_t rect;
|
||||||
|
@ -1225,9 +1226,9 @@ Draw_BlendScreen (quat_t color)
|
||||||
g += (int) (color[3] * (color[1] * 256 - g));
|
g += (int) (color[3] * (color[1] * 256 - g));
|
||||||
b += (int) (color[3] * (color[2] * 256 -g));
|
b += (int) (color[3] * (color[2] * 256 -g));
|
||||||
|
|
||||||
newpal[0] = gammatable[r];
|
newpal[0] = vid.gammatable[r];
|
||||||
newpal[1] = gammatable[g];
|
newpal[1] = vid.gammatable[g];
|
||||||
newpal[2] = gammatable[b];
|
newpal[2] = vid.gammatable[b];
|
||||||
newpal += 3;
|
newpal += 3;
|
||||||
}
|
}
|
||||||
VID_ShiftPalette (pal);
|
VID_ShiftPalette (pal);
|
||||||
|
@ -1248,10 +1249,10 @@ Draw_BlendScreen (quat_t color)
|
||||||
g2 += (int) (color[3] * (color[1] - g2));
|
g2 += (int) (color[3] * (color[1] - g2));
|
||||||
b += (int) (color[3] * (color[2] - b));
|
b += (int) (color[3] * (color[2] - b));
|
||||||
|
|
||||||
rramp[i] = (gammatable[r] << 8) & 0xF800;
|
rramp[i] = (vid.gammatable[r] << 8) & 0xF800;
|
||||||
gramp[i*2+0] = (gammatable[g1] << 3) & 0x07E0;
|
gramp[i*2+0] = (vid.gammatable[g1] << 3) & 0x07E0;
|
||||||
gramp[i*2+1] = (gammatable[g2] << 3) & 0x07E0;
|
gramp[i*2+1] = (vid.gammatable[g2] << 3) & 0x07E0;
|
||||||
bramp[i] = (gammatable[b] >> 3) & 0x001F;
|
bramp[i] = (vid.gammatable[b] >> 3) & 0x001F;
|
||||||
}
|
}
|
||||||
temp = vid.buffer;
|
temp = vid.buffer;
|
||||||
for (y = 0;y < vid.height;y++, temp += (vid.rowbytes >> 1))
|
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));
|
g += (int) (color[3] * (color[1] * 256 - g));
|
||||||
b += (int) (color[3] * (color[2] * 256 - b));
|
b += (int) (color[3] * (color[2] * 256 - b));
|
||||||
|
|
||||||
ramp[i][0] = gammatable[r];
|
ramp[i][0] = vid.gammatable[r];
|
||||||
ramp[i][1] = gammatable[g];
|
ramp[i][1] = vid.gammatable[g];
|
||||||
ramp[i][2] = gammatable[b];
|
ramp[i][2] = vid.gammatable[b];
|
||||||
ramp[i][3] = 0;
|
ramp[i][3] = 0;
|
||||||
}
|
}
|
||||||
temp = vid.buffer;
|
temp = vid.buffer;
|
||||||
|
|
|
@ -52,7 +52,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
#include "sbar.h"
|
#include "vid_internal.h"
|
||||||
|
|
||||||
/* SCREEN SHOTS */
|
/* SCREEN SHOTS */
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
|
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
R_LineGraph
|
R_LineGraph
|
||||||
|
|
|
@ -36,6 +36,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "d_ifacea.h"
|
#include "d_ifacea.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FIXME
|
FIXME
|
||||||
|
|
|
@ -51,6 +51,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
//define PASSAGES
|
//define PASSAGES
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -42,6 +42,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
|
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
|
|
||||||
static int iskyspeed = 8;
|
static int iskyspeed = 8;
|
||||||
|
|
|
@ -41,9 +41,9 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
VISIBLE unsigned short d_8to16table[256];
|
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
|
LordHavoc: makes 8bit, 16bit, and 32bit colormaps and palettes
|
||||||
*/
|
*/
|
||||||
void
|
static __attribute__((used)) void //FIXME
|
||||||
VID_MakeColormaps (int fullbrights, byte *pal)
|
VID_MakeColormaps (int fullbrights, byte *pal)
|
||||||
{
|
{
|
||||||
vid.fullbright = fullbrights;
|
vid.fullbright = fullbrights;
|
||||||
|
|
|
@ -5,24 +5,15 @@ INCLUDES= -I$(top_srcdir)/include
|
||||||
lib_ldflags=-version-info $(QUAKE_LIBRARY_VERSION_INFO) \
|
lib_ldflags=-version-info $(QUAKE_LIBRARY_VERSION_INFO) \
|
||||||
-rpath $(libdir) -no-undefined
|
-rpath $(libdir) -no-undefined
|
||||||
|
|
||||||
if ASM_ARCH
|
|
||||||
asm= libvid_asm.la
|
|
||||||
else
|
|
||||||
asm=
|
|
||||||
endif
|
|
||||||
|
|
||||||
lib_LTLIBRARIES= @JOY_TARGETS@
|
lib_LTLIBRARIES= @JOY_TARGETS@
|
||||||
|
|
||||||
noinst_LTLIBRARIES= @VID_TARGETS@ @vid_libs@
|
noinst_LTLIBRARIES= @VID_TARGETS@ @vid_libs@
|
||||||
|
|
||||||
EXTRA_LTLIBRARIES= \
|
EXTRA_LTLIBRARIES= \
|
||||||
libQFjs.la libQFfbdev.la libQFsvga.la libQFx11.la libQFsdl.la libQFwgl.la \
|
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_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_linux_src= joy_linux.c
|
||||||
joy_win_src= joy_win.c
|
joy_win_src= joy_win.c
|
||||||
joy_null_src= joy_null.c
|
joy_null_src= joy_null.c
|
||||||
|
@ -92,23 +83,13 @@ libQFsdl_la_DEPENDENCIES= $(sdl_libs)
|
||||||
#
|
#
|
||||||
# SVGAlib
|
# 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_CFLAGS= @PREFER_NON_PIC@ $(SVGA_CFLAGS)
|
||||||
libQFsvga_la_SOURCES= vid_svgalib.c
|
libQFsvga_la_SOURCES= vid_svgalib.c
|
||||||
libQFsvga_la_LDFLAGS= @STATIC@
|
libQFsvga_la_LDFLAGS= @STATIC@
|
||||||
libQFsvga_la_LIBADD= $(svga_libs)
|
libQFsvga_la_LIBADD= $(svga_libs)
|
||||||
libQFsvga_la_DEPENDENCIES= $(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
|
# OpenGL in Win32
|
||||||
#
|
#
|
||||||
|
|
|
@ -22,6 +22,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "QF/vid.h"
|
#include "QF/vid.h"
|
||||||
|
|
||||||
#include "context_sdl.h"
|
#include "context_sdl.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
cvar_t *vid_bitdepth;
|
cvar_t *vid_bitdepth;
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
#include "context_x11.h"
|
#include "context_x11.h"
|
||||||
#include "dga_check.h"
|
#include "dga_check.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
static void (*event_handlers[LASTEvent]) (XEvent *);
|
static void (*event_handlers[LASTEvent]) (XEvent *);
|
||||||
qboolean oktodraw = false;
|
qboolean oktodraw = false;
|
||||||
|
|
|
@ -75,11 +75,11 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "QF/qargs.h"
|
#include "QF/qargs.h"
|
||||||
#include "QF/sound.h"
|
#include "QF/sound.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
#include "QF/vid.h"
|
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "context_x11.h"
|
#include "context_x11.h"
|
||||||
#include "dga_check.h"
|
#include "dga_check.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
cvar_t *in_snd_block;
|
cvar_t *in_snd_block;
|
||||||
cvar_t *in_dga;
|
cvar_t *in_dga;
|
||||||
|
|
|
@ -45,9 +45,9 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "QF/qargs.h"
|
#include "QF/qargs.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
#include "QF/va.h"
|
#include "QF/va.h"
|
||||||
#include "QF/vid.h"
|
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
/* Software and hardware gamma support */
|
/* Software and hardware gamma support */
|
||||||
VISIBLE byte gammatable[256];
|
VISIBLE byte gammatable[256];
|
||||||
|
|
|
@ -71,10 +71,10 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "QF/qargs.h"
|
#include "QF/qargs.h"
|
||||||
#include "QF/qendian.h"
|
#include "QF/qendian.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
#include "QF/vid.h"
|
|
||||||
|
|
||||||
#include "d_iface.h"
|
#include "d_iface.h"
|
||||||
#include "fbset.h"
|
#include "fbset.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
#ifndef PAGE_SIZE
|
#ifndef PAGE_SIZE
|
||||||
# define PAGE_SIZE (sysconf(_SC_PAGESIZE))
|
# define PAGE_SIZE (sysconf(_SC_PAGESIZE))
|
||||||
|
@ -307,7 +307,6 @@ VID_SetMode (const char *name, unsigned char *palette)
|
||||||
viddef.width = vmode->xres;
|
viddef.width = vmode->xres;
|
||||||
viddef.height = vmode->yres;
|
viddef.height = vmode->yres;
|
||||||
viddef.rowbytes = vmode->xres * (vmode->depth >> 3);
|
viddef.rowbytes = vmode->xres * (vmode->depth >> 3);
|
||||||
viddef.colormap8 = (byte *) vid_colormap;
|
|
||||||
viddef.fullbright = 256 - viddef.colormap8[256 * VID_GRADES];
|
viddef.fullbright = 256 - viddef.colormap8[256 * VID_GRADES];
|
||||||
viddef.conrowbytes = viddef.rowbytes;
|
viddef.conrowbytes = viddef.rowbytes;
|
||||||
viddef.numpages = 1;
|
viddef.numpages = 1;
|
||||||
|
@ -410,15 +409,13 @@ VID_Init (byte *palette, byte *colormap)
|
||||||
if (fbdev_inited)
|
if (fbdev_inited)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vid_colormap = colormap;
|
|
||||||
|
|
||||||
if (COM_CheckParm ("-novideo")) {
|
if (COM_CheckParm ("-novideo")) {
|
||||||
viddef.width = 320;
|
viddef.width = 320;
|
||||||
viddef.height = 200;
|
viddef.height = 200;
|
||||||
viddef.rowbytes = 320;
|
viddef.rowbytes = 320;
|
||||||
viddef.aspect = ((float) viddef.height
|
viddef.aspect = ((float) viddef.height
|
||||||
/ (float) viddef.width) * (4.0 / 3.0);
|
/ (float) viddef.width) * (4.0 / 3.0);
|
||||||
viddef.colormap8 = (byte *) vid_colormap;
|
viddef.colormap8 = colormap;
|
||||||
viddef.fullbright = 256 - viddef.colormap8[256 * VID_GRADES];
|
viddef.fullbright = 256 - viddef.colormap8[256 * VID_GRADES];
|
||||||
viddef.conrowbytes = viddef.rowbytes;
|
viddef.conrowbytes = viddef.rowbytes;
|
||||||
viddef.conwidth = viddef.width;
|
viddef.conwidth = viddef.width;
|
||||||
|
|
|
@ -162,14 +162,6 @@ glx_get_functions (void)
|
||||||
use_gl_procaddress = 1;
|
use_gl_procaddress = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
VID_Shutdown (void)
|
|
||||||
{
|
|
||||||
Sys_MaskPrintf (SYS_VID, "VID_Shutdown\n");
|
|
||||||
X11_CloseDisplay ();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
GL_Init (void)
|
GL_Init (void)
|
||||||
{
|
{
|
||||||
|
@ -240,28 +232,3 @@ VID_Init (byte *palette, byte *colormap)
|
||||||
vid.initialized = true;
|
vid.initialized = true;
|
||||||
vid.recalc_refdef = 1; // force a surface cache flush
|
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 "QF/vid.h"
|
||||||
|
|
||||||
#include "d_iface.h"
|
#include "d_iface.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
#ifdef _WIN32 // FIXME: evil hack to get full DirectSound support with SDL
|
#ifdef _WIN32 // FIXME: evil hack to get full DirectSound support with SDL
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -105,7 +106,6 @@ VID_Init (byte *palette, byte *colormap)
|
||||||
if (!(screen = SDL_SetVideoMode (viddef.width, viddef.height, 8, flags)))
|
if (!(screen = SDL_SetVideoMode (viddef.width, viddef.height, 8, flags)))
|
||||||
Sys_Error ("VID: Couldn't set video mode: %s", SDL_GetError ());
|
Sys_Error ("VID: Couldn't set video mode: %s", SDL_GetError ());
|
||||||
|
|
||||||
vid_colormap = colormap;
|
|
||||||
VID_InitGamma (palette);
|
VID_InitGamma (palette);
|
||||||
VID_SetPalette (viddef.palette);
|
VID_SetPalette (viddef.palette);
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ VID_Init (byte *palette, byte *colormap)
|
||||||
VGA_width = viddef.width;
|
VGA_width = viddef.width;
|
||||||
VGA_height = viddef.height;
|
VGA_height = viddef.height;
|
||||||
viddef.numpages = 1;
|
viddef.numpages = 1;
|
||||||
viddef.colormap8 = vid_colormap;
|
viddef.colormap8 = colormap;
|
||||||
viddef.fullbright = 256 - viddef.colormap8[256 * VID_GRADES];
|
viddef.fullbright = 256 - viddef.colormap8[256 * VID_GRADES];
|
||||||
viddef.do_screen_buffer = do_screen_buffer;
|
viddef.do_screen_buffer = do_screen_buffer;
|
||||||
VGA_pagebase = viddef.buffer = screen->pixels;
|
VGA_pagebase = viddef.buffer = screen->pixels;
|
||||||
|
|
|
@ -74,14 +74,12 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "QF/screen.h"
|
#include "QF/screen.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
#include "QF/va.h"
|
#include "QF/va.h"
|
||||||
#include "QF/vid.h"
|
|
||||||
|
|
||||||
#include "QF/plugin/vid_render.h"
|
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "context_x11.h"
|
#include "context_x11.h"
|
||||||
#include "d_iface.h"
|
#include "d_iface.h"
|
||||||
#include "dga_check.h"
|
#include "dga_check.h"
|
||||||
|
#include "vid_internal.h"
|
||||||
|
|
||||||
int XShmGetEventBase (Display *x); // for broken X11 headers
|
int XShmGetEventBase (Display *x); // for broken X11 headers
|
||||||
|
|
||||||
|
@ -500,7 +498,7 @@ void
|
||||||
VID_Init (byte *palette, byte *colormap)
|
VID_Init (byte *palette, byte *colormap)
|
||||||
{
|
{
|
||||||
viddef.numpages = 2;
|
viddef.numpages = 2;
|
||||||
viddef.colormap8 = vid_colormap = colormap;
|
viddef.colormap8 = colormap;
|
||||||
viddef.fullbright = 256 - viddef.colormap8[256 * VID_GRADES];
|
viddef.fullbright = 256 - viddef.colormap8[256 * VID_GRADES];
|
||||||
|
|
||||||
srandom (getpid ());
|
srandom (getpid ());
|
||||||
|
|
|
@ -53,8 +53,6 @@ cvar_t *chase_active;
|
||||||
int fps_count;
|
int fps_count;
|
||||||
int viewentity;
|
int viewentity;
|
||||||
|
|
||||||
byte *vid_colormap;
|
|
||||||
|
|
||||||
vid_render_data_t *r_data;
|
vid_render_data_t *r_data;
|
||||||
vid_render_funcs_t *r_funcs;
|
vid_render_funcs_t *r_funcs;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue