* Fixed an X11 software renderer crash in vid_x.c, thanks Justin A. McCright

* Renamed chase_* to cl_chasecam_* in UQ to match their parent cvar.
* Changed cl_chasecam* in UQ to be saved in config.cfg
* Moved dosasm.s to common, though it doesn't seem to be referenced at _all_
This commit is contained in:
Jeff Teunissen 2000-01-03 21:20:01 +00:00
parent 7a6884e4fb
commit 6337f34ba1
7 changed files with 105 additions and 104 deletions

View file

@ -5,13 +5,13 @@ Project hosting and server resources:
VA Linux Systems, Inc http://www.valinux.com
AbsoluteK <absolutek@quakeforge.net>
Chad Fowler <chadfowler@quakeforge.net>
Jeff Teunissen <deek@dusknet.dhis.net>
Jeff Teunissen <d2deek@pmail.net>
Administration and project management:
Nelson J. Rush <chesterrr@att.net>
QW/Q1 tree merging:
Jeff Teunissen <deek@dusknet.dhis.net>
Jeff Teunissen <d2deek@pmail.net>
Zephaniah E. Hull <warp@whitestar.soark.net>
Marcus Sundberg <mackan@stacken.kth.se>
Bill Currie <bill@taniwha.org>
@ -59,3 +59,5 @@ SDL Support:
Sam Lantinga <slouken@devolution.com>
Maas van den Berg <email@dds.nl>
X11 software renderer fixes:
"Justin A. McCright" <jam@qIj.damogran.org>

View file

@ -628,15 +628,16 @@ void VID_SetPalette(unsigned char *palette)
// Called at shutdown
void VID_Shutdown (void)
{
void VID_Shutdown (void) {
Con_Printf("VID_Shutdown\n");
XAutoRepeatOn(x_disp);
XCloseDisplay(x_disp);
if (x_disp) {
XAutoRepeatOn(x_disp);
XCloseDisplay(x_disp);
}
}
int XLateKey(XKeyEvent *ev)
{
int XLateKey(XKeyEvent *ev) {
int key;
char buf[64];

View file

@ -195,7 +195,7 @@ ALL_GL_SRC = $(GENERAL_SRC) $(GL_REND_SRC) $(GL_VID_SRC)
ALL_TDFX_SRC = $(GENERAL_SRC) $(GL_REND_SRC) $(TDFX_VID_SRC)
GENERAL_SRC = $(CL_COMMON_SRC) \
$(SYS_SRC) chase.c world.c $(SRV_PR_SRC) \
$(SYS_SRC) chasecam.c world.c $(SRV_PR_SRC) \
$(UQ_NET_SRC) $(UQ_SRV_SRC) \
$(UQ_GENERAL_SRC) $(UQ_SWREND_SRC_PLAT)

View file

@ -1,92 +0,0 @@
/*
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// chase.c -- chase camera code
#include "quakedef.h"
cvar_t chase_back = {"chase_back", "100"};
cvar_t chase_up = {"chase_up", "16"};
cvar_t chase_right = {"chase_right", "0"};
cvar_t cl_chasecam = {"cl_chasecam", "0"};
vec3_t chase_pos;
vec3_t chase_angles;
vec3_t chase_dest;
vec3_t chase_dest_angles;
void Chase_Init (void)
{
Cvar_RegisterVariable (&chase_back);
Cvar_RegisterVariable (&chase_up);
Cvar_RegisterVariable (&chase_right);
Cvar_RegisterVariable (&cl_chasecam);
}
void Chase_Reset (void)
{
// for respawning and teleporting
// start position 12 units behind head
}
void TraceLine (vec3_t start, vec3_t end, vec3_t impact)
{
trace_t trace;
memset (&trace, 0, sizeof(trace));
SV_RecursiveHullCheck (cl.worldmodel->hulls, 0, 0, 1, start, end, &trace);
VectorCopy (trace.endpos, impact);
}
void Chase_Update (void)
{
int i;
float dist;
vec3_t forward, up, right;
vec3_t dest, stop;
// if can't see player, reset
AngleVectors (cl.viewangles, forward, right, up);
// calc exact destination
for (i=0 ; i<3 ; i++)
chase_dest[i] = r_refdef.vieworg[i]
- forward[i]*chase_back.value
- right[i]*chase_right.value;
chase_dest[2] = r_refdef.vieworg[2] + chase_up.value;
// find the spot the player is looking at
VectorMA (r_refdef.vieworg, 4096, forward, dest);
TraceLine (r_refdef.vieworg, dest, stop);
// calculate pitch to look at the same spot from camera
VectorSubtract (stop, r_refdef.vieworg, stop);
dist = DotProduct (stop, forward);
if (dist < 1)
dist = 1;
r_refdef.viewangles[PITCH] = -atan(stop[2] / dist) / M_PI * 180;
// move towards destination
VectorCopy (chase_dest, r_refdef.vieworg);
}

90
uquake/chasecam.c Normal file
View file

@ -0,0 +1,90 @@
/*
chasecam.c
Chase camera code for UQuake
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999-2000 The QuakeForge Project.
Portions Copyright their respective authors.
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "quakedef.h"
cvar_t cl_chasecam = {"cl_chasecam", "0", true};
cvar_t cl_chasecam_up = {"cl_chasecam_up", "16", true};
cvar_t cl_chasecam_back = {"cl_chasecam_back", "100", true};
cvar_t cl_chasecam_right = {"cl_chasecam_right", "0", true};
vec3_t chase_pos;
vec3_t chase_angles;
vec3_t chase_dest;
vec3_t chase_dest_angles;
void Chase_Init (void) {
Cvar_RegisterVariable (&cl_chasecam);
Cvar_RegisterVariable (&cl_chasecam_up);
Cvar_RegisterVariable (&cl_chasecam_back);
Cvar_RegisterVariable (&cl_chasecam_right);
}
void Chase_Reset (void) {
// for respawning and teleporting
// start position 12 units behind head
}
void TraceLine (vec3_t start, vec3_t end, vec3_t impact) {
trace_t trace;
memset (&trace, 0, sizeof(trace));
SV_RecursiveHullCheck (cl.worldmodel->hulls, 0, 0, 1, start, end, &trace);
VectorCopy (trace.endpos, impact);
}
void Chase_Update (void) {
int i;
float dist;
vec3_t forward, up, right;
vec3_t dest, stop;
// if can't see player, reset
AngleVectors (cl.viewangles, forward, right, up);
// calc exact destination
for (i=0 ; i<3 ; i++)
chase_dest[i] = r_refdef.vieworg[i]
- forward[i] * cl_chasecam_back.value
- right[i] * cl_chasecam_right.value;
chase_dest[2] = r_refdef.vieworg[2] + cl_chasecam_up.value;
// find the spot the player is looking at
VectorMA (r_refdef.vieworg, 4096, forward, dest);
TraceLine (r_refdef.vieworg, dest, stop);
// calculate pitch to look at the same spot from camera
VectorSubtract (stop, r_refdef.vieworg, stop);
dist = DotProduct (stop, forward);
if (dist < 1)
dist = 1;
r_refdef.viewangles[PITCH] = -atan(stop[2] / dist) / M_PI * 180;
// move towards destination
VectorCopy (chase_dest, r_refdef.vieworg);
}

View file

@ -203,9 +203,9 @@ extern qboolean isDedicated;
extern int minimum_memory;
//
// chase
//
/*
Chase camera
*/
extern cvar_t cl_chasecam;
void Chase_Init (void);