1
0
Fork 0
forked from fte/fteqw

some bugfixes

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@867 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-02-06 02:47:36 +00:00
parent d29d5e71e6
commit 95eafd7427
30 changed files with 673 additions and 382 deletions

View file

@ -509,23 +509,21 @@ sw-rel:
sw-dbg:
$(MAKE) sw-tmp TYPE=_clsv-dbg OUT_DIR="$(DEBUG_DIR)/$(SWB_DIR)"
mcl-tmp:
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(MCL_EXE_NAME)" WCFLAGS="$(M_CFLAGS)" LDFLAGS="$(M_LDFLAGS)" SOBJS="$(MCL_OBJS)"
m-tmp:
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(M_EXE_NAME)" WCFLAGS="$(M_CFLAGS)" LDFLAGS="$(M_LDFLAGS)" SOBJS="$(MCL_OBJS)"
mcl-rel:
$(MAKE) mcl-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(MCL_DIR)"
mcl-dbg:
$(MAKE) mcl-tmp TYPE=_cl-dbg OUT_DIR="$(DEBUG_DIR)/$(MCL_DIR)"
m-tmp:
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(M_EXE_NAME)" WCFLAGS="$(M_CFLAGS)" LDFLAGS="$(M_LDFLAGS)" SOBJS="$(MCL_OBJS)"
m-rel:
$(MAKE) m-tmp TYPE=_clsv-rel OUT_DIR="$(RELEASE_DIR)/$(MCL_DIR)"
m-dbg:
$(MAKE) m-tmp TYPE=_clsv-dbg OUT_DIR="$(DEBUG_DIR)/$(MCL_DIR)"
.PHONY: m-tmp mcl-tmp sw-tmp swcl-tmp mingl-tmp glcl-tmp gl-tmp sv-tmp _clsv-dbg _clsv-rel _cl-dbg _cl-rel _out-rel _out-dbg
ifdef windir
debugdir:

View file

@ -667,7 +667,6 @@ void CL_Record_f (void)
}
else
{ //automagically generate a name
if (cl.spectator)
{ // FIXME: if tracking a player, use his name
fname = va ("spec_%s_%s",

View file

@ -8,7 +8,7 @@ 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.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
@ -72,7 +72,7 @@ qboolean CL_FilterModelindex(int modelindex, int frame)
}
if (cl_gibfilter.value && (
modelindex == cl_h_playerindex ||
modelindex == cl_h_playerindex ||
modelindex == cl_gib1index ||
modelindex == cl_gib2index ||
modelindex == cl_gib3index))
@ -204,28 +204,28 @@ void CL_DecayLights (void)
dl->radius = 0;
continue;
}
dl->radius -= host_frametime*dl->decay;
if (dl->radius < 0)
dl->radius = 0;
if (dl->channelfade[0])
{
dl->color[0] -= host_frametime*dl->channelfade[0];
dl->color[0] -= host_frametime*dl->channelfade[0];
if (dl->color[0] < 0)
dl->color[0] = 0;
}
if (dl->channelfade[1])
{
dl->color[1] -= host_frametime*dl->channelfade[1];
dl->color[1] -= host_frametime*dl->channelfade[1];
if (dl->color[1] < 0)
dl->color[1] = 0;
}
if (dl->channelfade[2])
{
dl->color[2] -= host_frametime*dl->channelfade[2];
dl->color[2] -= host_frametime*dl->channelfade[2];
if (dl->color[2] < 0)
dl->color[2] = 0;
}
@ -305,19 +305,19 @@ void CL_ParseDelta (entity_state_t *from, entity_state_t *to, int bits, qboolean
if (bits & U_ORIGIN1)
to->origin[0] = MSG_ReadCoord ();
if (bits & U_ANGLE1)
to->angles[0] = MSG_ReadAngle ();
if (bits & U_ORIGIN2)
to->origin[1] = MSG_ReadCoord ();
if (bits & U_ANGLE2)
to->angles[1] = MSG_ReadAngle ();
if (bits & U_ORIGIN3)
to->origin[2] = MSG_ReadCoord ();
if (bits & U_ANGLE3)
to->angles[2] = MSG_ReadAngle ();
@ -541,7 +541,7 @@ void CL_ParsePacketEntities (qboolean delta)
newnum += 512;
if (excessive & U_ENTITYDBL2)
newnum += 1024;
}
}
msg_readcount = oldpos;//undo the read...
}
@ -677,7 +677,7 @@ entity_state_t *CL_FindOldPacketEntity(int num)
// byte = bound(0, s->scale * 16, 255)
#define E5_SCALE (1<<10)
// flag
#define E5_ORIGIN32 (1<<11)
#define E5_ORIGIN32 (1<<11)
// flag
#define E5_ANGLES16 (1<<12)
// flag
@ -766,9 +766,9 @@ void DP5_ParseDelta(entity_state_t *s)
{
if (bits & E5_ANGLES16)
{
s->angles[0] = MSG_ReadAngle16();
s->angles[1] = MSG_ReadAngle16();
s->angles[2] = MSG_ReadAngle16();
s->angles[0] = MSG_ReadAngle16();
s->angles[1] = MSG_ReadAngle16();
s->angles[2] = MSG_ReadAngle16();
}
else
{
@ -848,7 +848,7 @@ void CLNQ_ParseDarkPlaces5Entities(void) //the things I do.. :o(
packet_entities_t *pack, *oldpack;
entity_state_t *to, *from;
entity_state_t *to, *from;
unsigned short read;
int oldi;
qboolean remove;
@ -967,7 +967,7 @@ void CLNQ_ParseEntity(unsigned int bits)
{
int i;
int num, pnum;
entity_state_t *state, *from;
entity_state_t *state, *from;
entity_state_t *base;
static float lasttime;
packet_entities_t *pack;
@ -990,7 +990,7 @@ void CLNQ_ParseEntity(unsigned int bits)
#define NQU_EFFECTS (1<<13)
#define NQU_LONGENTITY (1<<14)
// LordHavoc's: protocol extension
#define DPU_EXTEND1 (1<<15)
// LordHavoc: first extend byte
@ -1018,8 +1018,8 @@ void CLNQ_ParseEntity(unsigned int bits)
{ // first update is the final signon stage
cls.signon = 4;
CLNQ_SignonReply ();
}
pack = &cl.frames[cls.netchan.incoming_sequence&UPDATE_MASK].packet_entities;
}
pack = &cl.frames[cls.netchan.incoming_sequence&UPDATE_MASK].packet_entities;
if (bits & NQU_MOREBITS)
@ -1038,7 +1038,7 @@ void CLNQ_ParseEntity(unsigned int bits)
bits |= (i<<24);
}
if (bits & NQU_LONGENTITY)
if (bits & NQU_LONGENTITY)
num = MSG_ReadShort ();
else
num = MSG_ReadByte ();
@ -1064,7 +1064,7 @@ void CLNQ_ParseEntity(unsigned int bits)
state->number = num;
if (bits & NQU_MODEL)
if (bits & NQU_MODEL)
state->modelindex = MSG_ReadByte ();
else
state->modelindex = base->modelindex;
@ -1186,7 +1186,7 @@ entity_state_t *CL_FindPacketEntity(int num)
}
#endif
void CL_RotateAroundTag(entity_t *ent, int num, int tagent)
void CL_RotateAroundTag(entity_t *ent, int num, int tagent, int tagnum)
{
entity_state_t *ps;
float *org=NULL, *ang=NULL;
@ -1199,6 +1199,11 @@ void CL_RotateAroundTag(entity_t *ent, int num, int tagent)
float *tagorg=NULL;
float *tagaxis;
// ent->keynum = tagent;
if (cl.lerpents[tagent].tagent)
CL_RotateAroundTag(ent, num, cl.lerpents[tagent].tagent, cl.lerpents[tagent].tagindex);
ps = CL_FindPacketEntity(tagent);
if (ps)
{
@ -1210,6 +1215,7 @@ void CL_RotateAroundTag(entity_t *ent, int num, int tagent)
else
{
extern int parsecountmod;
// Con_Printf("tagent %i\n", tagent);
if (tagent <= MAX_CLIENTS && tagent > 0)
{
if (tagent-1 == cl.playernum[0])
@ -1233,27 +1239,22 @@ void CL_RotateAroundTag(entity_t *ent, int num, int tagent)
VectorInverse(axis[1]);
if (Mod_GetTag)
Mod_GetTag(cl.model_precache[model], cl.lerpents[tagent].tagindex, frame, &tagorg, &tagaxis);
Mod_GetTag(cl.model_precache[model], tagnum, frame, &tagorg, &tagaxis);
else
tagaxis = NULL;
if (tagaxis)
{
Matrix3_Multiply(ent->axis, (void*)tagaxis, temp);
// Con_Printf("Found tag %i\n", cl.lerpents[tagent].tagindex);
R_ConcatRotations(ent->axis, (void*)tagaxis, temp);
}
else //hrm.
{
memcpy(temp, ent->axis, sizeof(temp));
Matrix3_Multiply(axis, temp, ent->axis);
}
R_ConcatRotations(axis, temp, ent->axis);
}
if (org)
VectorAdd(ent->origin, org, ent->origin);
if (tagorg)
VectorAdd(ent->origin, tagorg, ent->origin);
ent->keynum = tagent;
if (cl.lerpents[tagent].tagent)
CL_RotateAroundTag(ent, num, cl.lerpents[tagent].tagent);
}
/*
===============
@ -1336,7 +1337,7 @@ void CL_LinkPacketEntities (void)
ent->flags = 0;
// set colormap
if (s1->colormap && (s1->colormap <= MAX_CLIENTS)
if (s1->colormap && (s1->colormap <= MAX_CLIENTS)
&& (gl_nocolors.value == -1 || (ent->model/* && s1->modelindex == cl_playerindex*/)))
{
ent->colormap = cl.players[s1->colormap-1].translations;
@ -1366,7 +1367,7 @@ void CL_LinkPacketEntities (void)
{
ent->lerptime = 1-(cl.time-cl.lerpents[s1->number].lerptime)/cl.lerpents[s1->number].lerprate;
}
if (ent->lerptime<0)ent->lerptime=0;
if (ent->lerptime>1)ent->lerptime=1;
@ -1393,7 +1394,7 @@ void CL_LinkPacketEntities (void)
// calculate origin
for (i=0 ; i<3 ; i++)
ent->origin[i] = s1->origin[i] +
ent->origin[i] = s1->origin[i] +
f * (cl.lerpents[s1->number].origin[i] - s1->origin[i]);
// rotate binary objects locally
@ -1430,7 +1431,7 @@ void CL_LinkPacketEntities (void)
if (cl.lerpents[s1->number].tagent)
{ //ent is attached to a tag, rotate this ent accordingly.
CL_RotateAroundTag(ent, s1->number, cl.lerpents[s1->number].tagent);
CL_RotateAroundTag(ent, s1->number, cl.lerpents[s1->number].tagent, cl.lerpents[s1->number].tagindex);
}
// add automatic particle trails
@ -1962,14 +1963,14 @@ void CL_AddFlagModels (entity_t *ent, int team)
f = 14;
if (ent->frame >= 29 && ent->frame <= 40) {
if (ent->frame >= 29 && ent->frame <= 34) { //axpain
if (ent->frame == 29) f = f + 2;
if (ent->frame == 29) f = f + 2;
else if (ent->frame == 30) f = f + 8;
else if (ent->frame == 31) f = f + 12;
else if (ent->frame == 32) f = f + 11;
else if (ent->frame == 33) f = f + 10;
else if (ent->frame == 34) f = f + 4;
} else if (ent->frame >= 35 && ent->frame <= 40) { // pain
if (ent->frame == 35) f = f + 2;
if (ent->frame == 35) f = f + 2;
else if (ent->frame == 36) f = f + 10;
else if (ent->frame == 37) f = f + 10;
else if (ent->frame == 38) f = f + 8;
@ -1978,7 +1979,7 @@ void CL_AddFlagModels (entity_t *ent, int team)
}
} else if (ent->frame >= 103 && ent->frame <= 118) {
if (ent->frame >= 103 && ent->frame <= 104) f = f + 6; //nailattack
else if (ent->frame >= 105 && ent->frame <= 106) f = f + 6; //light
else if (ent->frame >= 105 && ent->frame <= 106) f = f + 6; //light
else if (ent->frame >= 107 && ent->frame <= 112) f = f + 7; //rocketattack
else if (ent->frame >= 112 && ent->frame <= 118) f = f + 7; //shotattack
}
@ -2057,7 +2058,7 @@ void CL_LinkPlayers (void)
frame = &cl.frames[cl.parsecount&UPDATE_MASK];
for (j=0, info=cl.players, state=frame->playerstate ; j < MAX_CLIENTS
for (j=0, info=cl.players, state=frame->playerstate ; j < MAX_CLIENTS
; j++, info++, state++)
{
if (state->messagenum != cl.parsecount)
@ -2096,7 +2097,7 @@ void CL_LinkPlayers (void)
ent->flags = 0;
ent->model = cl.model_precache[state->modelindex];
ent->skinnum = state->skinnum;
ent->skinnum = state->skinnum;
ent->frame = state->frame;
ent->oldframe = state->oldframe;
@ -2230,7 +2231,7 @@ void CL_SetSolidEntities (void)
if (!cl.model_precache[state->modelindex])
continue;
if (*cl.model_precache[state->modelindex]->name == '*' || cl.model_precache[state->modelindex]->numsubmodels)
if ( cl.model_precache[state->modelindex]->hulls[1].firstclipnode
if ( cl.model_precache[state->modelindex]->hulls[1].firstclipnode
|| cl.model_precache[state->modelindex]->clipbox )
{
pmove.physents[pmove.numphysent].model = cl.model_precache[state->modelindex];
@ -2274,7 +2275,7 @@ void CL_SetUpPlayerPrediction(qboolean dopred)
frame = &cl.frames[cl.parsecount&UPDATE_MASK];
for (j=0, pplayer = predicted_players, state=frame->playerstate;
for (j=0, pplayer = predicted_players, state=frame->playerstate;
j < MAX_CLIENTS;
j++, pplayer++, state++)
{
@ -2336,7 +2337,7 @@ void CL_SetUpPlayerPrediction(qboolean dopred)
{
if (!Cam_DrawPlayer(0, j))
VectorCopy(pplayer->origin, cl.simorg[0]);
}
}
}
@ -2458,7 +2459,7 @@ void MVD_Interpolate(void)
VectorCopy(oldself->velocity, self->velocity);
VectorCopy(oldself->viewangles, self->viewangles);
cls.netchan.outgoing_sequence = cl.parsecount+1;
}

View file

@ -616,6 +616,9 @@ void CL_UpdatePrydonCursor(float cursor_screen[2], vec3_t cursor_start, vec3_t c
ML_ModelViewMatrix(modelview, cl.viewangles[0], cl.simorg[0]);
Matrix4_Transform3(modelview, temp, cursor_end);
CL_SetSolidEntities();
//don't bother with players, they don't exist in NQ...
tr = PM_PlayerTrace(cursor_start, cursor_end);
VectorCopy(tr.endpos, cursor_impact);
// CL_SelectTraceLine(cursor_start, cursor_end, cursor_impact, entnum);

View file

@ -2820,6 +2820,7 @@ Host_Init
*/
void Host_Init (quakeparms_t *parms)
{
int i;
int qrc, hrc, def;
extern cvar_t vid_renderer;
@ -2907,9 +2908,10 @@ void Host_Init (quakeparms_t *parms)
Cbuf_AddText ("+mlook\n", RESTRICT_LOCAL); //fixme: this is bulky, only exec one of these.
qrc = COM_FDepthFile("quake.rc", true);
hrc = COM_FDepthFile("hexen.rc", true);
def = COM_FDepthFile("default.cfg", true);
//who should we imitate?
qrc = COM_FDepthFile("quake.rc", true); //q1
hrc = COM_FDepthFile("hexen.rc", true); //h2
def = COM_FDepthFile("default.cfg", true); //q2/q3
if (qrc >= def && qrc >= hrc && qrc!=0x7fffffff)
Cbuf_AddText ("exec quake.rc\n", RESTRICT_LOCAL);
@ -2935,15 +2937,34 @@ void Host_Init (quakeparms_t *parms)
Cbuf_Execute (); //if the server initialisation causes a problem, give it a place to abort to
#ifndef NOMEDIA
if (!cls.demofile && !cls.state && !media_filmtype)
//assuming they didn't use any waits in thier config (fools)
//the configs should be fully loaded.
//so convert the backwards compable commandline parameters in cvar sets.
if (COM_CheckParm ("-window") || COM_CheckParm ("-startwindowed"))
Cvar_Set(Cvar_FindVar("vid_fullscreen"), "0");
if (COM_CheckParm ("-fullscreen"))
Cvar_Set(Cvar_FindVar("vid_fullscreen"), "1");
if ((i = COM_CheckParm ("-width"))) //width on it's own also sets height
{
if (COM_FDepthFile("video/idlogo.roq", true) > COM_FDepthFile("video/idlog.cin", true))
Media_PlayFilm("video/idlog.cin");
else
Media_PlayFilm("video/idlogo.roq");
Cvar_Set(Cvar_FindVar("vid_width"), com_argv[i+1]);
Cvar_SetValue(Cvar_FindVar("vid_height"), (atoi(com_argv[i+1])/3)*4);
}
#endif
if ((i = COM_CheckParm ("-height")))
Cvar_Set(Cvar_FindVar("vid_height"), com_argv[i+1]);
if ((i = COM_CheckParm ("-conwidth"))) //width on it's own also sets height
{
Cvar_Set(Cvar_FindVar("vid_conwidth"), com_argv[i+1]);
Cvar_SetValue(Cvar_FindVar("vid_conheight"), (atoi(com_argv[i+1])/3)*4);
}
if ((i = COM_CheckParm ("-conheight")))
Cvar_Set(Cvar_FindVar("vid_conheight"), com_argv[i+1]);
if ((i = COM_CheckParm ("-bpp")))
Cvar_Set(Cvar_FindVar("vid_bpp"), com_argv[i+1]);
if (!qrenderer && *vid_renderer.string)
{
Cmd_ExecuteString("vid_restart\n", RESTRICT_LOCAL);
@ -2956,6 +2977,15 @@ void Host_Init (quakeparms_t *parms)
UI_Init();
#ifndef NOMEDIA
if (!cls.demofile && !cls.state && !media_filmtype)
{
if (COM_FDepthFile("video/idlogo.roq", true) > COM_FDepthFile("video/idlog.cin", true))
Media_PlayFilm("video/idlog.cin");
else
Media_PlayFilm("video/idlogo.roq");
}
#endif
Con_TPrintf (TL_NL);
#ifdef VERSION3PART

View file

@ -791,6 +791,8 @@ void Model_NextDownload (void)
}
#endif
Hunk_Check();
cls.downloadtype = dl_model;
for (
@ -816,6 +818,8 @@ void Model_NextDownload (void)
if (CL_CheckMD2Skins(s))
return;
}
Hunk_Check();
if (cl.playernum[0] == -1)
{ //q2 cinematic - don't load the models.
@ -827,9 +831,13 @@ void Model_NextDownload (void)
{
if (!cl.model_name[i][0])
break;
Hunk_Check();
cl.model_precache[i] = NULL;
cl.model_precache[i] = Mod_ForName (cl.model_name[i], false);
Hunk_Check();
if (!cl.model_precache[i] || (i == 1 && (cl.model_precache[i]->type == mod_dummy || cl.model_precache[i]->needload)))
{

View file

@ -126,7 +126,8 @@ typedef struct
} q2player_state_t;
#endif
#define MAX_SCOREBOARDNAME 16
#define MAX_SCOREBOARDNAME 64
#define MAX_DISPLAYEDNAME 16
typedef struct player_info_s
{
int userid;

View file

@ -612,7 +612,7 @@ void CSQC_Init (void)
CSQC_InitFields(); //let the qclib know the field order that the engine needs.
if (PR_LoadProgs(csqcprogs, "qwprogs.dat", 0, NULL, 0) < 0) //no per-progs builtins.
if (PR_LoadProgs(csqcprogs, "csprogs.dat", 0, NULL, 0) < 0) //no per-progs builtins.
{
//failed to load or something
return;
@ -637,7 +637,7 @@ void CSQC_Init (void)
qboolean CSQC_DrawView(void)
{
if (!csqc_draw_function)
if (!csqc_draw_function || !csqcprogs)
return false;
PR_ExecuteProgram(csqcprogs, csqc_draw_function);

View file

@ -256,7 +256,6 @@ void R_StoreEfrags (efrag_t **ppefrag)
entity_t *pent;
model_t *clmodel;
efrag_t *pefrag;
return;
while ((pefrag = *ppefrag) != NULL)
{

View file

@ -1381,6 +1381,8 @@ qboolean R_ApplyRenderer (rendererstate_t *newr)
COM_FlushTempoaryPacks();
S_Shutdown();
if (qrenderer == QR_NONE || qrenderer==-1)
{
if (newr->renderer == QR_NONE && qrenderer != -1)
@ -1684,6 +1686,9 @@ TRACE(("dbg: R_ApplyRenderer: efrags\n"));
"OpenGL renderer initialized\n");
break;
}
if (!isDedicated)
S_Restart_f();
memcpy(&currentrendererstate, newr, sizeof(currentrendererstate));
return true;
@ -1713,6 +1718,7 @@ TRACE(("dbg: R_RestartRenderer_f\n"));
newr.fullscreen = vid_fullscreen.value;
newr.rate = vid_refreshrate.value;
Q_strncpyz(newr.glrenderer, gl_driver.string, sizeof(newr.glrenderer));
if (!*vid_renderer.string)
{
//gotta do this after main hunk is saved off.

View file

@ -175,6 +175,75 @@ void Draw_FunString(int x, int y, char *str)
}
}
void Draw_FunStringLen(int x, int y, char *str, int len)
{
int ext = COLOR_WHITE<<8;
int extstack[4];
int extstackdepth = 0;
while(*str)
{
if (*str == '^')
{
str++;
if (*str >= '0' && *str <= '7')
{
ext = (*str++-'0')*256 + (ext&~CON_COLOURMASK); //change colour only.
continue;
}
else if (*str == 'a')
{
str++;
ext = (ext & ~CON_2NDCHARSETTEXT) + (CON_2NDCHARSETTEXT - (ext & CON_2NDCHARSETTEXT));
continue;
}
else if (*str == 'b')
{
str++;
ext = (ext & ~CON_BLINKTEXT) + (CON_BLINKTEXT - (ext & CON_BLINKTEXT));
continue;
}
else if (*str == 's') //store on stack (it's great for names)
{
str++;
if (extstackdepth < sizeof(extstack)/sizeof(extstack[0]))
{
extstack[extstackdepth] = ext;
extstackdepth++;
}
}
else if (*str == 'r') //restore from stack (it's great for names)
{
str++;
if (extstackdepth)
{
extstackdepth--;
ext = extstack[extstackdepth];
}
continue;
}
else if (*str == '^')
{
Draw_ColouredCharacter(x, y, '^' + ext);
str++;
}
else
{
Draw_ColouredCharacter(x, y, '^' + ext);
x += 8;
Draw_ColouredCharacter (x, y, (*str++) + ext);
}
x += 8;
continue;
}
Draw_ColouredCharacter (x, y, (*str++) + ext);
x += 8;
if (--len< 0)
break;
}
}
static qboolean largegame = false;
@ -1813,7 +1882,7 @@ void Sbar_DeathmatchOverlay (int start)
int total;
int minutes;
int p;
char team[5];
char team[64];
int skip = 10;
if (largegame)
@ -1884,7 +1953,7 @@ void Sbar_DeathmatchOverlay (int start)
if (p < 0 || p > 999)
p = 999;
sprintf (num, "%4i", p);
Draw_String ( x, y, num);
Draw_FunString ( x, y, num);
// draw pl
p = s->pl;
@ -1947,7 +2016,7 @@ void Sbar_DeathmatchOverlay (int start)
if (cl.teamplay)
{
Q_strncpyz (team, Info_ValueForKey(s->userinfo, "team"), sizeof(team));
Draw_String (x+152, y, team);
Draw_FunStringLen (x+152, y, team, 4);
}
// draw name
@ -1958,6 +2027,8 @@ void Sbar_DeathmatchOverlay (int start)
y += skip;
}
Draw_Character(0,0,COLOR_WHITE<<8);
if (y >= vid.height-10) // we ran over the screen size, squish
largegame = true;
@ -2061,6 +2132,8 @@ void Sbar_ChatModeOverlay(void)
y += skip;
}
Draw_Character(0,0,COLOR_WHITE<<8);
if (y >= vid.height-10) // we ran over the screen size, squish
largegame = true;
@ -2082,9 +2155,9 @@ void Sbar_MiniDeathmatchOverlay (void)
int x, y, f;
char num[12];
player_info_t *s;
char team[5];
char team[64];
int numlines;
char name[16+1];
char name[64+1];
team_t *tm;
if (sbar_rect.width < 512 || !sb_lines)
@ -2144,7 +2217,7 @@ void Sbar_MiniDeathmatchOverlay (void)
f = s->frags;
sprintf (num, "%3i",f);
Draw_Character ( x+8 , y, num[0]);
Draw_ColouredCharacter ( x+8 , y, (COLOR_WHITE<<8)|num[0]);
Draw_Character ( x+16, y, num[1]);
Draw_Character ( x+24, y, num[2]);
@ -2155,19 +2228,17 @@ void Sbar_MiniDeathmatchOverlay (void)
Draw_Character ( x + 32, y, 17);
}
// team
Q_strncpyz(name, s->name, sizeof(name));
// team and name
if (cl.teamplay)
{
Q_strncpyz (team, Info_ValueForKey(s->userinfo, "team"), sizeof(team));
Draw_String (x+48, y, team);
Draw_FunStringLen (x+48, y, team, 4);
Draw_FunStringLen (x+48+40, y, name, MAX_DISPLAYEDNAME);
}
// draw name
Q_strncpyz(name, s->name, sizeof(name));
if (cl.teamplay)
Draw_FunString (x+48+40, y, name);
else
Draw_FunString (x+48, y, name);
Draw_FunStringLen (x+48, y, name, MAX_DISPLAYEDNAME);
y += 8;
}
@ -2178,7 +2249,7 @@ void Sbar_MiniDeathmatchOverlay (void)
// draw seperator
x += 208;
for (y = sbar_rect.height - sb_lines; y < sbar_rect.height - 6; y += 2)
Draw_Character(x, y, 14);
Draw_ColouredCharacter(x, y, (COLOR_WHITE<<8)|14);
x += 16;
@ -2190,11 +2261,11 @@ void Sbar_MiniDeathmatchOverlay (void)
// draw pings
Q_strncpyz (team, tm->team, sizeof(team));
Draw_String (x, y, team);
Draw_FunStringLen (x, y, team, 4);
// draw total
sprintf (num, "%5i", tm->frags);
Draw_String (x + 40, y, num);
Draw_FunString(x + 40, y, num);
if (!strncmp(Info_ValueForKey(cl.players[cl.playernum[0]].userinfo,
"team"), tm->team, 16)) {

View file

@ -34,7 +34,7 @@ void S_Update_(soundcardinfo_t *sc);
void S_StopAllSounds(qboolean clear);
void S_StopAllSoundsC(void);
void S_UpdateCard(soundcardinfo_t *sc, vec3_t origin, vec3_t forward, vec3_t right, vec3_t up);
void S_UpdateCard(soundcardinfo_t *sc);
// =======================================================================
// Internal sound data & structures
@ -162,6 +162,8 @@ void S_Startup (void)
if (sound_started)
S_Shutdown();
snd_blocked = 0;
if (!fakedma)
{
#if defined(_WIN32) && !defined(NODIRECTX)
@ -1109,13 +1111,18 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
{
soundcardinfo_t *sc;
VectorCopy(origin, listener_origin);
VectorCopy(forward, listener_forward);
VectorCopy(right, listener_right);
VectorCopy(up, listener_up);
S_UpdateCapture();
for (sc = sndcardinfo; sc; sc = sc->next)
S_UpdateCard(sc, origin, forward, right, up);
S_UpdateCard(sc);
}
void S_UpdateCard(soundcardinfo_t *sc, vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
void S_UpdateCard(soundcardinfo_t *sc)
{
int i, j;
int total;
@ -1129,11 +1136,6 @@ void S_UpdateCard(soundcardinfo_t *sc, vec3_t origin, vec3_t forward, vec3_t rig
if (!sc->inactive_sound)
return;
}
VectorCopy(origin, listener_origin);
VectorCopy(forward, listener_forward);
VectorCopy(right, listener_right);
VectorCopy(up, listener_up);
// update general area ambient sound sources
S_UpdateAmbientSounds (sc);
@ -1253,6 +1255,9 @@ void S_ExtraUpdate (void)
{
soundcardinfo_t *sc;
if (!sound_started)
return;
#ifdef _WIN32
IN_Accumulate ();
#endif
@ -1272,13 +1277,17 @@ void S_Update_(soundcardinfo_t *sc)
{
unsigned endtime;
int samps;
if (!sound_started)// || (snd_blocked > 0))
return;
if (sc->selfpainting)
return;
if ((snd_blocked > 0))
{
if (!sc->inactive_sound)
return;
}
// Updates DMA time
GetSoundtime(sc);

View file

@ -1143,9 +1143,6 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
Sys_Init ();
// because sound is off until we become active
S_BlockSound ();
Sys_Printf ("Host_Init\n");
Host_Init (&parms);

View file

@ -731,6 +731,64 @@ static char *Macro_demoplayback (void)
}
return "1"; //unknown.
}
static char *Macro_Match_Name (void)
{
int i;
i = TP_CountPlayers();
if (cl.teamplay && i >= 3)
{ // Teamplay
return va ("%s %s vs %s - %s",
TP_PlayerName(),
TP_PlayerTeam(),
TP_EnemyTeam(),
TP_MapName());
}
else
{
if (i == 2)
{ // Duel
return va ("%s vs %s - %s",
TP_PlayerName(),
TP_EnemyName(),
TP_MapName());
}
else if (i > 2)
{ // FFA
return va ("%s ffa - %s",
TP_PlayerName(),
TP_MapName());
}
else
{ // one player
return va ("%s - %s",
TP_PlayerName(),
TP_MapName());
}
}
}
//$matchtype
//duel,2on2,4on4,ffa,etc...
static char *Macro_Match_Type (void)
{
int i;
i = TP_CountPlayers();
if (cl.teamplay && i >= 3)
{
if (i >= 6)
return "4on4";
return "2on2";
}
if (i == 2)
return "duel";
if (i == 1)
return "single";
if (i == 0)
return "empty";
return "ffa";
}
/*
$droploc
Tells location of the dropped flag.
@ -764,9 +822,6 @@ $matchstatus
("disconnected", "standby" or "normal"). This can be
used for detecting prewar/prematch on ktpro/oztf servers.
$matchtype
duel,2on2,4on4,ffa,etc...
$mp3info
Evaluates to "author - title".
Examples:
@ -775,19 +830,6 @@ then hitting space will say something like
"listening to disturbed - rise".
bind x "if disturbed isin $mp3info then say dde music is cool"
$need
What you need.
Note: you have to set this with tp_need* variables.
$point
Name of object you are looking at.
$pointatloc
Name of object and location of object you are looking at.
$pointloc
Location of object you are looking at.
$triggermatch
$triggermatch is the last chat message that exec'd a msg_trigger.
@ -828,14 +870,14 @@ static void TP_InitMacros(void)
Cmd_AddMacro("point", Macro_PointName);
Cmd_AddMacro("pointatloc", Macro_PointNameAtLocation);
Cmd_AddMacro("pointloc", Macro_PointLocation);
Cmd_AddMacro("matchname", Macro_Match_Name);
Cmd_AddMacro("matchtype", Macro_Match_Type);
// Cmd_AddMacro("droploc", Macro_LastDrop);
// Cmd_AddMacro("droptime", Macro_LastDropTime);
// Cmd_AddMacro("ledpoint", Macro_Point_LED);
// Cmd_AddMacro("ledstatus", Macro_MyStatus_LED);
// Cmd_AddMacro("matchname", Macro_Match_Name);
// Cmd_AddMacro("matchstatus", Macro_Match_Status);
// Cmd_AddMacro("matchtype", Macro_Match_Type);
// Cmd_AddMacro("mp3info", );
// Cmd_AddMacro("triggermatch", Macro_LastTrigger_Match);
}

View file

@ -8,7 +8,7 @@ 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.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
@ -62,13 +62,13 @@ int PM_ClipVelocity (vec3_t in, vec3_t normal, vec3_t out, float overbounce)
float backoff;
float change;
int i, blocked;
blocked = 0;
if (normal[2] > 0)
blocked |= BLOCKED_FLOOR; // floor
if (!normal[2])
blocked |= BLOCKED_STEP; // step
backoff = DotProduct (in, normal) * overbounce;
for (i=0 ; i<3 ; i++)
@ -78,7 +78,7 @@ int PM_ClipVelocity (vec3_t in, vec3_t normal, vec3_t out, float overbounce)
if (out[i] > -STOP_EPSILON && out[i] < STOP_EPSILON)
out[i] = 0;
}
return blocked;
}
@ -105,14 +105,14 @@ int PM_SlideMove (void)
vec3_t end;
float time_left;
int blocked;
numbumps = 4;
blocked = 0;
VectorCopy (pmove.velocity, original_velocity);
VectorCopy (pmove.velocity, primal_velocity);
numplanes = 0;
time_left = frametime;
for (bumpcount=0 ; bumpcount<numbumps ; bumpcount++)
@ -152,7 +152,7 @@ int PM_SlideMove (void)
blocked |= BLOCKED_OTHER;
time_left -= time_left * trace.fraction;
// cliped to another plane
if (numplanes >= MAX_CLIP_PLANES)
{ // this shouldn't really happen
@ -178,9 +178,8 @@ int PM_SlideMove (void)
&& Length(pmove.velocity)>200 && pmove.cmd.buttons & 2 && !pmove.jump_held && !pmove.waterjumptime)
{
PM_ClipVelocity (original_velocity, planes[i], pmove.velocity, 2);
pmove.velocity[2] += 270;
if (pmove.velocity[2] < 125)
pmove.velocity[2] = 125;
if (pmove.velocity[2] < 270)
pmove.velocity[2] = 270;
pmove.jump_msec = pmove.cmd.msec;
pmove.jump_held = true;
pmove.waterjumptime = 0;
@ -196,7 +195,7 @@ int PM_SlideMove (void)
if (j == numplanes)
break;
}
if (i != numplanes)
{ // go along this plane
}
@ -302,7 +301,7 @@ usedown:
VectorCopy (downvel, pmove.velocity);
return;
}
// copy z value from slide move
pmove.velocity[2] = downvel[2];
@ -332,7 +331,7 @@ void PM_Friction (void)
float drop;
vec3_t start, stop;
trace_t trace;
if (pmove.waterjumptime)
return;
@ -408,7 +407,7 @@ void PM_Accelerate (vec3_t wishdir, float wishspeed, float accel)
accelspeed = accel*frametime*wishspeed;
if (accelspeed > addspeed)
accelspeed = addspeed;
for (i=0 ; i<3 ; i++)
pmove.velocity[i] += accelspeed*wishdir[i];
}
@ -418,7 +417,7 @@ void PM_AirAccelerate (vec3_t wishdir, float wishspeed, float accel)
int i;
float addspeed, accelspeed, currentspeed, wishspd = wishspeed;
float originalspeed, newspeed, speedcap;
if (pmove.pm_type == PM_DEAD)
return;
if (pmove.waterjumptime)
@ -441,7 +440,7 @@ void PM_AirAccelerate (vec3_t wishdir, float wishspeed, float accel)
accelspeed = accel * wishspeed * frametime;
if (accelspeed > addspeed)
accelspeed = addspeed;
for (i=0 ; i<3 ; i++)
pmove.velocity[i] += accelspeed*wishdir[i];
@ -517,19 +516,19 @@ void PM_FlyMove ()
for (i=0 ; i<3 ; i++)
wishvel[i] = forward[i]*pmove.cmd.forwardmove + right[i]*pmove.cmd.sidemove;
wishvel[2] += pmove.cmd.upmove;
VectorCopy (wishvel, wishdir);
wishspeed = VectorNormalize(wishdir);
if (wishspeed > movevars.maxspeed) {
VectorScale (wishvel, movevars.maxspeed/wishspeed, wishvel);
wishspeed = movevars.maxspeed;
}
PM_Accelerate (wishdir, wishspeed, movevars.accelerate);
PM_StepSlideMove ();
}
@ -544,7 +543,7 @@ void PM_LadderMove (void)
//
// user intentions
//
//
for (i=0 ; i<3 ; i++)
wishvel[i] = forward[i]*pmove.cmd.forwardmove + right[i]*pmove.cmd.sidemove + up[i]*pmove.cmd.upmove;
@ -575,7 +574,7 @@ void PM_LadderMove (void)
VectorCopy (trace.endpos, pmove.origin);
return;
}
PM_FlyMove ();
}
@ -596,7 +595,7 @@ void PM_AirMove (void)
fmove = pmove.cmd.forwardmove;
smove = pmove.cmd.sidemove;
forward[2] = 0;
right[2] = 0;
VectorNormalize (forward);
@ -617,7 +616,7 @@ void PM_AirMove (void)
VectorScale (wishvel, movevars.maxspeed/wishspeed, wishvel);
wishspeed = movevars.maxspeed;
}
if (pmove.onground)
{
if (pmove.velocity[2] > 0 || !movevars.slidefix)
@ -731,7 +730,7 @@ void PM_CategorizePosition (void)
{
trace_t t;
vec3_t flatforward, fwd1;
flatforward[0] = forward[0];
flatforward[1] = forward[1];
flatforward[2] = 0;
@ -952,7 +951,7 @@ void PM_SpectatorMove (void)
// accelerate
fmove = pmove.cmd.forwardmove;
smove = pmove.cmd.sidemove;
VectorNormalize (forward);
VectorNormalize (right);
@ -986,9 +985,9 @@ void PM_SpectatorMove (void)
accelspeed = movevars.accelerate*frametime*wishspeed;
if (accelspeed > addspeed)
accelspeed = addspeed;
for (i=0 ; i<3 ; i++)
pmove.velocity[i] += accelspeed*wishdir[i];
pmove.velocity[i] += accelspeed*wishdir[i];
}
// move

View file

@ -593,219 +593,222 @@ static galiastexnum_t *GL_ChooseSkin(galiasinfo_t *inf, char *modelname, entity_
int tc, bc;
if (e->scoreboard)
if (gl_nocolors.value)
{
if (!e->scoreboard->skin && !gl_nocolors.value)
Skin_Find(e->scoreboard);
tc = e->scoreboard->topcolor;
bc = e->scoreboard->bottomcolor;
//colour forcing
if (cl.splitclients<2 && !(cl.fpd & FPD_NO_FORCE_COLOR)) //no colour/skin forcing in splitscreen.
if (e->scoreboard)
{
if (cl.teamplay && !strcmp(e->scoreboard->team, cl.players[cl.playernum[0]].team))
if (!e->scoreboard->skin)
Skin_Find(e->scoreboard);
tc = e->scoreboard->topcolor;
bc = e->scoreboard->bottomcolor;
//colour forcing
if (cl.splitclients<2 && !(cl.fpd & FPD_NO_FORCE_COLOR)) //no colour/skin forcing in splitscreen.
{
if (cl_teamtopcolor>=0)
tc = cl_teamtopcolor;
if (cl_teambottomcolor>=0)
bc = cl_teambottomcolor;
}
else
{
if (cl_enemytopcolor>=0)
tc = cl_enemytopcolor;
if (cl_enemybottomcolor>=0)
bc = cl_enemybottomcolor;
if (cl.teamplay && !strcmp(e->scoreboard->team, cl.players[cl.playernum[0]].team))
{
if (cl_teamtopcolor>=0)
tc = cl_teamtopcolor;
if (cl_teambottomcolor>=0)
bc = cl_teambottomcolor;
}
else
{
if (cl_enemytopcolor>=0)
tc = cl_enemytopcolor;
if (cl_enemybottomcolor>=0)
bc = cl_enemybottomcolor;
}
}
}
}
else
{
tc = 1;
bc = 1;
}
if (!gl_nocolors.value && (tc != 1 || bc != 1 || (e->scoreboard && e->scoreboard->skin)))
{
int inwidth, inheight;
int tinwidth, tinheight;
char *skinname;
qbyte *original;
int cc;
galiascolourmapped_t *cm;
cc = (tc<<4)|bc;
if (!strstr(modelname, "progs/player.mdl"))
skinname = modelname;
else
{
if (e->scoreboard && e->scoreboard->skin && !gl_nocolors.value)
skinname = e->scoreboard->skin->name;
else
tc = 1;
bc = 1;
}
if (tc != 1 || bc != 1 || (e->scoreboard && e->scoreboard->skin))
{
int inwidth, inheight;
int tinwidth, tinheight;
char *skinname;
qbyte *original;
int cc;
galiascolourmapped_t *cm;
cc = (tc<<4)|bc;
if (!strstr(modelname, "progs/player.mdl"))
skinname = modelname;
}
if (!skincolourmapped.numbuckets)
Hash_InitTable(&skincolourmapped, 256, BZ_Malloc(Hash_BytesForBuckets(256)));
for (cm = Hash_Get(&skincolourmapped, skinname); cm; cm = Hash_GetNext(&skincolourmapped, skinname, cm))
{
if (cm->colour == cc && cm->skinnum == e->skinnum)
else
{
return &cm->texnum;
if (e->scoreboard && e->scoreboard->skin && !gl_nocolors.value)
skinname = e->scoreboard->skin->name;
else
skinname = modelname;
}
}
skins = (galiasskin_t*)((char *)inf + inf->ofsskins);
if (!skins->texnums)
return NULL;
if (e->skinnum >= 0 && e->skinnum < inf->numskins)
skins += e->skinnum;
texnums = (galiastexnum_t*)((char *)skins + skins->ofstexnums);
//colourmap isn't present yet.
cm = BZ_Malloc(sizeof(*cm));
Q_strncpyz(cm->name, skinname, sizeof(cm->name));
Hash_Add2(&skincolourmapped, cm->name, cm, &cm->bucket);
cm->colour = cc;
cm->skinnum = e->skinnum;
cm->texnum.fullbright = 0;
cm->texnum.base = 0;
cm->texnum.bump = texnums[cm->skinnum].bump; //can't colour bumpmapping
if (skinname!=modelname && e->scoreboard && e->scoreboard->skin)
{
original = Skin_Cache8(e->scoreboard->skin);
inwidth = e->scoreboard->skin->width;
inheight = e->scoreboard->skin->height;
}
else
{
original = NULL;
inwidth = 0;
}
if (!original)
{
if (skins->ofstexels)
if (!skincolourmapped.numbuckets)
Hash_InitTable(&skincolourmapped, 256, BZ_Malloc(Hash_BytesForBuckets(256)));
for (cm = Hash_Get(&skincolourmapped, skinname); cm; cm = Hash_GetNext(&skincolourmapped, skinname, cm))
{
original = (qbyte *)skins + skins->ofstexels;
inwidth = skins->skinwidth;
inheight = skins->skinheight;
if (cm->colour == cc && cm->skinnum == e->skinnum)
{
return &cm->texnum;
}
}
skins = (galiasskin_t*)((char *)inf + inf->ofsskins);
if (!skins->texnums)
return NULL;
if (e->skinnum >= 0 && e->skinnum < inf->numskins)
skins += e->skinnum;
texnums = (galiastexnum_t*)((char *)skins + skins->ofstexnums);
//colourmap isn't present yet.
cm = BZ_Malloc(sizeof(*cm));
Q_strncpyz(cm->name, skinname, sizeof(cm->name));
Hash_Add2(&skincolourmapped, cm->name, cm, &cm->bucket);
cm->colour = cc;
cm->skinnum = e->skinnum;
cm->texnum.fullbright = 0;
cm->texnum.base = 0;
cm->texnum.bump = texnums[cm->skinnum].bump; //can't colour bumpmapping
if (skinname!=modelname && e->scoreboard && e->scoreboard->skin)
{
original = Skin_Cache8(e->scoreboard->skin);
inwidth = e->scoreboard->skin->width;
inheight = e->scoreboard->skin->height;
}
else
{
original = NULL;
inwidth = 0;
inheight = 0;
}
}
tinwidth = skins->skinwidth;
tinheight = skins->skinheight;
if (original)
{
int i, j;
qbyte translate[256];
unsigned translate32[256];
static unsigned pixels[512*512];
unsigned *out;
unsigned frac, fracstep;
unsigned scaled_width, scaled_height;
qbyte *inrow;
texnums = &cm->texnum;
texnums->base = 0;
texnums->fullbright = 0;
scaled_width = gl_max_size.value < 512 ? gl_max_size.value : 512;
scaled_height = gl_max_size.value < 512 ? gl_max_size.value : 512;
for (i=0 ; i<256 ; i++)
translate[i] = i;
tc<<=4;
bc<<=4;
for (i=0 ; i<16 ; i++)
if (!original)
{
if (tc < 128) // the artists made some backwards ranges. sigh.
translate[TOP_RANGE+i] = tc+i;
else
translate[TOP_RANGE+i] = tc+15-i;
if (bc < 128)
translate[BOTTOM_RANGE+i] = bc+i;
else
translate[BOTTOM_RANGE+i] = bc+15-i;
}
for (i=0 ; i<256 ; i++)
translate32[i] = d_8to24rgbtable[translate[i]];
out = pixels;
fracstep = tinwidth*0x10000/scaled_width;
for (i=0 ; i<scaled_height ; i++, out += scaled_width)
{
inrow = original + inwidth*(i*tinheight/scaled_height);
frac = fracstep >> 1;
for (j=0 ; j<scaled_width ; j+=4)
if (skins->ofstexels)
{
out[j] = translate32[inrow[frac>>16]];
frac += fracstep;
out[j+1] = translate32[inrow[frac>>16]];
frac += fracstep;
out[j+2] = translate32[inrow[frac>>16]];
frac += fracstep;
out[j+3] = translate32[inrow[frac>>16]];
frac += fracstep;
original = (qbyte *)skins + skins->ofstexels;
inwidth = skins->skinwidth;
inheight = skins->skinheight;
}
else
{
original = NULL;
inwidth = 0;
inheight = 0;
}
}
texnums->base = texture_extension_number++;
GL_Bind(texnums->base);
qglTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
//now do the fullbrights.
out = pixels;
fracstep = tinwidth*0x10000/scaled_width;
for (i=0 ; i<scaled_height ; i++, out += scaled_width)
tinwidth = skins->skinwidth;
tinheight = skins->skinheight;
if (original)
{
inrow = original + inwidth*(i*tinheight/scaled_height);
frac = fracstep >> 1;
for (j=0 ; j<scaled_width ; j+=1)
int i, j;
qbyte translate[256];
unsigned translate32[256];
static unsigned pixels[512*512];
unsigned *out;
unsigned frac, fracstep;
unsigned scaled_width, scaled_height;
qbyte *inrow;
texnums = &cm->texnum;
texnums->base = 0;
texnums->fullbright = 0;
scaled_width = gl_max_size.value < 512 ? gl_max_size.value : 512;
scaled_height = gl_max_size.value < 512 ? gl_max_size.value : 512;
for (i=0 ; i<256 ; i++)
translate[i] = i;
tc<<=4;
bc<<=4;
for (i=0 ; i<16 ; i++)
{
if (inrow[frac>>16] < 255-vid.fullbright)
((char *) (&out[j]))[3] = 0; //alpha 0
frac += fracstep;
if (tc < 128) // the artists made some backwards ranges. sigh.
translate[TOP_RANGE+i] = tc+i;
else
translate[TOP_RANGE+i] = tc+15-i;
if (bc < 128)
translate[BOTTOM_RANGE+i] = bc+i;
else
translate[BOTTOM_RANGE+i] = bc+15-i;
}
for (i=0 ; i<256 ; i++)
translate32[i] = d_8to24rgbtable[translate[i]];
out = pixels;
fracstep = tinwidth*0x10000/scaled_width;
for (i=0 ; i<scaled_height ; i++, out += scaled_width)
{
inrow = original + inwidth*(i*tinheight/scaled_height);
frac = fracstep >> 1;
for (j=0 ; j<scaled_width ; j+=4)
{
out[j] = translate32[inrow[frac>>16]];
frac += fracstep;
out[j+1] = translate32[inrow[frac>>16]];
frac += fracstep;
out[j+2] = translate32[inrow[frac>>16]];
frac += fracstep;
out[j+3] = translate32[inrow[frac>>16]];
frac += fracstep;
}
}
texnums->base = texture_extension_number++;
GL_Bind(texnums->base);
qglTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
//now do the fullbrights.
out = pixels;
fracstep = tinwidth*0x10000/scaled_width;
for (i=0 ; i<scaled_height ; i++, out += scaled_width)
{
inrow = original + inwidth*(i*tinheight/scaled_height);
frac = fracstep >> 1;
for (j=0 ; j<scaled_width ; j+=1)
{
if (inrow[frac>>16] < 255-vid.fullbright)
((char *) (&out[j]))[3] = 0; //alpha 0
frac += fracstep;
}
}
texnums->fullbright = texture_extension_number++;
GL_Bind(texnums->fullbright);
qglTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
}
texnums->fullbright = texture_extension_number++;
GL_Bind(texnums->fullbright);
qglTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
else
{
skins = (galiasskin_t*)((char *)inf + inf->ofsskins);
if (e->skinnum >= 0 && e->skinnum < inf->numskins)
skins += e->skinnum;
if (!skins->texnums)
return NULL;
frame = cl.time*skins->skinspeed;
frame = frame%skins->texnums;
texnums = (galiastexnum_t*)((char *)skins + skins->ofstexnums + frame*sizeof(galiastexnum_t));
memcpy(&cm->texnum, texnums, sizeof(cm->texnum));
}
return &cm->texnum;
}
else
{
skins = (galiasskin_t*)((char *)inf + inf->ofsskins);
if (e->skinnum >= 0 && e->skinnum < inf->numskins)
skins += e->skinnum;
if (!skins->texnums)
return NULL;
frame = cl.time*skins->skinspeed;
frame = frame%skins->texnums;
texnums = (galiastexnum_t*)((char *)skins + skins->ofstexnums + frame*sizeof(galiastexnum_t));
memcpy(&cm->texnum, texnums, sizeof(cm->texnum));
}
return &cm->texnum;
}
skins = (galiasskin_t*)((char *)inf + inf->ofsskins);

View file

@ -1881,6 +1881,10 @@ R_ModifyColor
*/
void R_ModifyColor ( meshbuffer_t *mb, shaderpass_t *pass )
{
extern qbyte *host_basepal;
extern qboolean gammaworks;
extern qbyte gammatable[256];
int i, b;
float *table, c, a;
vec3_t t, v;
@ -1952,6 +1956,87 @@ void R_ModifyColor ( meshbuffer_t *mb, shaderpass_t *pass )
case RGB_GEN_EXACT_VERTEX:
memcpy ( bArray, vArray, sizeof(byte_vec4_t)*numColors );
break;
case RGB_GEN_TOPCOLOR: //multiply vertex by topcolor (for player models)
{
int rc, gc, bc;
if (currententity->scoreboard)
{
i = currententity->scoreboard->topcolor;
//colour forcing
if (cl.splitclients<2 && !(cl.fpd & FPD_NO_FORCE_COLOR)) //no colour/skin forcing in splitscreen.
{
if (cl.teamplay && !strcmp(currententity->scoreboard->team, cl.players[cl.playernum[0]].team))
{
if (cl_teamtopcolor>=0)
i = cl_teamtopcolor;
}
else
{
if (cl_enemytopcolor>=0)
i = cl_enemytopcolor;
}
}
}
else
i = TOP_RANGE>>4;
rc = host_basepal[i<<4];
gc = host_basepal[i<<4];
bc = host_basepal[i<<4];
if (!gammaworks)
{
rc = gammatable[rc];
gc = gammatable[gc];
bc = gammatable[bc];
}
for ( i = 0; i < numColors; i++, bArray += 4, vArray += 4 ) {
bArray[0] = (vArray[0]*rc)>>8;
bArray[1] = (vArray[1]*gc)>>8;
bArray[2] = (vArray[2]*bc)>>8;
}
break;
}
case RGB_GEN_BOTTOMCOLOR: //multiply vertex by bottomcolor (for player models)
{
int rc, gc, bc;
if (currententity->scoreboard)
{
i = currententity->scoreboard->bottomcolor;
//colour forcing
if (cl.splitclients<2 && !(cl.fpd & FPD_NO_FORCE_COLOR)) //no colour/skin forcing in splitscreen.
{
if (cl.teamplay && !strcmp(currententity->scoreboard->team, cl.players[cl.playernum[0]].team))
{
if (cl_teambottomcolor>=0)
i = cl_teambottomcolor;
}
else
{
if (cl_enemybottomcolor>=0)
i = cl_enemybottomcolor;
}
}
}
else
i = BOTTOM_RANGE>>4;
rc = host_basepal[i<<4];
gc = host_basepal[i<<4];
bc = host_basepal[i<<4];
if (!gammaworks)
{
rc = gammatable[rc];
gc = gammatable[gc];
bc = gammatable[bc];
}
for ( i = 0; i < numColors; i++, bArray += 4, vArray += 4 ) {
bArray[0] = (vArray[0]*rc)>>8;
bArray[1] = (vArray[1]*gc)>>8;
bArray[2] = (vArray[2]*bc)>>8;
}
break;
}
case RGB_GEN_ONE_MINUS_VERTEX:
for ( i = 0; i < numColors; i++, bArray += 4, vArray += 4 ) {

View file

@ -548,6 +548,7 @@ model_t *GLMod_LoadModel (model_t *mod, qboolean crash)
{
Mod_LoadQ2BrushModel (mod, buf);
mod->needload = false;
R_DefaultTrail(mod);
return mod;
}
#endif
@ -561,11 +562,14 @@ model_t *GLMod_LoadModel (model_t *mod, qboolean crash)
{
char mdlbase[MAX_QPATH];
COM_StripExtension(mod->name, mdlbase);
#ifdef MD3MODELS
if (!buf)
buf = (unsigned *)COM_LoadStackFile (va("%s.md3", mdlbase), stackbuf, sizeof(stackbuf));
#endif
#ifdef MD2MODELS
if (!buf)
buf = (unsigned *)COM_LoadStackFile (va("%s.md2", mdlbase), stackbuf, sizeof(stackbuf));
#endif
}
if (!buf)
{
@ -578,6 +582,7 @@ model_t *GLMod_LoadModel (model_t *mod, qboolean crash)
{
mod->needload = false;
GLMod_LoadDoomSprite(mod);
R_DefaultTrail(mod);
return mod;
}
#endif
@ -595,6 +600,7 @@ couldntload:
mod->maxs[1] = 16;
mod->maxs[2] = 16;
mod->needload = true;
R_DefaultTrail(mod);
return mod;
return NULL;
}

View file

@ -1808,7 +1808,7 @@ void PPL_BaseBModelTextures(entity_t *e)
void PPL_BaseEntTextures(void)
{
extern model_t *currentmodel;
int i;
int i,j;
if (!r_drawentities.value)
return;
@ -1818,6 +1818,17 @@ void PPL_BaseEntTextures(void)
{
currententity = &cl_visedicts[i];
j = currententity->keynum;
while(j)
{
if (j == cl.viewentity[r_refdef.currentplayernum]+1)
break;
j = cl.lerpents[j].tagent;
}
if (j)
continue;
if (cl.viewentity[r_refdef.currentplayernum] && currententity->keynum == cl.viewentity[r_refdef.currentplayernum])
continue;
if (!Cam_DrawPlayer(0, currententity->keynum-1))

View file

@ -144,12 +144,12 @@ void GLSCR_UpdateScreen (void)
//let let the user be too crazy
if (vid_conwidth.value > 2048) //anything higher is unreadable.
Cvar_Set(&vid_conwidth, "2048");
if (vid_conwidth.value < 320) //lower would be wrong
if (vid_conwidth.value < 240) //lower would be wrong
Cvar_Set(&vid_conwidth, "320");
if (vid_conheight.value > 1536) //anything higher is unreadable.
Cvar_Set(&vid_conheight, "1536");
if (vid_conheight.value < 320) //lower would be wrong
Cvar_Set(&vid_conheight, "320");
if (vid_conheight.value < 240) //lower would be wrong
Cvar_Set(&vid_conheight, "200");
vid_conwidth.modified = false;
vid_conheight.modified = false;

View file

@ -651,32 +651,38 @@ static void Shaderpass_RGBGen ( shader_t *shader, shaderpass_t *pass, char **ptr
char *token;
token = Shader_ParseString ( ptr );
if ( !Q_stricmp (token, "identitylighting") ) {
if ( !Q_stricmp (token, "identitylighting") )
pass->rgbgen = RGB_GEN_IDENTITY_LIGHTING;
} else if ( !Q_stricmp (token, "identity") ) {
else if ( !Q_stricmp (token, "identity") )
pass->rgbgen = RGB_GEN_IDENTITY;
} else if ( !Q_stricmp (token, "wave") ) {
else if ( !Q_stricmp (token, "wave") )
{
pass->rgbgen = RGB_GEN_WAVE;
Shader_ParseFunc ( ptr, &pass->rgbgen_func );
} else if ( !Q_stricmp(token, "entity") ) {
}
else if ( !Q_stricmp(token, "entity") )
pass->rgbgen = RGB_GEN_ENTITY;
} else if ( !Q_stricmp (token, "oneMinusEntity") ) {
else if ( !Q_stricmp (token, "oneMinusEntity") )
pass->rgbgen = RGB_GEN_ONE_MINUS_ENTITY;
} else if ( !Q_stricmp (token, "vertex")) {
else if ( !Q_stricmp (token, "vertex"))
pass->rgbgen = RGB_GEN_VERTEX;
} else if ( !Q_stricmp (token, "oneMinusVertex") ) {
else if ( !Q_stricmp (token, "oneMinusVertex") )
pass->rgbgen = RGB_GEN_ONE_MINUS_VERTEX;
} else if ( !Q_stricmp (token, "lightingDiffuse") ) {
else if ( !Q_stricmp (token, "lightingDiffuse") )
pass->rgbgen = RGB_GEN_LIGHTING_DIFFUSE;
} else if ( !Q_stricmp (token, "exactvertex") ) {
else if ( !Q_stricmp (token, "exactvertex") )
pass->rgbgen = RGB_GEN_EXACT_VERTEX;
} else if ( !Q_stricmp (token, "const") || !Q_stricmp (token, "constant") ) {
else if ( !Q_stricmp (token, "const") || !Q_stricmp (token, "constant") )
{
pass->rgbgen = RGB_GEN_CONST;
pass->rgbgen_func.type = SHADER_FUNC_CONSTANT;
Shader_ParseVector ( ptr, pass->rgbgen_func.args );
}
else if ( !Q_stricmp (token, "topcolor") )
pass->rgbgen = RGB_GEN_TOPCOLOR;
else if ( !Q_stricmp (token, "bottomcolor") )
pass->rgbgen = RGB_GEN_BOTTOMCOLOR;
}
static void Shaderpass_AlphaGen ( shader_t *shader, shaderpass_t *pass, char **ptr )

View file

@ -842,7 +842,8 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
GL_Init(&GLX_GetSymbol);
VID_SetPalette(palette);
GLVID_SetPalette(palette);
GLVID_ShiftPalette(palette);
Con_SafePrintf ("Video mode %dx%d initialized.\n", info->width, info->height);

View file

@ -138,7 +138,9 @@ typedef struct shaderpass_s {
RGB_GEN_IDENTITY,
RGB_GEN_CONST,
RGB_GEN_UNKNOWN,
RGB_GEN_LIGHTING_DIFFUSE
RGB_GEN_LIGHTING_DIFFUSE,
RGB_GEN_TOPCOLOR,
RGB_GEN_BOTTOMCOLOR
} rgbgen;
enum {
ALPHA_GEN_ENTITY,

View file

@ -1000,6 +1000,7 @@ pbool ED_ParseEpair (progfuncs_t *progfuncs, void *base, ddefXX_t *key, char *s,
break;
default:
Sys_Error("Bad bits in ED_ParseEpair");
d = 0;
}
switch (type)

View file

@ -7669,7 +7669,7 @@ void PF_setattachment(progfuncs_t *prinst, struct globalvars_s *pr_globals)
if (tagentity != sv.edicts && tagname && tagname[0])
{
modelindex = (int)e->v.modelindex;
modelindex = (int)tagentity->v.modelindex;
if (modelindex > 0 && modelindex < MAX_MODELS && (model = SV_GetTags(modelindex, &tagcount)))
{
for (i = 0;i < tagcount;i++)

View file

@ -1281,24 +1281,24 @@ void SVC_DirectConnect
if (atof(Info_ValueForKey (temp.userinfo, "*FuhQuake")) < 0.3)
{
SV_OutOfBandPrintf (isquake2client, adr, "%c\nThe server is using a halflife level and we don't think your client supports this\nuse 'setinfo iknow 1' to ignore this check\nYou can go to "ENGINEWEBSITE" to get a compatable client\n\nYou may need to enable an option\n\n", A2C_PRINT);
Con_Printf("player %s was dropped due to incompatable client\n", name);
return;
// Con_Printf("player %s was dropped due to incompatable client\n", name);
// return;
}
}
#ifdef PEXT_Q2BSP
else if (sv.worldmodel->fromgame == fg_quake2 && !(newcl->fteprotocolextensions & PEXT_Q2BSP))
{
SV_OutOfBandPrintf (isquake2client, adr, "%c\nThe server is using a quake 2 level and we don't think your client supports this\nuse 'setinfo iknow 1' to ignore this check\nYou can go to "ENGINEWEBSITE" to get a compatable client\n\nYou may need to enable an option\n\n", A2C_PRINT);
Con_Printf("player %s was dropped due to incompatable client\n", name);
return;
// Con_Printf("player %s was dropped due to incompatable client\n", name);
// return;
}
#endif
#ifdef PEXT_Q3BSP
else if (sv.worldmodel->fromgame == fg_quake3 && !(newcl->fteprotocolextensions & PEXT_Q3BSP))
{
SV_OutOfBandPrintf (isquake2client, adr, "%c\nThe server is using a quake 3 level and we don't think your client supports this\nuse 'setinfo iknow 1' to ignore this check\nYou can go to "ENGINEWEBSITE" to get a compatable client\n\nYou may need to enable an option\n\n", A2C_PRINT);
Con_Printf("player %s was dropped due to incompatable client\n", name);
return;
// Con_Printf("player %s was dropped due to incompatable client\n", name);
// return;
}
#endif
}

View file

@ -195,20 +195,27 @@ void R_InitSkyBox (void)
wm = cl.worldmodel;
r_skyfaces = wm->surfaces + wm->numsurfaces;
wm->numsurfaces += 6;
r_skyverts = wm->vertexes + wm->numvertexes;
wm->numvertexes += 8;
r_skyedges = wm->edges + wm->numedges;
wm->numedges += 12;
r_skysurfedges = wm->surfedges + wm->numsurfedges;
wm->numsurfedges += 24;
if (wm->numsurfaces > MAX_MAP_FACES
|| wm->numvertexes > MAX_MAP_VERTS
|| wm->numedges > MAX_MAP_EDGES)
Hunk_Check();
if (wm->numsurfaces+6 > MAX_MAP_FACES
|| wm->numvertexes+8 > MAX_MAP_VERTS
|| wm->numedges+12 > MAX_MAP_EDGES)
Host_Error ("InitSkyBox: map overflow");
r_skyfaces = wm->surfaces + wm->numsurfaces;
// wm->numsurfaces += 6;
r_skyverts = wm->vertexes + wm->numvertexes;
// wm->numvertexes += 8;
r_skyedges = wm->edges + wm->numedges;
// wm->numedges += 12;
r_skysurfedges = wm->surfedges + wm->numsurfedges;
// wm->numsurfedges += 24;
Hunk_Check();
memset (r_skyfaces, 0, 6*sizeof(*r_skyfaces));
Hunk_Check();
for (i=0 ; i<6 ; i++)
{
r_skyplanes[i].normal[skybox_planes[i*2]] = 1;
@ -220,26 +227,30 @@ void R_InitSkyBox (void)
r_skyfaces[i].plane = &r_skyplanes[i];
r_skyfaces[i].numedges = 4;
r_skyfaces[i].flags = box_faces[i] | SURF_DRAWSKYBOX;
r_skyfaces[i].firstedge = wm->numsurfedges-24+i*4;
r_skyfaces[i].firstedge = wm->numsurfedges+i*4;
r_skyfaces[i].texinfo = &r_skytexinfo[i];
r_skyfaces[i].texturemins[0] = -128;
r_skyfaces[i].texturemins[1] = -128;
r_skyfaces[i].extents[0] = 256;
r_skyfaces[i].extents[1] = 256;
}
Hunk_Check();
for (i=0 ; i<24 ; i++)
if (box_surfedges[i] > 0)
r_skysurfedges[i] = wm->numedges-13 + box_surfedges[i];
r_skysurfedges[i] = wm->numedges-12 + box_surfedges[i];
else
r_skysurfedges[i] = - (wm->numedges-13 + -box_surfedges[i]);
r_skysurfedges[i] = - (wm->numedges-12 + -box_surfedges[i]);
Hunk_Check();
for(i=0 ; i<12 ; i++)
{
r_skyedges[i].v[0] = wm->numvertexes-9+box_edges[i*2+0];
r_skyedges[i].v[1] = wm->numvertexes-9+box_edges[i*2+1];
r_skyedges[i].v[0] = wm->numvertexes-8+box_edges[i*2+0];
r_skyedges[i].v[1] = wm->numvertexes-8+box_edges[i*2+1];
r_skyedges[i].cachededgeoffset = 0;
}
Hunk_Check();
}
/*

View file

@ -261,7 +261,7 @@ R_NewMap
void SWR_NewMap (void)
{
int i;
memset (&r_worldentity, 0, sizeof(r_worldentity));
AngleVectors(r_worldentity.angles, r_worldentity.axis[0], r_worldentity.axis[1], r_worldentity.axis[2]);
VectorInverse(r_worldentity.axis[1]);

View file

@ -2926,9 +2926,6 @@ void SWMod_LoadAlias3Model (model_t *mod, void *buffer)
vec3_t mins, maxs;
if (!strcmp(loadmodel->name, "progs/player.mdl") ||
!strcmp(loadmodel->name, "progs/eyes.mdl")) {
unsigned short crc;
@ -3225,7 +3222,7 @@ void SWMod_LoadAlias3Model (model_t *mod, void *buffer)
//
// move the complete, relocatable alias model to the cache
//
//
end = Hunk_LowMark ();
total = end - start;

View file

@ -109,15 +109,20 @@ void R_GammaCorrectAndSetPalette(const unsigned char *pal)
void SWAppActivate(BOOL fActive, BOOL minimize)
{
boolean newa;
Minimized = minimize;
Key_ClearStates();
// we don't want to act like we're active if we're minimized
if (fActive && !Minimized)
ActiveApp = true;
newa = true;
else
ActiveApp = false;
newa = false;
if (ActiveApp == newa) //don't pause and resume these too often.
return;
ActiveApp = newa;
Key_ClearStates();
// minimize/restore mouse-capture on demand
if (!ActiveApp)