mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-21 19:32:30 +00:00
The big whitespace cleanup. ;-)
Removed trailing whitespace from code lines.
This commit is contained in:
parent
0dc2b18d74
commit
674ddcffe5
276 changed files with 3968 additions and 3968 deletions
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -57,7 +57,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define spanpackage_t_tfrac 20
|
||||
#define spanpackage_t_light 24
|
||||
#define spanpackage_t_zi 28
|
||||
#define spanpackage_t_size 32
|
||||
#define spanpackage_t_size 32
|
||||
|
||||
// edge_t structure
|
||||
// !!! if this is changed, it must be changed in r_shared.h too !!!
|
||||
|
@ -143,7 +143,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// !!! if this is changed, it must be changed in model.h too !!!
|
||||
#define mtri_facesfront 0
|
||||
#define mtri_vertindex 4
|
||||
#define mtri_size 16
|
||||
#define mtri_size 16
|
||||
|
||||
// !!! if this changes, array indexing in !!!
|
||||
// !!! d_polysa.s must be changed to match !!!
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define MAX_MAP_PLANES 8192
|
||||
#define MAX_MAP_NODES 32767 // because negative shorts are contents
|
||||
#define MAX_MAP_CLIPNODES 32767 //
|
||||
#define MAX_MAP_LEAFS 32767 //
|
||||
#define MAX_MAP_LEAFS 32767 //
|
||||
#define MAX_MAP_VERTS 65535
|
||||
#define MAX_MAP_FACES 65535
|
||||
#define MAX_MAP_MARKSURFACES 65535
|
||||
|
@ -98,7 +98,7 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
int version;
|
||||
int version;
|
||||
lump_t lumps[HEADER_LUMPS];
|
||||
} dheader_t;
|
||||
|
||||
|
@ -199,7 +199,7 @@ typedef struct
|
|||
short side;
|
||||
|
||||
int firstedge; // we must support > 64k edges
|
||||
short numedges;
|
||||
short numedges;
|
||||
short texinfo;
|
||||
|
||||
// lighting info
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
|
@ -28,15 +28,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
char *ddate = __DATE__ ;
|
||||
char *dtime = __TIME__ ;
|
||||
|
||||
char *mon[12] =
|
||||
char *mon[12] =
|
||||
{ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
|
||||
char mond[12] =
|
||||
char mond[12] =
|
||||
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
|
||||
// returns days since Oct 24 1996
|
||||
int build_number( void )
|
||||
{
|
||||
int m = 0;
|
||||
int m = 0;
|
||||
int d = 0;
|
||||
int y = 0;
|
||||
int hr, min;
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -500,7 +500,7 @@ void CDAudio_Play(byte track, qboolean looping)
|
|||
|
||||
if (!initialized || !enabled)
|
||||
return;
|
||||
|
||||
|
||||
if (!cd.valid)
|
||||
return;
|
||||
|
||||
|
@ -573,7 +573,7 @@ void CDAudio_Stop(void)
|
|||
{
|
||||
if (!initialized || !enabled)
|
||||
return;
|
||||
|
||||
|
||||
cdRequest->headerLength = 13;
|
||||
cdRequest->unit = 0;
|
||||
cdRequest->command = COMMAND_STOP_AUDIO;
|
||||
|
@ -600,13 +600,13 @@ void CDAudio_Resume(void)
|
|||
{
|
||||
if (!initialized || !enabled)
|
||||
return;
|
||||
|
||||
|
||||
if (!cd.valid)
|
||||
return;
|
||||
|
||||
if (!wasPlaying)
|
||||
return;
|
||||
|
||||
|
||||
cdRequest->headerLength = 13;
|
||||
cdRequest->unit = 0;
|
||||
cdRequest->command = COMMAND_RESUME_AUDIO;
|
||||
|
@ -825,7 +825,7 @@ int CDAudio_Init(void)
|
|||
"disabled. Use \"-nocdaudio\" if you\n"
|
||||
"wish to avoid this message in the\n"
|
||||
"future. See README.TXT for help.\n"
|
||||
);
|
||||
);
|
||||
return -1;
|
||||
}
|
||||
if (regs.x.bx > 1)
|
||||
|
@ -841,7 +841,7 @@ int CDAudio_Init(void)
|
|||
"MSCDEX version 2.00 or later\n"
|
||||
"required for music. See README.TXT\n"
|
||||
"for help.\n"
|
||||
);
|
||||
);
|
||||
Con_DPrintf("CDAudio_Init: MSCDEX version 2.00 or later required.\n");
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -85,7 +85,7 @@ static void CDAudio_Eject(void)
|
|||
if (cdfile == -1 || !enabled)
|
||||
return; // no cd init'd
|
||||
|
||||
if ( ioctl(cdfile, CDROMEJECT) == -1 )
|
||||
if ( ioctl(cdfile, CDROMEJECT) == -1 )
|
||||
Con_DPrintf("CD eject ioctl failed\n");
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ static void CDAudio_CloseDoor(void)
|
|||
if (cdfile == -1 || !enabled)
|
||||
return; // no cd init'd
|
||||
|
||||
if ( ioctl(cdfile, CDROMCLOSETRAY) == -1 )
|
||||
if ( ioctl(cdfile, CDROMCLOSETRAY) == -1 )
|
||||
Con_DPrintf("CD close ioctl failed\n");
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ static int CDAudio_GetAudioDiskInfo(void)
|
|||
|
||||
cdValid = false;
|
||||
|
||||
if ( ioctl(cdfile, CDROMREADTOCHDR, &tochdr) == -1 )
|
||||
if ( ioctl(cdfile, CDROMREADTOCHDR, &tochdr) == -1 )
|
||||
{
|
||||
Con_DPrintf("CD readtochdr ioctl failed\n");
|
||||
return -1;
|
||||
|
@ -150,7 +150,7 @@ void CDAudio_Play(byte track, qboolean looping)
|
|||
|
||||
if (cdfile == -1 || !enabled)
|
||||
return;
|
||||
|
||||
|
||||
if (!cdValid)
|
||||
{
|
||||
CDAudio_GetAudioDiskInfo();
|
||||
|
@ -222,7 +222,7 @@ void CDAudio_Play(byte track, qboolean looping)
|
|||
return;
|
||||
}
|
||||
|
||||
if ( ioctl(cdfile, CDROMRESUME) == -1 )
|
||||
if ( ioctl(cdfile, CDROMRESUME) == -1 )
|
||||
Con_DPrintf("CD resume ioctl failed\n");
|
||||
|
||||
playLooping = looping;
|
||||
|
@ -238,7 +238,7 @@ void CDAudio_Stop(void)
|
|||
{
|
||||
if (cdfile == -1 || !enabled)
|
||||
return;
|
||||
|
||||
|
||||
if (!playing)
|
||||
return;
|
||||
|
||||
|
@ -257,7 +257,7 @@ void CDAudio_Pause(void)
|
|||
if (!playing)
|
||||
return;
|
||||
|
||||
if ( ioctl(cdfile, CDROMPAUSE) == -1 )
|
||||
if ( ioctl(cdfile, CDROMPAUSE) == -1 )
|
||||
Con_DPrintf("CD pause ioctl failed\n");
|
||||
|
||||
wasPlaying = playing;
|
||||
|
@ -269,14 +269,14 @@ void CDAudio_Resume(void)
|
|||
{
|
||||
if (cdfile == -1 || !enabled)
|
||||
return;
|
||||
|
||||
|
||||
if (!cdValid)
|
||||
return;
|
||||
|
||||
if (!wasPlaying)
|
||||
return;
|
||||
|
||||
if ( ioctl(cdfile, CDROMRESUME) == -1 )
|
||||
|
||||
if ( ioctl(cdfile, CDROMRESUME) == -1 )
|
||||
Con_DPrintf("CD resume ioctl failed\n");
|
||||
playing = true;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -59,7 +59,7 @@ void CDAudio_Play(byte track, qboolean looping)
|
|||
/* XXX - Does this default value make sense? */
|
||||
CDstatus cd_stat = CD_ERROR;
|
||||
if(!cd_id || !enabled) return;
|
||||
|
||||
|
||||
if(!cdValid)
|
||||
{
|
||||
if(!CD_INDRIVE(cd_stat=SDL_CDStatus(cd_id)) ||(!cd_id->numtracks)) return;
|
||||
|
@ -158,11 +158,11 @@ int CDAudio_Init()
|
|||
SDL_GetError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
initialized = true;
|
||||
enabled = true;
|
||||
cdValid = true;
|
||||
|
||||
|
||||
if(!CD_INDRIVE(SDL_CDStatus(cd_id)))
|
||||
{
|
||||
Con_Printf("CDAudio_Init: No CD in drive.\n");
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -248,7 +248,7 @@ void CDAudio_Play(byte track, qboolean looping)
|
|||
|
||||
if (!enabled)
|
||||
return;
|
||||
|
||||
|
||||
if (!cdValid)
|
||||
{
|
||||
CDAudio_GetAudioDiskInfo();
|
||||
|
@ -369,13 +369,13 @@ void CDAudio_Resume(void)
|
|||
|
||||
if (!enabled)
|
||||
return;
|
||||
|
||||
|
||||
if (!cdValid)
|
||||
return;
|
||||
|
||||
if (!wasPlaying)
|
||||
return;
|
||||
|
||||
|
||||
mciPlayParms.dwFrom = MCI_MAKE_TMSF(playTrack, 0, 0, 0);
|
||||
mciPlayParms.dwTo = MCI_MAKE_TMSF(playTrack + 1, 0, 0, 0);
|
||||
mciPlayParms.dwCallback = (DWORD)mainwindow;
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
|
@ -128,7 +128,7 @@ static void vectoangles(vec3_t vec, vec3_t ang)
|
|||
{
|
||||
float forward;
|
||||
float yaw, pitch;
|
||||
|
||||
|
||||
if (vec[1] == 0 && vec[0] == 0)
|
||||
{
|
||||
yaw = 0;
|
||||
|
@ -173,7 +173,7 @@ qboolean Cam_DrawViewModel(void)
|
|||
// returns true if we should draw this player, we don't if we are chase camming
|
||||
qboolean Cam_DrawPlayer(int playernum)
|
||||
{
|
||||
if (cl.spectator && autocam && locked && cl_chasecam->value &&
|
||||
if (cl.spectator && autocam && locked && cl_chasecam->value &&
|
||||
spec_track == playernum)
|
||||
return false;
|
||||
return true;
|
||||
|
@ -216,7 +216,7 @@ pmtrace_t Cam_DoTrace(vec3_t vec1, vec3_t vec2)
|
|||
VectorCopy (vec1, pmove.origin);
|
||||
return PM_PlayerMove(pmove.origin, vec2);
|
||||
}
|
||||
|
||||
|
||||
// Returns distance or 9999 if invalid for some reason
|
||||
static float Cam_TryFlyby(player_state_t *self, player_state_t *player, vec3_t vec, qboolean checkvis)
|
||||
{
|
||||
|
@ -268,7 +268,7 @@ static qboolean Cam_IsVisible(player_state_t *player, vec3_t vec)
|
|||
return true;
|
||||
}
|
||||
|
||||
static qboolean InitFlyby(player_state_t *self, player_state_t *player, int checkvis)
|
||||
static qboolean InitFlyby(player_state_t *self, player_state_t *player, int checkvis)
|
||||
{
|
||||
float f, max;
|
||||
vec3_t vec, vec2;
|
||||
|
@ -354,7 +354,7 @@ static qboolean InitFlyby(player_state_t *self, player_state_t *player, int chec
|
|||
return false;
|
||||
}
|
||||
locked = true;
|
||||
VectorCopy(vec, desired_position);
|
||||
VectorCopy(vec, desired_position);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -377,7 +377,7 @@ static void Cam_CheckHighTarget(void)
|
|||
} else
|
||||
Cam_Unlock();
|
||||
}
|
||||
|
||||
|
||||
// ZOID
|
||||
//
|
||||
// Take over the user controls and track a player.
|
||||
|
@ -391,7 +391,7 @@ void Cam_Track(usercmd_t *cmd)
|
|||
|
||||
if (!cl.spectator)
|
||||
return;
|
||||
|
||||
|
||||
if (cl_hightrack->value && !locked)
|
||||
Cam_CheckHighTarget();
|
||||
|
||||
|
@ -419,7 +419,7 @@ void Cam_Track(usercmd_t *cmd)
|
|||
}
|
||||
} else
|
||||
cam_lastviewtime = realtime;
|
||||
|
||||
|
||||
// couldn't track for some reason
|
||||
if (!locked || !autocam)
|
||||
return;
|
||||
|
@ -454,7 +454,7 @@ void Cam_Track(usercmd_t *cmd)
|
|||
|
||||
// move there locally immediately
|
||||
VectorCopy(desired_position, self->origin);
|
||||
|
||||
|
||||
VectorSubtract(player->origin, desired_position, vec);
|
||||
vectoangles(vec, cl.viewangles);
|
||||
cl.viewangles[0] = -cl.viewangles[0];
|
||||
|
@ -507,7 +507,7 @@ void Cam_SetView(void)
|
|||
frame_t *frame;
|
||||
vec3_t vec, vec2;
|
||||
|
||||
if (cls.state != ca_active || !cl.spectator ||
|
||||
if (cls.state != ca_active || !cl.spectator ||
|
||||
!autocam || !locked)
|
||||
return;
|
||||
|
||||
|
@ -635,7 +635,7 @@ void Cam_Reset(void)
|
|||
|
||||
void CL_InitCam(void)
|
||||
{
|
||||
cl_hightrack = Cvar_Get ("cl_hightrack","0",0,"None");
|
||||
cl_hightrack = Cvar_Get ("cl_hightrack","0",0,"None");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -148,7 +148,7 @@ void CL_DecayLights (void)
|
|||
{
|
||||
if (dl->die < cl.time || !dl->radius)
|
||||
continue;
|
||||
|
||||
|
||||
dl->radius -= host_frametime*dl->decay;
|
||||
if (dl->radius < 0)
|
||||
dl->radius = 0;
|
||||
|
@ -194,10 +194,10 @@ void CL_ParseDelta (entity_state_t *from, entity_state_t *to, int bits)
|
|||
bitcounts[i]++;
|
||||
|
||||
to->flags = bits;
|
||||
|
||||
|
||||
if (bits & U_MODEL)
|
||||
to->modelindex = MSG_ReadByte ();
|
||||
|
||||
|
||||
if (bits & U_FRAME)
|
||||
to->frame = MSG_ReadByte ();
|
||||
|
||||
|
@ -212,19 +212,19 @@ void CL_ParseDelta (entity_state_t *from, entity_state_t *to, int bits)
|
|||
|
||||
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();
|
||||
#ifdef QUAKEWORLD
|
||||
|
@ -474,9 +474,9 @@ void CL_LinkPacketEntities (void)
|
|||
|
||||
ent->keynum = s1->number;
|
||||
ent->model = model = cl.model_precache[s1->modelindex];
|
||||
|
||||
|
||||
// set colormap
|
||||
if (s1->colormap && (s1->colormap < MAX_CLIENTS)
|
||||
if (s1->colormap && (s1->colormap < MAX_CLIENTS)
|
||||
&& !strcmp(ent->model->name,"progs/player.mdl") )
|
||||
{
|
||||
ent->colormap = cl.players[s1->colormap-1].translations;
|
||||
|
@ -490,7 +490,7 @@ void CL_LinkPacketEntities (void)
|
|||
|
||||
// set skin
|
||||
ent->skinnum = s1->skinnum;
|
||||
|
||||
|
||||
// set frame
|
||||
ent->frame = s1->frame;
|
||||
|
||||
|
@ -519,7 +519,7 @@ void CL_LinkPacketEntities (void)
|
|||
|
||||
// calculate origin
|
||||
for (i=0 ; i<3 ; i++)
|
||||
ent->origin[i] = s2->origin[i] +
|
||||
ent->origin[i] = s2->origin[i] +
|
||||
f * (s1->origin[i] - s2->origin[i]);
|
||||
|
||||
// add automatic particle trails
|
||||
|
@ -765,14 +765,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;
|
||||
|
@ -781,7 +781,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
|
||||
}
|
||||
|
@ -826,7 +826,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)
|
||||
|
@ -942,7 +942,7 @@ void CL_SetSolidEntities (void)
|
|||
continue;
|
||||
if (!cl.model_precache[state->modelindex])
|
||||
continue;
|
||||
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];
|
||||
|
@ -979,7 +979,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++) {
|
||||
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -81,7 +81,7 @@ void KeyDown (kbutton_t *b)
|
|||
|
||||
if (k == b->down[0] || k == b->down[1])
|
||||
return; // repeating key
|
||||
|
||||
|
||||
if (!b->down[0])
|
||||
b->down[0] = k;
|
||||
else if (!b->down[1])
|
||||
|
@ -91,7 +91,7 @@ void KeyDown (kbutton_t *b)
|
|||
Con_Printf ("Three keys down for a button!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (b->state & 1)
|
||||
return; // still down
|
||||
b->state |= 1 + 2; // down + impulse down
|
||||
|
@ -101,7 +101,7 @@ void KeyUp (kbutton_t *b)
|
|||
{
|
||||
int k;
|
||||
char *c;
|
||||
|
||||
|
||||
c = Cmd_Argv(1);
|
||||
if (c[0])
|
||||
k = atoi(c);
|
||||
|
@ -185,12 +185,12 @@ float CL_KeyState (kbutton_t *key)
|
|||
{
|
||||
float val;
|
||||
qboolean impulsedown, impulseup, down;
|
||||
|
||||
|
||||
impulsedown = key->state & 2;
|
||||
impulseup = key->state & 4;
|
||||
down = key->state & 1;
|
||||
val = 0;
|
||||
|
||||
|
||||
if (impulsedown && !impulseup) {
|
||||
if (down) {
|
||||
val = 0.5; // pressed and held this frame
|
||||
|
@ -221,7 +221,7 @@ float CL_KeyState (kbutton_t *key)
|
|||
}
|
||||
|
||||
key->state &= 1; // clear impulses
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ void CL_AdjustAngles (void)
|
|||
{
|
||||
float speed;
|
||||
float up, down;
|
||||
|
||||
|
||||
if (in_speed.state & 1)
|
||||
speed = host_frametime * cl_anglespeedkey->value;
|
||||
else
|
||||
|
@ -270,16 +270,16 @@ void CL_AdjustAngles (void)
|
|||
cl.viewangles[PITCH] -= speed*cl_pitchspeed->value * CL_KeyState (&in_forward);
|
||||
cl.viewangles[PITCH] += speed*cl_pitchspeed->value * CL_KeyState (&in_back);
|
||||
}
|
||||
|
||||
|
||||
up = CL_KeyState (&in_lookup);
|
||||
down = CL_KeyState(&in_lookdown);
|
||||
|
||||
|
||||
cl.viewangles[PITCH] -= speed*cl_pitchspeed->value * up;
|
||||
cl.viewangles[PITCH] += speed*cl_pitchspeed->value * down;
|
||||
|
||||
if (up || down)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
|
||||
cl.viewangles[PITCH] = bound( -70, cl.viewangles[PITCH], 80);
|
||||
cl.viewangles[ROLL] = bound( -50, cl.viewangles[ROLL], 50);
|
||||
}
|
||||
|
@ -298,9 +298,9 @@ void CL_BaseMove (usercmd_t *cmd)
|
|||
return;
|
||||
#endif
|
||||
CL_AdjustAngles ();
|
||||
|
||||
|
||||
memset (cmd, 0, sizeof(*cmd));
|
||||
#ifdef QUAKEWORLD
|
||||
#ifdef QUAKEWORLD
|
||||
VectorCopy (cl.viewangles, cmd->angles);
|
||||
#endif
|
||||
if (in_strafe.state & 1)
|
||||
|
@ -316,10 +316,10 @@ void CL_BaseMove (usercmd_t *cmd)
|
|||
cmd->upmove -= cl_upspeed->value * CL_KeyState (&in_down);
|
||||
|
||||
if (! (in_klook.state & 1) )
|
||||
{
|
||||
{
|
||||
cmd->forwardmove += cl_forwardspeed->value * CL_KeyState (&in_forward);
|
||||
cmd->forwardmove -= cl_backspeed->value * CL_KeyState (&in_back);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// adjust for speed key
|
||||
|
@ -366,11 +366,11 @@ void CL_FinishMove (usercmd_t *cmd)
|
|||
return;
|
||||
//
|
||||
// figure button bits
|
||||
//
|
||||
//
|
||||
if ( in_attack.state & 3 )
|
||||
cmd->buttons |= 1;
|
||||
in_attack.state &= ~2;
|
||||
|
||||
|
||||
if (in_jump.state & 3)
|
||||
cmd->buttons |= 2;
|
||||
in_jump.state &= ~2;
|
||||
|
@ -494,7 +494,7 @@ void CL_SendCmd (void)
|
|||
//
|
||||
// deliver the message
|
||||
//
|
||||
Netchan_Transmit (&cls.netchan, buf.cursize, buf.data);
|
||||
Netchan_Transmit (&cls.netchan, buf.cursize, buf.data);
|
||||
}
|
||||
#else
|
||||
/*
|
||||
|
@ -513,14 +513,14 @@ void CL_SendCmd (void)
|
|||
{
|
||||
// get basic movement from keyboard
|
||||
CL_BaseMove (&cmd);
|
||||
|
||||
|
||||
// allow mice or other external controllers to add to the move
|
||||
//(*IN_Move) (&cmd);
|
||||
IN_Move(&cmd);
|
||||
|
||||
|
||||
// send the unreliable message
|
||||
CL_SendMove (&cmd);
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (cls.demoplayback)
|
||||
|
@ -528,11 +528,11 @@ void CL_SendCmd (void)
|
|||
SZ_Clear (&cls.netchan.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// send the reliable message
|
||||
if (!cls.netchan.message.cursize)
|
||||
return; // no message at all
|
||||
|
||||
|
||||
if (!NET_CanSendMessage (cls.netcon))
|
||||
{
|
||||
Con_DPrintf ("CL_WriteToServer: can't send\n");
|
||||
|
@ -556,11 +556,11 @@ void CL_SendMove (usercmd_t *cmd)
|
|||
int bits;
|
||||
sizebuf_t buf;
|
||||
byte data[128];
|
||||
|
||||
|
||||
buf.maxsize = 128;
|
||||
buf.cursize = 0;
|
||||
buf.data = data;
|
||||
|
||||
|
||||
cl.cmd = *cmd;
|
||||
|
||||
//
|
||||
|
@ -572,7 +572,7 @@ void CL_SendMove (usercmd_t *cmd)
|
|||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
MSG_WriteAngle (&buf, cl.viewangles[i]);
|
||||
|
||||
|
||||
MSG_WriteShort (&buf, cmd->forwardmove);
|
||||
MSG_WriteShort (&buf, cmd->sidemove);
|
||||
MSG_WriteShort (&buf, cmd->upmove);
|
||||
|
@ -581,15 +581,15 @@ void CL_SendMove (usercmd_t *cmd)
|
|||
// send button bits
|
||||
//
|
||||
bits = 0;
|
||||
|
||||
|
||||
if ( in_attack.state & 3 )
|
||||
bits |= 1;
|
||||
in_attack.state &= ~2;
|
||||
|
||||
|
||||
if (in_jump.state & 3)
|
||||
bits |= 2;
|
||||
in_jump.state &= ~2;
|
||||
|
||||
|
||||
MSG_WriteByte (&buf, bits);
|
||||
|
||||
MSG_WriteByte (&buf, in_impulse);
|
||||
|
@ -614,7 +614,7 @@ void CL_SendMove (usercmd_t *cmd)
|
|||
//
|
||||
if (++cl.movemessages <= 2)
|
||||
return;
|
||||
|
||||
|
||||
if (NET_SendUnreliableMessage (cls.netcon, &buf) == -1)
|
||||
{
|
||||
Con_Printf ("CL_SendMove: lost server connection\n");
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -295,7 +295,7 @@ void CL_ClearState (void)
|
|||
|
||||
SZ_Clear (&cls.netchan.message);
|
||||
|
||||
// clear other arrays
|
||||
// clear other arrays
|
||||
memset (cl_efrags, 0, sizeof(cl_efrags));
|
||||
#ifdef UQUAKE
|
||||
memset (cl_entities, 0, sizeof(cl_entities));
|
||||
|
@ -337,14 +337,14 @@ void CL_Color_f (void)
|
|||
top = atoi(Cmd_Argv(1));
|
||||
bottom = atoi(Cmd_Argv(2));
|
||||
}
|
||||
|
||||
|
||||
top &= 15;
|
||||
if (top > 13)
|
||||
top = 13;
|
||||
bottom &= 15;
|
||||
if (bottom > 13)
|
||||
bottom = 13;
|
||||
|
||||
|
||||
snprintf(num, sizeof(num), "%i", top);
|
||||
Cvar_Set ("topcolor", num);
|
||||
snprintf(num, sizeof(num), "%i", bottom);
|
||||
|
@ -367,9 +367,9 @@ void CL_Connect_f (void)
|
|||
|
||||
if (Cmd_Argc() != 2) {
|
||||
Con_Printf ("usage: connect <server>\n");
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
server = Cmd_Argv (1);
|
||||
|
||||
CL_Disconnect ();
|
||||
|
@ -408,7 +408,7 @@ void CL_ConnectionlessPacket (void)
|
|||
}
|
||||
Netchan_Setup (&cls.netchan, net_from, cls.qport);
|
||||
MSG_WriteChar (&cls.netchan.message, clc_stringcmd);
|
||||
MSG_WriteString (&cls.netchan.message, "new");
|
||||
MSG_WriteString (&cls.netchan.message, "new");
|
||||
cls.state = ca_connected;
|
||||
Con_Printf ("Connected.\n");
|
||||
allowremotecmd = false; // localid required now for remote cmds
|
||||
|
@ -489,7 +489,7 @@ void CL_ConnectionlessPacket (void)
|
|||
data[3] = 0xff;
|
||||
data[4] = A2A_ACK;
|
||||
data[5] = 0;
|
||||
|
||||
|
||||
NET_SendPacket (6, data, net_from);
|
||||
return;
|
||||
}
|
||||
|
@ -539,7 +539,7 @@ void CL_Disconnect (void)
|
|||
|
||||
// stop sounds (especially looping!)
|
||||
S_StopAllSounds (true);
|
||||
|
||||
|
||||
// bring the console down and fade the colors back to normal
|
||||
// SCR_BringDownConsole ();
|
||||
|
||||
|
@ -668,7 +668,7 @@ void CL_EstablishConnection (char *host)
|
|||
Host_Error ("CL_Connect: connect failed\n");
|
||||
#endif
|
||||
Con_DPrintf ("CL_EstablishConnection: connected to %s\n", host);
|
||||
|
||||
|
||||
cls.demonum = -1; // not in the demo loop now
|
||||
cls.state = ca_connected;
|
||||
#ifdef UQUAKE
|
||||
|
@ -777,7 +777,7 @@ float CL_LerpPoint (void)
|
|||
float f, frac;
|
||||
|
||||
f = cl.mtime[0] - cl.mtime[1];
|
||||
|
||||
|
||||
if (!f || cl_nolerp->value || cls.timedemo || sv.active)
|
||||
{
|
||||
cl.time = cl.mtime[0];
|
||||
|
@ -812,7 +812,7 @@ SetPal(2);
|
|||
}
|
||||
else
|
||||
SetPal(0);
|
||||
|
||||
|
||||
return frac;
|
||||
}
|
||||
#endif
|
||||
|
@ -911,7 +911,7 @@ void CL_PrintEntities_f (void)
|
|||
{
|
||||
entity_t *ent;
|
||||
int i;
|
||||
|
||||
|
||||
for (i=0,ent=cl_entities ; i<cl.num_entities ; i++,ent++)
|
||||
{
|
||||
Con_Printf ("%3i:",i);
|
||||
|
@ -997,7 +997,7 @@ void CL_Rcon_f (void)
|
|||
}
|
||||
NET_StringToAdr (rcon_address->string, &to);
|
||||
}
|
||||
|
||||
|
||||
NET_SendPacket (strlen(message)+1, message
|
||||
, to);
|
||||
}
|
||||
|
@ -1017,7 +1017,7 @@ int CL_ReadFromServer (void)
|
|||
|
||||
cl.oldtime = cl.time;
|
||||
cl.time += host_frametime;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
ret = CL_GetMessage ();
|
||||
|
@ -1025,11 +1025,11 @@ int CL_ReadFromServer (void)
|
|||
Host_Error ("CL_ReadFromServer: lost server connection");
|
||||
if (!ret)
|
||||
break;
|
||||
|
||||
|
||||
cl.last_received_message = realtime;
|
||||
CL_ParseServerMessage ();
|
||||
} while (ret && cls.state >= ca_connected);
|
||||
|
||||
|
||||
if (cl_shownet->value)
|
||||
Con_Printf ("\n");
|
||||
|
||||
|
@ -1072,7 +1072,7 @@ void CL_ReadPackets (void)
|
|||
//
|
||||
// packet from server
|
||||
//
|
||||
if (!cls.demoplayback &&
|
||||
if (!cls.demoplayback &&
|
||||
!NET_CompareAdr (net_from, cls.netchan.remote_address))
|
||||
{
|
||||
Con_DPrintf ("%s:sequenced packet without connection\n"
|
||||
|
@ -1097,7 +1097,7 @@ void CL_ReadPackets (void)
|
|||
CL_Disconnect ();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1153,7 +1153,7 @@ void CL_RelinkEntities (void)
|
|||
vec3_t oldorg;
|
||||
dlight_t *dl;
|
||||
|
||||
// determine partial update time
|
||||
// determine partial update time
|
||||
frac = CL_LerpPoint ();
|
||||
|
||||
cl_numvisedicts = 0;
|
||||
|
@ -1162,12 +1162,12 @@ void CL_RelinkEntities (void)
|
|||
// interpolate player info
|
||||
//
|
||||
for (i=0 ; i<3 ; i++)
|
||||
cl.velocity[i] = cl.mvelocity[1][i] +
|
||||
cl.velocity[i] = cl.mvelocity[1][i] +
|
||||
frac * (cl.mvelocity[0][i] - cl.mvelocity[1][i]);
|
||||
|
||||
if (cls.demoplayback)
|
||||
{
|
||||
// interpolate the angles
|
||||
// interpolate the angles
|
||||
for (j=0 ; j<3 ; j++)
|
||||
{
|
||||
d = cl.mviewangles[0][j] - cl.mviewangles[1][j];
|
||||
|
@ -1178,9 +1178,9 @@ void CL_RelinkEntities (void)
|
|||
cl.viewangles[j] = cl.mviewangles[1][j] + frac*d;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bobjrotate = anglemod(100*cl.time);
|
||||
|
||||
|
||||
// start on the entity after the world
|
||||
for (i=1,ent=cl_entities+1 ; i<cl.num_entities ; i++,ent++)
|
||||
{
|
||||
|
@ -1228,7 +1228,7 @@ void CL_RelinkEntities (void)
|
|||
d += 360;
|
||||
ent->angles[j] = ent->msg_angles[1][j] + f*d;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// rotate binary objects locally
|
||||
|
@ -1249,14 +1249,14 @@ void CL_RelinkEntities (void)
|
|||
VectorCopy (ent->origin, dl->origin);
|
||||
dl->origin[2] += 16;
|
||||
AngleVectors (ent->angles, fv, rv, uv);
|
||||
|
||||
|
||||
VectorMA (dl->origin, 18, fv, dl->origin);
|
||||
dl->radius = 200 + (rand()&31);
|
||||
dl->minlight = 32;
|
||||
dl->die = cl.time + 0.1;
|
||||
}
|
||||
if (ent->effects & EF_BRIGHTLIGHT)
|
||||
{
|
||||
{
|
||||
dl = CL_AllocDlight (i);
|
||||
VectorCopy (ent->origin, dl->origin);
|
||||
dl->origin[2] += 16;
|
||||
|
@ -1264,7 +1264,7 @@ void CL_RelinkEntities (void)
|
|||
dl->die = cl.time + 0.001;
|
||||
}
|
||||
if (ent->effects & EF_DIMLIGHT)
|
||||
{
|
||||
{
|
||||
dl = CL_AllocDlight (i);
|
||||
VectorCopy (ent->origin, dl->origin);
|
||||
dl->radius = 200 + (rand()&31);
|
||||
|
@ -1272,7 +1272,7 @@ void CL_RelinkEntities (void)
|
|||
}
|
||||
#ifdef QUAKE2
|
||||
if (ent->effects & EF_DARKLIGHT)
|
||||
{
|
||||
{
|
||||
dl = CL_AllocDlight (i);
|
||||
VectorCopy (ent->origin, dl->origin);
|
||||
dl->radius = 200.0 + (rand()&31);
|
||||
|
@ -1280,7 +1280,7 @@ void CL_RelinkEntities (void)
|
|||
dl->dark = true;
|
||||
}
|
||||
if (ent->effects & EF_LIGHT)
|
||||
{
|
||||
{
|
||||
dl = CL_AllocDlight (i);
|
||||
VectorCopy (ent->origin, dl->origin);
|
||||
dl->radius = 200;
|
||||
|
@ -1432,25 +1432,25 @@ Con_DPrintf ("CL_SignonReply: %i\n", cls.signon);
|
|||
MSG_WriteString (&cls.netchan.message, "prespawn");
|
||||
cls.state = ca_onserver;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
||||
case 2:
|
||||
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
|
||||
MSG_WriteString (&cls.netchan.message, va("name \"%s\"\n", cl_name->string));
|
||||
|
||||
|
||||
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
|
||||
MSG_WriteString (&cls.netchan.message, va("color %i %i\n", ((int)cl_color->value)>>4, ((int)cl_color->value)&15));
|
||||
|
||||
|
||||
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
|
||||
snprintf(str, sizeof(str), "spawn %s", cls.spawnparms);
|
||||
MSG_WriteString (&cls.netchan.message, str);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
|
||||
case 3:
|
||||
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
|
||||
MSG_WriteString (&cls.netchan.message, "begin");
|
||||
Cache_Report (); // print remaining memory
|
||||
break;
|
||||
|
||||
|
||||
case 4:
|
||||
SCR_EndLoadingPlaque (); // allow normal screen updates
|
||||
cls.state = ca_active;
|
||||
|
@ -1563,7 +1563,7 @@ void SetPal (int i)
|
|||
static int old;
|
||||
byte pal[768];
|
||||
int c;
|
||||
|
||||
|
||||
if (i == old)
|
||||
return;
|
||||
old = i;
|
||||
|
@ -1628,7 +1628,7 @@ void CL_Init (void)
|
|||
// register our commands
|
||||
//
|
||||
Cmd_AddCommand ("changing", CL_Changing_f);
|
||||
#ifdef UQUAKE
|
||||
#ifdef UQUAKE
|
||||
Cmd_AddCommand ("entities", CL_PrintEntities_f);
|
||||
#endif
|
||||
Cmd_AddCommand ("disconnect", CL_Disconnect_f);
|
||||
|
@ -1760,7 +1760,7 @@ void CL_InitCvars()
|
|||
"None");
|
||||
topcolor = Cvar_Get ("topcolor","0",
|
||||
CVAR_ARCHIVE|CVAR_USERINFO|CVAR_SERVERINFO,
|
||||
"None");
|
||||
"None");
|
||||
bottomcolor = Cvar_Get ("bottomcolor","0",
|
||||
CVAR_ARCHIVE|CVAR_USERINFO|CVAR_SERVERINFO,
|
||||
"None");
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -106,7 +106,7 @@ explosion_t
|
|||
int i;
|
||||
float time;
|
||||
int index;
|
||||
|
||||
|
||||
for (i=0 ; i<MAX_EXPLOSIONS ; i++)
|
||||
if (!cl_explosions[i].model)
|
||||
return &cl_explosions[i];
|
||||
|
@ -133,13 +133,13 @@ CL_ParseBeam (model_t *m)
|
|||
vec3_t start, end;
|
||||
beam_t *b;
|
||||
int i;
|
||||
|
||||
|
||||
ent = MSG_ReadShort ();
|
||||
|
||||
|
||||
start[0] = MSG_ReadCoord ();
|
||||
start[1] = MSG_ReadCoord ();
|
||||
start[2] = MSG_ReadCoord ();
|
||||
|
||||
|
||||
end[0] = MSG_ReadCoord ();
|
||||
end[1] = MSG_ReadCoord ();
|
||||
end[2] = MSG_ReadCoord ();
|
||||
|
@ -201,7 +201,7 @@ CL_ParseTEnt (void)
|
|||
R_RunParticleEffect (pos, vec3_origin, 20, 30);
|
||||
S_StartSound (-1, 0, cl_sfx_wizhit, pos, 1, 1);
|
||||
break;
|
||||
|
||||
|
||||
case TE_KNIGHTSPIKE: // spike hitting wall
|
||||
pos[0] = MSG_ReadCoord ();
|
||||
pos[1] = MSG_ReadCoord ();
|
||||
|
@ -209,7 +209,7 @@ CL_ParseTEnt (void)
|
|||
R_RunParticleEffect (pos, vec3_origin, 226, 20);
|
||||
S_StartSound (-1, 0, cl_sfx_knighthit, pos, 1, 1);
|
||||
break;
|
||||
|
||||
|
||||
case TE_SPIKE: // spike hitting wall
|
||||
pos[0] = MSG_ReadCoord ();
|
||||
pos[1] = MSG_ReadCoord ();
|
||||
|
@ -250,7 +250,7 @@ CL_ParseTEnt (void)
|
|||
S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case TE_EXPLOSION: // rocket explosion
|
||||
// particles
|
||||
pos[0] = MSG_ReadCoord ();
|
||||
|
@ -278,8 +278,8 @@ CL_ParseTEnt (void)
|
|||
ex->start = cl.time;
|
||||
ex->model = Mod_ForName ("progs/s_explod.spr", true);
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
case TE_TAREXPLOSION: // tarbaby explosion
|
||||
pos[0] = MSG_ReadCoord ();
|
||||
pos[1] = MSG_ReadCoord ();
|
||||
|
@ -292,29 +292,29 @@ CL_ParseTEnt (void)
|
|||
case TE_LIGHTNING1: // lightning bolts
|
||||
CL_ParseBeam (Mod_ForName("progs/bolt.mdl", true));
|
||||
break;
|
||||
|
||||
|
||||
case TE_LIGHTNING2: // lightning bolts
|
||||
CL_ParseBeam (Mod_ForName("progs/bolt2.mdl", true));
|
||||
break;
|
||||
|
||||
|
||||
case TE_LIGHTNING3: // lightning bolts
|
||||
CL_ParseBeam (Mod_ForName("progs/bolt3.mdl", true));
|
||||
break;
|
||||
|
||||
case TE_LAVASPLASH:
|
||||
|
||||
case TE_LAVASPLASH:
|
||||
pos[0] = MSG_ReadCoord ();
|
||||
pos[1] = MSG_ReadCoord ();
|
||||
pos[2] = MSG_ReadCoord ();
|
||||
R_LavaSplash (pos);
|
||||
break;
|
||||
|
||||
|
||||
case TE_TELEPORT:
|
||||
pos[0] = MSG_ReadCoord ();
|
||||
pos[1] = MSG_ReadCoord ();
|
||||
pos[2] = MSG_ReadCoord ();
|
||||
R_TeleportSplash (pos);
|
||||
break;
|
||||
|
||||
|
||||
#ifdef QUAKEWORLD
|
||||
case TE_GUNSHOT: // bullet hitting wall
|
||||
cnt = MSG_ReadByte ();
|
||||
|
@ -323,7 +323,7 @@ CL_ParseTEnt (void)
|
|||
pos[2] = MSG_ReadCoord ();
|
||||
R_RunParticleEffect (pos, vec3_origin, 0, 20 * cnt);
|
||||
break;
|
||||
|
||||
|
||||
case TE_BLOOD: // bullets hitting body
|
||||
cnt = MSG_ReadByte ();
|
||||
pos[0] = MSG_ReadCoord ();
|
||||
|
@ -347,8 +347,8 @@ CL_ParseTEnt (void)
|
|||
pos[2] = MSG_ReadCoord ();
|
||||
R_RunParticleEffect (pos, vec3_origin, 0, 20);
|
||||
break;
|
||||
|
||||
// PGM 01/21/97
|
||||
|
||||
// PGM 01/21/97
|
||||
case TE_BEAM: // grappling hook beam
|
||||
CL_ParseBeam (Mod_ForName("progs/beam.mdl", true));
|
||||
break;
|
||||
|
@ -417,7 +417,7 @@ entity_t
|
|||
ent = &cl_visedicts[cl_numvisedicts];
|
||||
cl_numvisedicts++;
|
||||
ent->keynum = 0;
|
||||
|
||||
|
||||
memset (ent, 0, sizeof(*ent));
|
||||
|
||||
ent->colormap = vid.colormap;
|
||||
|
@ -468,7 +468,7 @@ CL_UpdateBeams (void)
|
|||
yaw = (int) (atan2(dist[1], dist[0]) * 180 / M_PI);
|
||||
if (yaw < 0)
|
||||
yaw += 360;
|
||||
|
||||
|
||||
forward = sqrt (dist[0]*dist[0] + dist[1]*dist[1]);
|
||||
pitch = (int) (atan2(dist[2], forward) * 180 / M_PI);
|
||||
if (pitch < 0)
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -214,7 +214,7 @@ typedef struct
|
|||
|
||||
int signon;
|
||||
struct qsocket_s *netcon;
|
||||
|
||||
|
||||
// demos - this stuff can't go into client_state_t
|
||||
int demonum;
|
||||
char demos[MAX_DEMOS][MAX_DEMONAME];
|
||||
|
@ -224,8 +224,8 @@ typedef struct
|
|||
int forcetrack;
|
||||
QFile *demofile;
|
||||
float td_lastframe;
|
||||
int td_startframe;
|
||||
float td_starttime;
|
||||
int td_startframe;
|
||||
float td_starttime;
|
||||
|
||||
} client_static_t;
|
||||
|
||||
|
@ -239,7 +239,7 @@ typedef struct
|
|||
{
|
||||
int movemessages; // since connecting to this server
|
||||
// throw out the first couple, so the
|
||||
// player doesn't accidentally do
|
||||
// player doesn't accidentally do
|
||||
// something the first frame
|
||||
|
||||
// information for local display
|
||||
|
@ -270,7 +270,7 @@ typedef struct
|
|||
int completed_time; // latched at intermission start
|
||||
float punchangle; // temporary yview for weapon kick
|
||||
int intermission; // don't change view, full screen, etc
|
||||
|
||||
|
||||
//
|
||||
// information that is static for the entire time connected to a server
|
||||
//
|
||||
|
@ -321,11 +321,11 @@ typedef struct
|
|||
// UQ specific.
|
||||
int num_entities; // held in cl_entities array
|
||||
float last_received_message; // (time) for net trouble icon
|
||||
double mtime[2]; // the timestamp of last two messages
|
||||
double mtime[2]; // the timestamp of last two messages
|
||||
double oldtime; // previous cl.time, time-oldtime is
|
||||
// used to decay light values and
|
||||
// smooth step ups
|
||||
|
||||
|
||||
qboolean onground;
|
||||
qboolean inwater;
|
||||
float viewheight;
|
||||
|
|
84
common/cmd.c
84
common/cmd.c
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -97,7 +97,7 @@ Adds command text at the end of the buffer
|
|||
void Cbuf_AddText (char *text)
|
||||
{
|
||||
int l;
|
||||
|
||||
|
||||
l = Q_strlen (text);
|
||||
|
||||
if (cmd_text.cursize + l >= cmd_text.maxsize)
|
||||
|
@ -133,7 +133,7 @@ void Cbuf_InsertText (char *text)
|
|||
}
|
||||
else
|
||||
temp = NULL; // shut up compiler
|
||||
|
||||
|
||||
// add the entire text of the file
|
||||
Cbuf_AddText (text);
|
||||
SZ_Write (&cmd_text, "\n", 1);
|
||||
|
@ -156,7 +156,7 @@ void Cbuf_Execute (void)
|
|||
char *text;
|
||||
char line[1024] = {0};
|
||||
int quotes;
|
||||
|
||||
|
||||
while (cmd_text.cursize)
|
||||
{
|
||||
// find a \n or ; line break
|
||||
|
@ -172,10 +172,10 @@ void Cbuf_Execute (void)
|
|||
if (text[i] == '\n' || text[i] == '\r')
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
memcpy (line, text, i);
|
||||
line[i] = '\0';
|
||||
|
||||
|
||||
// delete the text from the command buffer and move remaining commands down
|
||||
// this is necessary because commands (exec, alias) can insert data at the
|
||||
// beginning of the text buffer
|
||||
|
@ -191,7 +191,7 @@ void Cbuf_Execute (void)
|
|||
|
||||
// execute the command line
|
||||
Cmd_ExecuteString (line, src_command);
|
||||
|
||||
|
||||
if (cmd_wait)
|
||||
{ // skip out while text still remains in buffer, leaving it
|
||||
// for next frame
|
||||
|
@ -224,7 +224,7 @@ void Cmd_StuffCmds_f (void)
|
|||
int i, j;
|
||||
int s;
|
||||
char *text, *build, c;
|
||||
|
||||
|
||||
// build the combined string to parse from
|
||||
s = 0;
|
||||
for (i=1 ; i<com_argc ; i++)
|
||||
|
@ -235,7 +235,7 @@ void Cmd_StuffCmds_f (void)
|
|||
}
|
||||
if (!s)
|
||||
return;
|
||||
|
||||
|
||||
text = Z_Malloc (s+1);
|
||||
text[0] = 0;
|
||||
for (i=1 ; i<com_argc ; i++)
|
||||
|
@ -246,11 +246,11 @@ void Cmd_StuffCmds_f (void)
|
|||
if (i != com_argc-1)
|
||||
Q_strcat (text, " ");
|
||||
}
|
||||
|
||||
|
||||
// pull out the commands
|
||||
build = Z_Malloc (s+1);
|
||||
build[0] = 0;
|
||||
|
||||
|
||||
for (i=0 ; i<s-1 ; i++)
|
||||
{
|
||||
if (text[i] == '+')
|
||||
|
@ -262,17 +262,17 @@ void Cmd_StuffCmds_f (void)
|
|||
|
||||
c = text[j];
|
||||
text[j] = 0;
|
||||
|
||||
|
||||
Q_strcat (build, text+i);
|
||||
Q_strcat (build, "\n");
|
||||
text[j] = c;
|
||||
i = j-1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (build[0])
|
||||
Cbuf_InsertText (build);
|
||||
|
||||
|
||||
Z_Free (text);
|
||||
Z_Free (build);
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ void Cmd_Exec_f (void)
|
|||
}
|
||||
if (!Cvar_Command () && (cl_warncmd->value || developer->value))
|
||||
Con_Printf ("execing %s\n",Cmd_Argv(1));
|
||||
|
||||
|
||||
Cbuf_InsertText (f);
|
||||
Hunk_FreeToLowMark (mark);
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ Just prints the rest of the line to the console
|
|||
void Cmd_Echo_f (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i=1 ; i<Cmd_Argc() ; i++)
|
||||
Con_Printf ("%s ",Cmd_Argv(i));
|
||||
Con_Printf ("\n");
|
||||
|
@ -337,7 +337,7 @@ Creates a new command that executes a command string (possibly ; seperated)
|
|||
char *CopyString (char *in)
|
||||
{
|
||||
char *out;
|
||||
|
||||
|
||||
out = Z_Malloc (strlen(in)+1);
|
||||
strcpy (out, in);
|
||||
return out;
|
||||
|
@ -381,7 +381,7 @@ void Cmd_Alias_f (void)
|
|||
a->next = cmd_alias;
|
||||
cmd_alias = a;
|
||||
}
|
||||
strcpy (a->name, s);
|
||||
strcpy (a->name, s);
|
||||
|
||||
// copy the rest of the command line
|
||||
cmd[0] = 0; // start out with a null string
|
||||
|
@ -393,7 +393,7 @@ void Cmd_Alias_f (void)
|
|||
strcat (cmd, " ");
|
||||
}
|
||||
strcat (cmd, "\n");
|
||||
|
||||
|
||||
a->value = CopyString (cmd);
|
||||
}
|
||||
|
||||
|
@ -424,7 +424,7 @@ void Cmd_UnAlias_f (void)
|
|||
prev->next = a->next;
|
||||
if (a == cmd_alias)
|
||||
cmd_alias = a->next;
|
||||
Z_Free (a);
|
||||
Z_Free (a);
|
||||
return;
|
||||
}
|
||||
prev = a;
|
||||
|
@ -479,7 +479,7 @@ char *Cmd_Argv (int arg)
|
|||
{
|
||||
if ( arg >= cmd_argc )
|
||||
return cmd_null_string;
|
||||
return cmd_argv[arg];
|
||||
return cmd_argv[arg];
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -507,14 +507,14 @@ Parses the given string into command line tokens.
|
|||
void Cmd_TokenizeString (char *text)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
// clear the args from the last string
|
||||
for (i=0 ; i<cmd_argc ; i++)
|
||||
Z_Free (cmd_argv[i]);
|
||||
|
||||
|
||||
cmd_argc = 0;
|
||||
cmd_args = NULL;
|
||||
|
||||
|
||||
while (1)
|
||||
{
|
||||
// skip whitespace up to a /n
|
||||
|
@ -522,7 +522,7 @@ void Cmd_TokenizeString (char *text)
|
|||
{
|
||||
text++;
|
||||
}
|
||||
|
||||
|
||||
if (*text == '\n')
|
||||
{ // a newline seperates commands in the buffer
|
||||
text++;
|
||||
|
@ -531,10 +531,10 @@ void Cmd_TokenizeString (char *text)
|
|||
|
||||
if (!*text)
|
||||
return;
|
||||
|
||||
|
||||
if (cmd_argc == 1)
|
||||
cmd_args = text;
|
||||
|
||||
|
||||
text = COM_Parse (text);
|
||||
if (!text)
|
||||
return;
|
||||
|
@ -546,7 +546,7 @@ void Cmd_TokenizeString (char *text)
|
|||
cmd_argc++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -558,17 +558,17 @@ Cmd_AddCommand
|
|||
void Cmd_AddCommand (char *cmd_name, xcommand_t function)
|
||||
{
|
||||
cmd_function_t *cmd;
|
||||
|
||||
|
||||
if (host_initialized) // because hunk allocation would get stomped
|
||||
Sys_Error ("Cmd_AddCommand after host_initialized");
|
||||
|
||||
|
||||
// fail if the command is a variable name
|
||||
if (Cvar_VariableString(cmd_name)[0])
|
||||
{
|
||||
Con_Printf ("Cmd_AddCommand: %s already defined as a var\n", cmd_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// fail if the command already exists
|
||||
for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
|
||||
{
|
||||
|
@ -616,12 +616,12 @@ char *Cmd_CompleteCommand (char *partial)
|
|||
cmd_function_t *cmd;
|
||||
int len;
|
||||
cmdalias_t *a;
|
||||
|
||||
|
||||
len = Q_strlen(partial);
|
||||
|
||||
|
||||
if (!len)
|
||||
return NULL;
|
||||
|
||||
|
||||
// check for exact match
|
||||
for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
|
||||
if (!strcmp (partial,cmd->name))
|
||||
|
@ -658,7 +658,7 @@ void Cmd_ForwardToServer (void)
|
|||
Con_Printf ("Can't \"%s\", not connected\n", Cmd_Argv(0));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (cls.demoplayback)
|
||||
return; // not really connected
|
||||
|
||||
|
@ -691,7 +691,7 @@ void Cmd_ForwardToServer_f (void)
|
|||
Cbuf_InsertText ("snap\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (cls.demoplayback)
|
||||
return; // not really connected
|
||||
|
||||
|
@ -719,13 +719,13 @@ FIXME: lookupnoadd the token to speed search?
|
|||
============
|
||||
*/
|
||||
void Cmd_ExecuteString (char *text, cmd_source_t src)
|
||||
{
|
||||
{
|
||||
cmd_function_t *cmd;
|
||||
cmdalias_t *a;
|
||||
|
||||
cmd_source = src;
|
||||
Cmd_TokenizeString (text);
|
||||
|
||||
|
||||
// execute the command line
|
||||
if (!Cmd_Argc())
|
||||
return; // no tokens
|
||||
|
@ -756,10 +756,10 @@ void Cmd_ExecuteString (char *text, cmd_source_t src)
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (cl_warncmd->value || developer->value)
|
||||
Con_Printf ("Unknown command \"%s\"\n", Cmd_Argv(0));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -775,14 +775,14 @@ where the given parameter apears, or 0 if not present
|
|||
int Cmd_CheckParm (char *parm)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
if (!parm)
|
||||
Sys_Error ("Cmd_CheckParm: NULL");
|
||||
|
||||
for (i = 1; i < Cmd_Argc (); i++)
|
||||
if (! Q_strcasecmp (parm, Cmd_Argv (i)))
|
||||
return i;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
|
114
common/common.c
114
common/common.c
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -88,7 +88,7 @@ Handles byte ordering and avoids alignment errors
|
|||
void MSG_WriteChar (sizebuf_t *sb, int c)
|
||||
{
|
||||
byte *buf;
|
||||
|
||||
|
||||
#ifdef PARANOID
|
||||
if (c < -128 || c > 127)
|
||||
Sys_Error ("MSG_WriteChar: range error");
|
||||
|
@ -101,7 +101,7 @@ void MSG_WriteChar (sizebuf_t *sb, int c)
|
|||
void MSG_WriteByte (sizebuf_t *sb, int c)
|
||||
{
|
||||
byte *buf;
|
||||
|
||||
|
||||
#ifdef PARANOID
|
||||
if (c < 0 || c > 255)
|
||||
Sys_Error ("MSG_WriteByte: range error");
|
||||
|
@ -114,7 +114,7 @@ void MSG_WriteByte (sizebuf_t *sb, int c)
|
|||
void MSG_WriteShort (sizebuf_t *sb, int c)
|
||||
{
|
||||
byte *buf;
|
||||
|
||||
|
||||
#ifdef PARANOID
|
||||
if (c < ((short)0x8000) || c > (short)0x7fff)
|
||||
Sys_Error ("MSG_WriteShort: range error");
|
||||
|
@ -128,7 +128,7 @@ void MSG_WriteShort (sizebuf_t *sb, int c)
|
|||
void MSG_WriteLong (sizebuf_t *sb, int c)
|
||||
{
|
||||
byte *buf;
|
||||
|
||||
|
||||
buf = SZ_GetSpace (sb, 4);
|
||||
buf[0] = c&0xff;
|
||||
buf[1] = (c>>8)&0xff;
|
||||
|
@ -143,11 +143,11 @@ void MSG_WriteFloat (sizebuf_t *sb, float f)
|
|||
float f;
|
||||
int l;
|
||||
} dat;
|
||||
|
||||
|
||||
|
||||
|
||||
dat.f = f;
|
||||
dat.l = LittleLong (dat.l);
|
||||
|
||||
|
||||
SZ_Write (sb, &dat.l, 4);
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ void MSG_WriteDeltaUsercmd (sizebuf_t *buf, usercmd_t *from, usercmd_t *cmd)
|
|||
MSG_WriteAngle16 (buf, cmd->angles[1]);
|
||||
if (bits & CM_ANGLE3)
|
||||
MSG_WriteAngle16 (buf, cmd->angles[2]);
|
||||
|
||||
|
||||
if (bits & CM_FORWARD)
|
||||
MSG_WriteShort (buf, cmd->forwardmove);
|
||||
if (bits & CM_SIDE)
|
||||
|
@ -242,70 +242,70 @@ int MSG_GetReadCount(void)
|
|||
int MSG_ReadChar (void)
|
||||
{
|
||||
int c;
|
||||
|
||||
|
||||
if (msg_readcount+1 > net_message.cursize)
|
||||
{
|
||||
msg_badread = true;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
c = (signed char)net_message.data[msg_readcount];
|
||||
msg_readcount++;
|
||||
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
int MSG_ReadByte (void)
|
||||
{
|
||||
int c;
|
||||
|
||||
|
||||
if (msg_readcount+1 > net_message.cursize)
|
||||
{
|
||||
msg_badread = true;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
c = (unsigned char)net_message.data[msg_readcount];
|
||||
msg_readcount++;
|
||||
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
int MSG_ReadShort (void)
|
||||
{
|
||||
int c;
|
||||
|
||||
|
||||
if (msg_readcount+2 > net_message.cursize)
|
||||
{
|
||||
msg_badread = true;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
c = (short)(net_message.data[msg_readcount]
|
||||
+ (net_message.data[msg_readcount+1]<<8));
|
||||
|
||||
|
||||
msg_readcount += 2;
|
||||
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
int MSG_ReadLong (void)
|
||||
{
|
||||
int c;
|
||||
|
||||
|
||||
if (msg_readcount+4 > net_message.cursize)
|
||||
{
|
||||
msg_badread = true;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
c = net_message.data[msg_readcount]
|
||||
+ (net_message.data[msg_readcount+1]<<8)
|
||||
+ (net_message.data[msg_readcount+2]<<16)
|
||||
+ (net_message.data[msg_readcount+3]<<24);
|
||||
|
||||
|
||||
msg_readcount += 4;
|
||||
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
@ -317,23 +317,23 @@ float MSG_ReadFloat (void)
|
|||
float f;
|
||||
int l;
|
||||
} dat;
|
||||
|
||||
|
||||
dat.b[0] = net_message.data[msg_readcount];
|
||||
dat.b[1] = net_message.data[msg_readcount+1];
|
||||
dat.b[2] = net_message.data[msg_readcount+2];
|
||||
dat.b[3] = net_message.data[msg_readcount+3];
|
||||
msg_readcount += 4;
|
||||
|
||||
|
||||
dat.l = LittleLong (dat.l);
|
||||
|
||||
return dat.f;
|
||||
return dat.f;
|
||||
}
|
||||
|
||||
char *MSG_ReadString (void)
|
||||
{
|
||||
static char string[2048];
|
||||
int l,c;
|
||||
|
||||
|
||||
l = 0;
|
||||
do
|
||||
{
|
||||
|
@ -343,9 +343,9 @@ char *MSG_ReadString (void)
|
|||
string[l] = c;
|
||||
l++;
|
||||
} while (l < sizeof(string)-1);
|
||||
|
||||
|
||||
string[l] = 0;
|
||||
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
|
@ -353,7 +353,7 @@ char *MSG_ReadStringLine (void)
|
|||
{
|
||||
static char string[2048];
|
||||
int l,c;
|
||||
|
||||
|
||||
l = 0;
|
||||
do
|
||||
{
|
||||
|
@ -363,9 +363,9 @@ char *MSG_ReadStringLine (void)
|
|||
string[l] = c;
|
||||
l++;
|
||||
} while (l < sizeof(string)-1);
|
||||
|
||||
|
||||
string[l] = 0;
|
||||
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
|
@ -391,7 +391,7 @@ void MSG_ReadDeltaUsercmd (usercmd_t *from, usercmd_t *move)
|
|||
memcpy (move, from, sizeof(*move));
|
||||
|
||||
bits = MSG_ReadByte ();
|
||||
|
||||
|
||||
// read current angles
|
||||
if (bits & CM_ANGLE1)
|
||||
move->angles[0] = MSG_ReadAngle16 ();
|
||||
|
@ -399,7 +399,7 @@ void MSG_ReadDeltaUsercmd (usercmd_t *from, usercmd_t *move)
|
|||
move->angles[1] = MSG_ReadAngle16 ();
|
||||
if (bits & CM_ANGLE3)
|
||||
move->angles[2] = MSG_ReadAngle16 ();
|
||||
|
||||
|
||||
// read movement
|
||||
if (bits & CM_FORWARD)
|
||||
move->forwardmove = MSG_ReadShort ();
|
||||
|
@ -407,7 +407,7 @@ void MSG_ReadDeltaUsercmd (usercmd_t *from, usercmd_t *move)
|
|||
move->sidemove = MSG_ReadShort ();
|
||||
if (bits & CM_UP)
|
||||
move->upmove = MSG_ReadShort ();
|
||||
|
||||
|
||||
// read buttons
|
||||
if (bits & CM_BUTTONS)
|
||||
move->buttons = MSG_ReadByte ();
|
||||
|
@ -448,35 +448,35 @@ void SZ_Clear (sizebuf_t *buf)
|
|||
void *SZ_GetSpace (sizebuf_t *buf, int length)
|
||||
{
|
||||
void *data;
|
||||
|
||||
|
||||
if (buf->cursize + length > buf->maxsize)
|
||||
{
|
||||
if (!buf->allowoverflow)
|
||||
Sys_Error ("SZ_GetSpace: overflow without allowoverflow set (%d)", buf->maxsize);
|
||||
|
||||
|
||||
if (length > buf->maxsize)
|
||||
Sys_Error ("SZ_GetSpace: %i is > full buffer size", length);
|
||||
|
||||
|
||||
Sys_Printf ("SZ_GetSpace: overflow\n"); // because Con_Printf may be redirected
|
||||
SZ_Clear (buf);
|
||||
SZ_Clear (buf);
|
||||
buf->overflowed = true;
|
||||
}
|
||||
|
||||
data = buf->data + buf->cursize;
|
||||
buf->cursize += length;
|
||||
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void SZ_Write (sizebuf_t *buf, void *data, int length)
|
||||
{
|
||||
Q_memcpy (SZ_GetSpace(buf,length),data,length);
|
||||
Q_memcpy (SZ_GetSpace(buf,length),data,length);
|
||||
}
|
||||
|
||||
void SZ_Print (sizebuf_t *buf, char *data)
|
||||
{
|
||||
int len;
|
||||
|
||||
|
||||
len = Q_strlen(data)+1;
|
||||
|
||||
if (!buf->cursize || buf->data[buf->cursize-1])
|
||||
|
@ -494,7 +494,7 @@ COM_SkipPath
|
|||
char *COM_SkipPath (char *pathname)
|
||||
{
|
||||
char *last;
|
||||
|
||||
|
||||
last = pathname;
|
||||
while (*pathname)
|
||||
{
|
||||
|
@ -546,15 +546,15 @@ COM_FileBase
|
|||
void COM_FileBase (char *in, char *out)
|
||||
{
|
||||
char *s, *s2;
|
||||
|
||||
|
||||
s = in + strlen(in) - 1;
|
||||
|
||||
|
||||
while (s != in && *s != '.')
|
||||
s--;
|
||||
|
||||
|
||||
for (s2 = s ; *s2 && *s2 != '/' ; s2--)
|
||||
;
|
||||
|
||||
|
||||
if (s-s2 < 2)
|
||||
strcpy (out,"?model?");
|
||||
else
|
||||
|
@ -600,13 +600,13 @@ char *COM_Parse (char *data)
|
|||
{
|
||||
int c;
|
||||
int len;
|
||||
|
||||
|
||||
len = 0;
|
||||
com_token[0] = 0;
|
||||
|
||||
|
||||
if (!data)
|
||||
return NULL;
|
||||
|
||||
|
||||
// skip whitespace
|
||||
skipwhite:
|
||||
while ( (c = *data) <= ' ')
|
||||
|
@ -615,7 +615,7 @@ skipwhite:
|
|||
return NULL; // end of file;
|
||||
data++;
|
||||
}
|
||||
|
||||
|
||||
// skip // comments
|
||||
if (c=='/' && data[1] == '/')
|
||||
{
|
||||
|
@ -623,7 +623,7 @@ skipwhite:
|
|||
data++;
|
||||
goto skipwhite;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// handle quoted strings specially
|
||||
if (c == '\"')
|
||||
|
@ -689,7 +689,7 @@ skipwhite:
|
|||
if (c=='{' || c=='}'|| c==')'|| c=='(' || c=='\'')
|
||||
break;
|
||||
} while (c>32);
|
||||
|
||||
|
||||
com_token[len] = 0;
|
||||
return data;
|
||||
}
|
||||
|
@ -721,19 +721,19 @@ char *va(char *format, ...)
|
|||
{
|
||||
va_list argptr;
|
||||
static char string[1024];
|
||||
|
||||
|
||||
va_start (argptr, format);
|
||||
vsnprintf (string, sizeof(string), format, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
return string;
|
||||
return string;
|
||||
}
|
||||
|
||||
/// just for debugging
|
||||
int memsearch (byte *start, int count, int search)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i=0 ; i<count ; i++)
|
||||
if (start[i] == search)
|
||||
return i;
|
||||
|
@ -794,7 +794,7 @@ char *Info_ValueForKey (char *s, char *key)
|
|||
// work without stomping on each other
|
||||
static int valueindex;
|
||||
char *o;
|
||||
|
||||
|
||||
valueindex = (valueindex + 1) % 4;
|
||||
if (*s == '\\')
|
||||
s++;
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
|
|
@ -9,7 +9,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.
|
||||
|
||||
|
@ -63,11 +63,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define svc_updatecolors 17 // [byte] [byte]
|
||||
#define svc_particle 18 // [vec3] <variable>
|
||||
#define svc_damage 19
|
||||
|
||||
|
||||
#define svc_spawnstatic 20
|
||||
// svc_spawnbinary 21
|
||||
#define svc_spawnbaseline 22
|
||||
|
||||
|
||||
#define svc_temp_entity 23
|
||||
|
||||
#define svc_setpause 24 // [byte] on / off
|
||||
|
@ -104,7 +104,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#define svc_download 41 // [short] size [size bytes]
|
||||
#define svc_playerinfo 42 // variable
|
||||
#define svc_nails 43 // [byte] num [48 bits] xyzpy 12 12 12 4 8
|
||||
#define svc_nails 43 // [byte] num [48 bits] xyzpy 12 12 12 4 8
|
||||
#define svc_chokecount 44 // [byte] packets choked
|
||||
#define svc_modellist 45 // [strings]
|
||||
#define svc_soundlist 46 // [strings]
|
||||
|
@ -176,9 +176,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define TE_TELEPORT 11
|
||||
#define TE_EXPLOSION2 12
|
||||
|
||||
// PGM 01/21/97
|
||||
// PGM 01/21/97
|
||||
#define TE_BEAM 13
|
||||
// PGM 01/21/97
|
||||
// PGM 01/21/97
|
||||
|
||||
// QUAKEWORLD
|
||||
#define TE_BLOOD 12
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -115,7 +115,7 @@ void Host_Quit_f (void);
|
|||
void Host_ClientCommands (char *fmt, ...);
|
||||
void Host_ShutdownServer (qboolean crash);
|
||||
|
||||
extern qboolean msg_suppress_1;
|
||||
extern qboolean msg_suppress_1;
|
||||
// suppresses resolution and cache size console output
|
||||
// an fullscreen DIB focus gain/loss
|
||||
#endif // _COMMON_QUAKEDEF_H
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -61,7 +61,7 @@ qboolean con_debuglog;
|
|||
extern char key_lines[32][MAXCMDLINE];
|
||||
extern int edit_line;
|
||||
extern int key_linepos;
|
||||
|
||||
|
||||
|
||||
qboolean con_initialized;
|
||||
|
||||
|
@ -88,7 +88,7 @@ void Con_ToggleConsole_f (void)
|
|||
}
|
||||
else
|
||||
key_dest = key_console;
|
||||
|
||||
|
||||
Con_ClearNotify ();
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ void Con_ToggleChat_f (void)
|
|||
}
|
||||
else
|
||||
key_dest = key_console;
|
||||
|
||||
|
||||
Con_ClearNotify ();
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ void Con_Clear_f (void)
|
|||
Q_memset (con_chat.text, ' ', CON_TEXTSIZE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_ClearNotify
|
||||
|
@ -132,12 +132,12 @@ Con_ClearNotify
|
|||
void Con_ClearNotify (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i=0 ; i<NUM_CON_TIMES ; i++)
|
||||
con_times[i] = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_MessageMode_f
|
||||
|
@ -195,7 +195,7 @@ void Con_Resize (console_t *con)
|
|||
numlines = con_totallines;
|
||||
|
||||
numchars = oldwidth;
|
||||
|
||||
|
||||
if (con_linewidth < numchars)
|
||||
numchars = con_linewidth;
|
||||
|
||||
|
@ -219,7 +219,7 @@ void Con_Resize (console_t *con)
|
|||
con->display = con->current;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_CheckResize
|
||||
|
@ -246,7 +246,7 @@ void Con_Init (void)
|
|||
con = &con_main;
|
||||
con_linewidth = -1;
|
||||
Con_CheckResize ();
|
||||
|
||||
|
||||
Con_Printf ("Console initialized.\n");
|
||||
|
||||
//
|
||||
|
@ -323,7 +323,7 @@ void Con_Print (char *txt)
|
|||
cr = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!con->x)
|
||||
{
|
||||
Con_Linefeed ();
|
||||
|
@ -351,7 +351,7 @@ void Con_Print (char *txt)
|
|||
con->x = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -369,24 +369,24 @@ void Con_Printf (char *fmt, ...)
|
|||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
static qboolean inupdate;
|
||||
|
||||
|
||||
va_start (argptr,fmt);
|
||||
vsnprintf (msg, sizeof(msg), fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
|
||||
// also echo to debugging console
|
||||
Sys_Printf ("%s", msg); // also echo to debugging console
|
||||
|
||||
// log all messages to file
|
||||
if (con_debuglog)
|
||||
Sys_DebugLog(va("%s/qconsole.log",com_gamedir), "%s", msg);
|
||||
|
||||
|
||||
if (!con_initialized)
|
||||
return;
|
||||
|
||||
|
||||
// write it to the scrollable buffer
|
||||
Con_Print (msg);
|
||||
|
||||
|
||||
// update the screen immediately if the console is displayed
|
||||
if (cls.state != ca_active)
|
||||
{
|
||||
|
@ -412,14 +412,14 @@ void Con_DPrintf (char *fmt, ...)
|
|||
{
|
||||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
|
||||
|
||||
if (!developer->value)
|
||||
return; // don't confuse non-developers with techie stuff...
|
||||
|
||||
va_start (argptr,fmt);
|
||||
vsnprintf (msg, sizeof(msg), fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
|
||||
Con_Printf ("%s", msg);
|
||||
}
|
||||
|
||||
|
@ -462,7 +462,7 @@ void Con_DrawInput (void)
|
|||
// prestep if horizontally scrolling
|
||||
if (key_linepos >= con_linewidth)
|
||||
text += 1 + key_linepos - con_linewidth;
|
||||
|
||||
|
||||
// draw it
|
||||
y = con_vislines-22;
|
||||
|
||||
|
@ -499,7 +499,7 @@ void Con_DrawNotify (void)
|
|||
if (time > con_notifytime->value)
|
||||
continue;
|
||||
text = con->text + (i % con_totallines)*con_linewidth;
|
||||
|
||||
|
||||
clearnotify = 0;
|
||||
scr_copytop = 1;
|
||||
|
||||
|
@ -514,7 +514,7 @@ void Con_DrawNotify (void)
|
|||
{
|
||||
clearnotify = 0;
|
||||
scr_copytop = 1;
|
||||
|
||||
|
||||
if (chat_team)
|
||||
{
|
||||
Draw_String (8, v, "say_team:");
|
||||
|
@ -538,7 +538,7 @@ void Con_DrawNotify (void)
|
|||
Draw_Character ( (x+skip)<<3, v, 10+((int)(realtime*con_cursorspeed)&1));
|
||||
v += 8;
|
||||
}
|
||||
|
||||
|
||||
if (v > con_notifylines)
|
||||
con_notifylines = v;
|
||||
}
|
||||
|
@ -560,7 +560,7 @@ void Con_DrawConsole (int lines)
|
|||
int j, n;
|
||||
char dlbar[1024];
|
||||
#endif
|
||||
|
||||
|
||||
if (lines <= 0)
|
||||
return;
|
||||
|
||||
|
@ -569,7 +569,7 @@ void Con_DrawConsole (int lines)
|
|||
|
||||
// draw the text
|
||||
con_vislines = lines;
|
||||
|
||||
|
||||
// changed to line things up better
|
||||
rows = (lines-22)>>3; // rows of text to draw
|
||||
|
||||
|
@ -581,11 +581,11 @@ void Con_DrawConsole (int lines)
|
|||
// draw arrows to show the buffer is backscrolled
|
||||
for (x=0 ; x<con_linewidth ; x+=4)
|
||||
Draw_Character ( (x+1)<<3, y, '^');
|
||||
|
||||
|
||||
y -= 8;
|
||||
rows--;
|
||||
}
|
||||
|
||||
|
||||
row = con->display;
|
||||
for (i=0 ; i<rows ; i++, y-=8, row--)
|
||||
{
|
||||
|
@ -593,7 +593,7 @@ void Con_DrawConsole (int lines)
|
|||
break;
|
||||
if (con->current - row >= con_totallines)
|
||||
break; // past scrollback wrap point
|
||||
|
||||
|
||||
text = con->text + (row % con_totallines)*con_linewidth;
|
||||
|
||||
for (x=0 ; x<con_linewidth ; x++)
|
||||
|
@ -627,7 +627,7 @@ void Con_DrawConsole (int lines)
|
|||
n = 0;
|
||||
else
|
||||
n = y * cls.downloadpercent / 100;
|
||||
|
||||
|
||||
for (j = 0; j < y; j++)
|
||||
if (j == n)
|
||||
dlbar[i++] = '\x83';
|
||||
|
@ -698,11 +698,11 @@ void Con_SafePrintf (char *fmt, ...)
|
|||
va_list argptr;
|
||||
char msg[1024];
|
||||
int temp;
|
||||
|
||||
|
||||
va_start (argptr, fmt);
|
||||
vsnprintf (msg, sizeof(msg), fmt,argptr);
|
||||
va_end (argptr);
|
||||
|
||||
|
||||
temp = scr_disabled_for_loading;
|
||||
scr_disabled_for_loading = true;
|
||||
Con_Printf ("%s", msg);
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -50,7 +50,7 @@ Cvar_FindVar
|
|||
cvar_t *Cvar_FindVar (char *var_name)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
|
||||
for (var=cvar_vars ; var ; var=var->next)
|
||||
if (!Q_strcmp (var_name, var->name))
|
||||
return var;
|
||||
|
@ -66,7 +66,7 @@ Cvar_VariableValue
|
|||
float Cvar_VariableValue (char *var_name)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
|
||||
var = Cvar_FindVar (var_name);
|
||||
if (!var)
|
||||
return 0;
|
||||
|
@ -82,7 +82,7 @@ Cvar_VariableString
|
|||
char *Cvar_VariableString (char *var_name)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
|
||||
var = Cvar_FindVar (var_name);
|
||||
if (!var)
|
||||
return cvar_null_string;
|
||||
|
@ -99,12 +99,12 @@ char *Cvar_CompleteVariable (char *partial)
|
|||
{
|
||||
cvar_t *cvar;
|
||||
int len;
|
||||
|
||||
|
||||
len = Q_strlen(partial);
|
||||
|
||||
|
||||
if (!len)
|
||||
return NULL;
|
||||
|
||||
|
||||
// check exact match
|
||||
for (cvar=cvar_vars ; cvar ; cvar=cvar->next)
|
||||
if (!strcmp (partial,cvar->name))
|
||||
|
@ -132,7 +132,7 @@ Cvar_Set
|
|||
void Cvar_Set (char *var_name, char *value)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
|
||||
var = Cvar_FindVar (var_name);
|
||||
if (!var)
|
||||
{ // there is an error in C code if this happens
|
||||
|
@ -158,9 +158,9 @@ void Cvar_Set (char *var_name, char *value)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Z_Free (var->string); // free the old value string
|
||||
|
||||
|
||||
var->string = Z_Malloc (Q_strlen(value)+1);
|
||||
Q_strcpy (var->string, value);
|
||||
var->value = Q_atof (var->string);
|
||||
|
@ -170,7 +170,7 @@ void Cvar_Set (char *var_name, char *value)
|
|||
{
|
||||
cvar_t *var;
|
||||
qboolean changed;
|
||||
|
||||
|
||||
var = Cvar_FindVar (var_name);
|
||||
if (!var)
|
||||
{ // there is an error in C code if this happens
|
||||
|
@ -180,11 +180,11 @@ void Cvar_Set (char *var_name, char *value)
|
|||
|
||||
// Don't change if this is a CVAR_ROM
|
||||
if(var->flags&CVAR_ROM) return;
|
||||
|
||||
|
||||
changed = Q_strcmp(var->string, value);
|
||||
|
||||
|
||||
Z_Free (var->string); // free the old value string
|
||||
|
||||
|
||||
var->string = Z_Malloc (Q_strlen(value)+1);
|
||||
Q_strcpy (var->string, value);
|
||||
var->value = Q_atof (var->string);
|
||||
|
@ -212,7 +212,7 @@ qboolean Cvar_Command (void)
|
|||
v = Cvar_FindVar (Cmd_Argv(0));
|
||||
if (!v)
|
||||
return false;
|
||||
|
||||
|
||||
// perform a variable print or set
|
||||
if (Cmd_Argc() == 1)
|
||||
{
|
||||
|
@ -236,7 +236,7 @@ with the archive flag set to true.
|
|||
void Cvar_WriteVariables (QFile *f)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
|
||||
for (var = cvar_vars ; var ; var = var->next)
|
||||
if (var->flags&CVAR_ARCHIVE)
|
||||
Qprintf (f, "%s \"%s\"\n", var->name, var->string);
|
||||
|
@ -256,15 +256,15 @@ void Cvar_Set_f(void)
|
|||
var_name = Cmd_Argv (1);
|
||||
value = Cmd_Argv (2);
|
||||
var = Cvar_FindVar (var_name);
|
||||
if (var)
|
||||
if (var)
|
||||
{
|
||||
Cvar_Set (var->name, value);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
var = Cvar_Get (var_name, value, CVAR_USER_CREATED|CVAR_HEAP,
|
||||
"User created cvar");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Cvar_Toggle_f (void)
|
||||
|
@ -294,7 +294,7 @@ void Cvar_Help_f (void)
|
|||
|
||||
if (Cmd_Argc() != 2)
|
||||
{
|
||||
Con_Printf ("usage: help <cvar>\n");
|
||||
Con_Printf ("usage: help <cvar>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -329,7 +329,7 @@ void Cvar_Init()
|
|||
void Cvar_Shutdown (void)
|
||||
{
|
||||
cvar_t *var,*next;
|
||||
|
||||
|
||||
var = cvar_vars;
|
||||
while(var)
|
||||
{
|
||||
|
@ -340,7 +340,7 @@ void Cvar_Shutdown (void)
|
|||
free(var);
|
||||
var = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cvar_t *Cvar_Get(char *name, char *string, int cvarflags, char *description)
|
||||
|
@ -354,7 +354,7 @@ cvar_t *Cvar_Get(char *name, char *string, int cvarflags, char *description)
|
|||
return NULL;
|
||||
}
|
||||
v = Cvar_FindVar(name);
|
||||
if (!v)
|
||||
if (!v)
|
||||
{
|
||||
v = (cvar_t *) malloc(sizeof(cvar_t));
|
||||
// Cvar doesn't exist, so we create it
|
||||
|
@ -365,7 +365,7 @@ cvar_t *Cvar_Get(char *name, char *string, int cvarflags, char *description)
|
|||
Q_strcpy (v->string, string);
|
||||
v->flags = cvarflags;
|
||||
v->description = strdup(description);
|
||||
v->value = Q_atof (v->string);
|
||||
v->value = Q_atof (v->string);
|
||||
return v;
|
||||
}
|
||||
// Cvar does exist, so we update the flags and return.
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -32,7 +32,7 @@ typedef struct cvar_s
|
|||
char *name;
|
||||
char *string;
|
||||
int flags;
|
||||
char *description; // for "help" command
|
||||
char *description; // for "help" command
|
||||
// qboolean archive; // set to true to cause it to be saved to vars.rc
|
||||
// qboolean info; // added to serverinfo or userinfo when changed
|
||||
// qboolean server; // notifies players when changed (UQUAKE)
|
||||
|
@ -54,12 +54,12 @@ typedef struct cvar_s
|
|||
|
||||
#define CVAR_ROM 64 // display only, cannot be set by user at all
|
||||
#define CVAR_USER_CREATED 128 // created by a set command
|
||||
#define CVAR_HEAP 256 // allocated off the heap, safe to free
|
||||
#define CVAR_HEAP 256 // allocated off the heap, safe to free
|
||||
#define CVAR_CHEAT 512 // can not be changed if cheats are disabled
|
||||
#define CVAR_NORESTART 1024 // do not clear when a cvar_restart is issued
|
||||
#define CVAR_LATCH 2048 // will only change when C code next does
|
||||
// a Cvar_Get(), so it can't be changed
|
||||
#define CVAR_TEMP 4906 // can be set even when cheats are
|
||||
#define CVAR_TEMP 4906 // can be set even when cheats are
|
||||
// disabled, but is not archived
|
||||
|
||||
// Zoid| A good CVAR_ROM example is basepath. The code should read "cvar_t
|
||||
|
|
|
@ -9,7 +9,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.
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -89,7 +89,7 @@ void D_DrawSolidSurface (surf_t *surf, int color)
|
|||
espan_t *span;
|
||||
byte *pdest;
|
||||
int u, u2, pix;
|
||||
|
||||
|
||||
pix = (color<<24) | (color<<16) | (color<<8) | color;
|
||||
for (span=surf->spans ; span ; span=span->pnext)
|
||||
{
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -55,7 +55,7 @@ void D_FillRect (vrect_t *rect, int color)
|
|||
rwidth = vid.width - rx;
|
||||
if (ry+rheight > vid.height)
|
||||
rheight = vid.height - rx;
|
||||
|
||||
|
||||
if (rwidth < 1 || rheight < 1)
|
||||
return;
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -98,7 +98,7 @@ typedef struct {
|
|||
typedef struct
|
||||
{
|
||||
int nump;
|
||||
emitpoint_t *pverts; // there's room for an extra element at [nump],
|
||||
emitpoint_t *pverts; // there's room for an extra element at [nump],
|
||||
// if the driver wants to duplicate element [0] at
|
||||
// element [nump] to avoid dealing with wrapping
|
||||
mspriteframe_t *pspriteframe;
|
||||
|
@ -128,7 +128,7 @@ extern qboolean r_recursiveaffinetriangles; // true if a driver wants to use
|
|||
// recursive triangular subdivison
|
||||
// and vertex drawing via
|
||||
// D_PolysetDrawFinalVerts() past
|
||||
// a certain distance (normally
|
||||
// a certain distance (normally
|
||||
// only used by the software
|
||||
// driver)
|
||||
extern float r_aliasuvscale; // scale-up factor for screen u and v
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -30,7 +30,7 @@ int d_vrectx, d_vrecty, d_vrectright_particle, d_vrectbottom_particle;
|
|||
int d_y_aspect_shift, d_pix_min, d_pix_max, d_pix_shift;
|
||||
|
||||
int d_scantable[MAXHEIGHT];
|
||||
short *zspantable[MAXHEIGHT];
|
||||
short *zspantable[MAXHEIGHT];
|
||||
|
||||
/*
|
||||
================
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -67,7 +67,7 @@ void D_DrawParticle (particle_t *pparticle)
|
|||
|
||||
transformed[0] = DotProduct(local, r_pright);
|
||||
transformed[1] = DotProduct(local, r_pup);
|
||||
transformed[2] = DotProduct(local, r_ppn);
|
||||
transformed[2] = DotProduct(local, r_ppn);
|
||||
|
||||
if (transformed[2] < PARTICLE_Z_CLIP)
|
||||
return;
|
||||
|
@ -78,7 +78,7 @@ void D_DrawParticle (particle_t *pparticle)
|
|||
u = (int)(xcenter + zi * transformed[0] + 0.5);
|
||||
v = (int)(ycenter - zi * transformed[1] + 0.5);
|
||||
|
||||
if ((v > d_vrectbottom_particle) ||
|
||||
if ((v > d_vrectbottom_particle) ||
|
||||
(u > d_vrectright_particle) ||
|
||||
(v < d_vrecty) ||
|
||||
(u < d_vrectx))
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
// TODO: put in span spilling to shrink list size
|
||||
// !!! if this is changed, it must be changed in d_polysa.s too !!!
|
||||
#define DPS_MAXSPANS MAXHEIGHT+1
|
||||
#define DPS_MAXSPANS MAXHEIGHT+1
|
||||
// 1 extra for spanpackage that marks end
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
|
@ -167,7 +167,7 @@ void D_PolysetDrawFinalVerts (finalvert_t *fv, int numverts)
|
|||
if (z >= *zbuf)
|
||||
{
|
||||
int pix;
|
||||
|
||||
|
||||
*zbuf = z;
|
||||
pix = skintable[fv->v[3]>>16][fv->v[2]>>16];
|
||||
pix = ((byte *)acolormap)[pix + (fv->v[4] & 0xFF00) ];
|
||||
|
@ -202,7 +202,7 @@ void D_DrawSubdiv (void)
|
|||
|
||||
if (((index0->v[1]-index1->v[1]) *
|
||||
(index0->v[0]-index2->v[0]) -
|
||||
(index0->v[0]-index1->v[0]) *
|
||||
(index0->v[0]-index1->v[0]) *
|
||||
(index0->v[1]-index2->v[1])) >= 0)
|
||||
{
|
||||
continue;
|
||||
|
@ -377,7 +377,7 @@ split:
|
|||
if (z >= *zbuf)
|
||||
{
|
||||
int pix;
|
||||
|
||||
|
||||
*zbuf = z;
|
||||
pix = d_pcolormap[skintable[new[3]>>16][new[2]>>16]];
|
||||
d_viewbuffer[d_scantable[new[1]] + new[0]] = pix;
|
||||
|
@ -401,7 +401,7 @@ void D_PolysetUpdateTables (void)
|
|||
{
|
||||
int i;
|
||||
byte *s;
|
||||
|
||||
|
||||
if (r_affinetridesc.skinwidth != skinwidth ||
|
||||
r_affinetridesc.pskin != skinstart)
|
||||
{
|
||||
|
@ -998,7 +998,7 @@ void D_PolysetRecursiveDrawLine (int *lp1, int *lp2)
|
|||
int d;
|
||||
int new[6];
|
||||
int ofs;
|
||||
|
||||
|
||||
d = lp2[0] - lp1[0];
|
||||
if (d < -1 || d > 1)
|
||||
goto split;
|
||||
|
@ -1022,7 +1022,7 @@ split:
|
|||
if (new[5] > d_pzbuffer[ofs])
|
||||
{
|
||||
int pix;
|
||||
|
||||
|
||||
d_pzbuffer[ofs] = new[5];
|
||||
pix = skintable[new[3]>>16][new[2]>>16];
|
||||
// pix = ((byte *)acolormap)[pix + (new[4] & 0xFF00)];
|
||||
|
@ -1038,7 +1038,7 @@ void D_PolysetRecursiveTriangle2 (int *lp1, int *lp2, int *lp3)
|
|||
{
|
||||
int d;
|
||||
int new[4];
|
||||
|
||||
|
||||
d = lp2[0] - lp1[0];
|
||||
if (d < -1 || d > 1)
|
||||
goto split;
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -125,7 +125,7 @@ void Turbulent8 (espan_t *pspan)
|
|||
fixed16_t snext, tnext;
|
||||
float sdivz, tdivz, zi, z, du, dv, spancountminus1;
|
||||
float sdivz16stepu, tdivz16stepu, zi16stepu;
|
||||
|
||||
|
||||
r_turb_turb = sintable + ((int)(cl.time*SPEED)&(CYCLE-1));
|
||||
|
||||
r_turb_sstep = 0; // keep compiler happy
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -334,7 +334,7 @@ void D_SpriteScanRightEdge (void)
|
|||
|
||||
} while (i != maxindex);
|
||||
|
||||
pspan->count = DS_SPAN_LIST_END; // mark the end of the span list
|
||||
pspan->count = DS_SPAN_LIST_END; // mark the end of the span list
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -46,13 +46,13 @@ int D_SurfaceCacheForRes (int width, int height)
|
|||
size = Q_atoi(com_argv[COM_CheckParm("-surfcachesize")+1]) * 1024;
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
size = SURFCACHE_SIZE_AT_320X200;
|
||||
|
||||
pix = width*height;
|
||||
if (pix > 64000)
|
||||
size += (pix-64000)*3;
|
||||
|
||||
|
||||
|
||||
return size;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ void D_ClearCacheGuard (void)
|
|||
{
|
||||
byte *s;
|
||||
int i;
|
||||
|
||||
|
||||
s = (byte *)sc_base + sc_size;
|
||||
for (i=0 ; i<GUARDSIZE ; i++)
|
||||
s[i] = (byte)i;
|
||||
|
@ -93,11 +93,11 @@ void D_InitCaches (void *buffer, int size)
|
|||
sc_size = size - GUARDSIZE;
|
||||
sc_base = (surfcache_t *)buffer;
|
||||
sc_rover = sc_base;
|
||||
|
||||
|
||||
sc_base->next = NULL;
|
||||
sc_base->owner = NULL;
|
||||
sc_base->size = sc_size;
|
||||
|
||||
|
||||
D_ClearCacheGuard ();
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ D_FlushCaches
|
|||
void D_FlushCaches (void)
|
||||
{
|
||||
surfcache_t *c;
|
||||
|
||||
|
||||
if (!sc_base)
|
||||
return;
|
||||
|
||||
|
@ -119,7 +119,7 @@ void D_FlushCaches (void)
|
|||
if (c->owner)
|
||||
*c->owner = NULL;
|
||||
}
|
||||
|
||||
|
||||
sc_rover = sc_base;
|
||||
sc_base->next = NULL;
|
||||
sc_base->owner = NULL;
|
||||
|
@ -141,7 +141,7 @@ surfcache_t *D_SCAlloc (int width, int size)
|
|||
|
||||
if ((size <= 0) || (size > 0x10000))
|
||||
Sys_Error ("D_SCAlloc: bad cache size %d\n", size);
|
||||
|
||||
|
||||
/* This adds the offset of data[0] in the surfcache_t struct. */
|
||||
size += (int)((surfcache_t *)0)->data;
|
||||
|
||||
|
@ -162,12 +162,12 @@ surfcache_t *D_SCAlloc (int width, int size)
|
|||
}
|
||||
sc_rover = sc_base;
|
||||
}
|
||||
|
||||
|
||||
// colect and free surfcache_t blocks until the rover block is large enough
|
||||
new = sc_rover;
|
||||
if (sc_rover->owner)
|
||||
*sc_rover->owner = NULL;
|
||||
|
||||
|
||||
while (new->size < size)
|
||||
{
|
||||
// free another
|
||||
|
@ -176,7 +176,7 @@ surfcache_t *D_SCAlloc (int width, int size)
|
|||
Sys_Error ("D_SCAlloc: hit the end of memory");
|
||||
if (sc_rover->owner)
|
||||
*sc_rover->owner = NULL;
|
||||
|
||||
|
||||
new->size += sc_rover->size;
|
||||
new->next = sc_rover->next;
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ surfcache_t *D_SCAlloc (int width, int size)
|
|||
}
|
||||
else
|
||||
sc_rover = new->next;
|
||||
|
||||
|
||||
new->width = width;
|
||||
// DEBUG
|
||||
if (width > 0)
|
||||
|
@ -208,7 +208,7 @@ surfcache_t *D_SCAlloc (int width, int size)
|
|||
r_cache_thrash = true;
|
||||
}
|
||||
else if (wrapped_this_time)
|
||||
{
|
||||
{
|
||||
d_roverwrapped = true;
|
||||
}
|
||||
|
||||
|
@ -254,9 +254,9 @@ int MaskForNum (int num)
|
|||
int D_log2 (int num)
|
||||
{
|
||||
int c;
|
||||
|
||||
|
||||
c = 0;
|
||||
|
||||
|
||||
while (num>>=1)
|
||||
c++;
|
||||
return c;
|
||||
|
@ -281,7 +281,7 @@ surfcache_t *D_CacheSurface (msurface_t *surface, int miplevel)
|
|||
r_drawsurf.lightadj[1] = d_lightstylevalue[surface->styles[1]];
|
||||
r_drawsurf.lightadj[2] = d_lightstylevalue[surface->styles[2]];
|
||||
r_drawsurf.lightadj[3] = d_lightstylevalue[surface->styles[3]];
|
||||
|
||||
|
||||
//
|
||||
// see if the cache holds apropriate data
|
||||
//
|
||||
|
@ -303,7 +303,7 @@ surfcache_t *D_CacheSurface (msurface_t *surface, int miplevel)
|
|||
r_drawsurf.surfwidth = surface->extents[0] >> miplevel;
|
||||
r_drawsurf.rowbytes = r_drawsurf.surfwidth;
|
||||
r_drawsurf.surfheight = surface->extents[1] >> miplevel;
|
||||
|
||||
|
||||
//
|
||||
// allocate memory if needed
|
||||
//
|
||||
|
@ -315,14 +315,14 @@ surfcache_t *D_CacheSurface (msurface_t *surface, int miplevel)
|
|||
cache->owner = &surface->cachespots[miplevel];
|
||||
cache->mipscale = surfscale;
|
||||
}
|
||||
|
||||
|
||||
if (surface->dlightframe == r_framecount)
|
||||
cache->dlight = 1;
|
||||
else
|
||||
cache->dlight = 0;
|
||||
|
||||
r_drawsurf.surfdat = (pixel_t *)cache->data;
|
||||
|
||||
|
||||
cache->texture = r_drawsurf.texture;
|
||||
cache->lightadj[0] = r_drawsurf.lightadj[0];
|
||||
cache->lightadj[1] = r_drawsurf.lightadj[1];
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -35,7 +35,7 @@ void D_DrawZPoint (void)
|
|||
byte *pdest;
|
||||
short *pz;
|
||||
int izi;
|
||||
|
||||
|
||||
pz = d_pzbuffer + (d_zwidth * r_zpointdesc.v) + r_zpointdesc.u;
|
||||
pdest = d_viewbuffer + d_scantable[r_zpointdesc.v] + r_zpointdesc.u;
|
||||
izi = (int)(r_zpointdesc.zi * 0x8000);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
dga_check.c
|
||||
|
||||
|
||||
Routines to check for XFree86 DGA and VidMode extensions
|
||||
|
||||
Copyright (C) 2000 Contributors of the QuakeForge Project
|
||||
|
@ -14,7 +14,7 @@
|
|||
|
||||
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.
|
||||
|
||||
|
@ -84,7 +84,7 @@ VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver)
|
|||
#if defined(HAS_DGA)
|
||||
int event_base, error_base;
|
||||
int dummy;
|
||||
|
||||
|
||||
if (! XF86VidModeQueryExtension(dpy, &event_base, &error_base)) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
dga_check.h
|
||||
|
||||
|
||||
Definitions for XFree86 DGA and VidMode support
|
||||
|
||||
|
||||
Copyright (C) 2000 Contributors of the QuakeForge Project
|
||||
Copyright (C) 2000 Marcus Sundberg [mackan@stacken.kth.se]
|
||||
Please see the file "AUTHORS" for a list of contributors
|
||||
|
@ -14,13 +14,13 @@
|
|||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* dirent.c
|
||||
*
|
||||
* Derived from DIRLIB.C by Matt J. Weinstein
|
||||
* Derived from DIRLIB.C by Matt J. Weinstein
|
||||
* This note appears in the DIRLIB.H
|
||||
* DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89
|
||||
*
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -74,7 +74,7 @@ qpic_t *Draw_CachePic (char *path)
|
|||
cachepic_t *pic;
|
||||
int i;
|
||||
qpic_t *dat;
|
||||
|
||||
|
||||
for (pic=menu_cachepics, i=0 ; i<menu_numcachepics ; pic++, i++)
|
||||
if (!strcmp (path, pic->name))
|
||||
break;
|
||||
|
@ -96,7 +96,7 @@ qpic_t *Draw_CachePic (char *path)
|
|||
// load the pic from disk
|
||||
//
|
||||
COM_LoadCacheFile (path, &pic->cache);
|
||||
|
||||
|
||||
dat = (qpic_t *)pic->cache.data;
|
||||
if (!dat)
|
||||
{
|
||||
|
@ -143,11 +143,11 @@ void Draw_Character (int x, int y, int num)
|
|||
byte *dest;
|
||||
byte *source;
|
||||
unsigned short *pusdest;
|
||||
int drawline;
|
||||
int drawline;
|
||||
int row, col;
|
||||
|
||||
num &= 255;
|
||||
|
||||
|
||||
if (y <= -8)
|
||||
return; // totally off screen
|
||||
|
||||
|
@ -173,7 +173,7 @@ void Draw_Character (int x, int y, int num)
|
|||
if (r_pixbytes == 1)
|
||||
{
|
||||
dest = vid.conbuffer + y*vid.conrowbytes + x;
|
||||
|
||||
|
||||
while (drawline--)
|
||||
{
|
||||
if (source[0])
|
||||
|
@ -284,7 +284,7 @@ void Draw_Crosshair(void)
|
|||
byte c = (byte)crosshaircolor->value;
|
||||
|
||||
if (crosshair->value == 2) {
|
||||
x = scr_vrect.x + scr_vrect.width/2 + cl_crossx->value;
|
||||
x = scr_vrect.x + scr_vrect.width/2 + cl_crossx->value;
|
||||
y = scr_vrect.y + scr_vrect.height/2 + cl_crossy->value;
|
||||
// FIXME: Find a better way to do this...
|
||||
Draw_Pixel(x - 1, y, c);
|
||||
|
@ -297,8 +297,8 @@ void Draw_Crosshair(void)
|
|||
Draw_Pixel(x, y + 3, c);
|
||||
} else if (crosshair->value)
|
||||
Draw_Character (
|
||||
scr_vrect.x + scr_vrect.width/2-4 + cl_crossx->value,
|
||||
scr_vrect.y + scr_vrect.height/2-4 + cl_crossy->value,
|
||||
scr_vrect.x + scr_vrect.width/2-4 + cl_crossx->value,
|
||||
scr_vrect.y + scr_vrect.height/2-4 + cl_crossy->value,
|
||||
'+');
|
||||
}
|
||||
|
||||
|
@ -315,7 +315,7 @@ void Draw_DebugChar (char num)
|
|||
{
|
||||
byte *dest;
|
||||
byte *source;
|
||||
int drawline;
|
||||
int drawline;
|
||||
extern byte *draw_chars;
|
||||
int row, col;
|
||||
|
||||
|
@ -463,7 +463,7 @@ void Draw_TransPic (int x, int y, qpic_t *pic)
|
|||
{
|
||||
Sys_Error ("Draw_TransPic: bad coordinates");
|
||||
}
|
||||
|
||||
|
||||
source = pic->data;
|
||||
|
||||
if (r_pixbytes == 1)
|
||||
|
@ -477,7 +477,7 @@ void Draw_TransPic (int x, int y, qpic_t *pic)
|
|||
for (u=0 ; u<pic->width ; u++)
|
||||
if ( (tbyte=source[u]) != TRANSPARENT_COLOR)
|
||||
dest[u] = tbyte;
|
||||
|
||||
|
||||
dest += vid.rowbytes;
|
||||
source += pic->width;
|
||||
}
|
||||
|
@ -550,7 +550,7 @@ void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation)
|
|||
{
|
||||
Sys_Error ("Draw_TransPic: bad coordinates");
|
||||
}
|
||||
|
||||
|
||||
source = pic->data;
|
||||
|
||||
if (r_pixbytes == 1)
|
||||
|
@ -642,7 +642,7 @@ void Draw_ConsoleBackground (int lines)
|
|||
+ 320*186;
|
||||
|
||||
memcpy(saveback, conback->data + 320*186, 320*8);
|
||||
|
||||
|
||||
// draw the pic
|
||||
if (r_pixbytes == 1)
|
||||
{
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -61,7 +61,7 @@ void CL_ParseUpdate (int bits)
|
|||
bits |= (i<<8);
|
||||
}
|
||||
|
||||
if (bits & U_LONGENTITY)
|
||||
if (bits & U_LONGENTITY)
|
||||
num = MSG_ReadShort ();
|
||||
else
|
||||
num = MSG_ReadByte ();
|
||||
|
@ -78,7 +78,7 @@ if (bits&(1<<i))
|
|||
forcelink = false;
|
||||
|
||||
ent->msgtime = cl.mtime[0];
|
||||
|
||||
|
||||
if (bits & U_MODEL)
|
||||
{
|
||||
modnum = MSG_ReadByte ();
|
||||
|
@ -87,7 +87,7 @@ if (bits&(1<<i))
|
|||
}
|
||||
else
|
||||
modnum = ent->baseline.modelindex;
|
||||
|
||||
|
||||
model = cl.model_precache[modnum];
|
||||
if (model != ent->model)
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ if (bits&(1<<i))
|
|||
if (num > 0 && num <= cl.maxclients)
|
||||
R_TranslatePlayerSkin (num - 1);
|
||||
}
|
||||
|
||||
|
||||
if (bits & U_FRAME)
|
||||
ent->frame = MSG_ReadByte ();
|
||||
else
|
||||
|
@ -204,7 +204,7 @@ void CL_NewTranslation (int slot)
|
|||
int i, j;
|
||||
int top, bottom;
|
||||
byte *dest, *source;
|
||||
|
||||
|
||||
if (slot > cl.maxclients)
|
||||
Sys_Error ("CL_NewTranslation: slot > cl.maxclients");
|
||||
dest = cl.scores[slot].translations;
|
||||
|
@ -221,12 +221,12 @@ void CL_NewTranslation (int slot)
|
|||
else
|
||||
for (j=0 ; j<16 ; j++)
|
||||
dest[TOP_RANGE+j] = source[top+15-j];
|
||||
|
||||
|
||||
if (bottom < 128)
|
||||
memcpy (dest + BOTTOM_RANGE, source + bottom, 16);
|
||||
else
|
||||
for (j=0 ; j<16 ; j++)
|
||||
dest[BOTTOM_RANGE+j] = source[bottom+15-j];
|
||||
dest[BOTTOM_RANGE+j] = source[bottom+15-j];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -292,7 +292,7 @@ qpic_t *Draw_CachePic (char *path)
|
|||
//
|
||||
// load the pic from disk
|
||||
//
|
||||
dat = (qpic_t *)COM_LoadTempFile (path);
|
||||
dat = (qpic_t *)COM_LoadTempFile (path);
|
||||
if (!dat)
|
||||
Sys_Error ("Draw_CachePic: failed to load %s", path);
|
||||
SwapPic (dat);
|
||||
|
@ -460,7 +460,7 @@ void Draw_Character (int x, int y, int num)
|
|||
return; // space
|
||||
|
||||
num &= 255;
|
||||
|
||||
|
||||
if (y <= -8)
|
||||
return; // totally off screen
|
||||
|
||||
|
@ -522,7 +522,7 @@ void Draw_Crosshair(void)
|
|||
unsigned char *pColor;
|
||||
|
||||
if (crosshair->value == 3) {
|
||||
x = scr_vrect.x + scr_vrect.width/2 - 3 + cl_crossx->value;
|
||||
x = scr_vrect.x + scr_vrect.width/2 - 3 + cl_crossx->value;
|
||||
y = scr_vrect.y + scr_vrect.height/2 - 3 + cl_crossy->value;
|
||||
|
||||
glTexEnvf ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
|
||||
|
@ -531,7 +531,7 @@ void Draw_Crosshair(void)
|
|||
GL_Bind (cs_texture3);
|
||||
|
||||
glBegin (GL_QUADS);
|
||||
|
||||
|
||||
glTexCoord2f (0, 0);
|
||||
glVertex2f (x - 7, y - 1);
|
||||
glTexCoord2f (1, 0);
|
||||
|
@ -540,12 +540,12 @@ void Draw_Crosshair(void)
|
|||
glVertex2f (x + 9, y + 17);
|
||||
glTexCoord2f (0, 1);
|
||||
glVertex2f (x - 7, y + 17);
|
||||
|
||||
|
||||
glEnd ();
|
||||
|
||||
|
||||
glTexEnvf ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
|
||||
} else if (crosshair->value == 2) {
|
||||
x = scr_vrect.x + scr_vrect.width/2 - 3 + cl_crossx->value;
|
||||
x = scr_vrect.x + scr_vrect.width/2 - 3 + cl_crossx->value;
|
||||
y = scr_vrect.y + scr_vrect.height/2 - 3 + cl_crossy->value;
|
||||
|
||||
glTexEnvf ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
|
||||
|
@ -554,7 +554,7 @@ void Draw_Crosshair(void)
|
|||
GL_Bind (cs_texture);
|
||||
|
||||
glBegin (GL_QUADS);
|
||||
|
||||
|
||||
glTexCoord2f (0, 0);
|
||||
glVertex2f (x - 4, y - 4);
|
||||
glTexCoord2f (1, 0);
|
||||
|
@ -563,13 +563,13 @@ void Draw_Crosshair(void)
|
|||
glVertex2f (x + 12, y + 12);
|
||||
glTexCoord2f (0, 1);
|
||||
glVertex2f (x - 4, y + 12);
|
||||
|
||||
|
||||
glEnd ();
|
||||
|
||||
|
||||
glTexEnvf ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
|
||||
} else if (crosshair->value)
|
||||
Draw_Character (scr_vrect.x + scr_vrect.width/2-4 + cl_crossx->value,
|
||||
scr_vrect.y + scr_vrect.height/2-4 + cl_crossy->value,
|
||||
Draw_Character (scr_vrect.x + scr_vrect.width/2-4 + cl_crossx->value,
|
||||
scr_vrect.y + scr_vrect.height/2-4 + cl_crossy->value,
|
||||
'+');
|
||||
}
|
||||
|
||||
|
@ -655,7 +655,7 @@ void Draw_SubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int h
|
|||
if (scrap_dirty)
|
||||
Scrap_Upload ();
|
||||
gl = (glpic_t *)pic->data;
|
||||
|
||||
|
||||
oldglwidth = gl->sh - gl->sl;
|
||||
oldglheight = gl->th - gl->tl;
|
||||
|
||||
|
@ -664,7 +664,7 @@ void Draw_SubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int h
|
|||
|
||||
newtl = gl->tl + (srcy*oldglheight)/pic->height;
|
||||
newth = newtl + (height*oldglheight)/pic->height;
|
||||
|
||||
|
||||
glColor4f (1,1,1,1);
|
||||
GL_Bind (gl->texnum);
|
||||
glBegin (GL_QUADS);
|
||||
|
@ -692,7 +692,7 @@ void Draw_TransPic (int x, int y, qpic_t *pic)
|
|||
{
|
||||
Sys_Error ("Draw_TransPic: bad coordinates");
|
||||
}
|
||||
|
||||
|
||||
Draw_Pic (x, y, pic);
|
||||
}
|
||||
|
||||
|
@ -769,7 +769,7 @@ void Draw_ConsoleBackground (int lines)
|
|||
|
||||
conback = Draw_CachePic ("gfx/conback.lmp");
|
||||
gl = (glpic_t *)conback->data;
|
||||
|
||||
|
||||
y = vid.height * 0.9;
|
||||
if (lines > y)
|
||||
alpha = 1;
|
||||
|
@ -803,7 +803,7 @@ void Draw_ConsoleBackground (int lines)
|
|||
glCullFace(GL_FRONT);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
}
|
||||
|
||||
|
||||
ofs = (vid.height - lines)/(float)vid.height;
|
||||
|
||||
glBegin (GL_QUADS);
|
||||
|
@ -1225,7 +1225,7 @@ done: ;
|
|||
}
|
||||
}
|
||||
|
||||
void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboolean alpha)
|
||||
void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboolean alpha)
|
||||
{
|
||||
int i, s;
|
||||
qboolean noalpha;
|
||||
|
@ -1397,13 +1397,13 @@ int GL_LoadTexture (char *identifier, int width, int height, byte *data, qboolea
|
|||
{
|
||||
if (!strcmp (identifier, glt->identifier))
|
||||
{
|
||||
if (width != glt->width
|
||||
if (width != glt->width
|
||||
|| height != glt->height)
|
||||
{
|
||||
glt->width = width;
|
||||
glt->height = height;
|
||||
glt->mipmap = mipmap;
|
||||
|
||||
|
||||
GL_Bind (glt->texnum);
|
||||
|
||||
GL_Upload8 (data, width, height,
|
||||
|
@ -1446,12 +1446,12 @@ int GL_LoadPicTexture (qpic_t *pic)
|
|||
|
||||
static GLenum oldtarget = TEXTURE0_SGIS;
|
||||
|
||||
void GL_SelectTexture (GLenum target)
|
||||
void GL_SelectTexture (GLenum target)
|
||||
{
|
||||
if (!gl_mtexable)
|
||||
return;
|
||||
qglSelectTextureSGIS(target);
|
||||
if (target == oldtarget)
|
||||
if (target == oldtarget)
|
||||
return;
|
||||
cnttextures[oldtarget-TEXTURE0_SGIS] = currenttexture;
|
||||
currenttexture = cnttextures[target-TEXTURE0_SGIS];
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -302,7 +302,7 @@ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
|
|||
|
||||
aliasmodel = m;
|
||||
paliashdr = hdr; // (aliashdr_t *)Mod_Extradata (m);
|
||||
|
||||
|
||||
modelcrc = m->numclipnodes +
|
||||
m->numedges +
|
||||
m->numframes +
|
||||
|
@ -324,7 +324,7 @@ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
|
|||
COM_StripExtension (m->name+strlen("progs/"), cache+strlen("glquake/"));
|
||||
strcat (cache, ".ms3");
|
||||
|
||||
COM_FOpenFile (cache, &f);
|
||||
COM_FOpenFile (cache, &f);
|
||||
if (f)
|
||||
{
|
||||
byte sig[2];
|
||||
|
@ -336,7 +336,7 @@ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
|
|||
if ((memcmp(sig, "QF", sizeof(sig)) != 0) ||
|
||||
cachecrc != modelcrc)
|
||||
{
|
||||
Con_Printf ("Mismatched mesh on model %s\n",m->name);
|
||||
Con_Printf ("Mismatched mesh on model %s\n",m->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -348,7 +348,7 @@ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
|
|||
fCacheSynced = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!fCacheSynced)
|
||||
{
|
||||
//
|
||||
|
@ -378,7 +378,7 @@ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
|
|||
byte sig[2];
|
||||
memcpy(sig, "QF",2);
|
||||
Qwrite(f, sig, sizeof(sig));
|
||||
Qwrite(f, &modelcrc, sizeof(modelcrc));
|
||||
Qwrite(f, &modelcrc, sizeof(modelcrc));
|
||||
Qwrite(f, &numcommands, 4);
|
||||
Qwrite(f, &numorder, 4);
|
||||
Qwrite(f, commands, numcommands * sizeof(commands[0]));
|
||||
|
@ -396,7 +396,7 @@ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
|
|||
paliashdr->commands = (byte *)cmds - (byte *)paliashdr;
|
||||
memcpy (cmds, commands, numcommands * 4);
|
||||
|
||||
verts = Hunk_Alloc (paliashdr->numposes * paliashdr->poseverts
|
||||
verts = Hunk_Alloc (paliashdr->numposes * paliashdr->poseverts
|
||||
* sizeof(trivertx_t) );
|
||||
paliashdr->posedata = (byte *)verts - (byte *)paliashdr;
|
||||
for (i=0 ; i<paliashdr->numposes ; i++)
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -76,13 +76,13 @@ Caches the data if needed
|
|||
void *Mod_Extradata (model_t *mod)
|
||||
{
|
||||
void *r;
|
||||
|
||||
|
||||
r = Cache_Check (&mod->cache);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
Mod_LoadModel (mod, true);
|
||||
|
||||
|
||||
if (!mod->cache.data)
|
||||
Sys_Error ("Mod_Extradata: caching failed");
|
||||
return mod->cache.data;
|
||||
|
@ -98,7 +98,7 @@ mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
|
|||
mnode_t *node;
|
||||
float d;
|
||||
mplane_t *plane;
|
||||
|
||||
|
||||
if (!model || !model->nodes)
|
||||
Sys_Error ("Mod_PointInLeaf: bad model");
|
||||
|
||||
|
@ -114,7 +114,7 @@ mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
|
|||
else
|
||||
node = node->children[1];
|
||||
}
|
||||
|
||||
|
||||
return NULL; // never reached
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ byte *Mod_DecompressVis (byte *in, model_t *model)
|
|||
byte *out;
|
||||
int row;
|
||||
|
||||
row = (model->numleafs+7)>>3;
|
||||
row = (model->numleafs+7)>>3;
|
||||
out = decompressed;
|
||||
|
||||
#if 0
|
||||
|
@ -144,7 +144,7 @@ byte *Mod_DecompressVis (byte *in, model_t *model)
|
|||
*out++ = 0xff;
|
||||
row--;
|
||||
}
|
||||
return decompressed;
|
||||
return decompressed;
|
||||
}
|
||||
|
||||
do
|
||||
|
@ -154,7 +154,7 @@ byte *Mod_DecompressVis (byte *in, model_t *model)
|
|||
*out++ = *in++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
c = in[1];
|
||||
in += 2;
|
||||
while (c)
|
||||
|
@ -164,7 +164,7 @@ byte *Mod_DecompressVis (byte *in, model_t *model)
|
|||
}
|
||||
} while (out - decompressed < row);
|
||||
#endif
|
||||
|
||||
|
||||
return decompressed;
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ void Mod_ClearAll (void)
|
|||
{
|
||||
int i;
|
||||
model_t *mod;
|
||||
|
||||
|
||||
for (i=0 , mod=mod_known ; i<mod_numknown ; i++, mod++)
|
||||
if (mod->type != mod_alias)
|
||||
mod->needload = true;
|
||||
|
@ -200,17 +200,17 @@ model_t *Mod_FindName (char *name)
|
|||
{
|
||||
int i;
|
||||
model_t *mod;
|
||||
|
||||
|
||||
if (!name[0])
|
||||
Sys_Error ("Mod_ForName: NULL name");
|
||||
|
||||
|
||||
//
|
||||
// search the currently loaded models
|
||||
//
|
||||
for (i=0 , mod=mod_known ; i<mod_numknown ; i++, mod++)
|
||||
if (!strcmp (mod->name, name) )
|
||||
break;
|
||||
|
||||
|
||||
if (i == mod_numknown)
|
||||
{
|
||||
if (mod_numknown == MAX_MOD_KNOWN)
|
||||
|
@ -232,9 +232,9 @@ Mod_TouchModel
|
|||
void Mod_TouchModel (char *name)
|
||||
{
|
||||
model_t *mod;
|
||||
|
||||
|
||||
mod = Mod_FindName (name);
|
||||
|
||||
|
||||
if (!mod->needload)
|
||||
{
|
||||
if (mod->type == mod_alias)
|
||||
|
@ -272,9 +272,9 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
|
|||
//
|
||||
if (!crash)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// load the file
|
||||
//
|
||||
|
@ -285,12 +285,12 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
|
|||
Sys_Error ("Mod_NumForName: %s not found", mod->name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// allocate a new model
|
||||
//
|
||||
COM_FileBase (mod->name, loadname);
|
||||
|
||||
|
||||
loadmodel = mod;
|
||||
|
||||
//
|
||||
|
@ -299,17 +299,17 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
|
|||
|
||||
// call the apropriate loader
|
||||
mod->needload = false;
|
||||
|
||||
|
||||
switch (LittleLong(*(unsigned *)buf))
|
||||
{
|
||||
case IDPOLYHEADER:
|
||||
Mod_LoadAliasModel (mod, buf);
|
||||
break;
|
||||
|
||||
|
||||
case IDSPRITEHEADER:
|
||||
Mod_LoadSpriteModel (mod, buf);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
Mod_LoadBrushModel (mod, buf);
|
||||
break;
|
||||
|
@ -328,9 +328,9 @@ Loads in a model for the given name
|
|||
model_t *Mod_ForName (char *name, qboolean crash)
|
||||
{
|
||||
model_t *mod;
|
||||
|
||||
|
||||
mod = Mod_FindName (name);
|
||||
|
||||
|
||||
return Mod_LoadModel (mod, crash);
|
||||
}
|
||||
|
||||
|
@ -366,9 +366,9 @@ void Mod_LoadTextures (lump_t *l)
|
|||
return;
|
||||
}
|
||||
m = (dmiptexlump_t *)(mod_base + l->fileofs);
|
||||
|
||||
|
||||
m->nummiptex = LittleLong (m->nummiptex);
|
||||
|
||||
|
||||
loadmodel->numtextures = m->nummiptex;
|
||||
loadmodel->textures = Hunk_AllocName (m->nummiptex * sizeof(*loadmodel->textures) , loadname);
|
||||
|
||||
|
@ -382,7 +382,7 @@ void Mod_LoadTextures (lump_t *l)
|
|||
mt->height = LittleLong (mt->height);
|
||||
for (j=0 ; j<MIPLEVELS ; j++)
|
||||
mt->offsets[j] = LittleLong (mt->offsets[j]);
|
||||
|
||||
|
||||
if ( (mt->width & 15) || (mt->height & 15) )
|
||||
Sys_Error ("Texture %s is not 16 aligned", mt->name);
|
||||
pixels = mt->width*mt->height/64*85;
|
||||
|
@ -396,9 +396,9 @@ void Mod_LoadTextures (lump_t *l)
|
|||
tx->offsets[j] = mt->offsets[j] + sizeof(texture_t) - sizeof(miptex_t);
|
||||
// the pixels immediately follow the structures
|
||||
memcpy ( tx+1, mt+1, pixels);
|
||||
|
||||
|
||||
if (!Q_strncmp(mt->name,"sky",3))
|
||||
|
||||
if (!Q_strncmp(mt->name,"sky",3))
|
||||
R_InitSky (tx);
|
||||
else
|
||||
{
|
||||
|
@ -472,7 +472,7 @@ void Mod_LoadTextures (lump_t *l)
|
|||
else
|
||||
Sys_Error ("Bad animating texture %s", tx->name);
|
||||
}
|
||||
|
||||
|
||||
#define ANIM_CYCLE 2
|
||||
// link them all together
|
||||
for (j=0 ; j<max ; j++)
|
||||
|
@ -514,7 +514,7 @@ void Mod_LoadLighting (lump_t *l)
|
|||
loadmodel->lightdata = NULL;
|
||||
return;
|
||||
}
|
||||
loadmodel->lightdata = Hunk_AllocName ( l->filelen, loadname);
|
||||
loadmodel->lightdata = Hunk_AllocName ( l->filelen, loadname);
|
||||
memcpy (loadmodel->lightdata, mod_base + l->fileofs, l->filelen);
|
||||
}
|
||||
|
||||
|
@ -531,7 +531,7 @@ void Mod_LoadVisibility (lump_t *l)
|
|||
loadmodel->visdata = NULL;
|
||||
return;
|
||||
}
|
||||
loadmodel->visdata = Hunk_AllocName ( l->filelen, loadname);
|
||||
loadmodel->visdata = Hunk_AllocName ( l->filelen, loadname);
|
||||
memcpy (loadmodel->visdata, mod_base + l->fileofs, l->filelen);
|
||||
}
|
||||
|
||||
|
@ -548,7 +548,7 @@ void Mod_LoadEntities (lump_t *l)
|
|||
loadmodel->entities = NULL;
|
||||
return;
|
||||
}
|
||||
loadmodel->entities = Hunk_AllocName ( l->filelen, loadname);
|
||||
loadmodel->entities = Hunk_AllocName ( l->filelen, loadname);
|
||||
memcpy (loadmodel->entities, mod_base + l->fileofs, l->filelen);
|
||||
}
|
||||
|
||||
|
@ -568,7 +568,7 @@ void Mod_LoadVertexes (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->vertexes = out;
|
||||
loadmodel->numvertexes = count;
|
||||
|
@ -596,7 +596,7 @@ void Mod_LoadSubmodels (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->submodels = out;
|
||||
loadmodel->numsubmodels = count;
|
||||
|
@ -632,7 +632,7 @@ void Mod_LoadEdges (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( (count + 1) * sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( (count + 1) * sizeof(*out), loadname);
|
||||
|
||||
loadmodel->edges = out;
|
||||
loadmodel->numedges = count;
|
||||
|
@ -661,7 +661,7 @@ void Mod_LoadTexinfo (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->texinfo = out;
|
||||
loadmodel->numtexinfo = count;
|
||||
|
@ -690,7 +690,7 @@ void Mod_LoadTexinfo (lump_t *l)
|
|||
|
||||
miptex = LittleLong (in->miptex);
|
||||
out->flags = LittleLong (in->flags);
|
||||
|
||||
|
||||
if (!loadmodel->textures)
|
||||
{
|
||||
out->texture = r_notexture_mip; // checkerboard texture
|
||||
|
@ -729,7 +729,7 @@ void CalcSurfaceExtents (msurface_t *s)
|
|||
maxs[0] = maxs[1] = -99999;
|
||||
|
||||
tex = s->texinfo;
|
||||
|
||||
|
||||
for (i=0 ; i<s->numedges ; i++)
|
||||
{
|
||||
e = loadmodel->surfedges[s->firstedge+i];
|
||||
|
@ -737,10 +737,10 @@ void CalcSurfaceExtents (msurface_t *s)
|
|||
v = &loadmodel->vertexes[loadmodel->edges[e].v[0]];
|
||||
else
|
||||
v = &loadmodel->vertexes[loadmodel->edges[-e].v[1]];
|
||||
|
||||
|
||||
for (j=0 ; j<2 ; j++)
|
||||
{
|
||||
val = v->position[0] * tex->vecs[j][0] +
|
||||
val = v->position[0] * tex->vecs[j][0] +
|
||||
v->position[1] * tex->vecs[j][1] +
|
||||
v->position[2] * tex->vecs[j][2] +
|
||||
tex->vecs[j][3];
|
||||
|
@ -752,7 +752,7 @@ void CalcSurfaceExtents (msurface_t *s)
|
|||
}
|
||||
|
||||
for (i=0 ; i<2 ; i++)
|
||||
{
|
||||
{
|
||||
bmins[i] = floor(mins[i]/16);
|
||||
bmaxs[i] = ceil(maxs[i]/16);
|
||||
|
||||
|
@ -780,7 +780,7 @@ void Mod_LoadFaces (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->surfaces = out;
|
||||
loadmodel->numsurfaces = count;
|
||||
|
@ -788,20 +788,20 @@ void Mod_LoadFaces (lump_t *l)
|
|||
for ( surfnum=0 ; surfnum<count ; surfnum++, in++, out++)
|
||||
{
|
||||
out->firstedge = LittleLong(in->firstedge);
|
||||
out->numedges = LittleShort(in->numedges);
|
||||
out->numedges = LittleShort(in->numedges);
|
||||
out->flags = 0;
|
||||
|
||||
planenum = LittleShort(in->planenum);
|
||||
side = LittleShort(in->side);
|
||||
if (side)
|
||||
out->flags |= SURF_PLANEBACK;
|
||||
out->flags |= SURF_PLANEBACK;
|
||||
|
||||
out->plane = loadmodel->planes + planenum;
|
||||
|
||||
out->texinfo = loadmodel->texinfo + LittleShort (in->texinfo);
|
||||
|
||||
CalcSurfaceExtents (out);
|
||||
|
||||
|
||||
// lighting info
|
||||
|
||||
for (i=0 ; i<MAXLIGHTMAPS ; i++)
|
||||
|
@ -811,9 +811,9 @@ void Mod_LoadFaces (lump_t *l)
|
|||
out->samples = NULL;
|
||||
else
|
||||
out->samples = loadmodel->lightdata + i;
|
||||
|
||||
|
||||
// set the drawing flags flag
|
||||
|
||||
|
||||
if (!Q_strncmp(out->texinfo->texture->name,"sky",3)) // sky
|
||||
{
|
||||
out->flags |= (SURF_DRAWSKY | SURF_DRAWTILED);
|
||||
|
@ -822,7 +822,7 @@ void Mod_LoadFaces (lump_t *l)
|
|||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!Q_strncmp(out->texinfo->texture->name,"*",1)) // turbulent
|
||||
{
|
||||
out->flags |= (SURF_DRAWTURB | SURF_DRAWTILED);
|
||||
|
@ -868,7 +868,7 @@ void Mod_LoadNodes (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->nodes = out;
|
||||
loadmodel->numnodes = count;
|
||||
|
@ -880,13 +880,13 @@ void Mod_LoadNodes (lump_t *l)
|
|||
out->minmaxs[j] = LittleShort (in->mins[j]);
|
||||
out->minmaxs[3+j] = LittleShort (in->maxs[j]);
|
||||
}
|
||||
|
||||
|
||||
p = LittleLong(in->planenum);
|
||||
out->plane = loadmodel->planes + p;
|
||||
|
||||
out->firstsurface = LittleShort (in->firstface);
|
||||
out->numsurfaces = LittleShort (in->numfaces);
|
||||
|
||||
|
||||
for (j=0 ; j<2 ; j++)
|
||||
{
|
||||
p = LittleShort (in->children[j]);
|
||||
|
@ -896,7 +896,7 @@ void Mod_LoadNodes (lump_t *l)
|
|||
out->children[j] = (mnode_t *)(loadmodel->leafs + (-1 - p));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Mod_SetParent (loadmodel->nodes, NULL); // sets nodes and leafs
|
||||
}
|
||||
|
||||
|
@ -917,7 +917,7 @@ void Mod_LoadLeafs (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->leafs = out;
|
||||
loadmodel->numleafs = count;
|
||||
|
@ -938,14 +938,14 @@ void Mod_LoadLeafs (lump_t *l)
|
|||
out->firstmarksurface = loadmodel->marksurfaces +
|
||||
LittleShort(in->firstmarksurface);
|
||||
out->nummarksurfaces = LittleShort(in->nummarksurfaces);
|
||||
|
||||
|
||||
p = LittleLong(in->visofs);
|
||||
if (p == -1)
|
||||
out->compressed_vis = NULL;
|
||||
else
|
||||
out->compressed_vis = loadmodel->visdata + p;
|
||||
out->efrags = NULL;
|
||||
|
||||
|
||||
for (j=0 ; j<4 ; j++)
|
||||
out->ambient_sound_level[j] = in->ambient_level[j];
|
||||
|
||||
|
@ -960,7 +960,7 @@ void Mod_LoadLeafs (lump_t *l)
|
|||
for (j=0 ; j<out->nummarksurfaces ; j++)
|
||||
out->firstmarksurface[j]->flags |= SURF_DONTWARP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -978,7 +978,7 @@ void Mod_LoadClipnodes (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->clipnodes = out;
|
||||
loadmodel->numclipnodes = count;
|
||||
|
@ -1028,12 +1028,12 @@ void Mod_MakeHull0 (void)
|
|||
dclipnode_t *out;
|
||||
int i, j, count;
|
||||
hull_t *hull;
|
||||
|
||||
hull = &loadmodel->hulls[0];
|
||||
|
||||
|
||||
hull = &loadmodel->hulls[0];
|
||||
|
||||
in = loadmodel->nodes;
|
||||
count = loadmodel->numnodes;
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
hull->clipnodes = out;
|
||||
hull->firstclipnode = 0;
|
||||
|
@ -1060,16 +1060,16 @@ Mod_LoadMarksurfaces
|
|||
=================
|
||||
*/
|
||||
void Mod_LoadMarksurfaces (lump_t *l)
|
||||
{
|
||||
{
|
||||
int i, j, count;
|
||||
short *in;
|
||||
msurface_t **out;
|
||||
|
||||
|
||||
in = (void *)(mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof(*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->marksurfaces = out;
|
||||
loadmodel->nummarksurfaces = count;
|
||||
|
@ -1089,15 +1089,15 @@ Mod_LoadSurfedges
|
|||
=================
|
||||
*/
|
||||
void Mod_LoadSurfedges (lump_t *l)
|
||||
{
|
||||
{
|
||||
int i, count;
|
||||
int *in, *out;
|
||||
|
||||
|
||||
in = (void *)(mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof(*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->surfedges = out;
|
||||
loadmodel->numsurfedges = count;
|
||||
|
@ -1119,13 +1119,13 @@ void Mod_LoadPlanes (lump_t *l)
|
|||
dplane_t *in;
|
||||
int count;
|
||||
int bits;
|
||||
|
||||
|
||||
in = (void *)(mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof(*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*2*sizeof(*out), loadname);
|
||||
|
||||
out = Hunk_AllocName ( count*2*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->planes = out;
|
||||
loadmodel->numplanes = count;
|
||||
|
||||
|
@ -1173,9 +1173,9 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
|
|||
int i, j;
|
||||
dheader_t *header;
|
||||
dmodel_t *bm;
|
||||
|
||||
|
||||
loadmodel->type = mod_brush;
|
||||
|
||||
|
||||
header = (dheader_t *)buffer;
|
||||
|
||||
i = LittleLong (header->version);
|
||||
|
@ -1198,17 +1198,17 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
|
|||
for (i = 0; i < HEADER_LUMPS; i++) {
|
||||
if (i == LUMP_ENTITIES)
|
||||
continue;
|
||||
mod->checksum ^= LittleLong(Com_BlockChecksum(mod_base + header->lumps[i].fileofs,
|
||||
mod->checksum ^= LittleLong(Com_BlockChecksum(mod_base + header->lumps[i].fileofs,
|
||||
header->lumps[i].filelen));
|
||||
|
||||
if (i == LUMP_VISIBILITY || i == LUMP_LEAFS || i == LUMP_NODES)
|
||||
continue;
|
||||
mod->checksum2 ^= LittleLong(Com_BlockChecksum(mod_base + header->lumps[i].fileofs,
|
||||
mod->checksum2 ^= LittleLong(Com_BlockChecksum(mod_base + header->lumps[i].fileofs,
|
||||
header->lumps[i].filelen));
|
||||
}
|
||||
|
||||
// load into heap
|
||||
|
||||
|
||||
Mod_LoadVertexes (&header->lumps[LUMP_VERTEXES]);
|
||||
Mod_LoadEdges (&header->lumps[LUMP_EDGES]);
|
||||
Mod_LoadSurfedges (&header->lumps[LUMP_SURFEDGES]);
|
||||
|
@ -1226,9 +1226,9 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
|
|||
Mod_LoadSubmodels (&header->lumps[LUMP_MODELS]);
|
||||
|
||||
Mod_MakeHull0 ();
|
||||
|
||||
|
||||
mod->numframes = 2; // regular and alternate animation
|
||||
|
||||
|
||||
//
|
||||
// set up the submodels (FIXME: this is confusing)
|
||||
//
|
||||
|
@ -1242,10 +1242,10 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
|
|||
mod->hulls[j].firstclipnode = bm->headnode[j];
|
||||
mod->hulls[j].lastclipnode = mod->numclipnodes-1;
|
||||
}
|
||||
|
||||
|
||||
mod->firstmodelsurface = bm->firstface;
|
||||
mod->nummodelsurfaces = bm->numfaces;
|
||||
|
||||
|
||||
VectorCopy (bm->maxs, mod->maxs);
|
||||
VectorCopy (bm->mins, mod->mins);
|
||||
|
||||
|
@ -1297,7 +1297,7 @@ void * Mod_LoadAliasFrame (void * pin, maliasframedesc_t *frame)
|
|||
trivertx_t *pinframe;
|
||||
int i;
|
||||
daliasframe_t *pdaliasframe;
|
||||
|
||||
|
||||
//printf("pheader->numverts: %d\n", pheader->numverts);
|
||||
pdaliasframe = (daliasframe_t *)pin;
|
||||
|
||||
|
@ -1343,7 +1343,7 @@ void *Mod_LoadAliasGroup (void * pin, maliasframedesc_t *frame)
|
|||
int i, numframes;
|
||||
daliasinterval_t *pin_intervals;
|
||||
void *ptemp;
|
||||
|
||||
|
||||
pingroup = (daliasgroup_t *)pin;
|
||||
|
||||
numframes = LittleLong (pingroup->numframes);
|
||||
|
@ -1470,7 +1470,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
|||
daliasskingroup_t *pinskingroup;
|
||||
int groupskins;
|
||||
daliasskininterval_t *pinskinintervals;
|
||||
|
||||
|
||||
skin = (byte *)(pskintype + 1);
|
||||
|
||||
if (numskins < 1 || numskins > MAX_SKINS)
|
||||
|
@ -1494,7 +1494,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
|||
pheader->gl_texturenum[i][1] =
|
||||
pheader->gl_texturenum[i][2] =
|
||||
pheader->gl_texturenum[i][3] =
|
||||
GL_LoadTexture (name, pheader->skinwidth,
|
||||
GL_LoadTexture (name, pheader->skinwidth,
|
||||
pheader->skinheight, (byte *)(pskintype + 1), true, false);
|
||||
pskintype = (daliasskintype_t *)((byte *)(pskintype+1) + s);
|
||||
} else {
|
||||
|
@ -1516,15 +1516,15 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
|||
memcpy (texels, (byte *)(pskintype), s);
|
||||
}
|
||||
snprintf(name, sizeof(name), "%s_%i_%i", loadmodel->name, i,j);
|
||||
pheader->gl_texturenum[i][j&3] =
|
||||
GL_LoadTexture (name, pheader->skinwidth,
|
||||
pheader->gl_texturenum[i][j&3] =
|
||||
GL_LoadTexture (name, pheader->skinwidth,
|
||||
pheader->skinheight, (byte *)(pskintype), true, false);
|
||||
pskintype = (daliasskintype_t *)((byte *)(pskintype) + s);
|
||||
}
|
||||
k = j;
|
||||
for (/* */; j < 4; j++)
|
||||
pheader->gl_texturenum[i][j&3] =
|
||||
pheader->gl_texturenum[i][j - k];
|
||||
pheader->gl_texturenum[i][j&3] =
|
||||
pheader->gl_texturenum[i][j - k];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1560,15 +1560,15 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
|
|||
CRC_Init(&crc);
|
||||
for (len = com_filesize, p = buffer; len; len--, p++)
|
||||
CRC_ProcessByte(&crc, *p);
|
||||
|
||||
|
||||
snprintf(st, sizeof(st), "%d", (int) crc);
|
||||
Info_SetValueForKey (cls.userinfo,
|
||||
Info_SetValueForKey (cls.userinfo,
|
||||
!strcmp(loadmodel->name, "progs/player.mdl") ? pmodel_name : emodel_name,
|
||||
st, MAX_INFO_STRING);
|
||||
|
||||
if (cls.state >= ca_connected) {
|
||||
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
|
||||
snprintf(st, sizeof(st), "setinfo %s %d",
|
||||
snprintf(st, sizeof(st), "setinfo %s %d",
|
||||
!strcmp(loadmodel->name, "progs/player.mdl") ? pmodel_name : emodel_name,
|
||||
(int)crc);
|
||||
SZ_Print (&cls.netchan.message, st);
|
||||
|
@ -1588,11 +1588,11 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
|
|||
// allocate space for a working header, plus all the data except the frames,
|
||||
// skin and group info
|
||||
//
|
||||
size = sizeof (aliashdr_t)
|
||||
size = sizeof (aliashdr_t)
|
||||
+ (LittleLong (pinmodel->numframes) - 1) *
|
||||
sizeof (pheader->frames[0]);
|
||||
pheader = Hunk_AllocName (size, loadname);
|
||||
|
||||
|
||||
mod->flags = LittleLong (pinmodel->flags);
|
||||
|
||||
//
|
||||
|
@ -1716,10 +1716,10 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
|
|||
|
||||
//
|
||||
// move the complete, relocatable alias model to the cache
|
||||
//
|
||||
//
|
||||
end = Hunk_LowMark ();
|
||||
total = end - start;
|
||||
|
||||
|
||||
Cache_Alloc (&mod->cache, total, loadname);
|
||||
if (!mod->cache.data)
|
||||
return;
|
||||
|
@ -1837,7 +1837,7 @@ void Mod_LoadSpriteModel (model_t *mod, void *buffer)
|
|||
int numframes;
|
||||
int size;
|
||||
dspriteframetype_t *pframetype;
|
||||
|
||||
|
||||
pin = (dsprite_t *)buffer;
|
||||
|
||||
version = LittleLong (pin->version);
|
||||
|
@ -1864,7 +1864,7 @@ void Mod_LoadSpriteModel (model_t *mod, void *buffer)
|
|||
mod->maxs[0] = mod->maxs[1] = psprite->maxwidth/2;
|
||||
mod->mins[2] = -psprite->maxheight/2;
|
||||
mod->maxs[2] = psprite->maxheight/2;
|
||||
|
||||
|
||||
//
|
||||
// load the frames
|
||||
//
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -57,7 +57,7 @@ static void R_LineGraph (int x, int h)
|
|||
|
||||
if (h>s)
|
||||
h = s;
|
||||
|
||||
|
||||
for (i=0 ; i<h ; i++)
|
||||
if (i & 1)
|
||||
ngraph_texels[NET_GRAPHHEIGHT - i - 1][x] = 0xff;
|
||||
|
@ -123,11 +123,11 @@ void R_NetGraph (void)
|
|||
snprintf(st, sizeof(st), "%3i%% packet loss", lost);
|
||||
Draw_String(8, y, st);
|
||||
y += 8;
|
||||
|
||||
|
||||
GL_Bind(netgraphtexture);
|
||||
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format,
|
||||
NET_TIMINGS, NET_GRAPHHEIGHT, 0, GL_RGBA,
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format,
|
||||
NET_TIMINGS, NET_GRAPHHEIGHT, 0, GL_RGBA,
|
||||
GL_UNSIGNED_BYTE, ngraph_pixels);
|
||||
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -59,9 +59,9 @@ Call when removing an object from the world or moving it to another position
|
|||
void R_RemoveEfrags (entity_t *ent)
|
||||
{
|
||||
efrag_t *ef, *old, *walk, **prev;
|
||||
|
||||
|
||||
ef = ent->efrag;
|
||||
|
||||
|
||||
while (ef)
|
||||
{
|
||||
prev = &ef->leaf->efrags;
|
||||
|
@ -78,16 +78,16 @@ void R_RemoveEfrags (entity_t *ent)
|
|||
else
|
||||
prev = &walk->leafnext;
|
||||
}
|
||||
|
||||
|
||||
old = ef;
|
||||
ef = ef->entnext;
|
||||
|
||||
|
||||
// put it on the free list
|
||||
old->entnext = cl.free_efrags;
|
||||
cl.free_efrags = old;
|
||||
}
|
||||
|
||||
ent->efrag = NULL;
|
||||
|
||||
ent->efrag = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -101,12 +101,12 @@ void R_SplitEntityOnNode (mnode_t *node)
|
|||
mplane_t *splitplane;
|
||||
mleaf_t *leaf;
|
||||
int sides;
|
||||
|
||||
|
||||
if (node->contents == CONTENTS_SOLID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// add an efrag if the node is a leaf
|
||||
|
||||
if ( node->contents < 0)
|
||||
|
@ -126,25 +126,25 @@ void R_SplitEntityOnNode (mnode_t *node)
|
|||
cl.free_efrags = cl.free_efrags->entnext;
|
||||
|
||||
ef->entity = r_addent;
|
||||
|
||||
// add the entity link
|
||||
|
||||
// add the entity link
|
||||
*lastlink = ef;
|
||||
lastlink = &ef->entnext;
|
||||
ef->entnext = NULL;
|
||||
|
||||
|
||||
// set the leaf links
|
||||
ef->leaf = leaf;
|
||||
ef->leafnext = leaf->efrags;
|
||||
leaf->efrags = ef;
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// NODE_MIXED
|
||||
|
||||
splitplane = node->plane;
|
||||
sides = BOX_ON_PLANE_SIDE(r_emins, r_emaxs, splitplane);
|
||||
|
||||
|
||||
if (sides == 3)
|
||||
{
|
||||
// split on this plane
|
||||
|
@ -152,11 +152,11 @@ void R_SplitEntityOnNode (mnode_t *node)
|
|||
if (!r_pefragtopnode)
|
||||
r_pefragtopnode = node;
|
||||
}
|
||||
|
||||
|
||||
// recurse down the contacted sides
|
||||
if (sides & 1)
|
||||
R_SplitEntityOnNode (node->children[0]);
|
||||
|
||||
|
||||
if (sides & 2)
|
||||
R_SplitEntityOnNode (node->children[1]);
|
||||
}
|
||||
|
@ -172,15 +172,15 @@ void R_AddEfrags (entity_t *ent)
|
|||
{
|
||||
model_t *entmodel;
|
||||
int i;
|
||||
|
||||
|
||||
if (!ent->model)
|
||||
return;
|
||||
|
||||
r_addent = ent;
|
||||
|
||||
|
||||
lastlink = &ent->efrag;
|
||||
r_pefragtopnode = NULL;
|
||||
|
||||
|
||||
entmodel = ent->model;
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
|
@ -233,7 +233,7 @@ void R_StoreEfrags (efrag_t **ppefrag)
|
|||
ppefrag = &pefrag->leafnext;
|
||||
break;
|
||||
|
||||
default:
|
||||
default:
|
||||
Sys_Error ("R_StoreEfrags: Bad entity type %d\n", clmodel->type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -39,7 +39,7 @@ R_AnimateLight
|
|||
void R_AnimateLight (void)
|
||||
{
|
||||
int i,j,k;
|
||||
|
||||
|
||||
//
|
||||
// light animations
|
||||
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
||||
|
@ -55,7 +55,7 @@ void R_AnimateLight (void)
|
|||
k = cl_lightstyle[j].map[k] - 'a';
|
||||
k = k*22;
|
||||
d_lightstylevalue[j] = k;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -118,7 +118,7 @@ void R_RenderDlight (dlight_t *light)
|
|||
}
|
||||
|
||||
glBegin (GL_TRIANGLE_FAN);
|
||||
if (light->color[0] || light->color[1] || light->color[2]
|
||||
if (light->color[0] || light->color[1] || light->color[2]
|
||||
|| light->color[3]) // is there a color?
|
||||
glColor4f (light->color[0], light->color[1],
|
||||
light->color[2], light->color[3]);
|
||||
|
@ -134,7 +134,7 @@ void R_RenderDlight (dlight_t *light)
|
|||
for (j=0 ; j<3 ; j++)
|
||||
v[j] = light->origin[j] + (vright[j]*(*bub_cos) +
|
||||
+ vup[j]*(*bub_sin)) * rad;
|
||||
bub_sin++;
|
||||
bub_sin++;
|
||||
bub_cos++;
|
||||
glVertex3fv (v);
|
||||
}
|
||||
|
@ -197,13 +197,13 @@ void R_MarkLights (dlight_t *light, int bit, mnode_t *node)
|
|||
float dist;
|
||||
msurface_t *surf;
|
||||
int i;
|
||||
|
||||
|
||||
if (node->contents < 0)
|
||||
return;
|
||||
|
||||
splitplane = node->plane;
|
||||
dist = DotProduct (light->origin, splitplane->normal) - splitplane->dist;
|
||||
|
||||
|
||||
if (dist > light->radius)
|
||||
{
|
||||
R_MarkLights (light, bit, node->children[0]);
|
||||
|
@ -214,7 +214,7 @@ void R_MarkLights (dlight_t *light, int bit, mnode_t *node)
|
|||
R_MarkLights (light, bit, node->children[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// mark the polygons
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
for (i=0 ; i<node->numsurfaces ; i++, surf++)
|
||||
|
@ -289,13 +289,13 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
int maps;
|
||||
|
||||
r[0] = r[1] = r[2] = r[3] = 0;
|
||||
|
||||
|
||||
if (node->contents < 0)
|
||||
{
|
||||
r[3] = -1;
|
||||
return r; // didn't hit anything
|
||||
}
|
||||
|
||||
|
||||
// calculate mid point
|
||||
|
||||
// FIXME: optimize for axial
|
||||
|
@ -303,26 +303,26 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
front = DotProduct (start, plane->normal) - plane->dist;
|
||||
back = DotProduct (end, plane->normal) - plane->dist;
|
||||
side = front < 0;
|
||||
|
||||
|
||||
if ( (back < 0) == side)
|
||||
return RecursiveLightPoint (node->children[side], start, end);
|
||||
|
||||
|
||||
frac = front / (front-back);
|
||||
mid[0] = start[0] + (end[0] - start[0])*frac;
|
||||
mid[1] = start[1] + (end[1] - start[1])*frac;
|
||||
mid[2] = start[2] + (end[2] - start[2])*frac;
|
||||
|
||||
// go down front side
|
||||
|
||||
// go down front side
|
||||
r = RecursiveLightPoint (node->children[side], start, mid);
|
||||
if (r[3] >= 0)
|
||||
return r; // hit something
|
||||
|
||||
|
||||
if ( (back < 0) == side )
|
||||
{
|
||||
r[3] = -1;
|
||||
return r; // didn't hit anuthing
|
||||
}
|
||||
|
||||
|
||||
// check for impact on this node
|
||||
VectorCopy (mid, lightspot);
|
||||
lightplane = plane;
|
||||
|
@ -334,17 +334,17 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
continue; // no lightmaps
|
||||
|
||||
tex = surf->texinfo;
|
||||
|
||||
|
||||
s = DotProduct (mid, tex->vecs[0]) + tex->vecs[0][3];
|
||||
t = DotProduct (mid, tex->vecs[1]) + tex->vecs[1][3];;
|
||||
|
||||
if (s < surf->texturemins[0] ||
|
||||
t < surf->texturemins[1])
|
||||
continue;
|
||||
|
||||
|
||||
ds = s - surf->texturemins[0];
|
||||
dt = t - surf->texturemins[1];
|
||||
|
||||
|
||||
if ( ds > surf->extents[0] || dt > surf->extents[1] )
|
||||
continue;
|
||||
|
||||
|
@ -363,7 +363,7 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
else
|
||||
lightmap += (dt * ((surf->extents[0]>>4)+1)
|
||||
+ ds);
|
||||
|
||||
|
||||
|
||||
for (maps = 0 ; (maps < MAXLIGHTMAPS)
|
||||
&& (surf->styles[maps] != 255) ;
|
||||
|
@ -411,19 +411,19 @@ R_LightPoint (vec3_t p)
|
|||
{
|
||||
vec3_t end;
|
||||
int *r = myr;
|
||||
|
||||
|
||||
if (!cl.worldmodel->lightdata)
|
||||
{
|
||||
r[0] = r[1] = r[2] = r[3] = 255;
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
end[0] = p[0];
|
||||
end[1] = p[1];
|
||||
end[2] = p[2] - 2048;
|
||||
|
||||
|
||||
r = RecursiveLightPoint (cl.worldmodel->nodes, p, end);
|
||||
|
||||
|
||||
if (r[3] == -1)
|
||||
r[3] = 0;
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
gl_rmain.c
|
||||
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
||||
Please see the file "AUTHORS" for a list of contributors
|
||||
|
||||
|
||||
Author:
|
||||
Date: 07 Jan 2000
|
||||
|
||||
|
@ -15,13 +15,13 @@
|
|||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
@ -54,7 +54,7 @@ mplane_t frustum[4];
|
|||
|
||||
int c_brush_polys, c_alias_polys;
|
||||
|
||||
qboolean envmap; // true during envmap command capture
|
||||
qboolean envmap; // true during envmap command capture
|
||||
|
||||
int currenttexture = -1; // to avoid unnecessary texture sets
|
||||
|
||||
|
@ -123,7 +123,7 @@ cvar_t *gl_nocolors;
|
|||
cvar_t *gl_keeptjunctions;
|
||||
cvar_t *gl_doubleeyes;
|
||||
|
||||
extern cvar_t *gl_ztrick;
|
||||
extern cvar_t *gl_ztrick;
|
||||
#ifdef QUAKEWORLD
|
||||
extern cvar_t *scr_fov;
|
||||
#endif
|
||||
|
@ -257,7 +257,7 @@ R_DrawSpriteModel (entity_t *e) {
|
|||
VectorMA (e->origin, frame->down, up, point);
|
||||
VectorMA (point, frame->right, right, point);
|
||||
glVertex3fv (point);
|
||||
|
||||
|
||||
glEnd ();
|
||||
|
||||
glDisable (GL_ALPHA_TEST);
|
||||
|
@ -327,7 +327,7 @@ GL_DrawAliasFrame (aliashdr_t *paliashdr, int posenum)
|
|||
|
||||
// normals and vertexes come from the frame list
|
||||
|
||||
l = shadedots[verts->lightnormalindex]
|
||||
l = shadedots[verts->lightnormalindex]
|
||||
* shadelight[3];
|
||||
if (shadelight[0] || shadelight[1] || shadelight[2])
|
||||
glColor3f (l*shadelight[0], l*shadelight[1],
|
||||
|
@ -397,7 +397,7 @@ GL_DrawAliasShadow (aliashdr_t *paliashdr, int posenum) {
|
|||
verts++;
|
||||
} while (--count);
|
||||
glEnd ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -460,7 +460,7 @@ R_DrawAliasModel (entity_t *e) {
|
|||
shadelight[2] = (float)j[2];
|
||||
shadelight[3] = (float)j[3];
|
||||
ambientlight = shadelight[3];
|
||||
|
||||
|
||||
// allways give the gun some light
|
||||
if (e == &cl.viewent && ambientlight < 24)
|
||||
ambientlight = shadelight[3] = 24;
|
||||
|
@ -477,7 +477,7 @@ R_DrawAliasModel (entity_t *e) {
|
|||
if (add > 0)
|
||||
{
|
||||
ambientlight += add;
|
||||
// ZOID: models should be affected by
|
||||
// ZOID: models should be affected by
|
||||
// dlights as well
|
||||
shadelight[0] += cl_dlights[lnum].color[0];
|
||||
shadelight[1] += cl_dlights[lnum].color[1];
|
||||
|
@ -497,7 +497,7 @@ R_DrawAliasModel (entity_t *e) {
|
|||
if (!strcmp(clmodel->name, "progs/player.mdl"))
|
||||
#else
|
||||
i = currententity - cl_entities;
|
||||
if (i >= 1 && i <= cl.maxclients
|
||||
if (i >= 1 && i <= cl.maxclients
|
||||
/*&& !strcmp (currententity->model->name,
|
||||
"progs/player.mdl")*/ )
|
||||
#endif
|
||||
|
@ -509,11 +509,11 @@ R_DrawAliasModel (entity_t *e) {
|
|||
// HACK HACK HACK -- no fullbright colors, so make torches full light
|
||||
ambientlight = shadelight[3] = 256;
|
||||
|
||||
shadedots = r_avertexnormal_dots[((int)(e->angles[1]
|
||||
shadedots = r_avertexnormal_dots[((int)(e->angles[1]
|
||||
* (SHADEDOT_QUANT / 360.0)))
|
||||
& (SHADEDOT_QUANT - 1)];
|
||||
shadelight[3] /= 200.0;
|
||||
|
||||
|
||||
an = e->angles[1]/180*M_PI;
|
||||
shadevector[0] = cos(-an);
|
||||
shadevector[1] = sin(-an);
|
||||
|
@ -570,7 +570,7 @@ R_DrawAliasModel (entity_t *e) {
|
|||
#else
|
||||
if (currententity->colormap != vid.colormap && !gl_nocolors->value) {
|
||||
i = currententity - cl_entities;
|
||||
if (i >= 1 && i<=cl.maxclients
|
||||
if (i >= 1 && i<=cl.maxclients
|
||||
/*&& !strcmp (currententity->model->name,
|
||||
"progs/player.mdl")*/ )
|
||||
GL_Bind(playertextures - 1 + i);
|
||||
|
@ -704,7 +704,7 @@ R_DrawViewModel ( void )
|
|||
shadelight[2] = j[2];
|
||||
shadelight[3] = j[3];
|
||||
|
||||
// add dynamic lights
|
||||
// add dynamic lights
|
||||
for (lnum=0 ; lnum<MAX_DLIGHTS ; lnum++) {
|
||||
dl = &cl_dlights[lnum];
|
||||
if (!dl->radius)
|
||||
|
@ -957,7 +957,7 @@ R_RenderScene ( void ) {
|
|||
|
||||
R_SetupFrame ();
|
||||
R_SetFrustum ();
|
||||
|
||||
|
||||
R_SetupGL ();
|
||||
|
||||
R_MarkLeaves (); // done here so we know if we're in water
|
||||
|
@ -1065,12 +1065,12 @@ R_RenderView ( void ) {
|
|||
// render normal view
|
||||
|
||||
/*** Render Volumetric Fog ***/
|
||||
|
||||
if(r_volfog->value)
|
||||
|
||||
if(r_volfog->value)
|
||||
{
|
||||
R_RenderScene ();
|
||||
R_DrawViewModel ();
|
||||
|
||||
|
||||
glClear(GL_STENCIL_BUFFER_BIT);
|
||||
//glColorMask(GL_FALSE);
|
||||
glStencilFunc(GL_ALWAYS, 1, 1);
|
||||
|
@ -1082,7 +1082,7 @@ R_RenderView ( void ) {
|
|||
glFogfv (GL_FOG_COLOR, colors);
|
||||
// fixme: GL_FOG_DENSITY should have r_volfog_density var
|
||||
glFogf (GL_FOG_DENSITY, r_volfog->value);
|
||||
|
||||
|
||||
glEnable(GL_FOG);
|
||||
R_DrawWaterSurfaces();
|
||||
glDisable(GL_FOG);
|
||||
|
@ -1094,11 +1094,11 @@ R_RenderView ( void ) {
|
|||
|
||||
/*** Depth fog code ***/
|
||||
|
||||
else if (r_fog->value)
|
||||
else if (r_fog->value)
|
||||
{ // FIXME: would be nice if the user could select what fogmode... (r_fog_mode)
|
||||
glFogi (GL_FOG_MODE, GL_EXP2);
|
||||
glFogfv (GL_FOG_COLOR, colors);
|
||||
glFogf (GL_FOG_DENSITY, (GLfloat) r_fog->value);
|
||||
glFogf (GL_FOG_DENSITY, (GLfloat) r_fog->value);
|
||||
// glFogi (GL_FOG_MODE, GL_LINEAR);
|
||||
// glFogfv (GL_FOG_COLOR, colors);
|
||||
// glFogf (GL_FOG_START, 300.0);
|
||||
|
@ -1109,24 +1109,24 @@ R_RenderView ( void ) {
|
|||
R_RenderScene ();
|
||||
R_DrawViewModel ();
|
||||
R_DrawWaterSurfaces ();
|
||||
|
||||
|
||||
glDisable(GL_FOG);
|
||||
}
|
||||
}
|
||||
|
||||
/*** Regular rendering code ***/
|
||||
|
||||
else
|
||||
else
|
||||
{
|
||||
R_RenderScene ();
|
||||
R_DrawViewModel ();
|
||||
R_DrawWaterSurfaces ();
|
||||
}
|
||||
}
|
||||
|
||||
R_PolyBlend ();
|
||||
|
||||
if (r_speeds->value) {
|
||||
//glFinish ();
|
||||
time2 = Sys_DoubleTime ();
|
||||
Con_Printf ("%3i ms %4i wpoly %4i epoly\n", (int)((time2-time1)*1000), c_brush_polys, c_alias_polys);
|
||||
Con_Printf ("%3i ms %4i wpoly %4i epoly\n", (int)((time2-time1)*1000), c_brush_polys, c_alias_polys);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -46,13 +46,13 @@ void R_InitTextures (void)
|
|||
|
||||
// create a simple checkerboard texture for the default
|
||||
r_notexture_mip = Hunk_AllocName (sizeof(texture_t) + 16*16+8*8+4*4+2*2, "notexture");
|
||||
|
||||
|
||||
r_notexture_mip->width = r_notexture_mip->height = 16;
|
||||
r_notexture_mip->offsets[0] = sizeof(texture_t);
|
||||
r_notexture_mip->offsets[1] = r_notexture_mip->offsets[0] + 16*16;
|
||||
r_notexture_mip->offsets[2] = r_notexture_mip->offsets[1] + 8*8;
|
||||
r_notexture_mip->offsets[3] = r_notexture_mip->offsets[2] + 4*4;
|
||||
|
||||
|
||||
for (m=0 ; m<4 ; m++)
|
||||
{
|
||||
dest = (byte *)r_notexture_mip + r_notexture_mip->offsets[m];
|
||||
|
@ -64,7 +64,7 @@ void R_InitTextures (void)
|
|||
else
|
||||
*dest++ = 0xff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
byte dottexture[8][8] =
|
||||
|
@ -133,39 +133,39 @@ void R_Envmap_f (void)
|
|||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
COM_WriteFile ("env0.rgb", buffer, sizeof(buffer));
|
||||
COM_WriteFile ("env0.rgb", buffer, sizeof(buffer));
|
||||
|
||||
r_refdef.viewangles[1] = 90;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
COM_WriteFile ("env1.rgb", buffer, sizeof(buffer));
|
||||
COM_WriteFile ("env1.rgb", buffer, sizeof(buffer));
|
||||
|
||||
r_refdef.viewangles[1] = 180;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
COM_WriteFile ("env2.rgb", buffer, sizeof(buffer));
|
||||
COM_WriteFile ("env2.rgb", buffer, sizeof(buffer));
|
||||
|
||||
r_refdef.viewangles[1] = 270;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
COM_WriteFile ("env3.rgb", buffer, sizeof(buffer));
|
||||
COM_WriteFile ("env3.rgb", buffer, sizeof(buffer));
|
||||
|
||||
r_refdef.viewangles[0] = -90;
|
||||
r_refdef.viewangles[1] = 0;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
COM_WriteFile ("env4.rgb", buffer, sizeof(buffer));
|
||||
COM_WriteFile ("env4.rgb", buffer, sizeof(buffer));
|
||||
|
||||
r_refdef.viewangles[0] = 90;
|
||||
r_refdef.viewangles[1] = 0;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
COM_WriteFile ("env5.rgb", buffer, sizeof(buffer));
|
||||
COM_WriteFile ("env5.rgb", buffer, sizeof(buffer));
|
||||
|
||||
envmap = false;
|
||||
glDrawBuffer (GL_BACK);
|
||||
|
@ -179,14 +179,14 @@ R_Init
|
|||
===============
|
||||
*/
|
||||
void R_Init (void)
|
||||
{
|
||||
{
|
||||
#ifndef QUAKEWORLD
|
||||
extern cvar_t *gl_finish;
|
||||
#endif /* QUAKEWORLD */
|
||||
|
||||
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f);
|
||||
Cmd_AddCommand ("envmap", R_Envmap_f);
|
||||
Cmd_AddCommand ("pointfile", R_ReadPointFile_f);
|
||||
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f);
|
||||
Cmd_AddCommand ("envmap", R_Envmap_f);
|
||||
Cmd_AddCommand ("pointfile", R_ReadPointFile_f);
|
||||
|
||||
r_norefresh = Cvar_Get ("r_norefresh","0",0,"None");
|
||||
r_lightmap = Cvar_Get ("r_lightmap","0",0,"None");
|
||||
|
@ -231,7 +231,7 @@ void R_Init (void)
|
|||
#endif
|
||||
|
||||
R_InitBubble();
|
||||
|
||||
|
||||
gl_doubleeyes = Cvar_Get ("gl_doubleeyes","1",CVAR_ARCHIVE,"None");
|
||||
|
||||
R_InitParticles ();
|
||||
|
@ -311,7 +311,7 @@ void R_TranslatePlayerSkin (int playernum)
|
|||
translate[TOP_RANGE+i] = top+i;
|
||||
else
|
||||
translate[TOP_RANGE+i] = top+15-i;
|
||||
|
||||
|
||||
if (bottom < 128)
|
||||
translate[BOTTOM_RANGE+i] = bottom+i;
|
||||
else
|
||||
|
@ -356,7 +356,7 @@ void R_TranslatePlayerSkin (int playernum)
|
|||
|
||||
|
||||
// don't mipmap these, because it takes too long
|
||||
GL_Upload8 (translated, paliashdr->skinwidth, paliashdr->skinheight,
|
||||
GL_Upload8 (translated, paliashdr->skinwidth, paliashdr->skinheight,
|
||||
false, false, true);
|
||||
#endif
|
||||
|
||||
|
@ -416,8 +416,8 @@ void R_TranslatePlayerSkin (int playernum)
|
|||
}
|
||||
}
|
||||
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format,
|
||||
scaled_width, scaled_height, 0, GL_RGBA,
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format,
|
||||
scaled_width, scaled_height, 0, GL_RGBA,
|
||||
GL_UNSIGNED_BYTE, pixels);
|
||||
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
@ -452,7 +452,7 @@ void R_TranslatePlayerSkin (int playernum)
|
|||
translate[TOP_RANGE+i] = top+i;
|
||||
else
|
||||
translate[TOP_RANGE+i] = top+15-i;
|
||||
|
||||
|
||||
if (bottom < 128)
|
||||
translate[BOTTOM_RANGE+i] = bottom+i;
|
||||
else
|
||||
|
@ -574,7 +574,7 @@ R_NewMap
|
|||
void R_NewMap (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i=0 ; i<256 ; i++)
|
||||
d_lightstylevalue[i] = 264; // normal light value
|
||||
|
||||
|
@ -585,7 +585,7 @@ void R_NewMap (void)
|
|||
// FIXME: is this one short?
|
||||
for (i=0 ; i<cl.worldmodel->numleafs ; i++)
|
||||
cl.worldmodel->leafs[i].efrags = NULL;
|
||||
|
||||
|
||||
r_viewleaf = NULL;
|
||||
R_ClearParticles ();
|
||||
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -52,10 +52,10 @@ void R_DrawParticles (void)
|
|||
vec3_t up, right;
|
||||
float scale;
|
||||
qboolean alphaTestEnabled;
|
||||
|
||||
|
||||
GL_Bind(particletexture);
|
||||
alphaTestEnabled = glIsEnabled(GL_ALPHA_TEST);
|
||||
|
||||
|
||||
if (alphaTestEnabled)
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glEnable (GL_BLEND);
|
||||
|
@ -78,8 +78,8 @@ void R_DrawParticles (void)
|
|||
grav = frametime * 800 * 0.05;
|
||||
#endif
|
||||
dvel = 4*frametime;
|
||||
|
||||
for ( ;; )
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
kill = active_particles;
|
||||
if (kill && kill->die < cl.time)
|
||||
|
@ -108,7 +108,7 @@ void R_DrawParticles (void)
|
|||
}
|
||||
|
||||
// hack a scale up to keep particles from disapearing
|
||||
scale = (p->org[0] - r_origin[0])*vpn[0]
|
||||
scale = (p->org[0] - r_origin[0])*vpn[0]
|
||||
+ (p->org[1] - r_origin[1])*vpn[1]
|
||||
+ (p->org[2] - r_origin[2])*vpn[2];
|
||||
if (scale < 20)
|
||||
|
@ -140,7 +140,7 @@ void R_DrawParticles (void)
|
|||
p->org[0] += p->vel[0]*frametime;
|
||||
p->org[1] += p->vel[1]*frametime;
|
||||
p->org[2] += p->vel[2]*frametime;
|
||||
|
||||
|
||||
switch (p->type)
|
||||
{
|
||||
case pt_static:
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -113,7 +113,7 @@ void R_AddDynamicLights (msurface_t *surf)
|
|||
|
||||
local[0] -= surf->texturemins[0];
|
||||
local[1] -= surf->texturemins[1];
|
||||
|
||||
|
||||
for (t = 0 ; t<tmax ; t++)
|
||||
{
|
||||
td = local[1] - t*16;
|
||||
|
@ -290,13 +290,13 @@ texture_t *R_TextureAnimation (texture_t *base)
|
|||
if (base->alternate_anims)
|
||||
base = base->alternate_anims;
|
||||
}
|
||||
|
||||
|
||||
if (!base->anim_total)
|
||||
return base;
|
||||
|
||||
reletive = (int)(cl.time*10) % base->anim_total;
|
||||
|
||||
count = 0;
|
||||
count = 0;
|
||||
while (base->anim_min > reletive || base->anim_max <= reletive)
|
||||
{
|
||||
base = base->anim_next;
|
||||
|
@ -333,7 +333,7 @@ qboolean mtexenabled = false;
|
|||
|
||||
void GL_SelectTexture (GLenum target);
|
||||
|
||||
void GL_DisableMultitexture(void)
|
||||
void GL_DisableMultitexture(void)
|
||||
{
|
||||
if (mtexenabled) {
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
@ -342,7 +342,7 @@ void GL_DisableMultitexture(void)
|
|||
}
|
||||
}
|
||||
|
||||
void GL_EnableMultitexture(void)
|
||||
void GL_EnableMultitexture(void)
|
||||
{
|
||||
if (gl_mtexable) {
|
||||
GL_SelectTexture(TEXTURE1_SGIS);
|
||||
|
@ -435,7 +435,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
glBlendFunc (GL_ZERO, GL_ONE_MINUS_SRC_COLOR);
|
||||
|
||||
glDisable (GL_BLEND);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -493,7 +493,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
{
|
||||
lightmap_modified[i] = false;
|
||||
theRect = &lightmap_rectchange[i];
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t,
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t,
|
||||
BLOCK_WIDTH, theRect->h, gl_lightmap_format, GL_UNSIGNED_BYTE,
|
||||
lightmaps+(i* BLOCK_HEIGHT + theRect->t) *BLOCK_WIDTH*lightmap_bytes);
|
||||
theRect->l = BLOCK_WIDTH;
|
||||
|
@ -595,7 +595,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
|||
{
|
||||
lightmap_modified[i] = false;
|
||||
theRect = &lightmap_rectchange[i];
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t,
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t,
|
||||
BLOCK_WIDTH, theRect->h, gl_lightmap_format, GL_UNSIGNED_BYTE,
|
||||
lightmaps+(i* BLOCK_HEIGHT + theRect->t) *BLOCK_WIDTH*lightmap_bytes);
|
||||
theRect->l = BLOCK_WIDTH;
|
||||
|
@ -761,12 +761,12 @@ void R_BlendLightmaps (void)
|
|||
// theRect->w = BLOCK_WIDTH;
|
||||
// theRect->h = BLOCK_HEIGHT;
|
||||
// glTexImage2D (GL_TEXTURE_2D, 0, lightmap_bytes
|
||||
// , BLOCK_WIDTH, BLOCK_HEIGHT, 0,
|
||||
// , BLOCK_WIDTH, BLOCK_HEIGHT, 0,
|
||||
// gl_lightmap_format, GL_UNSIGNED_BYTE, lightmaps+i*BLOCK_WIDTH*BLOCK_HEIGHT*lightmap_bytes);
|
||||
// glTexImage2D (GL_TEXTURE_2D, 0, lightmap_bytes
|
||||
// , BLOCK_WIDTH, theRect->h, 0,
|
||||
// , BLOCK_WIDTH, theRect->h, 0,
|
||||
// gl_lightmap_format, GL_UNSIGNED_BYTE, lightmaps+(i*BLOCK_HEIGHT+theRect->t)*BLOCK_WIDTH*lightmap_bytes);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t,
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t,
|
||||
BLOCK_WIDTH, theRect->h, gl_lightmap_format, GL_UNSIGNED_BYTE,
|
||||
lightmaps+(i* BLOCK_HEIGHT + theRect->t) *BLOCK_WIDTH*lightmap_bytes);
|
||||
theRect->l = BLOCK_WIDTH;
|
||||
|
@ -776,7 +776,7 @@ void R_BlendLightmaps (void)
|
|||
}
|
||||
for ( ; p ; p=p->chain)
|
||||
{
|
||||
|
||||
|
||||
if (r_waterwarp->value && (p->flags & SURF_UNDERWATER)) {
|
||||
DrawGLWaterPolyLightmap (p);
|
||||
// if (r_waterwarp->value && ((r_viewleaf->contents==CONTENTS_EMPTY && (p->flags & SURF_UNDERWATER)))
|
||||
|
@ -831,7 +831,7 @@ void R_RenderBrushPoly (msurface_t *fa)
|
|||
EmitBothSkyLayers (fa);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
t = R_TextureAnimation (fa->texinfo->texture);
|
||||
GL_Bind (t->gl_texturenum);
|
||||
|
||||
|
@ -905,7 +905,7 @@ void R_RenderDynamicLightmaps (msurface_t *fa)
|
|||
|
||||
if (fa->flags & ( SURF_DRAWSKY | SURF_DRAWTURB) )
|
||||
return;
|
||||
|
||||
|
||||
fa->polys->chain = lightmap_polys[fa->lightmaptexturenum];
|
||||
lightmap_polys[fa->lightmaptexturenum] = fa->polys;
|
||||
|
||||
|
@ -1030,7 +1030,7 @@ void R_DrawWaterSurfaces (void)
|
|||
GL_Bind (s->texinfo->texture->gl_texturenum);
|
||||
EmitWaterPolys (s);
|
||||
}
|
||||
|
||||
|
||||
waterchain = NULL;
|
||||
} else {
|
||||
|
||||
|
@ -1046,12 +1046,12 @@ void R_DrawWaterSurfaces (void)
|
|||
continue;
|
||||
|
||||
// set modulate mode explicitly
|
||||
|
||||
|
||||
GL_Bind (t->gl_texturenum);
|
||||
|
||||
for ( ; s ; s=s->texturechain)
|
||||
EmitWaterPolys (s);
|
||||
|
||||
|
||||
t->texturechain = NULL;
|
||||
}
|
||||
|
||||
|
@ -1088,7 +1088,7 @@ void DrawTextureChains (void)
|
|||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0 ; i<cl.worldmodel->numtextures ; i++)
|
||||
{
|
||||
|
@ -1245,7 +1245,7 @@ void R_RecursiveWorldNode (mnode_t *node)
|
|||
return;
|
||||
if (R_CullBox (node->minmaxs, node->minmaxs+3))
|
||||
return;
|
||||
|
||||
|
||||
// if a leaf node, draw stuff
|
||||
if (node->contents < 0)
|
||||
{
|
||||
|
@ -1396,7 +1396,7 @@ void R_MarkLeaves (void)
|
|||
|
||||
if (r_oldviewleaf == r_viewleaf && !r_novis->value)
|
||||
return;
|
||||
|
||||
|
||||
r_visframecount++;
|
||||
r_oldviewleaf = r_viewleaf;
|
||||
|
||||
|
@ -1407,7 +1407,7 @@ void R_MarkLeaves (void)
|
|||
}
|
||||
else
|
||||
vis = Mod_LeafPVS (r_viewleaf, cl.worldmodel);
|
||||
|
||||
|
||||
for (i=0 ; i<cl.worldmodel->numleafs ; i++)
|
||||
{
|
||||
if (vis[i>>3] & (1<<(i&7)))
|
||||
|
@ -1575,7 +1575,7 @@ void BuildSurfaceDisplayList (msurface_t *fa)
|
|||
// skip co-linear points
|
||||
#define COLINEAR_EPSILON 0.001
|
||||
if ((fabs( v1[0] - v2[0] ) <= COLINEAR_EPSILON) &&
|
||||
(fabs( v1[1] - v2[1] ) <= COLINEAR_EPSILON) &&
|
||||
(fabs( v1[1] - v2[1] ) <= COLINEAR_EPSILON) &&
|
||||
(fabs( v1[2] - v2[2] ) <= COLINEAR_EPSILON))
|
||||
{
|
||||
int j;
|
||||
|
@ -1708,7 +1708,7 @@ void GL_BuildLightmaps (void)
|
|||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, lightmap_bytes
|
||||
, BLOCK_WIDTH, BLOCK_HEIGHT, 0,
|
||||
, BLOCK_WIDTH, BLOCK_HEIGHT, 0,
|
||||
gl_lightmap_format, GL_UNSIGNED_BYTE, lightmaps+i*BLOCK_WIDTH*BLOCK_HEIGHT*lightmap_bytes);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -74,7 +74,7 @@ SlowPrint ()
|
|||
Screen_Update ();
|
||||
Con_Printf ();
|
||||
|
||||
net
|
||||
net
|
||||
turn off messages option
|
||||
|
||||
the refresh is allways rendered, unless the console is full screen
|
||||
|
@ -84,14 +84,14 @@ console is:
|
|||
notify lines
|
||||
half
|
||||
full
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
int glx, gly, glwidth, glheight;
|
||||
|
||||
// only the refresh window will be updated unless these variables are flagged
|
||||
// only the refresh window will be updated unless these variables are flagged
|
||||
int scr_copytop;
|
||||
int scr_copyeverything;
|
||||
|
||||
|
@ -200,7 +200,7 @@ void SCR_DrawCenterString (void)
|
|||
else
|
||||
y = 48;
|
||||
|
||||
do
|
||||
do
|
||||
{
|
||||
// scan the width of the line
|
||||
for (l=0 ; l<40 ; l++)
|
||||
|
@ -209,11 +209,11 @@ void SCR_DrawCenterString (void)
|
|||
x = (vid.width - l*8)/2;
|
||||
for (j=0 ; j<l ; j++, x+=8)
|
||||
{
|
||||
Draw_Character (x, y, start[j]);
|
||||
Draw_Character (x, y, start[j]);
|
||||
if (!remaining--)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
y += 8;
|
||||
|
||||
while (*start && *start != '\n')
|
||||
|
@ -232,7 +232,7 @@ void SCR_CheckDrawCenterString (void)
|
|||
scr_erase_lines = scr_center_lines;
|
||||
|
||||
scr_centertime_off -= host_frametime;
|
||||
|
||||
|
||||
if (scr_centertime_off <= 0 && !cl.intermission)
|
||||
return;
|
||||
if (key_dest != key_game)
|
||||
|
@ -287,7 +287,7 @@ static void SCR_CalcRefdef (void)
|
|||
Sbar_Changed ();
|
||||
|
||||
//========================================
|
||||
|
||||
|
||||
// bound viewsize
|
||||
if (scr_viewsize->value < 30)
|
||||
Cvar_Set ("viewsize","30");
|
||||
|
@ -343,7 +343,7 @@ static void SCR_CalcRefdef (void)
|
|||
r_refdef.vrect.x = (vid.width - r_refdef.vrect.width)/2;
|
||||
if (full)
|
||||
r_refdef.vrect.y = 0;
|
||||
else
|
||||
else
|
||||
r_refdef.vrect.y = (h - r_refdef.vrect.height)/2;
|
||||
|
||||
r_refdef.fov_x = scr_fov->value;
|
||||
|
@ -447,7 +447,7 @@ SCR_DrawTurtle
|
|||
void SCR_DrawTurtle (void)
|
||||
{
|
||||
static int count;
|
||||
|
||||
|
||||
if (!scr_showturtle->value)
|
||||
return;
|
||||
|
||||
|
@ -535,7 +535,7 @@ void SCR_DrawPause (void)
|
|||
return;
|
||||
|
||||
pic = Draw_CachePic ("gfx/pause.lmp");
|
||||
Draw_Pic ( (vid.width - pic->width)/2,
|
||||
Draw_Pic ( (vid.width - pic->width)/2,
|
||||
(vid.height - 48 - pic->height)/2, pic);
|
||||
}
|
||||
|
||||
|
@ -552,9 +552,9 @@ void SCR_DrawLoading (void)
|
|||
|
||||
if (!scr_drawloading)
|
||||
return;
|
||||
|
||||
|
||||
pic = Draw_CachePic ("gfx/loading.lmp");
|
||||
Draw_Pic ( (vid.width - pic->width)/2,
|
||||
Draw_Pic ( (vid.width - pic->width)/2,
|
||||
(vid.height - 48 - pic->height)/2, pic);
|
||||
}
|
||||
|
||||
|
@ -571,10 +571,10 @@ SCR_SetUpToDrawConsole
|
|||
void SCR_SetUpToDrawConsole (void)
|
||||
{
|
||||
Con_CheckResize ();
|
||||
|
||||
|
||||
if (scr_drawloading)
|
||||
return; // never a console with loading plaque
|
||||
|
||||
|
||||
// decide on the height of the console
|
||||
if (cls.state != ca_active)
|
||||
{
|
||||
|
@ -583,12 +583,12 @@ void SCR_SetUpToDrawConsole (void)
|
|||
}
|
||||
else if (key_dest == key_console)
|
||||
{
|
||||
scr_conlines = vid.height * max(0.2,
|
||||
scr_conlines = vid.height * max(0.2,
|
||||
min(scr_consize->value, 1));
|
||||
}
|
||||
else
|
||||
scr_conlines = 0; // none visible
|
||||
|
||||
|
||||
if (scr_conlines < scr_con_current)
|
||||
{
|
||||
scr_con_current -= scr_conspeed->value * host_frametime * 4;
|
||||
|
@ -613,7 +613,7 @@ void SCR_SetUpToDrawConsole (void)
|
|||
else
|
||||
con_notifylines = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
SCR_DrawConsole
|
||||
|
@ -635,13 +635,13 @@ void SCR_DrawConsole (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SCREEN SHOTS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SCREEN SHOTS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
typedef struct _TargaHeader {
|
||||
unsigned char id_length, colormap_type, image_type;
|
||||
|
@ -652,33 +652,33 @@ typedef struct _TargaHeader {
|
|||
} TargaHeader;
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
SCR_ScreenShot_f
|
||||
==================
|
||||
*/
|
||||
void SCR_ScreenShot_f (void)
|
||||
==================
|
||||
*/
|
||||
void SCR_ScreenShot_f (void)
|
||||
{
|
||||
byte *buffer;
|
||||
char pcxname[80];
|
||||
char pcxname[80];
|
||||
char checkname[MAX_OSPATH];
|
||||
int i, c, temp;
|
||||
//
|
||||
// find a file name to save it to
|
||||
//
|
||||
//
|
||||
// find a file name to save it to
|
||||
//
|
||||
strcpy(pcxname,"quake00.tga");
|
||||
|
||||
for (i=0 ; i<=99 ; i++)
|
||||
{
|
||||
pcxname[5] = i/10 + '0';
|
||||
pcxname[6] = i%10 + '0';
|
||||
|
||||
for (i=0 ; i<=99 ; i++)
|
||||
{
|
||||
pcxname[5] = i/10 + '0';
|
||||
pcxname[6] = i%10 + '0';
|
||||
snprintf(checkname, sizeof(checkname), "%s/%s", com_gamedir, pcxname);
|
||||
if (Sys_FileTime(checkname) == -1)
|
||||
break; // file doesn't exist
|
||||
}
|
||||
if (i==100)
|
||||
}
|
||||
if (i==100)
|
||||
{
|
||||
Con_Printf ("SCR_ScreenShot_f: Couldn't create a PCX file\n");
|
||||
Con_Printf ("SCR_ScreenShot_f: Couldn't create a PCX file\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -692,7 +692,7 @@ void SCR_ScreenShot_f (void)
|
|||
buffer[15] = glheight>>8;
|
||||
buffer[16] = 24; // pixel size
|
||||
|
||||
glReadPixels (glx, gly, glwidth, glheight, GL_RGB, GL_UNSIGNED_BYTE, buffer+18 );
|
||||
glReadPixels (glx, gly, glwidth, glheight, GL_RGB, GL_UNSIGNED_BYTE, buffer+18 );
|
||||
|
||||
// swap rgb to bgr
|
||||
c = 18+glwidth*glheight*3;
|
||||
|
@ -706,27 +706,27 @@ void SCR_ScreenShot_f (void)
|
|||
|
||||
free (buffer);
|
||||
Con_Printf ("Wrote %s\n", pcxname);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
WritePCXfile
|
||||
==============
|
||||
*/
|
||||
/*
|
||||
==============
|
||||
WritePCXfile
|
||||
==============
|
||||
*/
|
||||
void WritePCXfile (char *filename, byte *data, int width, int height,
|
||||
int rowbytes, byte *palette, qboolean upload)
|
||||
int rowbytes, byte *palette, qboolean upload)
|
||||
{
|
||||
int i, j, length;
|
||||
pcx_t *pcx;
|
||||
byte *pack;
|
||||
|
||||
|
||||
pcx = Hunk_TempAlloc (width*height*2+1000);
|
||||
if (pcx == NULL)
|
||||
{
|
||||
Con_Printf("SCR_ScreenShot_f: not enough memory\n");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pcx->manufacturer = 0x0a; // PCX id
|
||||
pcx->version = 5; // 256 color
|
||||
pcx->encoding = 1; // uncompressed
|
||||
|
@ -764,13 +764,13 @@ void WritePCXfile (char *filename, byte *data, int width, int height,
|
|||
data += rowbytes - width;
|
||||
data -= rowbytes * 2;
|
||||
}
|
||||
|
||||
|
||||
// write the palette
|
||||
*pack++ = 0x0c; // palette ID byte
|
||||
for (i=0 ; i<768 ; i++)
|
||||
*pack++ = *palette++;
|
||||
|
||||
// write output file
|
||||
|
||||
// write output file
|
||||
length = pack - (byte *)pcx;
|
||||
#ifdef QUAKEWORLD
|
||||
if (upload)
|
||||
|
@ -778,8 +778,8 @@ void WritePCXfile (char *filename, byte *data, int width, int height,
|
|||
else
|
||||
#endif
|
||||
COM_WriteFile (filename, pcx, length);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
@ -859,17 +859,17 @@ void SCR_DrawStringToSnap (const char *s, byte *buf, int x, int y, int width)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
SCR_RSShot_f
|
||||
==================
|
||||
*/
|
||||
void SCR_RSShot_f (void)
|
||||
{
|
||||
==================
|
||||
*/
|
||||
void SCR_RSShot_f (void)
|
||||
{
|
||||
// int i;
|
||||
int x, y;
|
||||
unsigned char *src, *dest;
|
||||
char pcxname[80];
|
||||
char pcxname[80];
|
||||
// char checkname[MAX_OSPATH];
|
||||
unsigned char *newbuf;
|
||||
int w, h;
|
||||
|
@ -889,32 +889,32 @@ void SCR_RSShot_f (void)
|
|||
Con_Printf("Remote screen shot requested.\n");
|
||||
|
||||
#if 0
|
||||
//
|
||||
// find a file name to save it to
|
||||
//
|
||||
//
|
||||
// find a file name to save it to
|
||||
//
|
||||
strcpy(pcxname,"mquake00.pcx");
|
||||
|
||||
for (i=0 ; i<=99 ; i++)
|
||||
{
|
||||
pcxname[6] = i/10 + '0';
|
||||
pcxname[7] = i%10 + '0';
|
||||
|
||||
for (i=0 ; i<=99 ; i++)
|
||||
{
|
||||
pcxname[6] = i/10 + '0';
|
||||
pcxname[7] = i%10 + '0';
|
||||
snprintf(checkname, sizeof(checkname), "%s/%s", com_gamedir, pcxname);
|
||||
if (Sys_FileTime(checkname) == -1)
|
||||
break; // file doesn't exist
|
||||
}
|
||||
if (i==100)
|
||||
}
|
||||
if (i==100)
|
||||
{
|
||||
Con_Printf ("SCR_ScreenShot_f: Couldn't create a PCX");
|
||||
Con_Printf ("SCR_ScreenShot_f: Couldn't create a PCX");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// save the pcx file
|
||||
//
|
||||
|
||||
//
|
||||
// save the pcx file
|
||||
//
|
||||
newbuf = malloc(glheight * glwidth * 3);
|
||||
|
||||
glReadPixels (glx, gly, glwidth, glheight, GL_RGB, GL_UNSIGNED_BYTE, newbuf );
|
||||
glReadPixels (glx, gly, glwidth, glheight, GL_RGB, GL_UNSIGNED_BYTE, newbuf );
|
||||
|
||||
w = (vid.width < RSSHOT_WIDTH) ? glwidth : RSSHOT_WIDTH;
|
||||
h = (vid.height < RSSHOT_HEIGHT) ? glheight : RSSHOT_HEIGHT;
|
||||
|
@ -986,7 +986,7 @@ void SCR_RSShot_f (void)
|
|||
free(newbuf);
|
||||
|
||||
Con_Printf ("Wrote %s\n", pcxname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1007,7 +1007,7 @@ void SCR_BeginLoadingPlaque (void)
|
|||
return;
|
||||
if (cls.signon != SIGNONS)
|
||||
return;
|
||||
|
||||
|
||||
// redraw with no console and the loading plaque
|
||||
Con_ClearNotify ();
|
||||
scr_centertime_off = 0;
|
||||
|
@ -1053,7 +1053,7 @@ void SCR_DrawNotifyString (void)
|
|||
|
||||
y = vid.height*0.35;
|
||||
|
||||
do
|
||||
do
|
||||
{
|
||||
// scan the width of the line
|
||||
for (l=0 ; l<40 ; l++)
|
||||
|
@ -1061,8 +1061,8 @@ void SCR_DrawNotifyString (void)
|
|||
break;
|
||||
x = (vid.width - l*8)/2;
|
||||
for (j=0 ; j<l ; j++, x+=8)
|
||||
Draw_Character (x, y, start[j]);
|
||||
|
||||
Draw_Character (x, y, start[j]);
|
||||
|
||||
y += 8;
|
||||
|
||||
while (*start && *start != '\n')
|
||||
|
@ -1079,7 +1079,7 @@ void SCR_DrawNotifyString (void)
|
|||
SCR_ModalMessage
|
||||
|
||||
Displays a text string in the center of the screen and waits for a Y or N
|
||||
keypress.
|
||||
keypress.
|
||||
==================
|
||||
*/
|
||||
int SCR_ModalMessage (char *text)
|
||||
|
@ -1090,13 +1090,13 @@ int SCR_ModalMessage (char *text)
|
|||
#endif
|
||||
|
||||
scr_notifystring = text;
|
||||
|
||||
|
||||
// draw a fresh screen
|
||||
scr_fullupdate = 0;
|
||||
scr_drawdialog = true;
|
||||
SCR_UpdateScreen ();
|
||||
scr_drawdialog = false;
|
||||
|
||||
|
||||
S_ClearBuffer (); // so dma doesn't loop current sound
|
||||
|
||||
do
|
||||
|
@ -1124,9 +1124,9 @@ Brings the console down and fades the palettes back to normal
|
|||
void SCR_BringDownConsole (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
scr_centertime_off = 0;
|
||||
|
||||
|
||||
for (i=0 ; i<20 && scr_conlines != scr_con_current ; i++)
|
||||
SCR_UpdateScreen ();
|
||||
|
||||
|
@ -1140,20 +1140,20 @@ void SCR_TileClear (void)
|
|||
// left
|
||||
Draw_TileClear (0, 0, r_refdef.vrect.x, vid.height - sb_lines);
|
||||
// right
|
||||
Draw_TileClear (r_refdef.vrect.x + r_refdef.vrect.width, 0,
|
||||
vid.width - r_refdef.vrect.x + r_refdef.vrect.width,
|
||||
Draw_TileClear (r_refdef.vrect.x + r_refdef.vrect.width, 0,
|
||||
vid.width - r_refdef.vrect.x + r_refdef.vrect.width,
|
||||
vid.height - sb_lines);
|
||||
}
|
||||
if (r_refdef.vrect.y > 0) {
|
||||
// top
|
||||
Draw_TileClear (r_refdef.vrect.x, 0,
|
||||
r_refdef.vrect.x + r_refdef.vrect.width,
|
||||
Draw_TileClear (r_refdef.vrect.x, 0,
|
||||
r_refdef.vrect.x + r_refdef.vrect.width,
|
||||
r_refdef.vrect.y);
|
||||
// bottom
|
||||
Draw_TileClear (r_refdef.vrect.x,
|
||||
r_refdef.vrect.y + r_refdef.vrect.height,
|
||||
r_refdef.vrect.width,
|
||||
vid.height - sb_lines -
|
||||
r_refdef.vrect.y + r_refdef.vrect.height,
|
||||
r_refdef.vrect.width,
|
||||
vid.height - sb_lines -
|
||||
(r_refdef.vrect.height + r_refdef.vrect.y));
|
||||
}
|
||||
}
|
||||
|
@ -1202,7 +1202,7 @@ void SCR_UpdateScreen (void)
|
|||
}
|
||||
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
|
||||
|
||||
//
|
||||
// determine size of refresh window
|
||||
//
|
||||
|
@ -1219,7 +1219,7 @@ void SCR_UpdateScreen (void)
|
|||
// do 3D refresh drawing, and then update the screen
|
||||
//
|
||||
SCR_SetUpToDrawConsole ();
|
||||
|
||||
|
||||
V_RenderView ();
|
||||
|
||||
GL_Set2D ();
|
||||
|
@ -1258,7 +1258,7 @@ void SCR_UpdateScreen (void)
|
|||
{
|
||||
if (crosshair->value)
|
||||
Draw_Crosshair();
|
||||
|
||||
|
||||
SCR_DrawRam ();
|
||||
SCR_DrawNet ();
|
||||
SCR_DrawFPS ();
|
||||
|
@ -1266,7 +1266,7 @@ void SCR_UpdateScreen (void)
|
|||
SCR_DrawPause ();
|
||||
SCR_CheckDrawCenterString ();
|
||||
Sbar_Draw ();
|
||||
SCR_DrawConsole ();
|
||||
SCR_DrawConsole ();
|
||||
M_Draw ();
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -223,7 +223,7 @@ void VID_SetPalette (unsigned char *palette)
|
|||
g = pal[1];
|
||||
b = pal[2];
|
||||
pal += 3;
|
||||
|
||||
|
||||
// v = (255<<24) + (r<<16) + (g<<8) + (b<<0);
|
||||
// v = (255<<0) + (r<<8) + (g<<16) + (b<<24);
|
||||
v = (255<<24) + (r<<0) + (g<<8) + (b<<16);
|
||||
|
@ -352,7 +352,7 @@ qboolean VID_Is8bit(void)
|
|||
}
|
||||
|
||||
#ifdef GL_EXT_SHARED
|
||||
void VID_Init8bitPalette()
|
||||
void VID_Init8bitPalette()
|
||||
{
|
||||
// Check for 8bit Extensions and initialize them.
|
||||
int i;
|
||||
|
@ -378,7 +378,7 @@ void VID_Init8bitPalette()
|
|||
|
||||
#else
|
||||
|
||||
void VID_Init8bitPalette(void)
|
||||
void VID_Init8bitPalette(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -410,7 +410,7 @@ void VID_Init(unsigned char *palette)
|
|||
#ifdef HAS_DGA
|
||||
vid_dga_mouseaccel = Cvar_Get("vid_dga_mouseaccel","1",CVAR_ARCHIVE,
|
||||
"None");
|
||||
#endif
|
||||
#endif
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
vid.colormap = host_colormap;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
gl_vidlinux_3dfx.c - OpenGL device driver for 3Dfx chipsets running Linux
|
||||
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
||||
Portions Copyright (C) 1999,2000 Nelson Rush.
|
||||
|
@ -13,7 +13,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.
|
||||
|
||||
|
@ -51,7 +51,7 @@ static cvar_t *vid_redrawfull;
|
|||
static cvar_t *vid_waitforrefresh;
|
||||
cvar_t *gl_ztrick;
|
||||
extern cvar_t *gl_triplebuffer;
|
||||
|
||||
|
||||
static fxMesaContext fc = NULL;
|
||||
static int scr_width, scr_height;
|
||||
static qboolean is8bit = 0;
|
||||
|
@ -148,7 +148,7 @@ void VID_SetPalette (unsigned char *palette)
|
|||
g = pal[1];
|
||||
b = pal[2];
|
||||
pal += 3;
|
||||
|
||||
|
||||
// v = (255<<24) + (r<<16) + (g<<8) + (b<<0);
|
||||
// v = (255<<0) + (r<<8) + (g<<16) + (b<<24);
|
||||
v = (255<<24) + (r<<0) + (g<<8) + (b<<16);
|
||||
|
@ -272,7 +272,7 @@ void GL_EndRendering (void)
|
|||
fxMesaSwapBuffers();
|
||||
}
|
||||
|
||||
static int resolutions[][3]={
|
||||
static int resolutions[][3]={
|
||||
{ 320, 200, GR_RESOLUTION_320x200 },
|
||||
{ 320, 240, GR_RESOLUTION_320x240 },
|
||||
{ 400, 256, GR_RESOLUTION_400x256 },
|
||||
|
@ -337,7 +337,7 @@ findres(int *width, int *height)
|
|||
return resolutions[i][2];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
*width = 640;
|
||||
*height = 480;
|
||||
return GR_RESOLUTION_640x480;
|
||||
|
@ -349,7 +349,7 @@ qboolean VID_Is8bit(void)
|
|||
}
|
||||
|
||||
#ifdef GL_EXT_SHARED
|
||||
void VID_Init8bitPalette()
|
||||
void VID_Init8bitPalette()
|
||||
{
|
||||
// Check for 8bit Extensions and initialize them.
|
||||
int i;
|
||||
|
@ -376,7 +376,7 @@ void VID_Init8bitPalette()
|
|||
#else
|
||||
extern void gl3DfxSetPaletteEXT(GLuint *pal);
|
||||
|
||||
void VID_Init8bitPalette(void)
|
||||
void VID_Init8bitPalette(void)
|
||||
{
|
||||
// Check for 8bit Extensions and initialize them.
|
||||
int i;
|
||||
|
@ -417,7 +417,7 @@ void VID_Init(unsigned char *palette)
|
|||
"None");
|
||||
// Cvar_RegisterVariable (&gl_ztrick);
|
||||
gl_ztrick = Cvar_Get ("gl_ztrick","0",CVAR_ARCHIVE,"None");
|
||||
|
||||
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
vid.colormap = host_colormap;
|
||||
|
@ -456,7 +456,7 @@ void VID_Init(unsigned char *palette)
|
|||
if (vid.conheight < 200)
|
||||
vid.conheight = 200;
|
||||
|
||||
fc = fxMesaCreateContext(0, findres(&width, &height), GR_REFRESH_75Hz,
|
||||
fc = fxMesaCreateContext(0, findres(&width, &height), GR_REFRESH_75Hz,
|
||||
attribs);
|
||||
if (!fc)
|
||||
Sys_Error("Unable to create 3DFX context.\n");
|
||||
|
@ -497,7 +497,7 @@ void VID_ExtraOptionDraw(unsigned int options_draw_cursor)
|
|||
{
|
||||
/* Port specific Options menu entrys */
|
||||
}
|
||||
|
||||
|
||||
void VID_ExtraOptionCmd(int option_cursor)
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
gl_vidnt.c - OpenGL low-level video driver for Windows NT/9x
|
||||
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
||||
Portions Copyright (C) 1999,2000 Nelson Rush.
|
||||
|
@ -13,7 +13,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.
|
||||
|
||||
|
@ -522,7 +522,7 @@ void CheckTextureExtensions (void)
|
|||
if (!texture_ext || COM_CheckParm ("-gl11") )
|
||||
{
|
||||
hInstGL = LoadLibrary("opengl32.dll");
|
||||
|
||||
|
||||
if (hInstGL == NULL)
|
||||
Sys_Error ("Couldn't load opengl32.dll\n");
|
||||
|
||||
|
@ -579,7 +579,7 @@ int texture_mode = GL_LINEAR;
|
|||
int texture_extension_number = 1;
|
||||
|
||||
#ifdef _WIN32
|
||||
void CheckMultiTextureExtensions(void)
|
||||
void CheckMultiTextureExtensions(void)
|
||||
{
|
||||
if (strstr(gl_extensions, "GL_SGIS_multitexture ") && !COM_CheckParm("-nomtex")) {
|
||||
Con_Printf("Multitexture extensions found.\n");
|
||||
|
@ -589,7 +589,7 @@ void CheckMultiTextureExtensions(void)
|
|||
}
|
||||
}
|
||||
#else
|
||||
void CheckMultiTextureExtensions(void)
|
||||
void CheckMultiTextureExtensions(void)
|
||||
{
|
||||
gl_mtexable = true;
|
||||
}
|
||||
|
@ -729,7 +729,7 @@ void VID_SetPalette (unsigned char *palette)
|
|||
g = pal[1];
|
||||
b = pal[2];
|
||||
pal += 3;
|
||||
|
||||
|
||||
// v = (255<<24) + (r<<16) + (g<<8) + (b<<0);
|
||||
// v = (255<<0) + (r<<8) + (g<<16) + (b<<24);
|
||||
v = (255<<24) + (r<<0) + (g<<8) + (b<<16);
|
||||
|
@ -769,7 +769,7 @@ BOOL gammaworks;
|
|||
void VID_ShiftPalette (unsigned char *palette)
|
||||
{
|
||||
extern byte ramps[3][256];
|
||||
|
||||
|
||||
// VID_SetPalette (palette);
|
||||
|
||||
// gammaworks = SetDeviceGammaRamp (maindc, ramps);
|
||||
|
@ -830,7 +830,7 @@ BOOL bSetupPixelFormat(HDC hDC)
|
|||
0, // shift bit ignored
|
||||
0, // no accumulation buffer
|
||||
0, 0, 0, 0, // accum bits ignored
|
||||
32, // 32-bit z-buffer
|
||||
32, // 32-bit z-buffer
|
||||
0, // no stencil buffer
|
||||
0, // no auxiliary buffer
|
||||
PFD_MAIN_PLANE, // main layer
|
||||
|
@ -856,49 +856,49 @@ BOOL bSetupPixelFormat(HDC hDC)
|
|||
|
||||
|
||||
|
||||
byte scantokey[128] =
|
||||
{
|
||||
// 0 1 2 3 4 5 6 7
|
||||
// 8 9 A B C D E F
|
||||
0 , 27, '1', '2', '3', '4', '5', '6',
|
||||
'7', '8', '9', '0', '-', '=', K_BACKSPACE, 9, // 0
|
||||
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i',
|
||||
'o', 'p', '[', ']', 13 , K_CTRL,'a', 's', // 1
|
||||
'd', 'f', 'g', 'h', 'j', 'k', 'l', ';',
|
||||
'\'' , '`', K_SHIFT,'\\', 'z', 'x', 'c', 'v', // 2
|
||||
'b', 'n', 'm', ',', '.', '/', K_SHIFT,'*',
|
||||
K_ALT,' ', K_CAPSLOCK , K_F1, K_F2, K_F3, K_F4, K_F5, // 3
|
||||
K_F6, K_F7, K_F8, K_F9, K_F10, K_PAUSE , 0 , K_HOME,
|
||||
K_UPARROW,K_PGUP,'-',K_LEFTARROW,'5',K_RIGHTARROW,'+',K_END, //4
|
||||
K_DOWNARROW,K_PGDN,K_INS,K_DEL,0,0, 0, K_F11,
|
||||
K_F12,0 , 0 , 0 , 0 , 0 , 0 , 0, // 5
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, // 6
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 // 7
|
||||
};
|
||||
byte scantokey[128] =
|
||||
{
|
||||
// 0 1 2 3 4 5 6 7
|
||||
// 8 9 A B C D E F
|
||||
0 , 27, '1', '2', '3', '4', '5', '6',
|
||||
'7', '8', '9', '0', '-', '=', K_BACKSPACE, 9, // 0
|
||||
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i',
|
||||
'o', 'p', '[', ']', 13 , K_CTRL,'a', 's', // 1
|
||||
'd', 'f', 'g', 'h', 'j', 'k', 'l', ';',
|
||||
'\'' , '`', K_SHIFT,'\\', 'z', 'x', 'c', 'v', // 2
|
||||
'b', 'n', 'm', ',', '.', '/', K_SHIFT,'*',
|
||||
K_ALT,' ', K_CAPSLOCK , K_F1, K_F2, K_F3, K_F4, K_F5, // 3
|
||||
K_F6, K_F7, K_F8, K_F9, K_F10, K_PAUSE , 0 , K_HOME,
|
||||
K_UPARROW,K_PGUP,'-',K_LEFTARROW,'5',K_RIGHTARROW,'+',K_END, //4
|
||||
K_DOWNARROW,K_PGDN,K_INS,K_DEL,0,0, 0, K_F11,
|
||||
K_F12,0 , 0 , 0 , 0 , 0 , 0 , 0, // 5
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, // 6
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 // 7
|
||||
};
|
||||
|
||||
byte shiftscantokey[128] =
|
||||
{
|
||||
// 0 1 2 3 4 5 6 7
|
||||
// 8 9 A B C D E F
|
||||
0 , 27, '!', '@', '#', '$', '%', '^',
|
||||
'&', '*', '(', ')', '_', '+', K_BACKSPACE, 9, // 0
|
||||
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I',
|
||||
'O', 'P', '{', '}', 13 , K_CTRL,'A', 'S', // 1
|
||||
'D', 'F', 'G', 'H', 'J', 'K', 'L', ':',
|
||||
'"' , '~', K_SHIFT,'|', 'Z', 'X', 'C', 'V', // 2
|
||||
'B', 'N', 'M', '<', '>', '?', K_SHIFT,'*',
|
||||
K_ALT,' ', K_CAPSLOCK , K_F1, K_F2, K_F3, K_F4, K_F5, // 3
|
||||
K_F6, K_F7, K_F8, K_F9, K_F10, K_PAUSE , 0 , K_HOME,
|
||||
K_UPARROW,K_PGUP,'_',K_LEFTARROW,'%',K_RIGHTARROW,'+',K_END, //4
|
||||
K_DOWNARROW,K_PGDN,K_INS,K_DEL,0,0, 0, K_F11,
|
||||
K_F12,0 , 0 , 0 , 0 , 0 , 0 , 0, // 5
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, // 6
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 // 7
|
||||
};
|
||||
byte shiftscantokey[128] =
|
||||
{
|
||||
// 0 1 2 3 4 5 6 7
|
||||
// 8 9 A B C D E F
|
||||
0 , 27, '!', '@', '#', '$', '%', '^',
|
||||
'&', '*', '(', ')', '_', '+', K_BACKSPACE, 9, // 0
|
||||
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I',
|
||||
'O', 'P', '{', '}', 13 , K_CTRL,'A', 'S', // 1
|
||||
'D', 'F', 'G', 'H', 'J', 'K', 'L', ':',
|
||||
'"' , '~', K_SHIFT,'|', 'Z', 'X', 'C', 'V', // 2
|
||||
'B', 'N', 'M', '<', '>', '?', K_SHIFT,'*',
|
||||
K_ALT,' ', K_CAPSLOCK , K_F1, K_F2, K_F3, K_F4, K_F5, // 3
|
||||
K_F6, K_F7, K_F8, K_F9, K_F10, K_PAUSE , 0 , K_HOME,
|
||||
K_UPARROW,K_PGUP,'_',K_LEFTARROW,'%',K_RIGHTARROW,'+',K_END, //4
|
||||
K_DOWNARROW,K_PGDN,K_INS,K_DEL,0,0, 0, K_F11,
|
||||
K_F12,0 , 0 , 0 , 0 , 0 , 0 , 0, // 5
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, // 6
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 // 7
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
|
@ -934,7 +934,7 @@ ClearAllStates
|
|||
void ClearAllStates (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
// send an up event for each key, to make sure the server clears them all
|
||||
for (i=0 ; i<256 ; i++)
|
||||
{
|
||||
|
@ -1002,7 +1002,7 @@ void AppActivate(BOOL fActive, BOOL minimize)
|
|||
{
|
||||
IN_DeactivateMouse ();
|
||||
IN_ShowMouse ();
|
||||
if (vid_canalttab) {
|
||||
if (vid_canalttab) {
|
||||
ChangeDisplaySettings (NULL, 0);
|
||||
vid_wassuspended = true;
|
||||
}
|
||||
|
@ -1050,7 +1050,7 @@ LONG WINAPI MainWndProc (
|
|||
case WM_SYSKEYDOWN:
|
||||
Key_Event (MapKey(lParam), true);
|
||||
break;
|
||||
|
||||
|
||||
case WM_KEYUP:
|
||||
case WM_SYSKEYUP:
|
||||
Key_Event (MapKey(lParam), false);
|
||||
|
@ -1087,7 +1087,7 @@ LONG WINAPI MainWndProc (
|
|||
// JACK: This is the mouse wheel with the Intellimouse
|
||||
// Its delta is either positive or neg, and we generate the proper
|
||||
// Event.
|
||||
case WM_MOUSEWHEEL:
|
||||
case WM_MOUSEWHEEL:
|
||||
if ((short) HIWORD(wParam) > 0) {
|
||||
Key_Event(K_MWHEELUP, true);
|
||||
Key_Event(K_MWHEELUP, false);
|
||||
|
@ -1153,7 +1153,7 @@ int VID_NumModes (void)
|
|||
return nummodes;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
VID_GetModePtr
|
||||
|
@ -1270,7 +1270,7 @@ VID_DescribeMode_f
|
|||
void VID_DescribeMode_f (void)
|
||||
{
|
||||
int t, modenum;
|
||||
|
||||
|
||||
modenum = Q_atoi (Cmd_Argv(1));
|
||||
|
||||
t = leavecurrentmode;
|
||||
|
@ -1513,7 +1513,7 @@ qboolean VID_Is8bit() {
|
|||
|
||||
#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
|
||||
|
||||
void VID_Init8bitPalette()
|
||||
void VID_Init8bitPalette()
|
||||
{
|
||||
// Check for 8bit Extensions and initialize them.
|
||||
int i;
|
||||
|
@ -1596,7 +1596,7 @@ void VID_Init (unsigned char *palette)
|
|||
vid_nopageflip = Cvar_Get ("_vid_nopageflip","0",CVAR_ARCHIVE,"None");
|
||||
_vid_wait_override = Cvar_Get ("_vid_wait_override","0",CVAR_ARCHIVE,
|
||||
"None");
|
||||
|
||||
|
||||
_vid_default_mode = Cvar_Get ("_vid_default_mode","0",CVAR_ARCHIVE,
|
||||
"None");
|
||||
_vid_default_mode_win = Cvar_Get ("_vid_default_mode_win","0",
|
||||
|
@ -1890,7 +1890,7 @@ void VID_MenuDraw (void)
|
|||
|
||||
vid_wmodes = 0;
|
||||
lnummodes = VID_NumModes ();
|
||||
|
||||
|
||||
for (i=1 ; (i<lnummodes) && (vid_wmodes < MAX_MODEDESCS) ; i++)
|
||||
{
|
||||
ptr = VID_GetModeDescription (i);
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -45,9 +45,9 @@ void V_UpdatePalette (void)
|
|||
qboolean force;
|
||||
|
||||
V_CalcPowerupCshift ();
|
||||
|
||||
|
||||
new = false;
|
||||
|
||||
|
||||
for (i=0 ; i<NUM_CSHIFTS ; i++)
|
||||
{
|
||||
if (cl.cshifts[i].percent != cl.prev_cshifts[i].percent)
|
||||
|
@ -106,19 +106,19 @@ void V_UpdatePalette (void)
|
|||
|
||||
basepal = host_basepal;
|
||||
newpal = pal;
|
||||
|
||||
|
||||
for (i=0 ; i<256 ; i++)
|
||||
{
|
||||
ir = basepal[0];
|
||||
ig = basepal[1];
|
||||
ib = basepal[2];
|
||||
basepal += 3;
|
||||
|
||||
|
||||
newpal[0] = ramps[0][ir];
|
||||
newpal[1] = ramps[1][ig];
|
||||
newpal[2] = ramps[2][ib];
|
||||
newpal += 3;
|
||||
}
|
||||
|
||||
VID_ShiftPalette (pal);
|
||||
VID_ShiftPalette (pal);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
gl_warp.c
|
||||
|
||||
|
||||
Sky and water polygons
|
||||
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
||||
Please see the file "AUTHORS" for a list of contributors
|
||||
|
@ -15,7 +15,7 @@
|
|||
|
||||
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.
|
||||
|
||||
|
@ -355,7 +355,7 @@ LoadTGA (QFile *fin, byte **targa_rgba) {
|
|||
targa_header.id_length = Qgetc(fin);
|
||||
targa_header.colormap_type = Qgetc(fin);
|
||||
targa_header.image_type = Qgetc(fin);
|
||||
|
||||
|
||||
targa_header.colormap_index = QgetLittleShort(fin);
|
||||
targa_header.colormap_length = QgetLittleShort(fin);
|
||||
targa_header.colormap_size = Qgetc(fin);
|
||||
|
@ -366,7 +366,7 @@ LoadTGA (QFile *fin, byte **targa_rgba) {
|
|||
targa_header.pixel_size = Qgetc(fin);
|
||||
targa_header.attributes = Qgetc(fin);
|
||||
|
||||
if (targa_header.image_type!=2 && targa_header.image_type!=10)
|
||||
if (targa_header.image_type!=2 && targa_header.image_type!=10)
|
||||
Sys_Error ("LoadTGA: Only type 2 and 10 targa RGB images supported\n");
|
||||
|
||||
if (targa_header.colormap_type !=0 ||
|
||||
|
@ -379,17 +379,17 @@ LoadTGA (QFile *fin, byte **targa_rgba) {
|
|||
numPixels = columns * rows;
|
||||
|
||||
*targa_rgba = malloc (numPixels*4);
|
||||
|
||||
|
||||
if (targa_header.id_length != 0)
|
||||
Qseek(fin, targa_header.id_length, SEEK_CUR); // skip TARGA image comment
|
||||
|
||||
|
||||
if (targa_header.image_type==2) { // Uncompressed, RGB images
|
||||
for(row=rows-1; row>=0; row--) {
|
||||
pixbuf = *targa_rgba + row*columns*4;
|
||||
for(column=0; column<columns; column++) {
|
||||
switch (targa_header.pixel_size) {
|
||||
case 24:
|
||||
|
||||
|
||||
blue = Qgetc(fin);
|
||||
green = Qgetc(fin);
|
||||
red = Qgetc(fin);
|
||||
|
@ -434,7 +434,7 @@ LoadTGA (QFile *fin, byte **targa_rgba) {
|
|||
alphabyte = Qgetc(fin);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
for(j=0;j<packetSize;j++) {
|
||||
*pixbuf++=red;
|
||||
*pixbuf++=green;
|
||||
|
@ -482,7 +482,7 @@ LoadTGA (QFile *fin, byte **targa_rgba) {
|
|||
else
|
||||
goto breakOut;
|
||||
pixbuf = *targa_rgba + row*columns*4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -537,7 +537,7 @@ vec3_t skyclip[6] = {
|
|||
{0,-1,1},
|
||||
{0,1,1},
|
||||
{1,0,1},
|
||||
{-1,0,1}
|
||||
{-1,0,1}
|
||||
};
|
||||
int c_sky;
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
108
common/host.c
108
common/host.c
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
host.c
|
||||
|
||||
|
||||
(description)
|
||||
|
||||
|
||||
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
||||
Please see the file "AUTHORS" for a list of contributors
|
||||
|
||||
Author: Jeff Teunissen <deek@quakeforge.net>
|
||||
Date: 09 Feb 2000
|
||||
|
||||
|
||||
This file is part of the QuakeForge Core system.
|
||||
|
||||
|
||||
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
|
||||
|
@ -18,13 +18,13 @@
|
|||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
@ -129,7 +129,7 @@ Host_ClearMemory (void)
|
|||
|
||||
#ifdef UQUAKE
|
||||
cls.signon = 0;
|
||||
|
||||
|
||||
memset (&sv, 0, sizeof(sv));
|
||||
#endif
|
||||
memset (&cl, 0, sizeof(cl));
|
||||
|
@ -151,14 +151,14 @@ Host_EndGame ( char *message, ... )
|
|||
va_start (argptr, message);
|
||||
vsnprintf (string, sizeof(string), message, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
|
||||
Con_Printf ("\n===========================\n");
|
||||
Con_Printf ("Host_EndGame: %s\n", string);
|
||||
Con_Printf ("===========================\n\n");
|
||||
|
||||
|
||||
#if QUAKEWORLD
|
||||
CL_Disconnect ();
|
||||
|
||||
|
||||
longjmp (host_abort, 1);
|
||||
#elif UQUAKE
|
||||
cl.paused = false;
|
||||
|
@ -168,7 +168,7 @@ Host_EndGame ( char *message, ... )
|
|||
|
||||
if ( cls.state == ca_dedicated )
|
||||
Sys_Error ("Host_EndGame: %s\n",string); // dedicated servers exit
|
||||
|
||||
|
||||
if ( cls.demonum != -1 )
|
||||
CL_NextDemo ();
|
||||
else
|
||||
|
@ -236,7 +236,7 @@ Host_FilterTime ( float time )
|
|||
#ifdef UQUAKE
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -272,7 +272,7 @@ Host_FrameMain ( float time )
|
|||
// decide the simulation time
|
||||
if ( !Host_FilterTime(time) )
|
||||
return;
|
||||
|
||||
|
||||
// get new events
|
||||
IN_SendKeyEvents ();
|
||||
IN_Frame();
|
||||
|
@ -311,14 +311,14 @@ Host_FrameMain ( float time )
|
|||
// if running the server locally, make intentions now
|
||||
if (sv.active)
|
||||
CL_SendCmd ();
|
||||
|
||||
|
||||
// check for commands typed to the host
|
||||
Host_GetConsoleCommands ();
|
||||
|
||||
|
||||
if (sv.active)
|
||||
SV_Frame (); // Send frame to clients
|
||||
|
||||
/*
|
||||
/*
|
||||
if running the server remotely, send intentions now after incoming
|
||||
messages have been read
|
||||
*/
|
||||
|
@ -341,7 +341,7 @@ Host_FrameMain ( float time )
|
|||
|
||||
if (host_speeds->value)
|
||||
time2 = Sys_DoubleTime ();
|
||||
|
||||
|
||||
// update audio
|
||||
#ifdef QUAKEWORLD
|
||||
if (cls.state == ca_active) {
|
||||
|
@ -353,7 +353,7 @@ Host_FrameMain ( float time )
|
|||
}
|
||||
else
|
||||
S_Update (vec3_origin, vec3_origin, vec3_origin, vec3_origin);
|
||||
|
||||
|
||||
CDAudio_Update();
|
||||
|
||||
if (host_speeds->value) {
|
||||
|
@ -393,14 +393,14 @@ Host_Frame ( float time )
|
|||
Host_FrameMain (time);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
time1 = Sys_DoubleTime ();
|
||||
Host_FrameMain (time);
|
||||
time2 = Sys_DoubleTime ();
|
||||
|
||||
time2 = Sys_DoubleTime ();
|
||||
|
||||
timetotal += time2 - time1;
|
||||
timecount++;
|
||||
|
||||
|
||||
if (timecount < 1000)
|
||||
return;
|
||||
|
||||
|
@ -429,25 +429,25 @@ Host_Error ( char *error, ... )
|
|||
va_list argptr;
|
||||
char string[1024];
|
||||
static qboolean inerror = false;
|
||||
|
||||
|
||||
if ( inerror ) {
|
||||
Sys_Error ("Host_Error: Called recursively from within an error");
|
||||
}
|
||||
inerror = true;
|
||||
|
||||
|
||||
va_start (argptr, error);
|
||||
vsnprintf (string, sizeof(string), error, argptr);
|
||||
va_end (argptr);
|
||||
Con_Printf ("Host_Error: %s\n", string);
|
||||
|
||||
#ifdef UQUAKE
|
||||
#ifdef UQUAKE
|
||||
if (sv.active)
|
||||
SV_Shutdown (false);
|
||||
|
||||
if (cls.state == ca_dedicated)
|
||||
Sys_Error ("Host_Error: %s\n",string); // dedicated servers exit
|
||||
#endif
|
||||
|
||||
|
||||
CL_Disconnect ();
|
||||
cls.demonum = -1;
|
||||
|
||||
|
@ -464,7 +464,7 @@ Host_Error ( char *error, ... )
|
|||
|
||||
/*
|
||||
Host_InitVCR
|
||||
|
||||
|
||||
Set up playback and recording of demos.
|
||||
*/
|
||||
extern int vcrFile;
|
||||
|
@ -475,7 +475,7 @@ Host_InitVCR ( quakeparms_t *parms )
|
|||
{
|
||||
int i, len, n;
|
||||
char *p;
|
||||
|
||||
|
||||
if ( COM_CheckParm("-playback") ) {
|
||||
if ( com_argc != 2 )
|
||||
Sys_Error("No other parameters allowed with -playback\n");
|
||||
|
@ -536,7 +536,7 @@ Host_InitDisplay ()
|
|||
|
||||
/*
|
||||
Host_Init
|
||||
|
||||
|
||||
System Startup
|
||||
*/
|
||||
void
|
||||
|
@ -552,21 +552,21 @@ Host_Init (quakeparms_t *parms)
|
|||
|
||||
if ( COM_CheckParm ("-minmemory") )
|
||||
parms->memsize = MINIMUM_MEMORY;
|
||||
|
||||
|
||||
host_parms = *parms;
|
||||
|
||||
if (parms->memsize < MINIMUM_MEMORY)
|
||||
Sys_Error ("Only %4.1fMB of memory reported, can't execute game", parms->memsize / (float) 0x100000);
|
||||
|
||||
|
||||
Memory_Init (parms->membase, parms->memsize);
|
||||
CL_InitCvars();
|
||||
SCR_InitCvars();
|
||||
VID_InitCvars ();
|
||||
Cbuf_Init ();
|
||||
Cbuf_Init ();
|
||||
Cmd_Init ();
|
||||
Cvar_Init ();
|
||||
V_Init ();
|
||||
|
||||
|
||||
#ifdef QUAKEWORLD
|
||||
COM_Init ();
|
||||
|
||||
|
@ -575,20 +575,20 @@ Host_Init (quakeparms_t *parms)
|
|||
#elif UQUAKE
|
||||
Chase_Init ();
|
||||
Host_InitVCR (parms);
|
||||
|
||||
|
||||
COM_Init ();
|
||||
Host_InitLocal ();
|
||||
#endif
|
||||
|
||||
W_LoadWadFile ("gfx.wad");
|
||||
Key_Init ();
|
||||
Con_Init ();
|
||||
M_Init ();
|
||||
Con_Init ();
|
||||
M_Init ();
|
||||
|
||||
#ifdef UQUAKE
|
||||
#ifdef UQUAKE
|
||||
PR_Init ();
|
||||
#endif
|
||||
|
||||
|
||||
Mod_Init ();
|
||||
|
||||
#ifdef UQUAKE
|
||||
|
@ -598,7 +598,7 @@ Host_Init (quakeparms_t *parms)
|
|||
|
||||
Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
|
||||
Con_Printf ("%4.1f megabytes RAM used.\n", (parms->memsize / (1024 * 1024.0)) );
|
||||
|
||||
|
||||
R_InitTextures (); // needed even for UQ dedicated server
|
||||
|
||||
#ifdef UQUAKE
|
||||
|
@ -634,7 +634,7 @@ Host_Init (quakeparms_t *parms)
|
|||
|
||||
Cbuf_InsertText ("exec quake.rc\n");
|
||||
|
||||
#ifdef QUAKEWORLD
|
||||
#ifdef QUAKEWORLD
|
||||
Cbuf_AddText ("echo Type connect <internet address> or use GameSpy to connect to a game.\n");
|
||||
#endif
|
||||
Cbuf_AddText ("cl_warncmd 1\n");
|
||||
|
@ -643,10 +643,10 @@ Host_Init (quakeparms_t *parms)
|
|||
host_hunklevel = Hunk_LowMark ();
|
||||
host_initialized = true;
|
||||
|
||||
#ifdef QUAKEWORLD
|
||||
#ifdef QUAKEWORLD
|
||||
Con_Printf ("\nClient Version %s\n\n", QF_VERSION);
|
||||
#endif
|
||||
Sys_Printf ("======= QuakeForge Initialized =======\n");
|
||||
Sys_Printf ("======= QuakeForge Initialized =======\n");
|
||||
}
|
||||
|
||||
|
||||
|
@ -660,7 +660,7 @@ void
|
|||
Host_Shutdown( void )
|
||||
{
|
||||
static qboolean isdown = false;
|
||||
|
||||
|
||||
if ( isdown ) {
|
||||
printf ("recursive shutdown\n");
|
||||
return;
|
||||
|
@ -672,8 +672,8 @@ Host_Shutdown( void )
|
|||
scr_disabled_for_loading = true;
|
||||
#endif
|
||||
|
||||
Host_WriteConfiguration ();
|
||||
|
||||
Host_WriteConfiguration ();
|
||||
|
||||
CDAudio_Shutdown ();
|
||||
NET_Shutdown ();
|
||||
S_Shutdown();
|
||||
|
@ -683,7 +683,7 @@ Host_Shutdown( void )
|
|||
//plugin_unload(IN->handle);
|
||||
}
|
||||
|
||||
#if QUAKEWORLD
|
||||
#if QUAKEWORLD
|
||||
if (host_basepal) {
|
||||
#elif UQUAKE
|
||||
if (cls.state != ca_dedicated) {
|
||||
|
@ -710,7 +710,7 @@ Host_WriteConfiguration ( void )
|
|||
Con_Printf ("Couldn't write config.cfg.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Key_WriteBindings (f);
|
||||
Cvar_WriteVariables (f);
|
||||
|
||||
|
@ -722,14 +722,14 @@ Host_WriteConfiguration ( void )
|
|||
#ifdef UQUAKE
|
||||
/*
|
||||
Host_InitLocal
|
||||
|
||||
|
||||
(desc)
|
||||
*/
|
||||
void
|
||||
Host_InitLocal ( void )
|
||||
{
|
||||
Host_InitCommands ();
|
||||
|
||||
|
||||
// Cvar_RegisterVariable (&host_framerate);
|
||||
host_framerate = Cvar_Get ("host_framerate","0",0,"None");
|
||||
|
||||
|
@ -767,14 +767,14 @@ Host_InitLocal ( void )
|
|||
sv_filter = Cvar_Get ("sv_filter","1",0,"None");
|
||||
|
||||
Host_FindMaxClients ();
|
||||
|
||||
|
||||
host_time = 1.0; // so a think at time 0 won't get called
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Host_FindMaxClients
|
||||
|
||||
|
||||
(desc)
|
||||
*/
|
||||
void Host_FindMaxClients (void)
|
||||
|
@ -782,7 +782,7 @@ void Host_FindMaxClients (void)
|
|||
int i;
|
||||
|
||||
svs.maxclients = 1;
|
||||
|
||||
|
||||
i = COM_CheckParm ("-dedicated");
|
||||
if (i)
|
||||
{
|
||||
|
@ -834,11 +834,11 @@ void Host_ClientCommands (char *fmt, ...)
|
|||
{
|
||||
va_list argptr;
|
||||
char string[1024];
|
||||
|
||||
|
||||
va_start (argptr, fmt);
|
||||
vsnprintf (string, sizeof(string), fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
|
||||
MSG_WriteByte (&host_client->message, svc_stufftext);
|
||||
MSG_WriteString (&host_client->message, string);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -95,7 +95,7 @@ static void IN_init_kb()
|
|||
fprintf(stderr, "Video mode not set?\n");
|
||||
Sys_Error("keyboard_init() failed");
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < 128; i++)
|
||||
scantokey[i] = ' ';
|
||||
|
||||
|
@ -208,7 +208,7 @@ static void IN_init_kb()
|
|||
scantokey[119] = AA_UNKNOWN; /* pause */ // misc
|
||||
|
||||
if (!aa_autoinitkbd(context, AA_SENDRELEASE))
|
||||
{
|
||||
{
|
||||
fprintf(stderr, "Error in aa_autoinitkbd!\n");
|
||||
Sys_Error("keyboard_init() failed");
|
||||
}
|
||||
|
|
258
common/in_dos.c
258
common/in_dos.c
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -33,7 +33,7 @@ typedef struct
|
|||
long numAxes;
|
||||
long numButtons;
|
||||
long flags;
|
||||
|
||||
|
||||
vec3_t viewangles;
|
||||
|
||||
// intended velocities
|
||||
|
@ -94,7 +94,7 @@ qboolean joy_avail;
|
|||
int joy_oldbuttonstate;
|
||||
int joy_buttonstate;
|
||||
|
||||
int joyxl, joyxh, joyyl, joyyh;
|
||||
int joyxl, joyxh, joyyl, joyyh;
|
||||
int joystickx, joysticky;
|
||||
|
||||
qboolean need_center;
|
||||
|
@ -134,9 +134,9 @@ IN_StartupMouse
|
|||
*/
|
||||
void IN_StartupMouse (void)
|
||||
{
|
||||
if ( COM_CheckParm ("-nomouse") )
|
||||
return;
|
||||
|
||||
if ( COM_CheckParm ("-nomouse") )
|
||||
return;
|
||||
|
||||
// check for mouse
|
||||
regs.x.ax = 0;
|
||||
dos_int86(0x33);
|
||||
|
@ -146,7 +146,7 @@ void IN_StartupMouse (void)
|
|||
Con_Printf ("No mouse found\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
mouse_buttons = regs.x.bx;
|
||||
if (mouse_buttons > 3)
|
||||
mouse_buttons = 3;
|
||||
|
@ -205,7 +205,7 @@ void IN_Frame(void)
|
|||
regs.x.ax = 3; // read buttons
|
||||
dos_int86(0x33);
|
||||
mouse_buttonstate = regs.x.bx;
|
||||
|
||||
|
||||
// perform button actions
|
||||
for (i=0 ; i<mouse_buttons ; i++)
|
||||
{
|
||||
|
@ -219,11 +219,11 @@ void IN_Frame(void)
|
|||
{
|
||||
Key_Event (K_MOUSE1 + i, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
mouse_oldbuttonstate = mouse_buttonstate;
|
||||
}
|
||||
|
||||
|
||||
if (joy_avail)
|
||||
{
|
||||
joy_buttonstate = ((dos_inportb(0x201) >> 4)&15)^15;
|
||||
|
@ -241,14 +241,14 @@ void IN_Frame(void)
|
|||
Key_Event (K_JOY1 + i, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
joy_oldbuttonstate = joy_buttonstate;
|
||||
}
|
||||
|
||||
if (extern_avail)
|
||||
{
|
||||
extern_buttonstate = extern_control->buttons;
|
||||
|
||||
|
||||
// perform button actions
|
||||
for (i=0 ; i<extern_buttons ; i++)
|
||||
{
|
||||
|
@ -262,11 +262,11 @@ void IN_Frame(void)
|
|||
{
|
||||
Key_Event (K_AUX1 + i, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extern_oldbuttonstate = extern_buttonstate;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -286,7 +286,7 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
dos_int86(0x33);
|
||||
mx = (short)regs.x.cx;
|
||||
my = (short)regs.x.dx;
|
||||
|
||||
|
||||
if (m_filter->value)
|
||||
{
|
||||
mouse_x = (mx + old_mouse_x) * 0.5;
|
||||
|
@ -308,10 +308,10 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
|
||||
|
||||
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
|
||||
if ( (in_mlook.state & 1) && !(in_strafe.state & 1))
|
||||
{
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
|
@ -338,10 +338,10 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
{
|
||||
float speed, aspeed;
|
||||
|
||||
if (!joy_avail || !in_joystick->value)
|
||||
return;
|
||||
|
||||
IN_ReadJoystick ();
|
||||
if (!joy_avail || !in_joystick->value)
|
||||
return;
|
||||
|
||||
IN_ReadJoystick ();
|
||||
if (joysticky > joyyh*2 || joystickx > joyxh*2)
|
||||
return; // assume something jumped in and messed up the joystick
|
||||
// reading time (win 95)
|
||||
|
@ -355,15 +355,15 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
if (in_strafe.state & 1)
|
||||
{
|
||||
if (joystickx < joyxl)
|
||||
cmd->sidemove -= speed*cl_sidespeed->value;
|
||||
else if (joystickx > joyxh)
|
||||
cmd->sidemove += speed*cl_sidespeed->value;
|
||||
cmd->sidemove -= speed*cl_sidespeed->value;
|
||||
else if (joystickx > joyxh)
|
||||
cmd->sidemove += speed*cl_sidespeed->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (joystickx < joyxl)
|
||||
cl.viewangles[YAW] += aspeed*cl_yawspeed->value;
|
||||
else if (joystickx > joyxh)
|
||||
else if (joystickx > joyxh)
|
||||
cl.viewangles[YAW] -= aspeed*cl_yawspeed->value;
|
||||
cl.viewangles[YAW] = anglemod(cl.viewangles[YAW]);
|
||||
}
|
||||
|
@ -372,18 +372,18 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
{
|
||||
if (m_pitch->value < 0)
|
||||
speed *= -1;
|
||||
|
||||
if (joysticky < joyyl)
|
||||
|
||||
if (joysticky < joyyl)
|
||||
cl.viewangles[PITCH] += aspeed*cl_pitchspeed->value;
|
||||
else if (joysticky > joyyh)
|
||||
else if (joysticky > joyyh)
|
||||
cl.viewangles[PITCH] -= aspeed*cl_pitchspeed->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (joysticky < joyyl)
|
||||
cmd->forwardmove += speed*cl_forwardspeed->value;
|
||||
else if (joysticky > joyyh)
|
||||
cmd->forwardmove -= speed*cl_backspeed->value;
|
||||
if (joysticky < joyyl)
|
||||
cmd->forwardmove += speed*cl_forwardspeed->value;
|
||||
else if (joysticky > joyyh)
|
||||
cmd->forwardmove -= speed*cl_backspeed->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -399,12 +399,12 @@ void IN_Move (usercmd_t *cmd)
|
|||
IN_ExternalMove (cmd);
|
||||
}
|
||||
|
||||
/*
|
||||
============================================================================
|
||||
|
||||
JOYSTICK
|
||||
|
||||
============================================================================
|
||||
/*
|
||||
============================================================================
|
||||
|
||||
JOYSTICK
|
||||
|
||||
============================================================================
|
||||
*/
|
||||
|
||||
|
||||
|
@ -432,7 +432,7 @@ qboolean IN_ReadJoystick (void)
|
|||
if ( !(b&3) )
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Con_Printf ("IN_ReadJoystick: no response\n");
|
||||
joy_avail = false;
|
||||
return false;
|
||||
|
@ -443,12 +443,12 @@ qboolean IN_ReadJoystick (void)
|
|||
WaitJoyButton
|
||||
=============
|
||||
*/
|
||||
qboolean WaitJoyButton (void)
|
||||
{
|
||||
int oldbuttons, buttons;
|
||||
|
||||
oldbuttons = 0;
|
||||
do
|
||||
qboolean WaitJoyButton (void)
|
||||
{
|
||||
int oldbuttons, buttons;
|
||||
|
||||
oldbuttons = 0;
|
||||
do
|
||||
{
|
||||
key_count = -1;
|
||||
Sys_SendKeyEvents ();
|
||||
|
@ -460,16 +460,16 @@ qboolean WaitJoyButton (void)
|
|||
}
|
||||
key_lastpress = 0;
|
||||
SCR_UpdateScreen ();
|
||||
buttons = ((dos_inportb(0x201) >> 4)&1)^1;
|
||||
if (buttons != oldbuttons)
|
||||
{
|
||||
oldbuttons = buttons;
|
||||
continue;
|
||||
buttons = ((dos_inportb(0x201) >> 4)&1)^1;
|
||||
if (buttons != oldbuttons)
|
||||
{
|
||||
oldbuttons = buttons;
|
||||
continue;
|
||||
}
|
||||
} while ( !buttons);
|
||||
|
||||
do
|
||||
{
|
||||
} while ( !buttons);
|
||||
|
||||
do
|
||||
{
|
||||
key_count = -1;
|
||||
Sys_SendKeyEvents ();
|
||||
key_count = 0;
|
||||
|
@ -480,87 +480,87 @@ qboolean WaitJoyButton (void)
|
|||
}
|
||||
key_lastpress = 0;
|
||||
SCR_UpdateScreen ();
|
||||
buttons = ((dos_inportb(0x201) >> 4)&1)^1;
|
||||
if (buttons != oldbuttons)
|
||||
{
|
||||
oldbuttons = buttons;
|
||||
continue;
|
||||
}
|
||||
} while ( buttons);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
IN_StartupJoystick
|
||||
===============
|
||||
*/
|
||||
void IN_StartupJoystick (void)
|
||||
{
|
||||
int centerx, centery;
|
||||
|
||||
Con_Printf ("\n");
|
||||
buttons = ((dos_inportb(0x201) >> 4)&1)^1;
|
||||
if (buttons != oldbuttons)
|
||||
{
|
||||
oldbuttons = buttons;
|
||||
continue;
|
||||
}
|
||||
} while ( buttons);
|
||||
|
||||
joy_avail = false;
|
||||
if ( COM_CheckParm ("-nojoy") )
|
||||
return;
|
||||
|
||||
if (!IN_ReadJoystick ())
|
||||
{
|
||||
joy_avail = false;
|
||||
Con_Printf ("joystick not found\n");
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Con_Printf ("joystick found\n");
|
||||
|
||||
Con_Printf ("CENTER the joystick\nand press button 1 (ESC to skip):\n");
|
||||
if (!WaitJoyButton ())
|
||||
return;
|
||||
IN_ReadJoystick ();
|
||||
centerx = joystickx;
|
||||
centery = joysticky;
|
||||
|
||||
Con_Printf ("Push the joystick to the UPPER LEFT\nand press button 1 (ESC to skip):\n");
|
||||
if (!WaitJoyButton ())
|
||||
return;
|
||||
IN_ReadJoystick ();
|
||||
joyxl = (centerx + joystickx)/2;
|
||||
joyyl = (centerx + joysticky)/2;
|
||||
|
||||
Con_Printf ("Push the joystick to the LOWER RIGHT\nand press button 1 (ESC to skip):\n");
|
||||
if (!WaitJoyButton ())
|
||||
return;
|
||||
IN_ReadJoystick ();
|
||||
joyxh = (centerx + joystickx)/2;
|
||||
joyyh = (centery + joysticky)/2;
|
||||
|
||||
joy_avail = true;
|
||||
Con_Printf ("joystick configured.\n");
|
||||
|
||||
/*
|
||||
===============
|
||||
IN_StartupJoystick
|
||||
===============
|
||||
*/
|
||||
void IN_StartupJoystick (void)
|
||||
{
|
||||
int centerx, centery;
|
||||
|
||||
Con_Printf ("\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
============================================================================
|
||||
|
||||
EXTERNAL
|
||||
|
||||
============================================================================
|
||||
|
||||
joy_avail = false;
|
||||
if ( COM_CheckParm ("-nojoy") )
|
||||
return;
|
||||
|
||||
if (!IN_ReadJoystick ())
|
||||
{
|
||||
joy_avail = false;
|
||||
Con_Printf ("joystick not found\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Con_Printf ("joystick found\n");
|
||||
|
||||
Con_Printf ("CENTER the joystick\nand press button 1 (ESC to skip):\n");
|
||||
if (!WaitJoyButton ())
|
||||
return;
|
||||
IN_ReadJoystick ();
|
||||
centerx = joystickx;
|
||||
centery = joysticky;
|
||||
|
||||
Con_Printf ("Push the joystick to the UPPER LEFT\nand press button 1 (ESC to skip):\n");
|
||||
if (!WaitJoyButton ())
|
||||
return;
|
||||
IN_ReadJoystick ();
|
||||
joyxl = (centerx + joystickx)/2;
|
||||
joyyl = (centerx + joysticky)/2;
|
||||
|
||||
Con_Printf ("Push the joystick to the LOWER RIGHT\nand press button 1 (ESC to skip):\n");
|
||||
if (!WaitJoyButton ())
|
||||
return;
|
||||
IN_ReadJoystick ();
|
||||
joyxh = (centerx + joystickx)/2;
|
||||
joyyh = (centery + joysticky)/2;
|
||||
|
||||
joy_avail = true;
|
||||
Con_Printf ("joystick configured.\n");
|
||||
|
||||
Con_Printf ("\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
============================================================================
|
||||
|
||||
EXTERNAL
|
||||
|
||||
============================================================================
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
IN_StartupExternal
|
||||
===============
|
||||
*/
|
||||
void IN_StartupExternal (void)
|
||||
{
|
||||
/*
|
||||
===============
|
||||
IN_StartupExternal
|
||||
===============
|
||||
*/
|
||||
void IN_StartupExternal (void)
|
||||
{
|
||||
if (extern_control->numButtons > 32)
|
||||
extern_control->numButtons = 32;
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -108,8 +108,8 @@ static void CheckMouseState(void)
|
|||
// make input rawer
|
||||
XAutoRepeatOff(x_disp);
|
||||
XGrabKeyboard(x_disp, x_win, True, GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||
XGrabPointer(x_disp, x_win, True,
|
||||
PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
|
||||
XGrabPointer(x_disp, x_win, True,
|
||||
PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
|
||||
GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
|
||||
|
||||
// if (XChangePointerControl( x_disp, True, True, 1, MOUSE_SCALE, x_mouse_thresh ))
|
||||
|
@ -193,7 +193,7 @@ IN_Move(usercmd_t *cmd)
|
|||
|
||||
if (!x_grabbed)
|
||||
return; // no mouse movement
|
||||
|
||||
|
||||
|
||||
now = gethrtime();
|
||||
|
||||
|
@ -202,7 +202,7 @@ IN_Move(usercmd_t *cmd)
|
|||
|
||||
dy = global_dy;
|
||||
global_dy = 0;
|
||||
|
||||
|
||||
// printf("GOT: dx %d dy %d\n", dx, dy);
|
||||
|
||||
dx *= sensitivity->value;
|
||||
|
@ -210,7 +210,7 @@ IN_Move(usercmd_t *cmd)
|
|||
|
||||
//
|
||||
// implement low pass filter to smooth motion a bit
|
||||
//
|
||||
//
|
||||
if (now - last_movement > 100000000) {
|
||||
dx = .6 * dx;
|
||||
dy = .6 * dy;
|
||||
|
@ -225,20 +225,20 @@ IN_Move(usercmd_t *cmd)
|
|||
last_dy = dy;
|
||||
|
||||
if (!dx && !dy) {
|
||||
if (in_mlook.state & 1)
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// add mouse X/Y movement to cmd
|
||||
if ((in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1)))
|
||||
cmd->sidemove += m_side->value * dx;
|
||||
else
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw->value * dx;
|
||||
|
||||
if (in_mlook.state & 1)
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
|
||||
if ((in_mlook.state & 1) && !(in_strafe.state & 1)) {
|
||||
cl.viewangles[PITCH] += m_pitch->value * dy;
|
||||
if (cl.viewangles[PITCH] > 80) cl.viewangles[PITCH] = 80;
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -140,41 +140,41 @@ static void IN_init_kb()
|
|||
scantokey[ 13] = '=';
|
||||
scantokey[ 14] = K_BACKSPACE;
|
||||
scantokey[ 15] = K_TAB;
|
||||
scantokey[ 16] = 'q';
|
||||
scantokey[ 17] = 'w';
|
||||
scantokey[ 18] = 'e';
|
||||
scantokey[ 19] = 'r';
|
||||
scantokey[ 20] = 't';
|
||||
scantokey[ 21] = 'y';
|
||||
scantokey[ 22] = 'u';
|
||||
scantokey[ 23] = 'i';
|
||||
scantokey[ 24] = 'o';
|
||||
scantokey[ 25] = 'p';
|
||||
scantokey[ 16] = 'q';
|
||||
scantokey[ 17] = 'w';
|
||||
scantokey[ 18] = 'e';
|
||||
scantokey[ 19] = 'r';
|
||||
scantokey[ 20] = 't';
|
||||
scantokey[ 21] = 'y';
|
||||
scantokey[ 22] = 'u';
|
||||
scantokey[ 23] = 'i';
|
||||
scantokey[ 24] = 'o';
|
||||
scantokey[ 25] = 'p';
|
||||
scantokey[ 26] = '[';
|
||||
scantokey[ 27] = ']';
|
||||
scantokey[ 28] = K_ENTER;
|
||||
scantokey[ 29] = K_CTRL; /*left */
|
||||
scantokey[ 30] = 'a';
|
||||
scantokey[ 31] = 's';
|
||||
scantokey[ 32] = 'd';
|
||||
scantokey[ 33] = 'f';
|
||||
scantokey[ 34] = 'g';
|
||||
scantokey[ 35] = 'h';
|
||||
scantokey[ 36] = 'j';
|
||||
scantokey[ 37] = 'k';
|
||||
scantokey[ 38] = 'l';
|
||||
scantokey[ 31] = 's';
|
||||
scantokey[ 32] = 'd';
|
||||
scantokey[ 33] = 'f';
|
||||
scantokey[ 34] = 'g';
|
||||
scantokey[ 35] = 'h';
|
||||
scantokey[ 36] = 'j';
|
||||
scantokey[ 37] = 'k';
|
||||
scantokey[ 38] = 'l';
|
||||
scantokey[ 39] = ';';
|
||||
scantokey[ 40] = '\'';
|
||||
scantokey[ 41] = '`';
|
||||
scantokey[ 42] = K_SHIFT; /*left */
|
||||
scantokey[ 43] = '\\';
|
||||
scantokey[ 44] = 'z';
|
||||
scantokey[ 45] = 'x';
|
||||
scantokey[ 44] = 'z';
|
||||
scantokey[ 45] = 'x';
|
||||
scantokey[ 46] = 'c';
|
||||
scantokey[ 47] = 'v';
|
||||
scantokey[ 47] = 'v';
|
||||
scantokey[ 48] = 'b';
|
||||
scantokey[ 49] = 'n';
|
||||
scantokey[ 50] = 'm';
|
||||
scantokey[ 49] = 'n';
|
||||
scantokey[ 50] = 'm';
|
||||
scantokey[ 51] = ',';
|
||||
scantokey[ 52] = '.';
|
||||
scantokey[ 53] = '/';
|
||||
|
@ -182,7 +182,7 @@ static void IN_init_kb()
|
|||
scantokey[ 55] = KP_MULTIPLY;
|
||||
scantokey[ 56] = K_ALT; /*left */
|
||||
scantokey[ 57] = ' ';
|
||||
scantokey[ 58] = K_CAPSLOCK;
|
||||
scantokey[ 58] = K_CAPSLOCK;
|
||||
scantokey[ 59] = K_F1;
|
||||
scantokey[ 60] = K_F2;
|
||||
scantokey[ 61] = K_F3;
|
||||
|
@ -230,7 +230,7 @@ static void IN_init_kb()
|
|||
scantokey[110] = K_INS;
|
||||
scantokey[111] = K_DEL;
|
||||
scantokey[119] = K_PAUSE;
|
||||
|
||||
|
||||
if (keyboard_init()) {
|
||||
Sys_Error("keyboard_init() failed");
|
||||
}
|
||||
|
@ -367,9 +367,9 @@ void IN_Move(usercmd_t *cmd)
|
|||
} else {
|
||||
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
|
||||
}
|
||||
|
||||
|
||||
if ((in_mlook.state & 1)) V_StopPitchDrift();
|
||||
|
||||
|
||||
if ((in_mlook.state & 1) && !(in_strafe.state & 1)) {
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80) {
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -355,7 +355,7 @@ qboolean IN_InitDInput (void)
|
|||
if (!hInstDI)
|
||||
{
|
||||
hInstDI = LoadLibrary("dinput.dll");
|
||||
|
||||
|
||||
if (hInstDI == NULL)
|
||||
{
|
||||
Con_SafePrintf ("Couldn't load dinput.dll\n");
|
||||
|
@ -432,8 +432,8 @@ IN_StartupMouse
|
|||
*/
|
||||
void IN_StartupMouse (void)
|
||||
{
|
||||
if ( COM_CheckParm ("-nomouse") )
|
||||
return;
|
||||
if ( COM_CheckParm ("-nomouse") )
|
||||
return;
|
||||
|
||||
mouseinitialized = true;
|
||||
|
||||
|
@ -457,16 +457,16 @@ void IN_StartupMouse (void)
|
|||
|
||||
if (mouseparmsvalid)
|
||||
{
|
||||
if ( COM_CheckParm ("-noforcemspd") )
|
||||
if ( COM_CheckParm ("-noforcemspd") )
|
||||
newmouseparms[2] = originalmouseparms[2];
|
||||
|
||||
if ( COM_CheckParm ("-noforcemaccel") )
|
||||
if ( COM_CheckParm ("-noforcemaccel") )
|
||||
{
|
||||
newmouseparms[0] = originalmouseparms[0];
|
||||
newmouseparms[1] = originalmouseparms[1];
|
||||
}
|
||||
|
||||
if ( COM_CheckParm ("-noforcemparms") )
|
||||
if ( COM_CheckParm ("-noforcemparms") )
|
||||
{
|
||||
newmouseparms[0] = originalmouseparms[0];
|
||||
newmouseparms[1] = originalmouseparms[1];
|
||||
|
@ -577,8 +577,8 @@ void IN_MouseEvent (int mstate)
|
|||
{
|
||||
Key_Event (K_MOUSE1 + i, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
mouse_oldbuttonstate = mstate;
|
||||
}
|
||||
}
|
||||
|
@ -650,7 +650,7 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
else
|
||||
mstate_di &= ~(1<<1);
|
||||
break;
|
||||
|
||||
|
||||
case DIMOFS_BUTTON2:
|
||||
if (od.dwData & 0x80)
|
||||
mstate_di |= (1<<2);
|
||||
|
@ -674,8 +674,8 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
{
|
||||
Key_Event (K_MOUSE1 + i, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
mouse_oldbuttonstate = mstate_di;
|
||||
}
|
||||
else
|
||||
|
@ -712,7 +712,7 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
|
||||
if ( (in_mlook.state & 1) && !(in_strafe.state & 1))
|
||||
{
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
|
@ -790,24 +790,24 @@ void IN_ClearStates (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
IN_StartupJoystick
|
||||
===============
|
||||
*/
|
||||
void IN_StartupJoystick (void)
|
||||
{
|
||||
/*
|
||||
===============
|
||||
IN_StartupJoystick
|
||||
===============
|
||||
*/
|
||||
void IN_StartupJoystick (void)
|
||||
{
|
||||
int numdevs;
|
||||
JOYCAPS jc;
|
||||
MMRESULT mmr = !JOYERR_NOERROR;
|
||||
|
||||
|
||||
// assume no joystick
|
||||
joy_avail = false;
|
||||
joy_avail = false;
|
||||
|
||||
// abort startup if user requests no joystick
|
||||
if ( COM_CheckParm ("-nojoy") )
|
||||
return;
|
||||
|
||||
if ( COM_CheckParm ("-nojoy") )
|
||||
return;
|
||||
|
||||
// verify joystick driver is present
|
||||
if ((numdevs = joyGetNumDevs ()) == 0)
|
||||
{
|
||||
|
@ -824,7 +824,7 @@ void IN_StartupJoystick (void)
|
|||
|
||||
if ((mmr = joyGetPosEx (joy_id, &ji)) == JOYERR_NOERROR)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// abort startup if we didn't find a valid joystick
|
||||
if (mmr != JOYERR_NOERROR)
|
||||
|
@ -838,7 +838,7 @@ void IN_StartupJoystick (void)
|
|||
memset (&jc, 0, sizeof(jc));
|
||||
if ((mmr = joyGetDevCaps (joy_id, &jc, sizeof(jc))) != JOYERR_NOERROR)
|
||||
{
|
||||
Con_Printf ("\njoystick not found -- invalid joystick capabilities (%x)\n\n", mmr);
|
||||
Con_Printf ("\njoystick not found -- invalid joystick capabilities (%x)\n\n", mmr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -852,10 +852,10 @@ void IN_StartupJoystick (void)
|
|||
// mark the joystick as available and advanced initialization not completed
|
||||
// this is needed as cvars are not available during initialization
|
||||
|
||||
joy_avail = true;
|
||||
joy_avail = true;
|
||||
joy_advancedinit = false;
|
||||
|
||||
Con_Printf ("\njoystick detected\n\n");
|
||||
Con_Printf ("\njoystick detected\n\n");
|
||||
}
|
||||
|
||||
|
||||
|
@ -975,7 +975,7 @@ IN_Frame(void)
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// loop through the joystick buttons
|
||||
// key a joystick event or auxillary event for higher number buttons for each state change
|
||||
buttonstate = ji.dwButtons;
|
||||
|
@ -1030,11 +1030,11 @@ IN_Frame(void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
/*
|
||||
===============
|
||||
IN_ReadJoystick
|
||||
===============
|
||||
*/
|
||||
===============
|
||||
*/
|
||||
qboolean IN_ReadJoystick (void)
|
||||
{
|
||||
|
||||
|
@ -1087,9 +1087,9 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
// verify joystick is available and that the user wants to use it
|
||||
if (!joy_avail || !in_joystick->value)
|
||||
{
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// collect the joystick data, if possible
|
||||
if (IN_ReadJoystick () != true)
|
||||
{
|
||||
|
@ -1126,7 +1126,7 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
// convert range from -32768..32767 to -1..1
|
||||
// convert range from -32768..32767 to -1..1
|
||||
fAxisValue /= 32768.0;
|
||||
|
||||
switch (dwAxisMap[i])
|
||||
|
@ -1136,7 +1136,7 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
{
|
||||
// user wants forward control to become look control
|
||||
if (fabs(fAxisValue) > joy_pitchthreshold->value)
|
||||
{
|
||||
{
|
||||
// if mouse invert is on, invert the joystick pitch value
|
||||
// only absolute control support here (joy_advanced is false)
|
||||
if (m_pitch->value < 0.0)
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -162,14 +162,14 @@ int XLateKey(XKeyEvent *ev)
|
|||
case XK_Shift_L:
|
||||
case XK_Shift_R: key = K_SHIFT; break;
|
||||
|
||||
case XK_Execute:
|
||||
case XK_Control_L:
|
||||
case XK_Execute:
|
||||
case XK_Control_L:
|
||||
case XK_Control_R: key = K_CTRL; break;
|
||||
|
||||
case XK_Mode_switch:
|
||||
case XK_Alt_L:
|
||||
case XK_Meta_L:
|
||||
case XK_Alt_R:
|
||||
case XK_Alt_L:
|
||||
case XK_Meta_L:
|
||||
case XK_Alt_R:
|
||||
case XK_Meta_R: key = K_ALT; break;
|
||||
|
||||
case XK_Caps_Lock: key = K_CAPSLOCK; break;
|
||||
|
@ -217,7 +217,7 @@ int XLateKey(XKeyEvent *ev)
|
|||
key = key + ('a' - 'A');
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ static void event_motion(XEvent *event)
|
|||
XWarpPointer(x_disp, None, x_win, 0, 0, 0, 0,
|
||||
(vid.width / 2), (vid.height / 2));
|
||||
XSelectInput(x_disp, x_win, INPUT_MASK);
|
||||
XGrabPointer(x_disp, x_win, True, MOUSE_MASK, GrabModeAsync,
|
||||
XGrabPointer(x_disp, x_win, True, MOUSE_MASK, GrabModeAsync,
|
||||
GrabModeAsync, x_win, None, CurrentTime);
|
||||
} else {
|
||||
mouse_x = (event->xmotion.x - p_mouse_x);
|
||||
|
@ -294,7 +294,7 @@ IN_Frame(void)
|
|||
XUngrabPointer(x_disp,CurrentTime);
|
||||
} else {
|
||||
/* grab the pointer */
|
||||
XGrabPointer(x_disp, x_win, True, MOUSE_MASK, GrabModeAsync,
|
||||
XGrabPointer(x_disp, x_win, True, MOUSE_MASK, GrabModeAsync,
|
||||
GrabModeAsync, x_win, None, CurrentTime);
|
||||
//XGrabPointer(x_disp,x_win,True,0,GrabModeAsync,
|
||||
// GrabModeAsync,x_win,None,CurrentTime);
|
||||
|
@ -315,7 +315,7 @@ void IN_Move(usercmd_t *cmd)
|
|||
{
|
||||
if (!mouse_avail)
|
||||
return;
|
||||
|
||||
|
||||
if (m_filter->value) {
|
||||
mouse_x = (mouse_x + old_mouse_x) * 0.5;
|
||||
mouse_y = (mouse_y + old_mouse_y) * 0.5;
|
||||
|
@ -323,17 +323,17 @@ void IN_Move(usercmd_t *cmd)
|
|||
|
||||
old_mouse_x = mouse_x;
|
||||
old_mouse_y = mouse_y;
|
||||
|
||||
|
||||
mouse_x *= sensitivity->value;
|
||||
mouse_y *= sensitivity->value;
|
||||
|
||||
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
|
||||
if ( (in_mlook.state & 1) && !(in_strafe.state & 1)) {
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -91,7 +91,7 @@ keyname_t keynames[] =
|
|||
{"ALT", K_ALT},
|
||||
{"CTRL", K_CTRL},
|
||||
{"SHIFT", K_SHIFT},
|
||||
|
||||
|
||||
// Keypad stuff..
|
||||
{"NUMLOCK", KP_NUMLCK},
|
||||
{"KP_SLASH", KP_DIVIDE},
|
||||
|
@ -255,7 +255,7 @@ void Key_Console (int key)
|
|||
HANDLE th;
|
||||
char *clipText, *textCopied;
|
||||
#endif
|
||||
|
||||
|
||||
switch (key) {
|
||||
case KP_ENTER:
|
||||
case K_ENTER:
|
||||
|
@ -279,7 +279,7 @@ void Key_Console (int key)
|
|||
Cbuf_AddText (key_lines[edit_line]+1); // skip the ]
|
||||
|
||||
Cbuf_AddText ("\n");
|
||||
no_lf:
|
||||
no_lf:
|
||||
Con_Printf ("%s\n",key_lines[edit_line]);
|
||||
edit_line = (edit_line + 1) & 31;
|
||||
history_line = edit_line;
|
||||
|
@ -295,10 +295,10 @@ no_lf:
|
|||
// command completion
|
||||
CompleteCommand ();
|
||||
return;
|
||||
|
||||
|
||||
case K_BACKSPACE:
|
||||
if (key_linepos > 1)
|
||||
{
|
||||
{
|
||||
strcpy(key_lines[edit_line] + key_linepos - 1, key_lines[edit_line] + key_linepos);
|
||||
key_linepos--;
|
||||
}
|
||||
|
@ -309,12 +309,12 @@ no_lf:
|
|||
if (key_linepos < strlen(key_lines[edit_line]))
|
||||
strcpy(key_lines[edit_line] + key_linepos, key_lines[edit_line] + key_linepos + 1);
|
||||
return;
|
||||
|
||||
|
||||
case KP_RIGHTARROW:
|
||||
case K_RIGHTARROW:
|
||||
if (key_linepos < strlen(key_lines[edit_line]))
|
||||
key_linepos++;
|
||||
return;
|
||||
return;
|
||||
|
||||
case KP_LEFTARROW:
|
||||
case K_LEFTARROW:
|
||||
|
@ -351,7 +351,7 @@ no_lf:
|
|||
key_linepos = Q_strlen(key_lines[edit_line]);
|
||||
}
|
||||
return;
|
||||
|
||||
|
||||
case K_MWHEELUP:
|
||||
case KP_PGUP:
|
||||
case K_PGUP:
|
||||
|
@ -397,7 +397,7 @@ no_lf:
|
|||
i = MAXCMDLINE-1 - strlen(key_lines[edit_line]);
|
||||
if (i > 0)
|
||||
{ // insert the string
|
||||
memcpy (key_lines[edit_line] + key_linepos + i,
|
||||
memcpy (key_lines[edit_line] + key_linepos + i,
|
||||
key_lines[edit_line] + key_linepos, strlen(key_lines[edit_line]) - key_linepos + 1);
|
||||
memcpy (key_lines[edit_line] + key_linepos, textCopied, i);
|
||||
key_linepos += i;
|
||||
|
@ -414,10 +414,10 @@ no_lf:
|
|||
|
||||
if (key < 32 || key > 127)
|
||||
return; // non printable
|
||||
|
||||
|
||||
if (key_linepos < MAXCMDLINE-1)
|
||||
{
|
||||
i = strlen(key_lines[edit_line]) - 1;
|
||||
i = strlen(key_lines[edit_line]) - 1;
|
||||
if (i == MAXCMDLINE-2) i--;
|
||||
for (; i >= key_linepos; i--)
|
||||
key_lines[edit_line][i + 1] = key_lines[edit_line][i];
|
||||
|
@ -497,7 +497,7 @@ the K_* names are matched up.
|
|||
int Key_StringToKeynum (char *str)
|
||||
{
|
||||
keyname_t *kn;
|
||||
|
||||
|
||||
if (!str || !str[0])
|
||||
return -1;
|
||||
if (!str[1])
|
||||
|
@ -522,9 +522,9 @@ FIXME: handle quote special (general escape sequence?)
|
|||
*/
|
||||
char *Key_KeynumToString (int keynum)
|
||||
{
|
||||
keyname_t *kn;
|
||||
keyname_t *kn;
|
||||
static char tinystr[2];
|
||||
|
||||
|
||||
if (keynum == -1)
|
||||
return "<KEY NOT FOUND>";
|
||||
if (keynum > 32 && keynum < 127)
|
||||
|
@ -533,7 +533,7 @@ char *Key_KeynumToString (int keynum)
|
|||
tinystr[1] = 0;
|
||||
return tinystr;
|
||||
}
|
||||
|
||||
|
||||
for (kn=keynames ; kn->name ; kn++)
|
||||
if (keynum == kn->keynum)
|
||||
return kn->name;
|
||||
|
@ -551,7 +551,7 @@ void Key_SetBinding (int keynum, char *binding)
|
|||
{
|
||||
char *new;
|
||||
int l;
|
||||
|
||||
|
||||
if (keynum == -1)
|
||||
return;
|
||||
|
||||
|
@ -564,13 +564,13 @@ void Key_SetBinding (int keynum, char *binding)
|
|||
Z_Free (keybindings[keynum]);
|
||||
keybindings[keynum] = NULL;
|
||||
}
|
||||
|
||||
|
||||
// allocate memory for new binding
|
||||
l = Q_strlen (binding);
|
||||
l = Q_strlen (binding);
|
||||
new = Z_Malloc (l+1);
|
||||
Q_strcpy (new, binding);
|
||||
new[l] = 0;
|
||||
keybindings[keynum] = new;
|
||||
keybindings[keynum] = new;
|
||||
|
||||
if (!Q_strncmp (new, "toggleconsole", 13)) {
|
||||
consolekeys[keynum] = false;
|
||||
|
@ -591,7 +591,7 @@ void Key_Unbind_f (void)
|
|||
Con_Printf ("unbind <key> : remove commands from a key\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
b = Key_StringToKeynum (Cmd_Argv(1));
|
||||
if (b==-1)
|
||||
{
|
||||
|
@ -605,7 +605,7 @@ void Key_Unbind_f (void)
|
|||
void Key_Unbindall_f (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i=0 ; i<256 ; i++)
|
||||
if (keybindings[i])
|
||||
Key_SetBinding (i, "");
|
||||
|
@ -621,7 +621,7 @@ void Key_Bind_f (void)
|
|||
{
|
||||
int i, c, b;
|
||||
char cmd[1024];
|
||||
|
||||
|
||||
c = Cmd_Argc();
|
||||
|
||||
if (c != 2 && c != 3)
|
||||
|
@ -644,7 +644,7 @@ void Key_Bind_f (void)
|
|||
Con_Printf ("\"%s\" is not bound\n", Cmd_Argv(1) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// copy the rest of the command line
|
||||
cmd[0] = 0; // start out with a null string
|
||||
for (i=2 ; i< c ; i++)
|
||||
|
@ -689,7 +689,7 @@ void Key_Init (void)
|
|||
key_lines[i][1] = 0;
|
||||
}
|
||||
key_linepos = 1;
|
||||
|
||||
|
||||
//
|
||||
// init ascii characters in console mode
|
||||
//
|
||||
|
@ -799,11 +799,11 @@ void Key_Event (int key, qboolean down)
|
|||
{
|
||||
key_repeats[key]++;
|
||||
if (key != K_BACKSPACE && key != K_DEL
|
||||
&& key != K_LEFTARROW && key != K_RIGHTARROW
|
||||
&& key != K_LEFTARROW && key != K_RIGHTARROW
|
||||
&& key != K_PGUP && key != K_PGDN
|
||||
&& key_repeats[key] > 1)
|
||||
return; // ignore most autorepeats
|
||||
|
||||
|
||||
if (key >= 200 && !keybindings[key])
|
||||
Con_Printf ("%s is unbound, hit F4 to set.\n", Key_KeynumToString (key) );
|
||||
}
|
||||
|
@ -881,7 +881,7 @@ void Key_Event (int key, qboolean down)
|
|||
//
|
||||
if ( (key_dest == key_menu && menubound[key])
|
||||
|| (key_dest == key_console && !consolekeys[key])
|
||||
|| (key_dest == key_game && (
|
||||
|| (key_dest == key_game && (
|
||||
(cls.state == ca_active)
|
||||
|| !consolekeys[key] ) ) )
|
||||
{
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -49,7 +49,7 @@ typedef enum {
|
|||
K_DOWNARROW,
|
||||
K_LEFTARROW,
|
||||
K_RIGHTARROW,
|
||||
|
||||
|
||||
K_ALT,
|
||||
K_CTRL,
|
||||
K_SHIFT,
|
||||
|
@ -79,21 +79,21 @@ typedef enum {
|
|||
KP_NUMLCK,
|
||||
KP_DIVIDE,
|
||||
KP_MULTIPLY,
|
||||
|
||||
|
||||
KP_HOME,
|
||||
KP_UPARROW,
|
||||
KP_PGUP,
|
||||
KP_MINUS,
|
||||
|
||||
|
||||
KP_LEFTARROW,
|
||||
KP_5,
|
||||
KP_RIGHTARROW,
|
||||
KP_PLUS,
|
||||
|
||||
|
||||
KP_END,
|
||||
KP_DOWNARROW,
|
||||
KP_PGDN,
|
||||
|
||||
|
||||
KP_INS,
|
||||
KP_DEL,
|
||||
KP_ENTER,
|
||||
|
@ -104,7 +104,7 @@ typedef enum {
|
|||
K_MOUSE1 = 200,
|
||||
K_MOUSE2,
|
||||
K_MOUSE3,
|
||||
|
||||
|
||||
//
|
||||
// joystick buttons
|
||||
//
|
||||
|
@ -112,7 +112,7 @@ typedef enum {
|
|||
K_JOY2,
|
||||
K_JOY3,
|
||||
K_JOY4,
|
||||
|
||||
|
||||
//
|
||||
// aux keys are for multi-buttoned joysticks to generate so they can use
|
||||
// the normal binding process
|
||||
|
@ -149,9 +149,9 @@ typedef enum {
|
|||
K_AUX30,
|
||||
K_AUX31,
|
||||
K_AUX32,
|
||||
|
||||
|
||||
// JACK: Intellimouse(c) Mouse Wheel Support
|
||||
|
||||
|
||||
K_MWHEELUP,
|
||||
K_MWHEELDOWN
|
||||
} keynum_t;
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
void Q_memset (void *dest, int fill, int count)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
if ( (((long)dest | count) & 3) == 0)
|
||||
{
|
||||
count >>= 2;
|
||||
|
@ -52,7 +52,7 @@ void Q_memset (void *dest, int fill, int count)
|
|||
void Q_memcpy (void *dest, void *src, int count)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
if (( ( (long)dest | (long)src | count) & 3) == 0 )
|
||||
{
|
||||
count>>=2;
|
||||
|
@ -97,7 +97,7 @@ void Q_strncpy (char *dest, char *src, int count)
|
|||
int Q_strlen (char *str)
|
||||
{
|
||||
int count;
|
||||
|
||||
|
||||
count = 0;
|
||||
while (str[count])
|
||||
count++;
|
||||
|
@ -125,13 +125,13 @@ int Q_strcmp (char *s1, char *s2)
|
|||
while (1)
|
||||
{
|
||||
if (*s1 != *s2)
|
||||
return -1; // strings not equal
|
||||
return -1; // strings not equal
|
||||
if (!*s1)
|
||||
return 0; // strings are equal
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -142,20 +142,20 @@ int Q_strncmp (char *s1, char *s2, int count)
|
|||
if (!count--)
|
||||
return 0;
|
||||
if (*s1 != *s2)
|
||||
return -1; // strings not equal
|
||||
return -1; // strings not equal
|
||||
if (!*s1)
|
||||
return 0; // strings are equal
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int Q_strncasecmp (char *s1, char *s2, int n)
|
||||
{
|
||||
int c1, c2;
|
||||
|
||||
|
||||
while (1)
|
||||
{
|
||||
c1 = *s1++;
|
||||
|
@ -163,7 +163,7 @@ int Q_strncasecmp (char *s1, char *s2, int n)
|
|||
|
||||
if (!n--)
|
||||
return 0; // strings are equal until end point
|
||||
|
||||
|
||||
if (c1 != c2)
|
||||
{
|
||||
if (c1 >= 'a' && c1 <= 'z')
|
||||
|
@ -178,7 +178,7 @@ int Q_strncasecmp (char *s1, char *s2, int n)
|
|||
// s1++;
|
||||
// s2++;
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ int Q_atoi (char *str)
|
|||
int val;
|
||||
int sign;
|
||||
int c;
|
||||
|
||||
|
||||
if (*str == '-')
|
||||
{
|
||||
sign = -1;
|
||||
|
@ -202,7 +202,7 @@ int Q_atoi (char *str)
|
|||
}
|
||||
else
|
||||
sign = 1;
|
||||
|
||||
|
||||
val = 0;
|
||||
|
||||
//
|
||||
|
@ -224,7 +224,7 @@ int Q_atoi (char *str)
|
|||
return val*sign;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// check for character
|
||||
//
|
||||
|
@ -232,7 +232,7 @@ int Q_atoi (char *str)
|
|||
{
|
||||
return sign * str[1];
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// assume decimal
|
||||
//
|
||||
|
@ -243,7 +243,7 @@ int Q_atoi (char *str)
|
|||
return val*sign;
|
||||
val = val*10 + c - '0';
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ float Q_atof (char *str)
|
|||
int sign;
|
||||
int c;
|
||||
int decimal, total;
|
||||
|
||||
|
||||
if (*str == '-')
|
||||
{
|
||||
sign = -1;
|
||||
|
@ -262,7 +262,7 @@ float Q_atof (char *str)
|
|||
}
|
||||
else
|
||||
sign = 1;
|
||||
|
||||
|
||||
val = 0;
|
||||
|
||||
//
|
||||
|
@ -284,7 +284,7 @@ float Q_atof (char *str)
|
|||
return val*sign;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// check for character
|
||||
//
|
||||
|
@ -292,7 +292,7 @@ float Q_atof (char *str)
|
|||
{
|
||||
return sign * str[1];
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// assume decimal
|
||||
//
|
||||
|
@ -319,6 +319,6 @@ float Q_atof (char *str)
|
|||
val /= 10;
|
||||
total--;
|
||||
}
|
||||
|
||||
|
||||
return val*sign;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -207,7 +207,7 @@ int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, mplane_t *p)
|
|||
return 3;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// general case
|
||||
switch (p->signbits)
|
||||
{
|
||||
|
@ -297,7 +297,7 @@ void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
|
|||
{
|
||||
float angle;
|
||||
float sr, sp, sy, cr, cp, cy;
|
||||
|
||||
|
||||
angle = angles[YAW] * (M_PI*2 / 360);
|
||||
sy = sin(angle);
|
||||
cy = cos(angle);
|
||||
|
@ -323,7 +323,7 @@ int VectorCompare (vec3_t v1, vec3_t v2)
|
|||
{
|
||||
|
||||
if (v1[0] != v2[0] || v1[1] != v2[1] || v1[2] != v2[2]) return 0;
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@ float VectorNormalize (vec3_t v)
|
|||
v[1] *= ilength;
|
||||
v[2] *= ilength;
|
||||
}
|
||||
|
||||
|
||||
return length;
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
/*
|
||||
/*
|
||||
Unix SMB/Netbios implementation.
|
||||
Version 1.9.
|
||||
a implementation of MD4 designed for use in the SMB authentication protocol
|
||||
Copyright (C) Andrew Tridgell 1997-1998.
|
||||
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
@ -29,7 +29,7 @@
|
|||
#include "mdfour.h"
|
||||
#endif // _MDFOUR_H
|
||||
|
||||
/* NOTE: This code makes no attempt to be fast!
|
||||
/* NOTE: This code makes no attempt to be fast!
|
||||
|
||||
It assumes that a int is at least 32 bits long
|
||||
*/
|
||||
|
@ -60,38 +60,38 @@ static void mdfour64(uint32 *M)
|
|||
for (j=0;j<16;j++)
|
||||
X[j] = M[j];
|
||||
|
||||
A = m->A; B = m->B; C = m->C; D = m->D;
|
||||
A = m->A; B = m->B; C = m->C; D = m->D;
|
||||
AA = A; BB = B; CC = C; DD = D;
|
||||
|
||||
ROUND1(A,B,C,D, 0, 3); ROUND1(D,A,B,C, 1, 7);
|
||||
ROUND1(A,B,C,D, 0, 3); ROUND1(D,A,B,C, 1, 7);
|
||||
ROUND1(C,D,A,B, 2, 11); ROUND1(B,C,D,A, 3, 19);
|
||||
ROUND1(A,B,C,D, 4, 3); ROUND1(D,A,B,C, 5, 7);
|
||||
ROUND1(A,B,C,D, 4, 3); ROUND1(D,A,B,C, 5, 7);
|
||||
ROUND1(C,D,A,B, 6, 11); ROUND1(B,C,D,A, 7, 19);
|
||||
ROUND1(A,B,C,D, 8, 3); ROUND1(D,A,B,C, 9, 7);
|
||||
ROUND1(A,B,C,D, 8, 3); ROUND1(D,A,B,C, 9, 7);
|
||||
ROUND1(C,D,A,B, 10, 11); ROUND1(B,C,D,A, 11, 19);
|
||||
ROUND1(A,B,C,D, 12, 3); ROUND1(D,A,B,C, 13, 7);
|
||||
ROUND1(C,D,A,B, 14, 11); ROUND1(B,C,D,A, 15, 19);
|
||||
ROUND1(A,B,C,D, 12, 3); ROUND1(D,A,B,C, 13, 7);
|
||||
ROUND1(C,D,A,B, 14, 11); ROUND1(B,C,D,A, 15, 19);
|
||||
|
||||
ROUND2(A,B,C,D, 0, 3); ROUND2(D,A,B,C, 4, 5);
|
||||
ROUND2(A,B,C,D, 0, 3); ROUND2(D,A,B,C, 4, 5);
|
||||
ROUND2(C,D,A,B, 8, 9); ROUND2(B,C,D,A, 12, 13);
|
||||
ROUND2(A,B,C,D, 1, 3); ROUND2(D,A,B,C, 5, 5);
|
||||
ROUND2(A,B,C,D, 1, 3); ROUND2(D,A,B,C, 5, 5);
|
||||
ROUND2(C,D,A,B, 9, 9); ROUND2(B,C,D,A, 13, 13);
|
||||
ROUND2(A,B,C,D, 2, 3); ROUND2(D,A,B,C, 6, 5);
|
||||
ROUND2(A,B,C,D, 2, 3); ROUND2(D,A,B,C, 6, 5);
|
||||
ROUND2(C,D,A,B, 10, 9); ROUND2(B,C,D,A, 14, 13);
|
||||
ROUND2(A,B,C,D, 3, 3); ROUND2(D,A,B,C, 7, 5);
|
||||
ROUND2(A,B,C,D, 3, 3); ROUND2(D,A,B,C, 7, 5);
|
||||
ROUND2(C,D,A,B, 11, 9); ROUND2(B,C,D,A, 15, 13);
|
||||
|
||||
ROUND3(A,B,C,D, 0, 3); ROUND3(D,A,B,C, 8, 9);
|
||||
ROUND3(A,B,C,D, 0, 3); ROUND3(D,A,B,C, 8, 9);
|
||||
ROUND3(C,D,A,B, 4, 11); ROUND3(B,C,D,A, 12, 15);
|
||||
ROUND3(A,B,C,D, 2, 3); ROUND3(D,A,B,C, 10, 9);
|
||||
ROUND3(A,B,C,D, 2, 3); ROUND3(D,A,B,C, 10, 9);
|
||||
ROUND3(C,D,A,B, 6, 11); ROUND3(B,C,D,A, 14, 15);
|
||||
ROUND3(A,B,C,D, 1, 3); ROUND3(D,A,B,C, 9, 9);
|
||||
ROUND3(A,B,C,D, 1, 3); ROUND3(D,A,B,C, 9, 9);
|
||||
ROUND3(C,D,A,B, 5, 11); ROUND3(B,C,D,A, 13, 15);
|
||||
ROUND3(A,B,C,D, 3, 3); ROUND3(D,A,B,C, 11, 9);
|
||||
ROUND3(A,B,C,D, 3, 3); ROUND3(D,A,B,C, 11, 9);
|
||||
ROUND3(C,D,A,B, 7, 11); ROUND3(B,C,D,A, 15, 15);
|
||||
|
||||
A += AA; B += BB; C += CC; D += DD;
|
||||
|
||||
|
||||
#ifdef LARGE_INT32
|
||||
A &= 0xFFFFFFFF; B &= 0xFFFFFFFF;
|
||||
C &= 0xFFFFFFFF; D &= 0xFFFFFFFF;
|
||||
|
@ -149,7 +149,7 @@ static void mdfour_tail(unsigned char *in, int n)
|
|||
copy64(M, buf);
|
||||
mdfour64(M);
|
||||
} else {
|
||||
copy4(buf+120, b);
|
||||
copy4(buf+120, b);
|
||||
copy64(M, buf);
|
||||
mdfour64(M);
|
||||
copy64(M, buf+64);
|
||||
|
@ -202,13 +202,13 @@ static void file_checksum1(char *fname)
|
|||
int fd, i;
|
||||
struct mdfour md;
|
||||
unsigned char buf[64*1024], sum[16];
|
||||
|
||||
|
||||
fd = open(fname,O_RDONLY);
|
||||
if (fd == -1) {
|
||||
perror("fname");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
mdfour_begin(&md);
|
||||
|
||||
while (1) {
|
||||
|
@ -240,7 +240,7 @@ static void file_checksum2(char *fname)
|
|||
perror("fname");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
MDbegin(&md);
|
||||
|
||||
while (1) {
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
/*
|
||||
/*
|
||||
Unix SMB/Netbios implementation.
|
||||
Version 1.9.
|
||||
a implementation of MD4 designed for use in the SMB authentication protocol
|
||||
Copyright (C) Andrew Tridgell 1997-1998.
|
||||
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
|
190
common/model.c
190
common/model.c
|
@ -12,7 +12,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.
|
||||
|
||||
|
@ -86,13 +86,13 @@ Caches the data if needed
|
|||
void *Mod_Extradata (model_t *mod)
|
||||
{
|
||||
void *r;
|
||||
|
||||
|
||||
r = Cache_Check (&mod->cache);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
Mod_LoadModel (mod, true);
|
||||
|
||||
|
||||
if (!mod->cache.data)
|
||||
Sys_Error ("Mod_Extradata: caching failed");
|
||||
return mod->cache.data;
|
||||
|
@ -108,7 +108,7 @@ mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
|
|||
mnode_t *node;
|
||||
float d;
|
||||
mplane_t *plane;
|
||||
|
||||
|
||||
if (!model || !model->nodes)
|
||||
SV_SYS_ERROR ("Mod_PointInLeaf: bad model");
|
||||
|
||||
|
@ -124,7 +124,7 @@ mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
|
|||
else
|
||||
node = node->children[1];
|
||||
}
|
||||
|
||||
|
||||
return NULL; // never reached
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ byte *Mod_DecompressVis (byte *in, model_t *model)
|
|||
byte *out;
|
||||
int row;
|
||||
|
||||
row = (model->numleafs+7)>>3;
|
||||
row = (model->numleafs+7)>>3;
|
||||
out = decompressed;
|
||||
|
||||
#if 0
|
||||
|
@ -154,7 +154,7 @@ byte *Mod_DecompressVis (byte *in, model_t *model)
|
|||
*out++ = 0xff;
|
||||
row--;
|
||||
}
|
||||
return decompressed;
|
||||
return decompressed;
|
||||
}
|
||||
|
||||
do
|
||||
|
@ -164,7 +164,7 @@ byte *Mod_DecompressVis (byte *in, model_t *model)
|
|||
*out++ = *in++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
c = in[1];
|
||||
in += 2;
|
||||
while (c)
|
||||
|
@ -174,7 +174,7 @@ byte *Mod_DecompressVis (byte *in, model_t *model)
|
|||
}
|
||||
} while (out - decompressed < row);
|
||||
#endif
|
||||
|
||||
|
||||
return decompressed;
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ void Mod_ClearAll (void)
|
|||
{
|
||||
int i;
|
||||
model_t *mod;
|
||||
|
||||
|
||||
for (i=0 , mod=mod_known ; i<mod_numknown ; i++, mod++)
|
||||
if (mod->type != mod_alias)
|
||||
mod->needload = true;
|
||||
|
@ -210,17 +210,17 @@ model_t *Mod_FindName (char *name)
|
|||
{
|
||||
int i;
|
||||
model_t *mod;
|
||||
|
||||
|
||||
if (!name[0])
|
||||
SV_SYS_ERROR ("Mod_ForName: NULL name");
|
||||
|
||||
|
||||
//
|
||||
// search the currently loaded models
|
||||
//
|
||||
for (i=0 , mod=mod_known ; i<mod_numknown ; i++, mod++)
|
||||
if (!strcmp (mod->name, name) )
|
||||
break;
|
||||
|
||||
|
||||
if (i == mod_numknown)
|
||||
{
|
||||
if (mod_numknown == MAX_MOD_KNOWN)
|
||||
|
@ -242,9 +242,9 @@ Mod_TouchModel
|
|||
void Mod_TouchModel (char *name)
|
||||
{
|
||||
model_t *mod;
|
||||
|
||||
|
||||
mod = Mod_FindName (name);
|
||||
|
||||
|
||||
if (!mod->needload)
|
||||
{
|
||||
if (mod->type == mod_alias)
|
||||
|
@ -282,9 +282,9 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
|
|||
//
|
||||
if (!crash)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// load the file
|
||||
//
|
||||
|
@ -295,12 +295,12 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
|
|||
SV_SYS_ERROR ("Mod_NumForName: %s not found", mod->name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// allocate a new model
|
||||
//
|
||||
COM_FileBase (mod->name, loadname);
|
||||
|
||||
|
||||
loadmodel = mod;
|
||||
|
||||
//
|
||||
|
@ -309,7 +309,7 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
|
|||
|
||||
// call the apropriate loader
|
||||
mod->needload = false;
|
||||
|
||||
|
||||
#ifdef SERVERONLY //XXX FIXME WTF (taniwha)
|
||||
Mod_LoadBrushModel (mod, buf);
|
||||
#else
|
||||
|
@ -318,11 +318,11 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
|
|||
case IDPOLYHEADER:
|
||||
Mod_LoadAliasModel (mod, buf);
|
||||
break;
|
||||
|
||||
|
||||
case IDSPRITEHEADER:
|
||||
Mod_LoadSpriteModel (mod, buf);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
Mod_LoadBrushModel (mod, buf);
|
||||
break;
|
||||
|
@ -369,7 +369,7 @@ int Mod_LoadExternalTexture(int number, char *texturename)
|
|||
return (0);
|
||||
|
||||
sprintf(texturepathname, "/id1/gfx/%s", texturename);
|
||||
|
||||
|
||||
mt = (miptex_t *)COM_LoadHunkFile(texturepathname);
|
||||
|
||||
if (!mt)
|
||||
|
@ -380,7 +380,7 @@ int Mod_LoadExternalTexture(int number, char *texturename)
|
|||
mt->height = LittleLong (mt->height);
|
||||
for (j=0 ; j<MIPLEVELS ; j++)
|
||||
mt->offsets[j] = LittleLong (mt->offsets[j]);
|
||||
|
||||
|
||||
if ( (mt->width & 15) || (mt->height & 15) )
|
||||
Sys_Error ("Texture %s is not 16 aligned", mt->name);
|
||||
pixels = mt->width*mt->height/64*85;
|
||||
|
@ -395,10 +395,10 @@ int Mod_LoadExternalTexture(int number, char *texturename)
|
|||
tx->offsets[j] = mt->offsets[j] + sizeof(texture_t) - sizeof(miptex_t);
|
||||
// the pixels immediately follow the structures
|
||||
memcpy ( tx+1, mt+1, pixels);
|
||||
|
||||
if (!Q_strncmp(mt->name,"sky",3))
|
||||
|
||||
if (!Q_strncmp(mt->name,"sky",3))
|
||||
R_InitSky (tx);
|
||||
return (1);
|
||||
return (1);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -422,9 +422,9 @@ void Mod_LoadTextures (lump_t *l)
|
|||
return;
|
||||
}
|
||||
m = (dmiptexlump_t *)(mod_base + l->fileofs);
|
||||
|
||||
|
||||
m->nummiptex = LittleLong (m->nummiptex);
|
||||
|
||||
|
||||
loadmodel->numtextures = m->nummiptex;
|
||||
loadmodel->textures = Hunk_AllocName (m->nummiptex * sizeof(*loadmodel->textures) , loadname);
|
||||
|
||||
|
@ -445,7 +445,7 @@ void Mod_LoadTextures (lump_t *l)
|
|||
#endif
|
||||
for (j=0 ; j<MIPLEVELS ; j++)
|
||||
mt->offsets[j] = LittleLong (mt->offsets[j]);
|
||||
|
||||
|
||||
if ( (mt->width & 15) || (mt->height & 15) )
|
||||
SV_SYS_ERROR ("Texture %s is not 16 aligned", mt->name);
|
||||
pixels = mt->width*mt->height/64*85;
|
||||
|
@ -459,8 +459,8 @@ void Mod_LoadTextures (lump_t *l)
|
|||
tx->offsets[j] = mt->offsets[j] + sizeof(texture_t) - sizeof(miptex_t);
|
||||
// the pixels immediately follow the structures
|
||||
memcpy ( tx+1, mt+1, pixels);
|
||||
#ifndef SERVERONLY
|
||||
if (!Q_strncmp(mt->name,"sky",3))
|
||||
#ifndef SERVERONLY
|
||||
if (!Q_strncmp(mt->name,"sky",3))
|
||||
R_InitSky (tx);
|
||||
#endif
|
||||
}
|
||||
|
@ -529,7 +529,7 @@ void Mod_LoadTextures (lump_t *l)
|
|||
else
|
||||
SV_SYS_ERROR ("Bad animating texture %s", tx->name);
|
||||
}
|
||||
|
||||
|
||||
#define ANIM_CYCLE 2
|
||||
// link them all together
|
||||
for (j=0 ; j<max ; j++)
|
||||
|
@ -571,7 +571,7 @@ void Mod_LoadLighting (lump_t *l)
|
|||
loadmodel->lightdata = NULL;
|
||||
return;
|
||||
}
|
||||
loadmodel->lightdata = Hunk_AllocName ( l->filelen, loadname);
|
||||
loadmodel->lightdata = Hunk_AllocName ( l->filelen, loadname);
|
||||
memcpy (loadmodel->lightdata, mod_base + l->fileofs, l->filelen);
|
||||
}
|
||||
|
||||
|
@ -588,7 +588,7 @@ void Mod_LoadVisibility (lump_t *l)
|
|||
loadmodel->visdata = NULL;
|
||||
return;
|
||||
}
|
||||
loadmodel->visdata = Hunk_AllocName ( l->filelen, loadname);
|
||||
loadmodel->visdata = Hunk_AllocName ( l->filelen, loadname);
|
||||
memcpy (loadmodel->visdata, mod_base + l->fileofs, l->filelen);
|
||||
}
|
||||
|
||||
|
@ -605,7 +605,7 @@ void Mod_LoadEntities (lump_t *l)
|
|||
loadmodel->entities = NULL;
|
||||
return;
|
||||
}
|
||||
loadmodel->entities = Hunk_AllocName ( l->filelen, loadname);
|
||||
loadmodel->entities = Hunk_AllocName ( l->filelen, loadname);
|
||||
memcpy (loadmodel->entities, mod_base + l->fileofs, l->filelen);
|
||||
}
|
||||
|
||||
|
@ -625,7 +625,7 @@ void Mod_LoadVertexes (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
SV_SYS_ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->vertexes = out;
|
||||
loadmodel->numvertexes = count;
|
||||
|
@ -653,7 +653,7 @@ void Mod_LoadSubmodels (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
SV_SYS_ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->submodels = out;
|
||||
loadmodel->numsubmodels = count;
|
||||
|
@ -689,7 +689,7 @@ void Mod_LoadEdges (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
SV_SYS_ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( (count + 1) * sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( (count + 1) * sizeof(*out), loadname);
|
||||
|
||||
loadmodel->edges = out;
|
||||
loadmodel->numedges = count;
|
||||
|
@ -718,7 +718,7 @@ void Mod_LoadTexinfo (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
SV_SYS_ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->texinfo = out;
|
||||
loadmodel->numtexinfo = count;
|
||||
|
@ -761,7 +761,7 @@ void Mod_LoadTexinfo (lump_t *l)
|
|||
#endif
|
||||
miptex = LittleLong (in->miptex);
|
||||
out->flags = LittleLong (in->flags);
|
||||
|
||||
|
||||
if (!loadmodel->textures)
|
||||
{
|
||||
#ifdef SERVERONLY
|
||||
|
@ -808,7 +808,7 @@ void CalcSurfaceExtents (msurface_t *s)
|
|||
maxs[0] = maxs[1] = -99999;
|
||||
|
||||
tex = s->texinfo;
|
||||
|
||||
|
||||
for (i=0 ; i<s->numedges ; i++)
|
||||
{
|
||||
e = loadmodel->surfedges[s->firstedge+i];
|
||||
|
@ -816,10 +816,10 @@ void CalcSurfaceExtents (msurface_t *s)
|
|||
v = &loadmodel->vertexes[loadmodel->edges[e].v[0]];
|
||||
else
|
||||
v = &loadmodel->vertexes[loadmodel->edges[-e].v[1]];
|
||||
|
||||
|
||||
for (j=0 ; j<2 ; j++)
|
||||
{
|
||||
val = v->position[0] * tex->vecs[j][0] +
|
||||
val = v->position[0] * tex->vecs[j][0] +
|
||||
v->position[1] * tex->vecs[j][1] +
|
||||
v->position[2] * tex->vecs[j][2] +
|
||||
tex->vecs[j][3];
|
||||
|
@ -831,7 +831,7 @@ void CalcSurfaceExtents (msurface_t *s)
|
|||
}
|
||||
|
||||
for (i=0 ; i<2 ; i++)
|
||||
{
|
||||
{
|
||||
bmins[i] = floor(mins[i]/16);
|
||||
bmaxs[i] = ceil(maxs[i]/16);
|
||||
|
||||
|
@ -859,7 +859,7 @@ void Mod_LoadFaces (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
SV_SYS_ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->surfaces = out;
|
||||
loadmodel->numsurfaces = count;
|
||||
|
@ -867,20 +867,20 @@ void Mod_LoadFaces (lump_t *l)
|
|||
for ( surfnum=0 ; surfnum<count ; surfnum++, in++, out++)
|
||||
{
|
||||
out->firstedge = LittleLong(in->firstedge);
|
||||
out->numedges = LittleShort(in->numedges);
|
||||
out->numedges = LittleShort(in->numedges);
|
||||
out->flags = 0;
|
||||
|
||||
planenum = LittleShort(in->planenum);
|
||||
side = LittleShort(in->side);
|
||||
if (side)
|
||||
out->flags |= SURF_PLANEBACK;
|
||||
out->flags |= SURF_PLANEBACK;
|
||||
|
||||
out->plane = loadmodel->planes + planenum;
|
||||
|
||||
out->texinfo = loadmodel->texinfo + LittleShort (in->texinfo);
|
||||
|
||||
CalcSurfaceExtents (out);
|
||||
|
||||
|
||||
// lighting info
|
||||
|
||||
for (i=0 ; i<MAXLIGHTMAPS ; i++)
|
||||
|
@ -890,15 +890,15 @@ void Mod_LoadFaces (lump_t *l)
|
|||
out->samples = NULL;
|
||||
else
|
||||
out->samples = loadmodel->lightdata + i;
|
||||
|
||||
|
||||
// set the drawing flags flag
|
||||
|
||||
|
||||
if (!Q_strncmp(out->texinfo->texture->name,"sky",3)) // sky
|
||||
{
|
||||
out->flags |= (SURF_DRAWSKY | SURF_DRAWTILED);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!Q_strncmp(out->texinfo->texture->name,"*",1)) // turbulent
|
||||
{
|
||||
out->flags |= (SURF_DRAWTURB | SURF_DRAWTILED);
|
||||
|
@ -942,7 +942,7 @@ void Mod_LoadNodes (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
SV_SYS_ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->nodes = out;
|
||||
loadmodel->numnodes = count;
|
||||
|
@ -954,13 +954,13 @@ void Mod_LoadNodes (lump_t *l)
|
|||
out->minmaxs[j] = LittleShort (in->mins[j]);
|
||||
out->minmaxs[3+j] = LittleShort (in->maxs[j]);
|
||||
}
|
||||
|
||||
|
||||
p = LittleLong(in->planenum);
|
||||
out->plane = loadmodel->planes + p;
|
||||
|
||||
out->firstsurface = LittleShort (in->firstface);
|
||||
out->numsurfaces = LittleShort (in->numfaces);
|
||||
|
||||
|
||||
for (j=0 ; j<2 ; j++)
|
||||
{
|
||||
p = LittleShort (in->children[j]);
|
||||
|
@ -970,7 +970,7 @@ void Mod_LoadNodes (lump_t *l)
|
|||
out->children[j] = (mnode_t *)(loadmodel->leafs + (-1 - p));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Mod_SetParent (loadmodel->nodes, NULL); // sets nodes and leafs
|
||||
}
|
||||
|
||||
|
@ -989,7 +989,7 @@ void Mod_LoadLeafs (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
SV_SYS_ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->leafs = out;
|
||||
loadmodel->numleafs = count;
|
||||
|
@ -1008,17 +1008,17 @@ void Mod_LoadLeafs (lump_t *l)
|
|||
out->firstmarksurface = loadmodel->marksurfaces +
|
||||
LittleShort(in->firstmarksurface);
|
||||
out->nummarksurfaces = LittleShort(in->nummarksurfaces);
|
||||
|
||||
|
||||
p = LittleLong(in->visofs);
|
||||
if (p == -1)
|
||||
out->compressed_vis = NULL;
|
||||
else
|
||||
out->compressed_vis = loadmodel->visdata + p;
|
||||
out->efrags = NULL;
|
||||
|
||||
|
||||
for (j=0 ; j<4 ; j++)
|
||||
out->ambient_sound_level[j] = in->ambient_level[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1036,7 +1036,7 @@ void Mod_LoadClipnodes (lump_t *l)
|
|||
if (l->filelen % sizeof(*in))
|
||||
SV_SYS_ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->clipnodes = out;
|
||||
loadmodel->numclipnodes = count;
|
||||
|
@ -1086,12 +1086,12 @@ void Mod_MakeHull0 (void)
|
|||
dclipnode_t *out;
|
||||
int i, j, count;
|
||||
hull_t *hull;
|
||||
|
||||
hull = &loadmodel->hulls[0];
|
||||
|
||||
|
||||
hull = &loadmodel->hulls[0];
|
||||
|
||||
in = loadmodel->nodes;
|
||||
count = loadmodel->numnodes;
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
hull->clipnodes = out;
|
||||
hull->firstclipnode = 0;
|
||||
|
@ -1118,16 +1118,16 @@ Mod_LoadMarksurfaces
|
|||
=================
|
||||
*/
|
||||
void Mod_LoadMarksurfaces (lump_t *l)
|
||||
{
|
||||
{
|
||||
int i, j, count;
|
||||
short *in;
|
||||
msurface_t **out;
|
||||
|
||||
|
||||
in = (void *)(mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof(*in))
|
||||
SV_SYS_ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->marksurfaces = out;
|
||||
loadmodel->nummarksurfaces = count;
|
||||
|
@ -1147,15 +1147,15 @@ Mod_LoadSurfedges
|
|||
=================
|
||||
*/
|
||||
void Mod_LoadSurfedges (lump_t *l)
|
||||
{
|
||||
{
|
||||
int i, count;
|
||||
int *in, *out;
|
||||
|
||||
|
||||
in = (void *)(mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof(*in))
|
||||
SV_SYS_ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
out = Hunk_AllocName ( count*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->surfedges = out;
|
||||
loadmodel->numsurfedges = count;
|
||||
|
@ -1176,13 +1176,13 @@ void Mod_LoadPlanes (lump_t *l)
|
|||
dplane_t *in;
|
||||
int count;
|
||||
int bits;
|
||||
|
||||
|
||||
in = (void *)(mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof(*in))
|
||||
SV_SYS_ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
|
||||
count = l->filelen / sizeof(*in);
|
||||
out = Hunk_AllocName ( count*2*sizeof(*out), loadname);
|
||||
|
||||
out = Hunk_AllocName ( count*2*sizeof(*out), loadname);
|
||||
|
||||
loadmodel->planes = out;
|
||||
loadmodel->numplanes = count;
|
||||
|
||||
|
@ -1230,9 +1230,9 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
|
|||
int i, j;
|
||||
dheader_t *header;
|
||||
dmodel_t *bm;
|
||||
|
||||
|
||||
loadmodel->type = mod_brush;
|
||||
|
||||
|
||||
header = (dheader_t *)buffer;
|
||||
|
||||
i = LittleLong (header->version);
|
||||
|
@ -1241,7 +1241,7 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
|
|||
mod->name, i);
|
||||
|
||||
bspver = i; // save BSP version for later use
|
||||
|
||||
|
||||
// swap all the lumps
|
||||
mod_base = (byte *)header;
|
||||
|
||||
|
@ -1255,15 +1255,15 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
|
|||
for (i = 0; i < HEADER_LUMPS; i++) {
|
||||
if (i == LUMP_ENTITIES)
|
||||
continue;
|
||||
mod->checksum ^= LittleLong(Com_BlockChecksum(mod_base + header->lumps[i].fileofs,
|
||||
mod->checksum ^= LittleLong(Com_BlockChecksum(mod_base + header->lumps[i].fileofs,
|
||||
header->lumps[i].filelen));
|
||||
|
||||
if (i == LUMP_VISIBILITY || i == LUMP_LEAFS || i == LUMP_NODES)
|
||||
continue;
|
||||
mod->checksum2 ^= LittleLong(Com_BlockChecksum(mod_base + header->lumps[i].fileofs,
|
||||
mod->checksum2 ^= LittleLong(Com_BlockChecksum(mod_base + header->lumps[i].fileofs,
|
||||
header->lumps[i].filelen));
|
||||
}
|
||||
|
||||
|
||||
// load into heap
|
||||
|
||||
Mod_LoadVertexes (&header->lumps[LUMP_VERTEXES]);
|
||||
|
@ -1283,10 +1283,10 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
|
|||
Mod_LoadSubmodels (&header->lumps[LUMP_MODELS]);
|
||||
|
||||
Mod_MakeHull0 ();
|
||||
|
||||
|
||||
mod->numframes = 2; // regular and alternate animation
|
||||
mod->flags = 0;
|
||||
|
||||
|
||||
//
|
||||
// set up the submodels (FIXME: this is confusing)
|
||||
//
|
||||
|
@ -1300,14 +1300,14 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
|
|||
mod->hulls[j].firstclipnode = bm->headnode[j];
|
||||
mod->hulls[j].lastclipnode = mod->numclipnodes-1;
|
||||
}
|
||||
|
||||
|
||||
mod->firstmodelsurface = bm->firstface;
|
||||
mod->nummodelsurfaces = bm->numfaces;
|
||||
mod->radius = RadiusFromBounds (mod->mins, mod->maxs);
|
||||
|
||||
|
||||
VectorCopy (bm->maxs, mod->maxs);
|
||||
VectorCopy (bm->mins, mod->mins);
|
||||
|
||||
|
||||
mod->numleafs = bm->visleafs;
|
||||
|
||||
if (i < mod->numsubmodels-1)
|
||||
|
@ -1393,7 +1393,7 @@ void * Mod_LoadAliasGroup (void * pin, int *pframeindex, int numv,
|
|||
daliasinterval_t *pin_intervals;
|
||||
float *poutintervals;
|
||||
void *ptemp;
|
||||
|
||||
|
||||
pingroup = (daliasgroup_t *)pin;
|
||||
|
||||
numframes = LittleLong (pingroup->numframes);
|
||||
|
@ -1557,7 +1557,7 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
|
|||
maliasskindesc_t *pskindesc;
|
||||
int skinsize;
|
||||
int start, end, total;
|
||||
|
||||
|
||||
if (!strcmp(loadmodel->name, "progs/player.mdl") ||
|
||||
!strcmp(loadmodel->name, "progs/eyes.mdl")) {
|
||||
unsigned short crc;
|
||||
|
@ -1568,15 +1568,15 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
|
|||
CRC_Init(&crc);
|
||||
for (len = com_filesize, p = buffer; len; len--, p++)
|
||||
CRC_ProcessByte(&crc, *p);
|
||||
|
||||
|
||||
snprintf(st, sizeof(st), "%d", (int) crc);
|
||||
Info_SetValueForKey (cls.userinfo,
|
||||
Info_SetValueForKey (cls.userinfo,
|
||||
!strcmp(loadmodel->name, "progs/player.mdl") ? pmodel_name : emodel_name,
|
||||
st, MAX_INFO_STRING);
|
||||
|
||||
if (cls.state >= ca_connected) {
|
||||
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
|
||||
snprintf(st, sizeof(st), "setinfo %s %d",
|
||||
snprintf(st, sizeof(st), "setinfo %s %d",
|
||||
!strcmp(loadmodel->name, "progs/player.mdl") ? pmodel_name : emodel_name,
|
||||
(int)crc);
|
||||
SZ_Print (&cls.netchan.message, st);
|
||||
|
@ -1606,7 +1606,7 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
|
|||
pmodel = (mdl_t *) ((byte *)&pheader[1] +
|
||||
(LittleLong (pinmodel->numframes) - 1) *
|
||||
sizeof (pheader->frames[0]));
|
||||
|
||||
|
||||
// mod->cache.data = pheader;
|
||||
mod->flags = LittleLong (pinmodel->flags);
|
||||
|
||||
|
@ -1775,10 +1775,10 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
|
|||
|
||||
//
|
||||
// move the complete, relocatable alias model to the cache
|
||||
//
|
||||
//
|
||||
end = Hunk_LowMark ();
|
||||
total = end - start;
|
||||
|
||||
|
||||
Cache_Alloc (&mod->cache, total, loadname);
|
||||
if (!mod->cache.data)
|
||||
return;
|
||||
|
@ -1912,7 +1912,7 @@ void Mod_LoadSpriteModel (model_t *mod, void *buffer)
|
|||
int numframes;
|
||||
int size;
|
||||
dspriteframetype_t *pframetype;
|
||||
|
||||
|
||||
pin = (dsprite_t *)buffer;
|
||||
|
||||
version = LittleLong (pin->version);
|
||||
|
@ -1939,7 +1939,7 @@ void Mod_LoadSpriteModel (model_t *mod, void *buffer)
|
|||
mod->maxs[0] = mod->maxs[1] = psprite->maxwidth/2;
|
||||
mod->mins[2] = -psprite->maxheight/2;
|
||||
mod->maxs[2] = psprite->maxheight/2;
|
||||
|
||||
|
||||
//
|
||||
// load the frames
|
||||
//
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
@ -141,7 +141,7 @@ typedef struct msurface_s
|
|||
|
||||
int firstedge; // look up in model->surfedges[], negative numbers
|
||||
int numedges; // are backwards edges
|
||||
|
||||
|
||||
struct surfcache_s *cachespots[MIPLEVELS];
|
||||
|
||||
short texturemins[2];
|
||||
|
@ -153,7 +153,7 @@ typedef struct msurface_s
|
|||
struct msurface_s *texturechain;
|
||||
|
||||
mtexinfo_t *texinfo;
|
||||
|
||||
|
||||
// lighting info
|
||||
int dlightframe;
|
||||
int dlightbits;
|
||||
|
@ -170,14 +170,14 @@ typedef struct mnode_s
|
|||
// common with leaf
|
||||
int contents; // 0, to differentiate from leafs
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
||||
|
||||
float minmaxs[6]; // for bounding box culling
|
||||
|
||||
struct mnode_s *parent;
|
||||
|
||||
// node specific
|
||||
mplane_t *plane;
|
||||
struct mnode_s *children[2];
|
||||
struct mnode_s *children[2];
|
||||
|
||||
unsigned short firstsurface;
|
||||
unsigned short numsurfaces;
|
||||
|
@ -379,17 +379,17 @@ typedef struct model_s
|
|||
modtype_t type;
|
||||
int numframes;
|
||||
synctype_t synctype;
|
||||
|
||||
|
||||
int flags;
|
||||
|
||||
//
|
||||
// volume occupied by the model graphics
|
||||
//
|
||||
//
|
||||
vec3_t mins, maxs;
|
||||
float radius;
|
||||
|
||||
//
|
||||
// solid volume for clipping
|
||||
// solid volume for clipping
|
||||
//
|
||||
qboolean clipbox;
|
||||
vec3_t clipmins, clipmaxs;
|
||||
|
|
|
@ -10,7 +10,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.
|
||||
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -101,7 +101,7 @@ typedef struct qsocket_s
|
|||
qboolean disconnected;
|
||||
qboolean canSend;
|
||||
qboolean sendNext;
|
||||
|
||||
|
||||
int driver;
|
||||
int landriver;
|
||||
int socket;
|
||||
|
|
|
@ -11,7 +11,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.
|
||||
|
||||
|
@ -131,7 +131,7 @@ void Netchan_OutOfBand (netadr_t adr, int length, byte *data)
|
|||
send.data = send_buf;
|
||||
send.maxsize = sizeof(send_buf);
|
||||
send.cursize = 0;
|
||||
|
||||
|
||||
MSG_WriteLong (&send, -1); // -1 sequence means out of band
|
||||
SZ_Write (&send, data, length);
|
||||
|
||||
|
@ -154,7 +154,7 @@ void Netchan_OutOfBandPrint (netadr_t adr, char *format, ...)
|
|||
{
|
||||
va_list argptr;
|
||||
static char string[8192]; // ??? why static?
|
||||
|
||||
|
||||
va_start (argptr, format);
|
||||
vsnprintf (string, sizeof(string), format, argptr);
|
||||
va_end (argptr);
|
||||
|
@ -174,16 +174,16 @@ called to open a channel to a remote system
|
|||
void Netchan_Setup (netchan_t *chan, netadr_t adr, int qport)
|
||||
{
|
||||
memset (chan, 0, sizeof(*chan));
|
||||
|
||||
|
||||
chan->remote_address = adr;
|
||||
chan->last_received = realtime;
|
||||
|
||||
|
||||
chan->message.data = chan->message_buf;
|
||||
chan->message.allowoverflow = true;
|
||||
chan->message.maxsize = sizeof(chan->message_buf);
|
||||
|
||||
chan->qport = qport;
|
||||
|
||||
|
||||
chan->rate = 1.0/2500;
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,7 @@ qboolean Netchan_CanPacket (netchan_t *chan)
|
|||
===============
|
||||
Netchan_CanReliable
|
||||
|
||||
Returns true if the bandwidth choke isn't
|
||||
Returns true if the bandwidth choke isn't
|
||||
================
|
||||
*/
|
||||
qboolean Netchan_CanReliable (netchan_t *chan)
|
||||
|
@ -290,7 +290,7 @@ void Netchan_Transmit (netchan_t *chan, int length, byte *data)
|
|||
SZ_Write (&send, chan->reliable_buf, chan->reliable_length);
|
||||
chan->last_reliable_sequence = chan->outgoing_sequence;
|
||||
}
|
||||
|
||||
|
||||
// add the unreliable part if space is available
|
||||
if (send.maxsize - send.cursize >= length)
|
||||
SZ_Write (&send, data, length);
|
||||
|
@ -344,12 +344,12 @@ qboolean Netchan_Process (netchan_t *chan)
|
|||
|
||||
if (
|
||||
#ifndef SERVERONLY
|
||||
!cls.demoplayback &&
|
||||
!cls.demoplayback &&
|
||||
#endif
|
||||
!NET_CompareAdr (net_from, chan->remote_address))
|
||||
return false;
|
||||
|
||||
// get sequence numbers
|
||||
|
||||
// get sequence numbers
|
||||
MSG_BeginReading ();
|
||||
sequence = MSG_ReadLong ();
|
||||
sequence_ack = MSG_ReadLong ();
|
||||
|
@ -362,8 +362,8 @@ qboolean Netchan_Process (netchan_t *chan)
|
|||
reliable_message = sequence >> 31;
|
||||
reliable_ack = sequence_ack >> 31;
|
||||
|
||||
sequence &= ~(1<<31);
|
||||
sequence_ack &= ~(1<<31);
|
||||
sequence &= ~(1<<31);
|
||||
sequence_ack &= ~(1<<31);
|
||||
|
||||
if (showpackets->value)
|
||||
Con_Printf ("<-- s=%i(%i) a=%i(%i) %i\n"
|
||||
|
@ -379,7 +379,7 @@ qboolean Netchan_Process (netchan_t *chan)
|
|||
{
|
||||
int i;
|
||||
double time, rate;
|
||||
|
||||
|
||||
i = sequence_ack & (MAX_LATENT - 1);
|
||||
time = realtime - chan->outgoing_time[i];
|
||||
time -= 0.1; // subtract 100 ms
|
||||
|
@ -437,9 +437,9 @@ qboolean Netchan_Process (netchan_t *chan)
|
|||
//
|
||||
if (reliable_ack == (unsigned)chan->reliable_sequence)
|
||||
chan->reliable_length = 0; // it has been received
|
||||
|
||||
|
||||
//
|
||||
// if this message contains a reliable message, bump incoming_reliable_sequence
|
||||
// if this message contains a reliable message, bump incoming_reliable_sequence
|
||||
//
|
||||
chan->incoming_sequence = sequence;
|
||||
chan->incoming_acknowledged = sequence_ack;
|
||||
|
@ -454,7 +454,7 @@ qboolean Netchan_Process (netchan_t *chan)
|
|||
chan->frame_latency = chan->frame_latency*OLD_AVG
|
||||
+ (chan->outgoing_sequence-sequence_ack)*(1.0-OLD_AVG);
|
||||
chan->frame_rate = chan->frame_rate*OLD_AVG
|
||||
+ (realtime-chan->last_received)*(1.0-OLD_AVG);
|
||||
+ (realtime-chan->last_received)*(1.0-OLD_AVG);
|
||||
chan->good_count += 1;
|
||||
|
||||
chan->last_received = realtime;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*
|
||||
net_com.c - MD4-based checksum utility functions
|
||||
|
||||
|
||||
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
||||
Please see the file "AUTHORS" for a list of contributors
|
||||
|
||||
Author: Jeff Teunissen <d2deek@pmail.net>
|
||||
Date: 01 Jan 2000
|
||||
|
||||
|
||||
This file is part of the QuakeForge utility library.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
|
@ -16,7 +16,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.
|
||||
|
||||
|
@ -37,7 +37,7 @@ unsigned Com_BlockChecksum (void *buffer, int length)
|
|||
// mdfour_update (&md, (unsigned char *) buffer, length);
|
||||
// mdfour_result (&md, (unsigned char *) digest);
|
||||
mdfour ( (unsigned char *) digest, (unsigned char *) buffer, length );
|
||||
|
||||
|
||||
val = digest[0] ^ digest[1] ^ digest[2] ^ digest[3];
|
||||
|
||||
return val;
|
||||
|
@ -46,7 +46,7 @@ unsigned Com_BlockChecksum (void *buffer, int length)
|
|||
void Com_BlockFullChecksum (void *buffer, int len, unsigned char *outbuf)
|
||||
{
|
||||
// struct mdfour md;
|
||||
|
||||
|
||||
// mdfour_begin (&md);
|
||||
// mdfour_update (&md, (unsigned char *) buffer, len);
|
||||
// mdfour_result (&md, outbuf);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue