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

@ -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);
}
/*
===============
@ -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

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 (
@ -817,6 +819,8 @@ void Model_NextDownload (void)
return;
}
Hunk_Check();
if (cl.playernum[0] == -1)
{ //q2 cinematic - don't load the models.
cl.worldmodel = cl.model_precache[1] = Mod_ForName ("", false);
@ -828,9 +832,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)))
{
Con_TPrintf (TL_FILE_X_MISSING, cl.model_name[i]);

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)
@ -1685,6 +1687,9 @@ TRACE(("dbg: R_ApplyRenderer: efrags\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
@ -1959,6 +2028,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;
}
@ -2062,6 +2133,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 name
Q_strncpyz(name, s->name, sizeof(name));
if (cl.teamplay)
Draw_FunString (x+48+40, y, name);
Draw_FunStringLen (x+48+40, y, name, MAX_DISPLAYEDNAME);
}
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;
@ -1130,11 +1137,6 @@ void S_UpdateCard(soundcardinfo_t *sc, vec3_t origin, vec3_t forward, vec3_t rig
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
@ -1273,12 +1278,16 @@ 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

@ -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;

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);
if (!skincolourmapped.numbuckets)
Hash_InitTable(&skincolourmapped, 256, BZ_Malloc(Hash_BytesForBuckets(256)));
//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)
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);
else
{
skins = (galiasskin_t*)((char *)inf + inf->ofsskins);
if (e->skinnum >= 0 && e->skinnum < inf->numskins)
skins += e->skinnum;
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
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;
@ -1953,6 +1957,87 @@ void R_ModifyColor ( meshbuffer_t *mb, shaderpass_t *pass )
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 ) {
bArray[0] = 255 - vArray[0];

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

@ -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;

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)