From 57a17f003806d9326b64317babf866d6111c0abb Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Mon, 3 Oct 2005 20:52:19 +0000 Subject: * Removed jump pad code (and associated media loading) * Removed loading of some Q3 cruft * Spilled events attached to temporary entities are now reattached to their original entities, fixing the missing flame bug * Fixed "suicide god" bug * Fixed bug where zap ignores armour * Fixed missing particle systems when follow-spectating * Fixed potential bug involving dodgy pointer arithmetic in CG_LoadClientInfo * Cleaned up logic in CG_AddPlayerWeapon * MASK_SHOT traces no longer collide with corpses * Corpses timeout in 20 seconds instead of 60 * Improved robustness of spawn validation, fixing the bug on transit * A crapload of whitespace fixes --- src/ui/ui_shared.h | 285 ++++++++++++++++++++++++++--------------------------- 1 file changed, 140 insertions(+), 145 deletions(-) (limited to 'src/ui/ui_shared.h') diff --git a/src/ui/ui_shared.h b/src/ui/ui_shared.h index d0864c02..fd0ed967 100644 --- a/src/ui/ui_shared.h +++ b/src/ui/ui_shared.h @@ -31,36 +31,36 @@ #define MAX_COLOR_RANGES 10 #define MAX_OPEN_MENUS 16 -#define WINDOW_MOUSEOVER 0x00000001 // mouse is over it, non exclusive -#define WINDOW_HASFOCUS 0x00000002 // has cursor focus, exclusive -#define WINDOW_VISIBLE 0x00000004 // is visible -#define WINDOW_GREY 0x00000008 // is visible but grey ( non-active ) -#define WINDOW_DECORATION 0x00000010 // for decoration only, no mouse, keyboard, etc.. -#define WINDOW_FADINGOUT 0x00000020 // fading out, non-active -#define WINDOW_FADINGIN 0x00000040 // fading in -#define WINDOW_MOUSEOVERTEXT 0x00000080 // mouse is over it, non exclusive -#define WINDOW_INTRANSITION 0x00000100 // window is in transition -#define WINDOW_FORECOLORSET 0x00000200 // forecolor was explicitly set ( used to color alpha images or not ) -#define WINDOW_HORIZONTAL 0x00000400 // for list boxes and sliders, vertical is default this is set of horizontal -#define WINDOW_LB_LEFTARROW 0x00000800 // mouse is over left/up arrow -#define WINDOW_LB_RIGHTARROW 0x00001000 // mouse is over right/down arrow -#define WINDOW_LB_THUMB 0x00002000 // mouse is over thumb -#define WINDOW_LB_PGUP 0x00004000 // mouse is over page up -#define WINDOW_LB_PGDN 0x00008000 // mouse is over page down -#define WINDOW_ORBITING 0x00010000 // item is in orbit -#define WINDOW_OOB_CLICK 0x00020000 // close on out of bounds click -#define WINDOW_WRAPPED 0x00040000 // manually wrap text -#define WINDOW_AUTOWRAPPED 0x00080000 // auto wrap text -#define WINDOW_FORCED 0x00100000 // forced open -#define WINDOW_POPUP 0x00200000 // popup -#define WINDOW_BACKCOLORSET 0x00400000 // backcolor was explicitly set -#define WINDOW_TIMEDVISIBLE 0x00800000 // visibility timing ( NOT implemented ) +#define WINDOW_MOUSEOVER 0x00000001 // mouse is over it, non exclusive +#define WINDOW_HASFOCUS 0x00000002 // has cursor focus, exclusive +#define WINDOW_VISIBLE 0x00000004 // is visible +#define WINDOW_GREY 0x00000008 // is visible but grey ( non-active ) +#define WINDOW_DECORATION 0x00000010 // for decoration only, no mouse, keyboard, etc.. +#define WINDOW_FADINGOUT 0x00000020 // fading out, non-active +#define WINDOW_FADINGIN 0x00000040 // fading in +#define WINDOW_MOUSEOVERTEXT 0x00000080 // mouse is over it, non exclusive +#define WINDOW_INTRANSITION 0x00000100 // window is in transition +#define WINDOW_FORECOLORSET 0x00000200 // forecolor was explicitly set ( used to color alpha images or not ) +#define WINDOW_HORIZONTAL 0x00000400 // for list boxes and sliders, vertical is default this is set of horizontal +#define WINDOW_LB_LEFTARROW 0x00000800 // mouse is over left/up arrow +#define WINDOW_LB_RIGHTARROW 0x00001000 // mouse is over right/down arrow +#define WINDOW_LB_THUMB 0x00002000 // mouse is over thumb +#define WINDOW_LB_PGUP 0x00004000 // mouse is over page up +#define WINDOW_LB_PGDN 0x00008000 // mouse is over page down +#define WINDOW_ORBITING 0x00010000 // item is in orbit +#define WINDOW_OOB_CLICK 0x00020000 // close on out of bounds click +#define WINDOW_WRAPPED 0x00040000 // manually wrap text +#define WINDOW_AUTOWRAPPED 0x00080000 // auto wrap text +#define WINDOW_FORCED 0x00100000 // forced open +#define WINDOW_POPUP 0x00200000 // popup +#define WINDOW_BACKCOLORSET 0x00400000 // backcolor was explicitly set +#define WINDOW_TIMEDVISIBLE 0x00800000 // visibility timing ( NOT implemented ) // CGAME cursor type bits -#define CURSOR_NONE 0x00000001 -#define CURSOR_ARROW 0x00000002 -#define CURSOR_SIZER 0x00000004 +#define CURSOR_NONE 0x00000001 +#define CURSOR_ARROW 0x00000002 +#define CURSOR_SIZER 0x00000004 #ifdef CGAME #define STRING_POOL_SIZE 128*1024 @@ -72,14 +72,14 @@ #define MAX_SCRIPT_ARGS 12 #define MAX_EDITFIELD 256 -#define ART_FX_BASE "menu/art/fx_base" -#define ART_FX_BLUE "menu/art/fx_blue" -#define ART_FX_CYAN "menu/art/fx_cyan" -#define ART_FX_GREEN "menu/art/fx_grn" -#define ART_FX_RED "menu/art/fx_red" -#define ART_FX_TEAL "menu/art/fx_teal" -#define ART_FX_WHITE "menu/art/fx_white" -#define ART_FX_YELLOW "menu/art/fx_yel" +#define ART_FX_BASE "menu/art/fx_base" +#define ART_FX_BLUE "menu/art/fx_blue" +#define ART_FX_CYAN "menu/art/fx_cyan" +#define ART_FX_GREEN "menu/art/fx_grn" +#define ART_FX_RED "menu/art/fx_red" +#define ART_FX_TEAL "menu/art/fx_teal" +#define ART_FX_WHITE "menu/art/fx_white" +#define ART_FX_YELLOW "menu/art/fx_yel" #define ASSET_GRADIENTBAR "ui/assets/gradientbar2.tga" #define ASSET_SCROLLBAR "ui/assets/scrollbar.tga" @@ -88,14 +88,14 @@ #define ASSET_SCROLLBAR_ARROWLEFT "ui/assets/scrollbar_arrow_left.tga" #define ASSET_SCROLLBAR_ARROWRIGHT "ui/assets/scrollbar_arrow_right.tga" #define ASSET_SCROLL_THUMB "ui/assets/scrollbar_thumb.tga" -#define ASSET_SLIDER_BAR "ui/assets/slider2.tga" -#define ASSET_SLIDER_THUMB "ui/assets/sliderbutt_1.tga" +#define ASSET_SLIDER_BAR "ui/assets/slider2.tga" +#define ASSET_SLIDER_THUMB "ui/assets/sliderbutt_1.tga" #define SCROLLBAR_SIZE 16.0 #define SLIDER_WIDTH 96.0 #define SLIDER_HEIGHT 16.0 #define SLIDER_THUMB_WIDTH 12.0 #define SLIDER_THUMB_HEIGHT 20.0 -#define NUM_CROSSHAIRS 10 +#define NUM_CROSSHAIRS 10 typedef struct { const char *command; @@ -118,13 +118,13 @@ typedef struct { Rectangle rectClient; // screen coord rectangle const char *name; // const char *group; // if it belongs to a group - const char *cinematicName; // cinematic name - int cinematic; // cinematic handle + const char *cinematicName; // cinematic name + int cinematic; // cinematic handle int style; // int border; // - int ownerDraw; // ownerDraw style - int ownerDrawFlags; // show flags for ownerdraw items - float borderSize; // + int ownerDraw; // ownerDraw style + int ownerDrawFlags; // show flags for ownerdraw items + float borderSize; // int flags; // visible, focus, mouseover, cursor Rectangle rectEffects; // for various effects Rectangle rectEffects2; // for various effects @@ -134,86 +134,86 @@ typedef struct { vec4_t backColor; // border color vec4_t borderColor; // border color vec4_t outlineColor; // border color - qhandle_t background; // background asset + qhandle_t background; // background asset } windowDef_t; typedef windowDef_t Window; typedef struct { - vec4_t color; - float low; - float high; + vec4_t color; + float low; + float high; } colorRangeDef_t; // FIXME: combine flags into bitfields to save space // FIXME: consolidate all of the common stuff in one structure for menus and items // THINKABOUTME: is there any compelling reason not to have items contain items -// and do away with a menu per say.. major issue is not being able to dynamically allocate -// and destroy stuff.. Another point to consider is adding an alloc free call for vm's and have +// and do away with a menu per say.. major issue is not being able to dynamically allocate +// and destroy stuff.. Another point to consider is adding an alloc free call for vm's and have // the engine just allocate the pool for it based on a cvar // many of the vars are re-used for different item types, as such they are not always named appropriately // the benefits of c++ in DOOM will greatly help crap like this // FIXME: need to put a type ptr that points to specific type info per type -// +// #define MAX_LB_COLUMNS 16 typedef struct columnInfo_s { - int pos; - int width; - int maxChars; + int pos; + int width; + int maxChars; int align; } columnInfo_t; typedef struct listBoxDef_s { - int startPos; - int endPos; - int drawPadding; - int cursorPos; - float elementWidth; - float elementHeight; - int elementStyle; - int numColumns; - columnInfo_t columnInfo[MAX_LB_COLUMNS]; - const char *doubleClick; - qboolean notselectable; + int startPos; + int endPos; + int drawPadding; + int cursorPos; + float elementWidth; + float elementHeight; + int elementStyle; + int numColumns; + columnInfo_t columnInfo[MAX_LB_COLUMNS]; + const char *doubleClick; + qboolean notselectable; } listBoxDef_t; typedef struct editFieldDef_s { - float minVal; // edit field limits + float minVal; // edit field limits float maxVal; // float defVal; // - float range; // + float range; // int maxChars; // for edit fields int maxPaintChars; // for edit fields - int paintOffset; // + int paintOffset; // } editFieldDef_t; #define MAX_MULTI_CVARS 32 typedef struct multiDef_s { - const char *cvarList[MAX_MULTI_CVARS]; - const char *cvarStr[MAX_MULTI_CVARS]; - float cvarValue[MAX_MULTI_CVARS]; - int count; - qboolean strDef; + const char *cvarList[MAX_MULTI_CVARS]; + const char *cvarStr[MAX_MULTI_CVARS]; + float cvarValue[MAX_MULTI_CVARS]; + int count; + qboolean strDef; } multiDef_t; typedef struct modelDef_s { - int angle; - vec3_t origin; - float fov_x; - float fov_y; - int rotationSpeed; + int angle; + vec3_t origin; + float fov_x; + float fov_y; + int rotationSpeed; } modelDef_t; -#define CVAR_ENABLE 0x00000001 -#define CVAR_DISABLE 0x00000002 -#define CVAR_SHOW 0x00000004 -#define CVAR_HIDE 0x00000008 +#define CVAR_ENABLE 0x00000001 +#define CVAR_DISABLE 0x00000002 +#define CVAR_SHOW 0x00000004 +#define CVAR_HIDE 0x00000008 typedef struct itemDef_s { Window window; // common positional, border, style, layout info - Rectangle textRect; // rectangle the text ( if any ) consumes + Rectangle textRect; // rectangle the text ( if any ) consumes int type; // text, button, radiobutton, checkbox, textfield, listbox, combo int alignment; // left center right int textalignment; // ( optional ) alignment for text within rect based on text width @@ -227,40 +227,40 @@ typedef struct itemDef_s { const char *mouseEnterText; // mouse enter script const char *mouseExitText; // mouse exit script const char *mouseEnter; // mouse enter script - const char *mouseExit; // mouse exit script + const char *mouseExit; // mouse exit script const char *action; // select script const char *onFocus; // select script const char *leaveFocus; // select script - const char *cvar; // associated cvar + const char *cvar; // associated cvar const char *cvarTest; // associated cvar for enable actions - const char *enableCvar; // enable, disable, show, or hide based on value, this can contain a list - int cvarFlags; // what type of action to take on cvarenables + const char *enableCvar; // enable, disable, show, or hide based on value, this can contain a list + int cvarFlags; // what type of action to take on cvarenables sfxHandle_t focusSound; - int numColors; // number of color ranges - colorRangeDef_t colorRanges[MAX_COLOR_RANGES]; - float special; // used for feeder id's etc.. diff per type + int numColors; // number of color ranges + colorRangeDef_t colorRanges[MAX_COLOR_RANGES]; + float special; // used for feeder id's etc.. diff per type int cursorPos; // cursor position in characters - void *typeData; // type specific data ptr's + void *typeData; // type specific data ptr's } itemDef_t; typedef struct { Window window; - const char *font; // font - qboolean fullScreen; // covers entire screen - int itemCount; // number of items; - int fontIndex; // - int cursorItem; // which item as the cursor - int fadeCycle; // - float fadeClamp; // - float fadeAmount; // - const char *onOpen; // run when the menu is first opened - const char *onClose; // run when the menu is closed - const char *onESC; // run when the menu is closed - const char *soundName; // background loop sound for menu - - vec4_t focusColor; // focus color for items - vec4_t disableColor; // focus color for items - itemDef_t *items[MAX_MENUITEMS]; // items this menu contains + const char *font; // font + qboolean fullScreen; // covers entire screen + int itemCount; // number of items; + int fontIndex; // + int cursorItem; // which item as the cursor + int fadeCycle; // + float fadeClamp; // + float fadeAmount; // + const char *onOpen; // run when the menu is first opened + const char *onClose; // run when the menu is closed + const char *onESC; // run when the menu is closed + const char *soundName; // background loop sound for menu + + vec4_t focusColor; // focus color for items + vec4_t disableColor; // focus color for items + itemDef_t *items[MAX_MENUITEMS]; // items this menu contains } menuDef_t; typedef struct { @@ -296,11 +296,6 @@ typedef struct { float shadowFadeClamp; qboolean fontRegistered; - // player settings - qhandle_t fxBasePic; - qhandle_t fxPic[7]; - qhandle_t crosshairShader[NUM_CROSSHAIRS]; - } cachedAssets_t; typedef struct { @@ -327,8 +322,8 @@ typedef struct { void (*renderScene) ( const refdef_t *fd ); void (*registerFont) (const char *pFontname, int pointSize, fontInfo_t *font); void (*ownerDrawItem) (float x, float y, float w, float h, float text_x, float text_y, int ownerDraw, int ownerDrawFlags, int align, float special, float scale, vec4_t color, qhandle_t shader, int textStyle); - float (*getValue) (int ownerDraw); - qboolean (*ownerDrawVisible) (int flags); + float (*getValue) (int ownerDraw); + qboolean (*ownerDrawVisible) (int flags); void (*runScript)(char **p); void (*getTeamColor)(vec4_t *color); void (*getCVarString)(const char *cvar, char *buffer, int bufsize); @@ -343,38 +338,38 @@ typedef struct { const char *(*feederItemText)(float feederID, int index, int column, qhandle_t *handle); qhandle_t (*feederItemImage)(float feederID, int index); void (*feederSelection)(float feederID, int index); - void (*keynumToStringBuf)( int keynum, char *buf, int buflen ); - void (*getBindingBuf)( int keynum, char *buf, int buflen ); - void (*setBinding)( int keynum, const char *binding ); - void (*executeText)(int exec_when, const char *text ); - void (*Error)(int level, const char *error, ...); - void (*Print)(const char *msg, ...); - void (*Pause)(qboolean b); - int (*ownerDrawWidth)(int ownerDraw, float scale); - sfxHandle_t (*registerSound)(const char *name, qboolean compressed); - void (*startBackgroundTrack)( const char *intro, const char *loop); - void (*stopBackgroundTrack)(); - int (*playCinematic)(const char *name, float x, float y, float w, float h); - void (*stopCinematic)(int handle); - void (*drawCinematic)(int handle, float x, float y, float w, float h); - void (*runCinematicFrame)(int handle); - - float yscale; - float xscale; - float bias; - int realTime; - int frameTime; - int cursorx; - int cursory; - qboolean debug; + void (*keynumToStringBuf)( int keynum, char *buf, int buflen ); + void (*getBindingBuf)( int keynum, char *buf, int buflen ); + void (*setBinding)( int keynum, const char *binding ); + void (*executeText)(int exec_when, const char *text ); + void (*Error)(int level, const char *error, ...); + void (*Print)(const char *msg, ...); + void (*Pause)(qboolean b); + int (*ownerDrawWidth)(int ownerDraw, float scale); + sfxHandle_t (*registerSound)(const char *name, qboolean compressed); + void (*startBackgroundTrack)( const char *intro, const char *loop); + void (*stopBackgroundTrack)(); + int (*playCinematic)(const char *name, float x, float y, float w, float h); + void (*stopCinematic)(int handle); + void (*drawCinematic)(int handle, float x, float y, float w, float h); + void (*runCinematicFrame)(int handle); + + float yscale; + float xscale; + float bias; + int realTime; + int frameTime; + int cursorx; + int cursory; + qboolean debug; cachedAssets_t Assets; - glconfig_t glconfig; - qhandle_t whiteShader; + glconfig_t glconfig; + qhandle_t whiteShader; qhandle_t gradientImage; qhandle_t cursor; - float FPS; + float FPS; } displayContextDef_t; @@ -437,11 +432,11 @@ void Controls_SetDefaults( void ); //for cg_draw.c void Item_Text_AutoWrapped_Paint( itemDef_t *item ); -int trap_PC_AddGlobalDefine( char *define ); -int trap_PC_LoadSource( const char *filename ); -int trap_PC_FreeSource( int handle ); -int trap_PC_ReadToken( int handle, pc_token_t *pc_token ); -int trap_PC_SourceFileAndLine( int handle, char *filename, int *line ); +int trap_PC_AddGlobalDefine( char *define ); +int trap_PC_LoadSource( const char *filename ); +int trap_PC_FreeSource( int handle ); +int trap_PC_ReadToken( int handle, pc_token_t *pc_token ); +int trap_PC_SourceFileAndLine( int handle, char *filename, int *line ); void BindingFromName( const char *cvar ); extern char g_nameBind1[ 32 ]; -- cgit