Die letzten Header neu formatiert und in Sachen Komponenten aufgeräumt

This commit is contained in:
Yamagi Burmeister 2010-06-22 15:33:23 +00:00
parent 65230953f0
commit 7841c910ca
5 changed files with 223 additions and 236 deletions

View File

@ -30,6 +30,19 @@
#define INT int
#endif
#define MAX_CLIENTWEAPONMODELS 20
#define CMD_BACKUP 4 /* allow a lot of command backups for very fast systems */
/* the cl_parse_entities must be large enough to hold UPDATE_BACKUP frames of
entities, so that when a delta compressed message arives from the server
it can be un-deltad from the original */
#define MAX_PARSE_ENTITIES 1024
#define MAX_SUSTAINS 32
#define PARTICLE_GRAVITY 40
#define BLASTER_PARTICLE_COLOR 0xe0
#define INSTANT_PARTICLE -10000.0
#include <math.h>
#include <string.h>
#include <stdarg.h>
@ -74,8 +87,6 @@ typedef struct
int fly_stoptime;
} centity_t;
#define MAX_CLIENTWEAPONMODELS 20
typedef struct
{
char name[MAX_QPATH];
@ -94,11 +105,8 @@ typedef struct
extern char cl_weaponmodels[MAX_CLIENTWEAPONMODELS][MAX_QPATH];
extern int num_cl_weaponmodels;
#define CMD_BACKUP 4 /* allow a lot of command backups for very fast systems */
/* the client_state_t structure is wiped
completely at every server map change */
typedef struct
{
int timeoutcount;
@ -291,13 +299,8 @@ typedef struct
extern centity_t cl_entities[MAX_EDICTS];
extern cdlight_t cl_dlights[MAX_DLIGHTS];
/* the cl_parse_entities must be large enough to hold UPDATE_BACKUP frames of
entities, so that when a delta compressed message arives from the server
it can be un-deltad from the original */
#define MAX_PARSE_ENTITIES 1024
extern entity_state_t cl_parse_entities[MAX_PARSE_ENTITIES];
extern netadr_t net_from;
extern sizebuf_t net_message;
@ -322,7 +325,6 @@ typedef struct cl_sustain
void (*think)(struct cl_sustain *self);
} cl_sustain_t;
#define MAX_SUSTAINS 32
void CL_ParticleSteamEffect2(cl_sustain_t *self);
void CL_TeleporterParticles (entity_state_t *ent);
@ -348,11 +350,6 @@ typedef struct particle_s
float alphavel;
} cparticle_t;
#define PARTICLE_GRAVITY 40
#define BLASTER_PARTICLE_COLOR 0xe0
#define INSTANT_PARTICLE -10000.0
void CL_ClearEffects (void);
void CL_ClearTEnts (void);
void CL_BlasterTrail (vec3_t start, vec3_t end);
@ -407,7 +404,6 @@ void CL_AddDLights (void);
void CL_AddTEnts (void);
void CL_AddLightStyles (void);
void CL_PrepRefresh (void);
void CL_RegisterSounds (void);
@ -417,7 +413,6 @@ void IN_Accumulate (void);
void CL_ParseLayout (void);
extern refexport_t re;
void CL_Init (void);
@ -513,3 +508,4 @@ void CL_KeyInventory (int key);
void CL_DrawInventory (void);
void CL_PredictMovement (void);

View File

@ -1,6 +1,3 @@
//psychospaz's particle system
typedef enum
{
particle_generic,

View File

@ -1,22 +1,29 @@
/*
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.
*
* =======================================================================
*
* ABI between client and refresher
*
* =======================================================================
*/
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.
*/
#ifndef __REF_H
#define __REF_H
@ -37,79 +44,67 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define SHELL_RB_COLOR 0x68
#define SHELL_BG_COLOR 0x78
//ROGUE
#define SHELL_DOUBLE_COLOR 0xDF // 223
#define SHELL_DOUBLE_COLOR 0xDF
#define SHELL_HALF_DAM_COLOR 0x90
#define SHELL_CYAN_COLOR 0x72
//ROGUE
#define SHELL_CYAN_COLOR 0x72
#define SHELL_WHITE_COLOR 0xD7
typedef struct entity_s
{
struct model_s *model; // opaque type outside refresh
#define ENTITY_FLAGS 68
#define API_VERSION 3
typedef struct entity_s {
struct model_s *model; /* opaque type outside refresh */
float angles[3];
/*
** most recent data
*/
float origin[3]; // also used as RF_BEAM's "from"
int frame; // also used as RF_BEAM's diameter
/* most recent data */
float origin[3]; /* also used as RF_BEAM's "from" */
int frame; /* also used as RF_BEAM's diameter */
/*
** previous data for lerping
*/
float oldorigin[3]; // also used as RF_BEAM's "to"
/* previous data for lerping */
float oldorigin[3]; /* also used as RF_BEAM's "to" */
int oldframe;
/*
** misc
*/
float backlerp; // 0.0 = current, 1.0 = old
int skinnum; // also used as RF_BEAM's palette index
/* misc */
float backlerp; /* 0.0 = current, 1.0 = old */
int skinnum; /* also used as RF_BEAM's palette index */
int lightstyle; // for flashing entities
float alpha; // ignore if RF_TRANSLUCENT isn't set
int lightstyle; /* for flashing entities */
float alpha; /* ignore if RF_TRANSLUCENT isn't set */
struct image_s *skin; // NULL for inline skin
struct image_s *skin; /* NULL for inline skin */
int flags;
} entity_t;
#define ENTITY_FLAGS 68
typedef struct
{
vec3_t origin;
vec3_t color;
float intensity;
typedef struct {
vec3_t origin;
vec3_t color;
float intensity;
} dlight_t;
typedef struct
{
typedef struct {
vec3_t origin;
int color;
float alpha;
} particle_t;
typedef struct
{
float rgb[3]; // 0.0 - 2.0
float white; // highest of rgb
typedef struct {
float rgb[3]; /* 0.0 - 2.0 */
float white; /* highest of rgb */
} lightstyle_t;
typedef struct
{
int x, y, width, height;// in virtual screen coordinates
typedef struct {
int x, y, width, height; /* in virtual screen coordinates */
float fov_x, fov_y;
float vieworg[3];
float viewangles[3];
float blend[4]; // rgba 0-1 full screen blend
float time; // time is uesed to auto animate
int rdflags; // RDF_UNDERWATER, etc
float blend[4]; /* rgba 0-1 full screen blend */
float time; /* time is uesed to auto animate */
int rdflags; /* RDF_UNDERWATER, etc */
byte *areabits; // if not NULL, only areas with set bits will be drawn
byte *areabits; /* if not NULL, only areas with set bits will be drawn */
lightstyle_t *lightstyles; // [MAX_LIGHTSTYLES]
lightstyle_t *lightstyles; /* [MAX_LIGHTSTYLES] */
int num_entities;
entity_t *entities;
@ -121,102 +116,97 @@ typedef struct
particle_t *particles;
} refdef_t;
#define API_VERSION 3
//
// these are the functions exported by the refresh module
//
typedef struct
{
// if api_version is different, the dll cannot be used
/*
* these are the functions exported by the refresh module
*/
typedef struct {
/* if api_version is different, the dll cannot be used */
int api_version;
// called when the library is loaded
int (*Init) ( void *hinstance, void *wndproc );
/* called when the library is loaded */
int (*Init)(void *hinstance, void *wndproc);
// called before the library is unloaded
void (*Shutdown) (void);
/* called before the library is unloaded */
void (*Shutdown)(void);
// All data that will be used in a level should be
// registered before rendering any frames to prevent disk hits,
// but they can still be registered at a later time
// if necessary.
//
// EndRegistration will free any remaining data that wasn't registered.
// Any model_s or skin_s pointers from before the BeginRegistration
// are no longer valid after EndRegistration.
//
// Skins and images need to be differentiated, because skins
// are flood filled to eliminate mip map edge errors, and pics have
// an implicit "pics/" prepended to the name. (a pic name that starts with a
// slash will not use the "pics/" prefix or the ".pcx" postfix)
void (*BeginRegistration) (char *map);
struct model_s *(*RegisterModel) (char *name);
struct image_s *(*RegisterSkin) (char *name);
struct image_s *(*RegisterPic) (char *name);
void (*SetSky) (char *name, float rotate, vec3_t axis);
void (*EndRegistration) (void);
/* All data that will be used in a level should be
registered before rendering any frames to prevent disk hits,
but they can still be registered at a later time
if necessary.
void (*RenderFrame) (refdef_t *fd);
void (*DrawStretchPic) (int x, int y, int w, int h, char *name);
void (*DrawChar) (int x, int y, int c);
void (*DrawGetPicSize) (int *w, int *h, char *name); // will return 0 0 if not found
void (*DrawPic) (int x, int y, char *name);
void (*DrawTileClear) (int x, int y, int w, int h, char *name);
void (*DrawFill) (int x, int y, int w, int h, int c);
void (*DrawFadeScreen) (void);
EndRegistration will free any remaining data that wasn't registered.
Any model_s or skin_s pointers from before the BeginRegistration
are no longer valid after EndRegistration.
// Draw images for cinematic rendering (which can have a different palette). Note that calls
void (*DrawStretchRaw) (int x, int y, int w, int h, int cols, int rows, byte *data);
Skins and images need to be differentiated, because skins
are flood filled to eliminate mip map edge errors, and pics have
an implicit "pics/" prepended to the name. (a pic name that starts with a
slash will not use the "pics/" prefix or the ".pcx" postfix) */
void (*BeginRegistration)(char *map);
struct model_s *(*RegisterModel)(char *name);
struct image_s *(*RegisterSkin)(char *name);
struct image_s *(*RegisterPic)(char *name);
void (*SetSky)(char *name, float rotate, vec3_t axis);
void (*EndRegistration)(void);
/*
** video mode and refresh state management entry points
*/
void (*CinematicSetPalette)( const unsigned char *palette); // NULL = game palette
void (*BeginFrame)( float camera_separation );
void (*EndFrame) (void);
void (*RenderFrame)(refdef_t *fd);
void (*DrawStretchPic)(int x, int y, int w, int h, char *name);
void (*DrawChar)(int x, int y, int c);
void (*DrawGetPicSize)(int *w, int *h, char *name); /* will return 0 0 if not found */
void (*DrawPic)(int x, int y, char *name);
void (*DrawTileClear)(int x, int y, int w, int h, char *name);
void (*DrawFill)(int x, int y, int w, int h, int c);
void (*DrawFadeScreen)(void);
void (*AppActivate)( qboolean activate );
/* Draw images for cinematic rendering (which can have a different palette). Note that calls */
void (*DrawStretchRaw)(int x, int y, int w, int h, int cols, int rows, byte *data);
/* video mode and refresh state management entry points */
void (*CinematicSetPalette)(const unsigned char *palette); /* NULL = game palette */
void (*BeginFrame)(float camera_separation);
void (*EndFrame)(void);
void (*AppActivate)(qboolean activate);
} refexport_t;
//
// these are the functions imported by the refresh module
//
typedef struct
{
void (*Sys_Error) (int err_level, char *str, ...);
/*
* these are the functions imported by the refresh module
*/
typedef struct {
void (*Sys_Error)(int err_level, char *str, ...);
void (*Cmd_AddCommand) (char *name, void(*cmd)(void));
void (*Cmd_RemoveCommand) (char *name);
int (*Cmd_Argc) (void);
char *(*Cmd_Argv) (int i);
void (*Cmd_ExecuteText) (int exec_when, char *text);
void (*Cmd_AddCommand)(char *name, void(*cmd)(void));
void (*Cmd_RemoveCommand)(char *name);
int (*Cmd_Argc)(void);
char *(*Cmd_Argv)(int i);
void (*Cmd_ExecuteText)(int exec_when, char *text);
void (*Con_Printf) (int print_level, char *str, ...);
void (*Con_Printf)(int print_level, char *str, ...);
// files will be memory mapped read only
// the returned buffer may be part of a larger pak file,
// or a discrete file from anywhere in the quake search path
// a -1 return means the file does not exist
// NULL can be passed for buf to just determine existance
int (*FS_LoadFile) (char *name, void **buf);
void (*FS_FreeFile) (void *buf);
/* files will be memory mapped read only
the returned buffer may be part of a larger pak file,
or a discrete file from anywhere in the quake search path
a -1 return means the file does not exist
NULL can be passed for buf to just determine existance */
int (*FS_LoadFile)(char *name, void **buf);
void (*FS_FreeFile)(void *buf);
// gamedir will be the current directory that generated
// files should be stored to, ie: "f:\quake\id1"
char *(*FS_Gamedir) (void);
/* The gamedir is the ./baseq2 directory (read only) and the
~/.quake2/baseq2 directory for write operations. The later
overrides the first */
char *(*FS_Gamedir)(void);
cvar_t *(*Cvar_Get) (char *name, char *value, int flags);
cvar_t *(*Cvar_Set)( char *name, char *value );
void (*Cvar_SetValue)( char *name, float value );
cvar_t *(*Cvar_Get)(char *name, char *value, int flags);
cvar_t *(*Cvar_Set)(char *name, char *value);
void (*Cvar_SetValue)(char *name, float value);
qboolean (*Vid_GetModeInfo)( int *width, int *height, int mode );
void (*Vid_MenuInit)( void );
void (*Vid_NewWindow)( int width, int height );
qboolean(*Vid_GetModeInfo)(int *width, int *height, int mode);
void (*Vid_MenuInit)(void);
void (*Vid_NewWindow)(int width, int height);
} refimport_t;
// this is the only function actually exported at the linker level
typedef refexport_t (*GetRefAPI_t) (refimport_t);
/* this is the only function actually exported at the linker level */
typedef refexport_t (*GetRefAPI_t)(refimport_t);
#endif // __REF_H
#endif

View File

@ -1,62 +1,63 @@
/*
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.
*
* =======================================================================
*
* Header for the 2D client stuff and the .cinf file format
*
* =======================================================================
*/
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.
void SCR_Init(void);
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.
void SCR_UpdateScreen(void);
See the GNU General Public License for more details.
void SCR_SizeUp(void);
void SCR_SizeDown(void);
void SCR_CenterPrint(char *str);
void SCR_BeginLoadingPlaque(void);
void SCR_EndLoadingPlaque(void);
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.
void SCR_DebugGraph(float value, int color);
*/
// screen.h
void SCR_TouchPics(void);
void SCR_Init (void);
void SCR_UpdateScreen (void);
void SCR_SizeUp (void);
void SCR_SizeDown (void);
void SCR_CenterPrint (char *str);
void SCR_BeginLoadingPlaque (void);
void SCR_EndLoadingPlaque (void);
void SCR_DebugGraph (float value, int color);
void SCR_TouchPics (void);
void SCR_RunConsole (void);
void SCR_RunConsole(void);
extern float scr_con_current;
extern float scr_conlines; // lines of console to display
extern float scr_conlines; /* lines of console to display */
extern int sb_lines;
extern cvar_t *scr_viewsize;
extern cvar_t *crosshair;
extern vrect_t scr_vrect; // position of render window
extern vrect_t scr_vrect; /* position of render window */
extern char crosshair_pic[MAX_QPATH];
extern int crosshair_width, crosshair_height;
void SCR_AddDirtyPoint (int x, int y);
void SCR_DirtyScreen (void);
//
// scr_cin.c
//
void SCR_PlayCinematic (char *name);
qboolean SCR_DrawCinematic (void);
void SCR_RunCinematic (void);
void SCR_StopCinematic (void);
void SCR_FinishCinematic (void);
void SCR_AddDirtyPoint(int x, int y);
void SCR_DirtyScreen(void);
void SCR_PlayCinematic(char *name);
qboolean SCR_DrawCinematic(void);
void SCR_RunCinematic(void);
void SCR_StopCinematic(void);
void SCR_FinishCinematic(void);

View File

@ -1,41 +1,44 @@
/*
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.
*
* =======================================================================
*
* ABI to the video oute driver
*
* =======================================================================
*/
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.
*/
// vid.h -- video driver defs
typedef struct vrect_s
{
typedef struct vrect_s {
int x,y,width,height;
} vrect_t;
typedef struct
{
int width, height; // coordinates from main game
typedef struct {
int width, height; /* coordinates from main game */
} viddef_t;
extern viddef_t viddef; // global video state
extern viddef_t viddef; /* global video state */
// Video module initialisation etc
void VID_Init (void);
void VID_Shutdown (void);
void VID_CheckChanges (void);
/* Video module initialisation, etc */
void VID_Init(void);
void VID_Shutdown(void);
void VID_CheckChanges(void);
void VID_MenuInit( void );
void VID_MenuDraw( void );
const char *VID_MenuKey( int );
void VID_MenuInit(void);
void VID_MenuDraw(void);
const char *VID_MenuKey(int);