vid libs build but probably don't work yet (I KNOW x11 doesn't) lots of

build failures in the main source still
This commit is contained in:
Bill Currie 2001-04-15 08:04:15 +00:00
parent a0ab26ff6b
commit 36cbe70826
23 changed files with 52 additions and 346 deletions

View file

@ -58,6 +58,10 @@ void IN_ModeChanged (void);
void IN_HandlePause (qboolean paused);
extern cvar_t *_windowed_mouse;
extern cvar_t *m_filter;
extern cvar_t *in_freelook;
extern cvar_t *sensitivity;
extern cvar_t *lookstrafe;
extern qboolean in_mouse_avail;
extern float in_mouse_x, in_mouse_y;

View file

@ -67,8 +67,6 @@ extern glvert_t glv;
extern int glx, gly, glwidth, glheight;
// r_local.h -- private refresh defs
#define ALIAS_BASE_SIZE_RATIO (1.0 / 11.0)
// normalizing factor so player model works out to about
// 1 pixel per triangle
@ -86,54 +84,6 @@ extern int glx, gly, glwidth, glheight;
#define BACKFACE_EPSILON 0.01
void R_TimeRefresh_f (void);
void R_ReadPointFile_f (void);
texture_t *R_TextureAnimation (texture_t *base);
typedef struct surfcache_s {
struct surfcache_s *next;
struct surfcache_s **owner; // NULL is an empty chunk of memory
int lightadj[MAXLIGHTMAPS]; // checked for strobe flush
int dlight;
int size; // including header
unsigned int width;
unsigned int height; // DEBUG only needed for debug
float mipscale;
struct texture_s *texture; // checked for animating textures
byte data[4]; // width*height elements
} surfcache_t;
#if 0
//====================================================
extern entity_t r_worldentity;
extern qboolean r_cache_thrash; // compatability
extern vec3_t modelorg, r_entorigin;
extern entity_t *currententity;
extern int r_visframecount; // ??? what difs?
extern int r_framecount;
extern mplane_t frustum[4];
extern int c_brush_polys, c_alias_polys;
//
// view origin
//
extern vec3_t vup;
extern vec3_t vpn;
extern vec3_t vright;
extern vec3_t r_origin;
//
// screen size info
//
extern refdef_t r_refdef;
extern mleaf_t *r_viewleaf, *r_oldviewleaf;
extern texture_t *r_notexture_mip;
extern int d_lightstylevalue[256]; // 8.8 fraction of base light value
#endif
extern qboolean envmap;
extern int currenttexture;
extern int cnttextures[2];
@ -145,22 +95,7 @@ extern int player_fb_textures;
extern int skytexturenum; // index in cl.loadmodel, not gl texture object
extern cvar_t *r_norefresh;
extern cvar_t *r_drawentities;
extern cvar_t *r_drawworld;
extern cvar_t *r_drawviewmodel;
extern cvar_t *r_particles;
extern cvar_t *r_speeds;
extern cvar_t *r_waterwarp;
extern cvar_t *r_fullbright;
extern cvar_t *r_lightmap;
extern cvar_t *r_shadows;
extern cvar_t *r_mirroralpha;
extern cvar_t *r_wateralpha;
extern cvar_t *r_waterripple;
extern cvar_t *r_dynamic;
extern cvar_t *r_novis;
extern cvar_t *r_netgraph;
extern cvar_t *gl_affinemodels;
extern cvar_t *gl_clear;
@ -209,18 +144,13 @@ extern int gl_lightmap_format;
extern int gl_solid_format;
extern int gl_alpha_format;
extern float r_world_matrix[16];
extern float bubble_sintable[], bubble_costable[];
extern float v_blend[4];
extern unsigned char lighthalf_v[3];
extern const char *gl_vendor;
extern const char *gl_renderer;
extern const char *gl_version;
extern const char *gl_extensions;
void R_TranslatePlayerSkin (int playernum);
void GL_Bind (int texnum);
// Multitexture
@ -228,12 +158,6 @@ void GL_Bind (int texnum);
#define TEXTURE0_SGIS 0x835E
#define TEXTURE1_SGIS 0x835F
#ifndef _WIN32
# ifndef APIENTRY
# define APIENTRY /* */
# endif
#endif
typedef void (APIENTRY *lpMTexFUNC) (GLenum, GLfloat, GLfloat);
typedef void (APIENTRY *lpSelTexFUNC) (GLenum);
extern lpMTexFUNC qglMTexCoord2fSGIS;
@ -261,107 +185,4 @@ void GL_Set2D (void);
void GL_CheckGamma (unsigned char *pal);
void GL_CheckBrightness (unsigned char *pal);
void EmitWaterPolys (msurface_t *fa);
void EmitSkyPolys (msurface_t *fa);
void EmitBothSkyLayers (msurface_t *fa);
void R_DrawSkyChain (msurface_t *s);
void R_LoadSkys (char *);
void R_DrawSky (void);
void R_RotateForEntity (entity_t *e);
qboolean R_CullBox (vec3_t mins, vec3_t maxs);
void AddLightBlend (float, float, float, float);
void GL_SelectTexture (GLenum target);
//
// gl_rpart.c
//
typedef struct {
int key; // allows reusability
vec3_t origin, owner;
float size;
float die, decay; // duration settings
float minlight; // lighting threshold
float color[3]; // RGB
} fire_t;
void R_AddFire (vec3_t, vec3_t, entity_t *ent);
fire_t *R_AllocFire (int);
void R_DrawFire (fire_t *);
void R_UpdateFires (void);
//
// gl_warp.c
//
void GL_SubdivideSurface (msurface_t *fa);
void EmitBothSkyLayers (msurface_t *fa);
void EmitWaterPolys (msurface_t *fa);
void EmitSkyPolys (msurface_t *fa);
void R_DrawSkyChain (msurface_t *s);
void R_LoadSkys (char *);
void R_DrawSky (void);
void R_DrawSkyChain (msurface_t *sky_chain);
//
// gl_draw.c
//
void GL_Set2D (void);
//
// gl_rmain.c
//
void GL_CheckBrightness (unsigned char *pal);
//qboolean R_CullBox (vec3_t mins, vec3_t maxs);
void R_RotateForEntity (entity_t *e);
extern inline qboolean R_CullBox (vec3_t mins, vec3_t maxs)
{
int i;
for (i=0 ; i<4 ; i++)
if (BoxOnPlaneSide (mins, maxs, &frustum[i]) == 2)
return true;
return false;
}
//
// gl_rlight.c
//
extern float bubble_sintable[], bubble_costable[];
extern float v_blend[4];
void R_MarkLights (vec3_t lightorigin, dlight_t *light, int bit, mnode_t *node);
void R_AnimateLight (void);
void R_RenderDlights (void);
int R_LightPoint (vec3_t p);
void AddLightBlend (float, float, float, float);
//
// gl_refrag.c
//
void R_StoreEfrags (efrag_t **ppefrag);
//
// gl_screen.c
//
extern qboolean lighthalf;
extern unsigned char lighthalf_v[3];
//
// gl_rsurf.c
//
void R_DrawBrushModel (entity_t *e);
void R_DrawWorld (void);
void GL_BuildLightmaps (void);
//
// gl_ngraph.c
//
void R_NetGraph (void);
#endif // __glquake_h

