mirror of
https://github.com/yquake2/ctf.git
synced 2024-11-22 20:01:03 +00:00
Reformat headers.
This commit is contained in:
parent
9357548ed3
commit
3ebbe127d2
4 changed files with 1107 additions and 1175 deletions
169
src/header/ctf.h
169
src/header/ctf.h
|
@ -1,75 +1,84 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* =======================================================================
|
||||
*
|
||||
* CTF specific stuff.
|
||||
*
|
||||
* =======================================================================
|
||||
*/
|
||||
|
||||
#ifndef CTF_CTF_H
|
||||
#define CTF_CTF_H
|
||||
|
||||
#define CTF_VERSION 1.52
|
||||
#define CTF_VSTRING2(x) #x
|
||||
#define CTF_VERSION 1.52
|
||||
#define CTF_VSTRING2(x) # x
|
||||
#define CTF_VSTRING(x) CTF_VSTRING2(x)
|
||||
#define CTF_STRING_VERSION CTF_VSTRING(CTF_VERSION)
|
||||
#define CTF_STRING_VERSION CTF_VSTRING(CTF_VERSION)
|
||||
|
||||
#define STAT_CTF_TEAM1_PIC 17
|
||||
#define STAT_CTF_TEAM1_CAPS 18
|
||||
#define STAT_CTF_TEAM2_PIC 19
|
||||
#define STAT_CTF_TEAM2_CAPS 20
|
||||
#define STAT_CTF_FLAG_PIC 21
|
||||
#define STAT_CTF_JOINED_TEAM1_PIC 22
|
||||
#define STAT_CTF_JOINED_TEAM2_PIC 23
|
||||
#define STAT_CTF_TEAM1_HEADER 24
|
||||
#define STAT_CTF_TEAM2_HEADER 25
|
||||
#define STAT_CTF_TECH 26
|
||||
#define STAT_CTF_ID_VIEW 27
|
||||
#define STAT_CTF_MATCH 28
|
||||
#define STAT_CTF_ID_VIEW_COLOR 29
|
||||
#define STAT_CTF_TEAMINFO 30
|
||||
#define STAT_CTF_TEAM1_PIC 17
|
||||
#define STAT_CTF_TEAM1_CAPS 18
|
||||
#define STAT_CTF_TEAM2_PIC 19
|
||||
#define STAT_CTF_TEAM2_CAPS 20
|
||||
#define STAT_CTF_FLAG_PIC 21
|
||||
#define STAT_CTF_JOINED_TEAM1_PIC 22
|
||||
#define STAT_CTF_JOINED_TEAM2_PIC 23
|
||||
#define STAT_CTF_TEAM1_HEADER 24
|
||||
#define STAT_CTF_TEAM2_HEADER 25
|
||||
#define STAT_CTF_TECH 26
|
||||
#define STAT_CTF_ID_VIEW 27
|
||||
#define STAT_CTF_MATCH 28
|
||||
#define STAT_CTF_ID_VIEW_COLOR 29
|
||||
#define STAT_CTF_TEAMINFO 30
|
||||
|
||||
#define CONFIG_CTF_MATCH (CS_AIRACCEL-1)
|
||||
#define CONFIG_CTF_TEAMINFO (CS_AIRACCEL-2)
|
||||
#define CONFIG_CTF_MATCH (CS_AIRACCEL - 1)
|
||||
#define CONFIG_CTF_TEAMINFO (CS_AIRACCEL - 2)
|
||||
|
||||
typedef enum {
|
||||
typedef enum
|
||||
{
|
||||
CTF_NOTEAM,
|
||||
CTF_TEAM1,
|
||||
CTF_TEAM2
|
||||
} ctfteam_t;
|
||||
|
||||
typedef enum {
|
||||
typedef enum
|
||||
{
|
||||
CTF_GRAPPLE_STATE_FLY,
|
||||
CTF_GRAPPLE_STATE_PULL,
|
||||
CTF_GRAPPLE_STATE_HANG
|
||||
} ctfgrapplestate_t;
|
||||
|
||||
typedef struct ghost_s {
|
||||
typedef struct ghost_s
|
||||
{
|
||||
char netname[16];
|
||||
int number;
|
||||
|
||||
// stats
|
||||
/* stats */
|
||||
int deaths;
|
||||
int kills;
|
||||
int caps;
|
||||
int basedef;
|
||||
int carrierdef;
|
||||
|
||||
int code; // ghost code
|
||||
int team; // team
|
||||
int score; // frags at time of disconnect
|
||||
int code; /* ghost code */
|
||||
int team; /* team */
|
||||
int score; /* frags at time of disconnect */
|
||||
edict_t *ent;
|
||||
} ghost_t;
|
||||
|
||||
|
@ -78,36 +87,36 @@ extern cvar_t *ctf;
|
|||
#define CTF_TEAM1_SKIN "ctf_r"
|
||||
#define CTF_TEAM2_SKIN "ctf_b"
|
||||
|
||||
#define DF_CTF_FORCEJOIN 131072
|
||||
#define DF_ARMOR_PROTECT 262144
|
||||
#define DF_CTF_NO_TECH 524288
|
||||
#define DF_CTF_FORCEJOIN 131072
|
||||
#define DF_ARMOR_PROTECT 262144
|
||||
#define DF_CTF_NO_TECH 524288
|
||||
|
||||
#define CTF_CAPTURE_BONUS 15 // what you get for capture
|
||||
#define CTF_TEAM_BONUS 10 // what your team gets for capture
|
||||
#define CTF_RECOVERY_BONUS 1 // what you get for recovery
|
||||
#define CTF_FLAG_BONUS 0 // what you get for picking up enemy flag
|
||||
#define CTF_FRAG_CARRIER_BONUS 2 // what you get for fragging enemy flag carrier
|
||||
#define CTF_FLAG_RETURN_TIME 40 // seconds until auto return
|
||||
#define CTF_CAPTURE_BONUS 15 /* what you get for capture */
|
||||
#define CTF_TEAM_BONUS 10 /* what your team gets for capture */
|
||||
#define CTF_RECOVERY_BONUS 1 /* what you get for recovery */
|
||||
#define CTF_FLAG_BONUS 0 /* what you get for picking up enemy flag */
|
||||
#define CTF_FRAG_CARRIER_BONUS 2 /* what you get for fragging enemy flag carrier */
|
||||
#define CTF_FLAG_RETURN_TIME 40 /* seconds until auto return */
|
||||
|
||||
#define CTF_CARRIER_DANGER_PROTECT_BONUS 2 // bonus for fraggin someone who has recently hurt your flag carrier
|
||||
#define CTF_CARRIER_PROTECT_BONUS 1 // bonus for fraggin someone while either you or your target are near your flag carrier
|
||||
#define CTF_FLAG_DEFENSE_BONUS 1 // bonus for fraggin someone while either you or your target are near your flag
|
||||
#define CTF_RETURN_FLAG_ASSIST_BONUS 1 // awarded for returning a flag that causes a capture to happen almost immediately
|
||||
#define CTF_FRAG_CARRIER_ASSIST_BONUS 2 // award for fragging a flag carrier if a capture happens almost immediately
|
||||
#define CTF_CARRIER_DANGER_PROTECT_BONUS 2 /* bonus for fraggin someone who has recently hurt your flag carrier */
|
||||
#define CTF_CARRIER_PROTECT_BONUS 1 /* bonus for fraggin someone while either you or your target are near your flag carrier */
|
||||
#define CTF_FLAG_DEFENSE_BONUS 1 /* bonus for fraggin someone while either you or your target are near your flag */
|
||||
#define CTF_RETURN_FLAG_ASSIST_BONUS 1 /* awarded for returning a flag that causes a capture to happen almost immediately */
|
||||
#define CTF_FRAG_CARRIER_ASSIST_BONUS 2 /* award for fragging a flag carrier if a capture happens almost immediately */
|
||||
|
||||
#define CTF_TARGET_PROTECT_RADIUS 400 // the radius around an object being defended where a target will be worth extra frags
|
||||
#define CTF_ATTACKER_PROTECT_RADIUS 400 // the radius around an object being defended where an attacker will get extra frags when making kills
|
||||
#define CTF_TARGET_PROTECT_RADIUS 400 /* the radius around an object being defended where a target will be worth extra frags */
|
||||
#define CTF_ATTACKER_PROTECT_RADIUS 400 /* the radius around an object being defended where an attacker will get extra frags when making kills */
|
||||
|
||||
#define CTF_CARRIER_DANGER_PROTECT_TIMEOUT 8
|
||||
#define CTF_FRAG_CARRIER_ASSIST_TIMEOUT 10
|
||||
#define CTF_RETURN_FLAG_ASSIST_TIMEOUT 10
|
||||
#define CTF_CARRIER_DANGER_PROTECT_TIMEOUT 8
|
||||
#define CTF_FRAG_CARRIER_ASSIST_TIMEOUT 10
|
||||
#define CTF_RETURN_FLAG_ASSIST_TIMEOUT 10
|
||||
|
||||
#define CTF_AUTO_FLAG_RETURN_TIMEOUT 30 // number of seconds before dropped flag auto-returns
|
||||
#define CTF_AUTO_FLAG_RETURN_TIMEOUT 30 /* number of seconds before dropped flag auto-returns */
|
||||
|
||||
#define CTF_TECH_TIMEOUT 60 // seconds before techs spawn again
|
||||
#define CTF_TECH_TIMEOUT 60 /* seconds before techs spawn again */
|
||||
|
||||
#define CTF_GRAPPLE_SPEED 650 // speed of grapple in flight
|
||||
#define CTF_GRAPPLE_PULL_SPEED 650 // speed player is pulled at
|
||||
#define CTF_GRAPPLE_SPEED 650 /* speed of grapple in flight */
|
||||
#define CTF_GRAPPLE_PULL_SPEED 650 /* speed player is pulled at */
|
||||
|
||||
void CTFInit(void);
|
||||
void CTFSpawn(void);
|
||||
|
@ -120,31 +129,31 @@ char *CTFTeamName(int team);
|
|||
char *CTFOtherTeamName(int team);
|
||||
void CTFAssignSkin(edict_t *ent, char *s);
|
||||
void CTFAssignTeam(gclient_t *who);
|
||||
edict_t *SelectCTFSpawnPoint (edict_t *ent);
|
||||
edict_t *SelectCTFSpawnPoint(edict_t *ent);
|
||||
qboolean CTFPickup_Flag(edict_t *ent, edict_t *other);
|
||||
void CTFDrop_Flag(edict_t *ent, gitem_t *item);
|
||||
void CTFEffects(edict_t *player);
|
||||
void CTFCalcScores(void);
|
||||
void SetCTFStats(edict_t *ent);
|
||||
void CTFDeadDropFlag(edict_t *self);
|
||||
void CTFScoreboardMessage (edict_t *ent, edict_t *killer);
|
||||
void CTFTeam_f (edict_t *ent);
|
||||
void CTFID_f (edict_t *ent);
|
||||
void CTFScoreboardMessage(edict_t *ent, edict_t *killer);
|
||||
void CTFTeam_f(edict_t *ent);
|
||||
void CTFID_f(edict_t *ent);
|
||||
void CTFSay_Team(edict_t *who, char *msg);
|
||||
void CTFFlagSetup (edict_t *ent);
|
||||
void CTFFlagSetup(edict_t *ent);
|
||||
void CTFResetFlag(int ctf_team);
|
||||
void CTFFragBonuses(edict_t *targ, edict_t *inflictor, edict_t *attacker);
|
||||
void CTFCheckHurtCarrier(edict_t *targ, edict_t *attacker);
|
||||
|
||||
// GRAPPLE
|
||||
void CTFWeapon_Grapple (edict_t *ent);
|
||||
/* GRAPPLE */
|
||||
void CTFWeapon_Grapple(edict_t *ent);
|
||||
void CTFPlayerResetGrapple(edict_t *ent);
|
||||
void CTFGrapplePull(edict_t *self);
|
||||
void CTFResetGrapple(edict_t *self);
|
||||
|
||||
//TECH
|
||||
/* TECH */
|
||||
gitem_t *CTFWhat_Tech(edict_t *ent);
|
||||
qboolean CTFPickup_Tech (edict_t *ent, edict_t *other);
|
||||
qboolean CTFPickup_Tech(edict_t *ent, edict_t *other);
|
||||
void CTFDrop_Tech(edict_t *ent, gitem_t *item);
|
||||
void CTFDeadDropTech(edict_t *ent);
|
||||
void CTFSetupTechSpawn(void);
|
||||
|
@ -177,8 +186,8 @@ void CTFPlayerList(edict_t *ent);
|
|||
|
||||
qboolean CTFCheckRules(void);
|
||||
|
||||
void SP_misc_ctf_banner (edict_t *ent);
|
||||
void SP_misc_ctf_small_banner (edict_t *ent);
|
||||
void SP_misc_ctf_banner(edict_t *ent);
|
||||
void SP_misc_ctf_small_banner(edict_t *ent);
|
||||
|
||||
extern char *ctf_statusbar;
|
||||
|
||||
|
@ -188,8 +197,8 @@ void ChasePrev(edict_t *ent);
|
|||
|
||||
void CTFObserver(edict_t *ent);
|
||||
|
||||
void SP_trigger_teleport (edict_t *ent);
|
||||
void SP_info_teleport_destination (edict_t *ent);
|
||||
void SP_trigger_teleport(edict_t *ent);
|
||||
void SP_info_teleport_destination(edict_t *ent);
|
||||
|
||||
void CTFSetPowerUpEffect(edict_t *ent, int def);
|
||||
|
||||
|
|
|
@ -1,248 +1,215 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* =======================================================================
|
||||
*
|
||||
* Here are the client, server and game are tied together.
|
||||
*
|
||||
* =======================================================================
|
||||
*/
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
/*
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*
|
||||
* THIS FILE IS _VERY_ FRAGILE AND THERE'S NOTHING IN IT THAT CAN OR
|
||||
* MUST BE CHANGED. IT'S MOST LIKELY A VERY GOOD IDEA TO CLOSE THE
|
||||
* EDITOR NOW AND NEVER LOOK BACK. OTHERWISE YOU MAY SCREW UP EVERYTHING!
|
||||
*
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*/
|
||||
|
||||
#ifndef CTF_GAME_H
|
||||
#define CTF_GAME_H
|
||||
|
||||
// game.h -- game dll information visible to server
|
||||
#define GAME_API_VERSION 3
|
||||
|
||||
#define GAME_API_VERSION 3
|
||||
|
||||
// edict->svflags
|
||||
|
||||
#define SVF_NOCLIENT 0x00000001 // don't send entity to clients, even if it has effects
|
||||
#define SVF_DEADMONSTER 0x00000002 // treat as CONTENTS_DEADMONSTER for collision
|
||||
#define SVF_MONSTER 0x00000004 // treat as CONTENTS_MONSTER for collision
|
||||
//ZOID
|
||||
#define SVF_PROJECTILE 0x00000008 // entity is simple projectile, used for network optimization
|
||||
// if an entity is projectile, the model index/x/y/z/pitch/yaw are sent, encoded into
|
||||
// seven (or eight) bytes. This is to speed up projectiles. Currently, only the
|
||||
// hyperblaster makes use of this. use for items that are moving with a constant
|
||||
// velocity that don't change direction or model
|
||||
//ZOID
|
||||
|
||||
// edict->solid values
|
||||
/* edict->svflags */
|
||||
#define SVF_NOCLIENT 0x00000001 /* don't send entity to clients, even if it has effects */
|
||||
#define SVF_DEADMONSTER 0x00000002 /* treat as CONTENTS_DEADMONSTER for collision */
|
||||
#define SVF_MONSTER 0x00000004 /* treat as CONTENTS_MONSTER for collision */
|
||||
#define SVF_PROJECTILE 0x00000008 /* entity is simple projectile, used for network optimization */
|
||||
|
||||
/* edict->solid values */
|
||||
typedef enum
|
||||
{
|
||||
SOLID_NOT, // no interaction with other objects
|
||||
SOLID_TRIGGER, // only touch when inside, after moving
|
||||
SOLID_BBOX, // touch on edge
|
||||
SOLID_BSP // bsp clip, touch on edge
|
||||
SOLID_NOT, /* no interaction with other objects */
|
||||
SOLID_TRIGGER, /* only touch when inside, after moving */
|
||||
SOLID_BBOX, /* touch on edge */
|
||||
SOLID_BSP /* bsp clip, touch on edge */
|
||||
} solid_t;
|
||||
|
||||
//===============================================================
|
||||
/* =============================================================== */
|
||||
|
||||
// link_t is only used for entity area links now
|
||||
/* link_t is only used for entity area links now */
|
||||
typedef struct link_s
|
||||
{
|
||||
struct link_s *prev, *next;
|
||||
struct link_s *prev, *next;
|
||||
} link_t;
|
||||
|
||||
#define MAX_ENT_CLUSTERS 16
|
||||
|
||||
#define MAX_ENT_CLUSTERS 16
|
||||
|
||||
typedef struct edict_s edict_t;
|
||||
typedef struct gclient_s gclient_t;
|
||||
|
||||
|
||||
#ifndef GAME_INCLUDE
|
||||
|
||||
struct gclient_s
|
||||
{
|
||||
player_state_t ps; // communicated by server to clients
|
||||
int ping;
|
||||
// the game dll can add anything it wants after
|
||||
// this point in the structure
|
||||
player_state_t ps; /* communicated by server to clients */
|
||||
int ping;
|
||||
/* the game dll can add anything it wants after */
|
||||
/* this point in the structure */
|
||||
};
|
||||
|
||||
|
||||
struct edict_s
|
||||
{
|
||||
entity_state_t s;
|
||||
struct gclient_s *client;
|
||||
qboolean inuse;
|
||||
int linkcount;
|
||||
entity_state_t s;
|
||||
struct gclient_s *client;
|
||||
qboolean inuse;
|
||||
int linkcount;
|
||||
|
||||
// FIXME: move these fields to a server private sv_entity_t
|
||||
link_t area; // linked to a division node or leaf
|
||||
|
||||
int num_clusters; // if -1, use headnode instead
|
||||
int clusternums[MAX_ENT_CLUSTERS];
|
||||
int headnode; // unused if num_clusters != -1
|
||||
int areanum, areanum2;
|
||||
link_t area; /* linked to a division node or leaf */
|
||||
|
||||
//================================
|
||||
int num_clusters; /* if -1, use headnode instead */
|
||||
int clusternums[MAX_ENT_CLUSTERS];
|
||||
int headnode; /* unused if num_clusters != -1 */
|
||||
int areanum, areanum2;
|
||||
|
||||
int svflags; // SVF_NOCLIENT, SVF_DEADMONSTER, SVF_MONSTER, etc
|
||||
vec3_t mins, maxs;
|
||||
vec3_t absmin, absmax, size;
|
||||
solid_t solid;
|
||||
int clipmask;
|
||||
edict_t *owner;
|
||||
/* ================================ */
|
||||
|
||||
// the game dll can add anything it wants after
|
||||
// this point in the structure
|
||||
int svflags; /* SVF_NOCLIENT, SVF_DEADMONSTER, SVF_MONSTER, etc */
|
||||
vec3_t mins, maxs;
|
||||
vec3_t absmin, absmax, size;
|
||||
solid_t solid;
|
||||
int clipmask;
|
||||
edict_t *owner;
|
||||
};
|
||||
|
||||
#endif // GAME_INCLUDE
|
||||
#endif /* GAME_INCLUDE */
|
||||
|
||||
//===============================================================
|
||||
/* =============================================================== */
|
||||
|
||||
//
|
||||
// functions provided by the main engine
|
||||
//
|
||||
/* functions provided by the main engine */
|
||||
typedef struct
|
||||
{
|
||||
// special messages
|
||||
void (*bprintf) (int printlevel, char *fmt, ...);
|
||||
void (*dprintf) (char *fmt, ...);
|
||||
void (*cprintf) (edict_t *ent, int printlevel, char *fmt, ...);
|
||||
void (*centerprintf) (edict_t *ent, char *fmt, ...);
|
||||
void (*sound) (edict_t *ent, int channel, int soundindex, float volume, float attenuation, float timeofs);
|
||||
void (*positioned_sound) (vec3_t origin, edict_t *ent, int channel, int soundinedex, float volume, float attenuation, float timeofs);
|
||||
/* special messages */
|
||||
void (*bprintf)(int printlevel, char *fmt, ...);
|
||||
void (*dprintf)(char *fmt, ...);
|
||||
void (*cprintf)(edict_t *ent, int printlevel, char *fmt, ...);
|
||||
void (*centerprintf)(edict_t *ent, char *fmt, ...);
|
||||
void (*sound)(edict_t *ent, int channel, int soundindex, float volume,
|
||||
float attenuation, float timeofs);
|
||||
void (*positioned_sound)(vec3_t origin, edict_t *ent, int channel,
|
||||
int soundinedex, float volume, float attenuation, float timeofs);
|
||||
|
||||
// config strings hold all the index strings, the lightstyles,
|
||||
// and misc data like the sky definition and cdtrack.
|
||||
// All of the current configstrings are sent to clients when
|
||||
// they connect, and changes are sent to all connected clients.
|
||||
void (*configstring) (int num, char *string);
|
||||
void (*configstring)(int num, char *string);
|
||||
|
||||
void (*error) (char *fmt, ...);
|
||||
void (*error)(char *fmt, ...);
|
||||
|
||||
// the *index functions create configstrings and some internal server state
|
||||
int (*modelindex) (char *name);
|
||||
int (*soundindex) (char *name);
|
||||
int (*imageindex) (char *name);
|
||||
/* the *index functions create configstrings and some internal server state */
|
||||
int (*modelindex)(char *name);
|
||||
int (*soundindex)(char *name);
|
||||
int (*imageindex)(char *name);
|
||||
|
||||
void (*setmodel) (edict_t *ent, char *name);
|
||||
void (*setmodel)(edict_t *ent, char *name);
|
||||
|
||||
// collision detection
|
||||
trace_t (*trace) (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, edict_t *passent, int contentmask);
|
||||
int (*pointcontents) (vec3_t point);
|
||||
qboolean (*inPVS) (vec3_t p1, vec3_t p2);
|
||||
qboolean (*inPHS) (vec3_t p1, vec3_t p2);
|
||||
void (*SetAreaPortalState) (int portalnum, qboolean open);
|
||||
qboolean (*AreasConnected) (int area1, int area2);
|
||||
/* collision detection */
|
||||
trace_t (*trace)(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end,
|
||||
edict_t *passent, int contentmask);
|
||||
int (*pointcontents)(vec3_t point);
|
||||
qboolean (*inPVS)(vec3_t p1, vec3_t p2);
|
||||
qboolean (*inPHS)(vec3_t p1, vec3_t p2);
|
||||
void (*SetAreaPortalState)(int portalnum, qboolean open);
|
||||
qboolean (*AreasConnected)(int area1, int area2);
|
||||
|
||||
// an entity will never be sent to a client or used for collision
|
||||
// if it is not passed to linkentity. If the size, position, or
|
||||
// solidity changes, it must be relinked.
|
||||
void (*linkentity) (edict_t *ent);
|
||||
void (*unlinkentity) (edict_t *ent); // call before removing an interactive edict
|
||||
int (*BoxEdicts) (vec3_t mins, vec3_t maxs, edict_t **list, int maxcount, int areatype);
|
||||
void (*Pmove) (pmove_t *pmove); // player movement code common with client prediction
|
||||
void (*linkentity)(edict_t *ent);
|
||||
void (*unlinkentity)(edict_t *ent); /* call before removing an interactive edict */
|
||||
int (*BoxEdicts)(vec3_t mins, vec3_t maxs, edict_t **list, int maxcount,
|
||||
int areatype);
|
||||
void (*Pmove)(pmove_t *pmove); /* player movement code common with client prediction */
|
||||
|
||||
// network messaging
|
||||
void (*multicast) (vec3_t origin, multicast_t to);
|
||||
void (*unicast) (edict_t *ent, qboolean reliable);
|
||||
void (*WriteChar) (int c);
|
||||
void (*WriteByte) (int c);
|
||||
void (*WriteShort) (int c);
|
||||
void (*WriteLong) (int c);
|
||||
void (*WriteFloat) (float f);
|
||||
void (*WriteString) (char *s);
|
||||
void (*WritePosition) (vec3_t pos); // some fractional bits
|
||||
void (*WriteDir) (vec3_t pos); // single byte encoded, very coarse
|
||||
void (*WriteAngle) (float f);
|
||||
/* network messaging */
|
||||
void (*multicast)(vec3_t origin, multicast_t to);
|
||||
void (*unicast)(edict_t *ent, qboolean reliable);
|
||||
void (*WriteChar)(int c);
|
||||
void (*WriteByte)(int c);
|
||||
void (*WriteShort)(int c);
|
||||
void (*WriteLong)(int c);
|
||||
void (*WriteFloat)(float f);
|
||||
void (*WriteString)(char *s);
|
||||
void (*WritePosition)(vec3_t pos); /* some fractional bits */
|
||||
void (*WriteDir)(vec3_t pos); /* single byte encoded, very coarse */
|
||||
void (*WriteAngle)(float f);
|
||||
|
||||
// managed memory allocation
|
||||
void *(*TagMalloc) (int size, int tag);
|
||||
void (*TagFree) (void *block);
|
||||
void (*FreeTags) (int tag);
|
||||
/* managed memory allocation */
|
||||
void *(*TagMalloc)(int size, int tag);
|
||||
void (*TagFree)(void *block);
|
||||
void (*FreeTags)(int tag);
|
||||
|
||||
// console variable interaction
|
||||
cvar_t *(*cvar) (char *var_name, char *value, int flags);
|
||||
cvar_t *(*cvar_set) (char *var_name, char *value);
|
||||
cvar_t *(*cvar_forceset) (char *var_name, char *value);
|
||||
/* console variable interaction */
|
||||
cvar_t *(*cvar)(char *var_name, char *value, int flags);
|
||||
cvar_t *(*cvar_set)(char *var_name, char *value);
|
||||
cvar_t *(*cvar_forceset)(char *var_name, char *value);
|
||||
|
||||
// ClientCommand and ServerCommand parameter access
|
||||
int (*argc) (void);
|
||||
char *(*argv) (int n);
|
||||
char *(*args) (void); // concatenation of all argv >= 1
|
||||
/* ClientCommand and ServerCommand parameter access */
|
||||
int (*argc)(void);
|
||||
char *(*argv)(int n);
|
||||
char *(*args)(void); /* concatenation of all argv >= 1 */
|
||||
|
||||
// add commands to the server console as if they were typed in
|
||||
// for map changing, etc
|
||||
void (*AddCommandString) (char *text);
|
||||
|
||||
void (*DebugGraph) (float value, int color);
|
||||
void (*AddCommandString)(char *text);
|
||||
void (*DebugGraph)(float value, int color);
|
||||
} game_import_t;
|
||||
|
||||
//
|
||||
// functions exported by the game subsystem
|
||||
//
|
||||
/* functions exported by the game subsystem */
|
||||
typedef struct
|
||||
{
|
||||
int apiversion;
|
||||
int apiversion;
|
||||
|
||||
// the init function will only be called when a game starts,
|
||||
// not each time a level is loaded. Persistant data for clients
|
||||
// and the server can be allocated in init
|
||||
void (*Init) (void);
|
||||
void (*Shutdown) (void);
|
||||
void (*Init)(void);
|
||||
void (*Shutdown)(void);
|
||||
|
||||
// each new level entered will cause a call to SpawnEntities
|
||||
void (*SpawnEntities) (char *mapname, char *entstring, char *spawnpoint);
|
||||
/* each new level entered will cause a call to SpawnEntities */
|
||||
void (*SpawnEntities)(char *mapname, char *entstring, char *spawnpoint);
|
||||
|
||||
// Read/Write Game is for storing persistant cross level information
|
||||
// about the world state and the clients.
|
||||
// WriteGame is called every time a level is exited.
|
||||
// ReadGame is called on a loadgame.
|
||||
void (*WriteGame) (char *filename, qboolean autosave);
|
||||
void (*ReadGame) (char *filename);
|
||||
void (*WriteGame)(char *filename, qboolean autosave);
|
||||
void (*ReadGame)(char *filename);
|
||||
void (*WriteLevel)(char *filename);
|
||||
void (*ReadLevel)(char *filename);
|
||||
|
||||
// ReadLevel is called after the default map information has been
|
||||
// loaded with SpawnEntities
|
||||
void (*WriteLevel) (char *filename);
|
||||
void (*ReadLevel) (char *filename);
|
||||
qboolean (*ClientConnect)(edict_t *ent, char *userinfo);
|
||||
void (*ClientBegin)(edict_t *ent);
|
||||
void (*ClientUserinfoChanged)(edict_t *ent, char *userinfo);
|
||||
void (*ClientDisconnect)(edict_t *ent);
|
||||
void (*ClientCommand)(edict_t *ent);
|
||||
void (*ClientThink)(edict_t *ent, usercmd_t *cmd);
|
||||
|
||||
qboolean (*ClientConnect) (edict_t *ent, char *userinfo);
|
||||
void (*ClientBegin) (edict_t *ent);
|
||||
void (*ClientUserinfoChanged) (edict_t *ent, char *userinfo);
|
||||
void (*ClientDisconnect) (edict_t *ent);
|
||||
void (*ClientCommand) (edict_t *ent);
|
||||
void (*ClientThink) (edict_t *ent, usercmd_t *cmd);
|
||||
void (*RunFrame)(void);
|
||||
void (*ServerCommand)(void);
|
||||
|
||||
void (*RunFrame) (void);
|
||||
|
||||
// ServerCommand will be called when an "sv <command>" command is issued on the
|
||||
// server console.
|
||||
// The game can issue gi.argc() / gi.argv() commands to get the rest
|
||||
// of the parameters
|
||||
void (*ServerCommand) (void);
|
||||
|
||||
//
|
||||
// global variables shared between game and server
|
||||
//
|
||||
|
||||
// The edict array is allocated in the game dll so it
|
||||
// can vary in size from one game to another.
|
||||
//
|
||||
// The size will be fixed when ge->Init() is called
|
||||
struct edict_s *edicts;
|
||||
int edict_size;
|
||||
int num_edicts; // current number, <= max_edicts
|
||||
int max_edicts;
|
||||
/* global variables shared between game and server */
|
||||
struct edict_s *edicts;
|
||||
int edict_size;
|
||||
int num_edicts; /* current number, <= max_edicts */
|
||||
int max_edicts;
|
||||
} game_export_t;
|
||||
|
||||
game_export_t *GetGameApi (game_import_t *import);
|
||||
game_export_t *GetGameApi(game_import_t *import);
|
||||
|
||||
#endif /* CTF_GAME_H */
|
||||
|
||||
|
|
1718
src/header/local.h
1718
src/header/local.h
File diff suppressed because it is too large
Load diff
|
@ -1,33 +1,41 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* =======================================================================
|
||||
*
|
||||
* Header for the CTF ingame menu.
|
||||
*
|
||||
* =======================================================================
|
||||
*/
|
||||
|
||||
#ifndef CTF_MENU_H
|
||||
#define CTF_MENU_H
|
||||
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
PMENU_ALIGN_LEFT,
|
||||
PMENU_ALIGN_CENTER,
|
||||
PMENU_ALIGN_RIGHT
|
||||
};
|
||||
|
||||
typedef struct pmenuhnd_s {
|
||||
typedef struct pmenuhnd_s
|
||||
{
|
||||
struct pmenu_s *entries;
|
||||
int cur;
|
||||
int num;
|
||||
|
@ -36,15 +44,23 @@ typedef struct pmenuhnd_s {
|
|||
|
||||
typedef void (*SelectFunc_t)(edict_t *ent, pmenuhnd_t *hnd);
|
||||
|
||||
typedef struct pmenu_s {
|
||||
typedef struct pmenu_s
|
||||
{
|
||||
char *text;
|
||||
int align;
|
||||
SelectFunc_t SelectFunc;
|
||||
} pmenu_t;
|
||||
|
||||
pmenuhnd_t *PMenu_Open(edict_t *ent, pmenu_t *entries, int cur, int num, void *arg);
|
||||
pmenuhnd_t *PMenu_Open(edict_t *ent,
|
||||
pmenu_t *entries,
|
||||
int cur,
|
||||
int num,
|
||||
void *arg);
|
||||
void PMenu_Close(edict_t *ent);
|
||||
void PMenu_UpdateEntry(pmenu_t *entry, const char *text, int align, SelectFunc_t SelectFunc);
|
||||
void PMenu_UpdateEntry(pmenu_t *entry,
|
||||
const char *text,
|
||||
int align,
|
||||
SelectFunc_t SelectFunc);
|
||||
void PMenu_Do_Update(edict_t *ent);
|
||||
void PMenu_Update(edict_t *ent);
|
||||
void PMenu_Next(edict_t *ent);
|
||||
|
|
Loading…
Reference in a new issue