View file

@ -20,7 +20,7 @@ libQFjs_la_CFLAGS= $(JOY_CFLAGS)
YFLAGS = -d
libQFfbdev_la_LDFLAGS= -version-info 1:0:0
libQFfbdev_la_SOURCES= fbset.c fbset_modes_y.y fbset_modes_l.l \
in_common.c in_fbdev.c vid.c vid_fbdev.c
in_common.c in_fbdev.c vid.c vid_common_sw.c vid_fbdev.c
YACCLEX_CLEANFILES= fbset_modes_y.c fbset_modes_y.h \
fbset_modes_y.tab.h fbset_modes_l.c
EXTRA_libQFfbdev_la_SOURCES=fbset_modes_y.h

View file

@ -72,7 +72,7 @@ static struct termios old_tty, new_tty;
static int tty_fd = 0;
void
IN_Init (void)
IN_LL_Init (void)
{
fd_blocking(0, 0);
tcgetattr(tty_fd, &old_tty);
@ -85,17 +85,17 @@ IN_Init (void)
}
void
IN_Init_Cvars (void)
IN_LL_Init_Cvars (void)
{
}
void
IN_Shutdown (void)
IN_LL_Shutdown (void)
{
}
void
IN_SendKeyEvents (void)
IN_LL_SendKeyEvents (void)
{
int k, down;
char buf[4];
@ -133,12 +133,7 @@ IN_SendKeyEvents (void)
}
void
IN_Commands (void)
{
}
void
IN_Move (void)
IN_LL_Commands (void)
{
}
@ -146,6 +141,6 @@ IN_Move (void)
IN_ModeChanged
*/
void
IN_ModeChanged (void)
IN_LL_ModeChanged (void)
{
}

View file

@ -61,18 +61,11 @@ static unsigned char scantokey[128];
static int mouse_buttons;
static int mouse_buttonstate;
static int mouse_oldbuttonstate;
static float mouse_x, mouse_y;
static float old_mouse_x, old_mouse_y;
static int mx, my;
static void IN_InitKeyboard (void);
static void IN_InitMouse (void);
cvar_t *_windowed_mouse;
cvar_t *m_filter;
cvar_t *sensitivity;
cvar_t *lookstrafe;
static void
keyhandler (int scancode, int state)
{
@ -104,7 +97,7 @@ mousehandler (int buttonstate, int dx, int dy, int dz, int drx, int dry, int drz
void
IN_Init (void)
IN_LL_Init (void)
{
if (COM_CheckParm ("-nokbd"))
UseKeyboard = 0;
@ -116,22 +109,13 @@ IN_Init (void)
if (UseMouse)
IN_InitMouse ();
JOY_Init ();
in_svgalib_inited = 1;
return;
}
void
IN_Init_Cvars (void)
IN_LL_Init_Cvars (void)
{
JOY_Init_Cvars ();
m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, NULL,
"Toggle mouse input filtering.");
lookstrafe = Cvar_Get ("lookstrafe", "0", CVAR_ARCHIVE, NULL,
"when mlook/klook on player will strafe");
sensitivity = Cvar_Get ("sensitivity", "3", CVAR_ARCHIVE, NULL,
"mouse sensitivity multiplier");
}
static void
@ -288,13 +272,13 @@ IN_InitMouse (void)
} else {
mouse_seteventhandler ((void *) mousehandler);
}
in_mouse_avail = 1;
}
void
IN_Shutdown (void)
IN_LL_Shutdown (void)
{
JOY_Shutdown ();
Con_Printf ("IN_Shutdown\n");
Con_Printf ("IN_LL_Shutdown\n");
if (UseMouse)
mouse_close ();
@ -305,7 +289,7 @@ IN_Shutdown (void)
void
IN_SendKeyEvents (void)
IN_LL_SendKeyEvents (void)
{
if (!in_svgalib_inited)
return;
@ -317,9 +301,8 @@ IN_SendKeyEvents (void)
void
IN_Commands (void)
IN_LL_Commands (void)
{
JOY_Command ();
if (UseMouse) {
/* Poll mouse values */
while (mouse_update ());
@ -349,47 +332,3 @@ IN_Commands (void)
mouse_oldbuttonstate = mouse_buttonstate;
}
}
void
IN_Move (void)
{
JOY_Move ();
if (!UseMouse)
return;
/* Poll mouse values */
while (mouse_update ());
if (m_filter->int_val) {
mouse_x = (mx + old_mouse_x) * 0.5;
mouse_y = (my + old_mouse_y) * 0.5;
} else {
mouse_x = mx;
mouse_y = my;
}
old_mouse_x = mx;
old_mouse_y = my;
/* Clear for next update */
mx = my = 0;
mouse_x *= sensitivity->value;
mouse_y *= sensitivity->value;
/* Add mouse X/Y movement to cmd */
if ((in_strafe.state & 1) || (lookstrafe->int_val && freelook)) {
viewdelta.position[0] += mouse_x;
} else {
viewdelta.angles[YAW] -= mouse_x;
}
if (freelook && !(in_strafe.state & 1)) {
viewdelta.angles[PITCH] += mouse_y;
} else {
if (in_strafe.state & 1)
viewdelta.position[1] -= mouse_y;
else
viewdelta.position[2] -= mouse_y;
}
}

View file

@ -49,8 +49,9 @@
#include "QF/input.h"
#include "QF/qargs.h"
#include "QF/quakefs.h"
#include "glquake.h"
#include "QF/qfgl_ext.h"
#include "QF/vid.h"
#include "glquake.h"
#include "sbar.h"
#define WARP_WIDTH 320

View file

@ -32,15 +32,12 @@
#include <math.h>
#include "QF/cvar.h"
#include "QF/compat.h"
#include "QF/qargs.h"
#include "QF/vid.h"
void
VID_InitBuffers (void)
{
#if 0 //XXX not just yet
int buffersize, zbuffersize, cachesize;
void *vid_surfcache;
@ -89,4 +86,5 @@ VID_InitBuffers (void)
}
D_InitCaches (vid_surfcache, cachesize);
#endif
}

View file

@ -48,14 +48,16 @@
#include "QF/compat.h"
#include "QF/console.h"
#include "context_x11.h"
#include "glquake.h"
#include "QF/input.h"
#include "QF/qargs.h"
#include "QF/qendian.h"
#include "QF/quakefs.h"
#include "sbar.h"
#include "QF/va.h"
#include "QF/vid.h"
#include "context_x11.h"
#include "glquake.h"
#include "sbar.h"
#define WARP_WIDTH 320
#define WARP_HEIGHT 200

View file

@ -49,11 +49,11 @@
#include "QF/compat.h"
#include "QF/console.h"
#include "QF/cvar.h"
#include "d_local.h"
#include "QF/input.h"
#include "QF/qargs.h"
#include "QF/qendian.h"
#include "QF/sys.h"
#include "QF/vid.h"
void VGA_UpdatePlanarScreen (void *srcbuffer);
@ -354,60 +354,6 @@ get_mode (char *name, int width, int height, int depth)
}
void
VID_InitBuffers (void)
{
int buffersize, zbuffersize, cachesize;
void *vid_surfcache;
// Calculate the sizes we want first
buffersize = vid.rowbytes * vid.height;
zbuffersize = vid.width * vid.height * sizeof (*d_pzbuffer);
cachesize = D_SurfaceCacheForRes (vid.width, vid.height);
// Free the old screen buffer
if (vid.buffer) {
free (vid.buffer);
vid.conbuffer = vid.buffer = NULL;
}
// Free the old z-buffer
if (d_pzbuffer) {
free (d_pzbuffer);
d_pzbuffer = NULL;
}
// Free the old surface cache
vid_surfcache = D_SurfaceCacheAddress ();
if (vid_surfcache) {
D_FlushCaches ();
free (vid_surfcache);
vid_surfcache = NULL;
}
// Allocate the new screen buffer
vid.conbuffer = vid.buffer = calloc (buffersize, 1);
if (!vid.conbuffer) {
Sys_Error ("Not enough memory for video mode\n");
}
// Allocate the new z-buffer
d_pzbuffer = calloc (zbuffersize, 1);
if (!d_pzbuffer) {
free (vid.buffer);
vid.conbuffer = vid.buffer = NULL;
Sys_Error ("Not enough memory for video mode\n");
}
// Allocate the new surface cache; free the z-buffer if we fail
vid_surfcache = calloc (cachesize, 1);
if (!vid_surfcache) {
free (vid.buffer);
free (d_pzbuffer);
vid.conbuffer = vid.buffer = NULL;
d_pzbuffer = NULL;
Sys_Error ("Not enough memory for video mode\n");
}
D_InitCaches (vid_surfcache, cachesize);
}
void
VID_Shutdown (void)
{
@ -493,9 +439,6 @@ VID_SetMode (int modenum, unsigned char *palette)
vid.conheight = vid.height;
vid.numpages = 1;
vid.maxwarpwidth = WARP_WIDTH;
vid.maxwarpheight = WARP_HEIGHT;
// alloc screen buffer, z-buffer, and surface cache
VID_InitBuffers ();

View file

@ -71,14 +71,13 @@
#include "QF/cvar.h"
#include "QF/qargs.h"
#include "QF/qendian.h"
#include "QF/screen.h"
#include "QF/sys.h"
#include "QF/va.h"
#include "client.h"
#include "QF/vid.h"
#include "context_x11.h"
#include "d_local.h"
#include "dga_check.h"
#include "draw.h"
#include "screen.h"
extern viddef_t vid; // global video state
unsigned short d_8to16table[256];
@ -90,7 +89,7 @@ int XShmQueryExtension (Display *);
int XShmGetEventBase (Display *);
static qboolean doShm;
static XShmSegmentInfo x_shminfo[2];
//static XShmSegmentInfo x_shminfo[2];
static int current_framebuffer;
static XImage *x_framebuffer[2] = { 0, 0 };
@ -304,6 +303,7 @@ D_EndDirectRect (int x, int y, int width, int height)
static void
ResetFrameBuffer (void)
{
#if 0 //XXX not yet
int tbuffersize, tcachesize;
void *vid_surfcache;
@ -356,11 +356,13 @@ ResetFrameBuffer (void)
if (!x_framebuffer[0]) {
Sys_Error ("VID: XCreateImage failed\n");
}
#endif
}
static void
ResetSharedFrameBuffers (void)
{
#if 0
int tbuffersize, tcachesize;
void *vid_surfcache;
@ -439,7 +441,7 @@ ResetSharedFrameBuffers (void)
shmctl (x_shminfo[frm].shmid, IPC_RMID, 0);
}
#endif
}
static void
@ -470,8 +472,6 @@ VID_Init (unsigned char *palette)
vid.height = vid_height->int_val;
Con_CheckResize (); // Now that we have a window size, fix console
vid.maxwarpwidth = WARP_WIDTH;
vid.maxwarpheight = WARP_HEIGHT;
vid.numpages = 2;
vid.colormap = vid_colormap;
vid.fullbright = 256 - LittleLong (*((int *) vid.colormap + 2048));

View file

@ -29,7 +29,7 @@
#ifndef _DRAW_H
#define _DRAW_H
#include "wad.h"
#include "QF/wad.h"
extern qpic_t *draw_disc; // also used on sbar

View file

@ -88,7 +88,7 @@
#include "QF/quakefs.h"
#include "QF/qargs.h"
#include "sbar.h"
#include "screen.h"
#include "QF/screen.h"
#include "skin.h"
#include "QF/sound.h"
#include "QF/sys.h"

View file

@ -58,7 +58,7 @@
#include "QF/msg.h"
#include "pmove.h"
#include "protocol.h"
#include "screen.h"
#include "QF/screen.h"
#include "sbar.h"
#include "skin.h"
#include "QF/sound.h"

View file

@ -46,7 +46,7 @@
#include "QF/input.h"
#include "QF/keys.h"
#include "QF/qargs.h"
#include "screen.h"
#include "QF/screen.h"
#include "QF/sys.h"
#include "QF/va.h"

View file

@ -38,13 +38,15 @@
#include <stdio.h>
#include "client.h"
#include "QF/cmd.h"
#include "QF/console.h"
#include "draw.h"
#include "glquake.h"
#include "sbar.h"
#include "screen.h"
#include "QF/screen.h"
#include "QF/sys.h"
#include "QF/vid.h"
extern byte *vid_basepal;

View file

@ -46,8 +46,8 @@
#include "draw.h"
#include "glquake.h"
#include "sbar.h"
#include "screen.h"
#include "QF/sys.h"
#include "QF/vid.h"
extern unsigned char d_15to8table[65536];
extern cvar_t *gl_picmip;

View file

@ -48,7 +48,7 @@
#include "QF/console.h"
#include "QF/cvar.h"
#include "QF/keys.h"
#include "screen.h"
#include "QF/screen.h"
#include "QF/sys.h"
/*

View file

@ -44,6 +44,7 @@
#include "QF/qtypes.h"
#include "QF/quakefs.h"
#include "texture.h"
#include "QF/vid.h"
#include "QF/zone.h"
/*

View file

@ -41,7 +41,7 @@
#include "host.h"
#include "QF/msg.h"
#include "pmove.h"
#include "screen.h"
#include "QF/screen.h"
#include "QF/vid.h"
#include "view.h"

View file

@ -46,7 +46,7 @@
#include "draw.h"
#include "QF/msg.h"
#include "sbar.h"
#include "screen.h"
#include "QF/screen.h"
#include "QF/va.h"
#include "QF/vid.h"

View file

@ -49,7 +49,7 @@
#include "client.h"
#include "host.h"
#include "pcx.h"
#include "screen.h"
#include "QF/screen.h"
#include "skin.h"
#include "texture.h"

View file

@ -47,7 +47,7 @@
#include "QF/mathlib.h"
#include "r_dynamic.h"
#include "r_local.h"
#include "screen.h"
#include "QF/screen.h"
#include "QF/sound.h"
#include "QF/sys.h"
#include "view.h"

View file

@ -39,7 +39,7 @@
#include "QF/sys.h"
#include "QF/quakefs.h"
#include "QF/qendian.h"
#include "wad.h"
#include "QF/wad.h"
int wad_numlumps;
lumpinfo_t *wad_lumps;