00001 #ifndef __UI_SHARED_H
00002 #define __UI_SHARED_H
00003
00004
00005 #include "../game/q_shared.h"
00006 #include "../cgame/tr_types.h"
00007 #include "keycodes.h"
00008
00009 #include "../../ui/menudef.h"
00010
00011 #define MAX_MENUNAME 32
00012 #define MAX_ITEMTEXT 64
00013 #define MAX_ITEMACTION 64
00014 #define MAX_MENUDEFFILE 4096
00015 #define MAX_MENUFILE 32768
00016 #define MAX_MENUS 64
00017 #define MAX_MENUITEMS 256
00018 #define MAX_COLOR_RANGES 10
00019 #define MAX_OPEN_MENUS 16
00020 #define MAX_TEXTSCROLL_LINES 256
00021
00022 #define WINDOW_MOUSEOVER 0x00000001 // mouse is over it, non exclusive
00023 #define WINDOW_HASFOCUS 0x00000002 // has cursor focus, exclusive
00024 #define WINDOW_VISIBLE 0x00000004 // is visible
00025 #define WINDOW_INACTIVE 0x00000008 // is visible but grey ( non-active )
00026 #define WINDOW_DECORATION 0x00000010 // for decoration only, no mouse, keyboard, etc..
00027 #define WINDOW_FADINGOUT 0x00000020 // fading out, non-active
00028 #define WINDOW_FADINGIN 0x00000040 // fading in
00029 #define WINDOW_MOUSEOVERTEXT 0x00000080 // mouse is over it, non exclusive
00030 #define WINDOW_INTRANSITION 0x00000100 // window is in transition
00031 #define WINDOW_FORECOLORSET 0x00000200 // forecolor was explicitly set ( used to color alpha images or not )
00032 #define WINDOW_HORIZONTAL 0x00000400 // for list boxes and sliders, vertical is default this is set of horizontal
00033 #define WINDOW_LB_LEFTARROW 0x00000800 // mouse is over left/up arrow
00034 #define WINDOW_LB_RIGHTARROW 0x00001000 // mouse is over right/down arrow
00035 #define WINDOW_LB_THUMB 0x00002000 // mouse is over thumb
00036 #define WINDOW_LB_PGUP 0x00004000 // mouse is over page up
00037 #define WINDOW_LB_PGDN 0x00008000 // mouse is over page down
00038 #define WINDOW_ORBITING 0x00010000 // item is in orbit
00039 #define WINDOW_OOB_CLICK 0x00020000 // close on out of bounds click
00040 #define WINDOW_WRAPPED 0x00040000 // manually wrap text
00041 #define WINDOW_AUTOWRAPPED 0x00080000 // auto wrap text
00042 #define WINDOW_FORCED 0x00100000 // forced open
00043 #define WINDOW_POPUP 0x00200000 // popup
00044 #define WINDOW_BACKCOLORSET 0x00400000 // backcolor was explicitly set
00045 #define WINDOW_TIMEDVISIBLE 0x00800000 // visibility timing ( NOT implemented )
00046 #define WINDOW_PLAYERCOLOR 0x01000000 // hack the forecolor to match ui_char_color_*
00047
00048
00049 #define WINDOW_INTRANSITIONMODEL 0x04000000 // delayed script waiting to run
00050
00051
00052
00053 #define CURSOR_NONE 0x00000001
00054 #define CURSOR_ARROW 0x00000002
00055 #define CURSOR_SIZER 0x00000004
00056
00057 #ifdef _XBOX
00058
00059 #ifdef CGAME
00060 #define STRING_POOL_SIZE 32*1024
00061 #else
00062 #define STRING_POOL_SIZE 128*1024
00063 #endif
00064
00065 #else
00066
00067 #ifdef CGAME
00068 #define STRING_POOL_SIZE 128*1024
00069 #else
00070 #define STRING_POOL_SIZE 384*1024
00071 #endif
00072
00073 #endif
00074
00075 #define MAX_STRING_HANDLES 4096
00076 #define MAX_SCRIPT_ARGS 12
00077 #define MAX_EDITFIELD 256
00078
00079 #define ART_FX_BASE "menu/art/fx_base"
00080 #define ART_FX_BLUE "menu/art/fx_blue"
00081 #define ART_FX_CYAN "menu/art/fx_cyan"
00082 #define ART_FX_GREEN "menu/art/fx_grn"
00083 #define ART_FX_RED "menu/art/fx_red"
00084 #define ART_FX_TEAL "menu/art/fx_teal"
00085 #define ART_FX_WHITE "menu/art/fx_white"
00086 #define ART_FX_YELLOW "menu/art/fx_yel"
00087 #define ART_FX_ORANGE "menu/art/fx_orange"
00088 #define ART_FX_PURPLE "menu/art/fx_purple"
00089
00090 #define ASSET_GRADIENTBAR "ui/assets/gradientbar2.tga"
00091 #define ASSET_SCROLLBAR "gfx/menus/scrollbar.tga"
00092 #define ASSET_SCROLLBAR_ARROWDOWN "gfx/menus/scrollbar_arrow_dwn_a.tga"
00093 #define ASSET_SCROLLBAR_ARROWUP "gfx/menus/scrollbar_arrow_up_a.tga"
00094 #define ASSET_SCROLLBAR_ARROWLEFT "gfx/menus/scrollbar_arrow_left.tga"
00095 #define ASSET_SCROLLBAR_ARROWRIGHT "gfx/menus/scrollbar_arrow_right.tga"
00096 #define ASSET_SCROLL_THUMB "gfx/menus/scrollbar_thumb.tga"
00097 #define ASSET_SLIDER_BAR "menu/new/slider"
00098 #define ASSET_SLIDER_THUMB "menu/new/sliderthumb"
00099 #define SCROLLBAR_SIZE 16.0
00100 #define SLIDER_WIDTH 96.0
00101 #define SLIDER_HEIGHT 16.0
00102 #define SLIDER_THUMB_WIDTH 12.0
00103 #define SLIDER_THUMB_HEIGHT 20.0
00104 #define NUM_CROSSHAIRS 9
00105
00106 typedef struct {
00107 const char *command;
00108 const char *args[MAX_SCRIPT_ARGS];
00109 } scriptDef_t;
00110
00111
00112 typedef struct {
00113 float x;
00114 float y;
00115 float w;
00116 float h;
00117 } rectDef_t;
00118
00119 typedef rectDef_t Rectangle;
00120
00121
00122 typedef struct {
00123 Rectangle rect;
00124 Rectangle rectClient;
00125 const char *name;
00126 const char *group;
00127 const char *cinematicName;
00128 int cinematic;
00129 int style;
00130 int border;
00131 int ownerDraw;
00132 int ownerDrawFlags;
00133 float borderSize;
00134 int flags;
00135 Rectangle rectEffects;
00136 Rectangle rectEffects2;
00137 int offsetTime;
00138 int nextTime;
00139 vec4_t foreColor;
00140 vec4_t backColor;
00141 vec4_t borderColor;
00142 vec4_t outlineColor;
00143 qhandle_t background;
00144 } windowDef_t;
00145
00146 typedef windowDef_t Window;
00147
00148 typedef struct {
00149 vec4_t color;
00150 float low;
00151 float high;
00152 } colorRangeDef_t;
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 #define MAX_LB_COLUMNS 16
00165
00166 typedef struct columnInfo_s {
00167 int pos;
00168 int width;
00169 int maxChars;
00170 } columnInfo_t;
00171
00172 typedef struct listBoxDef_s {
00173 int startPos;
00174 int endPos;
00175 int drawPadding;
00176 int cursorPos;
00177 float elementWidth;
00178 float elementHeight;
00179 int elementStyle;
00180 int numColumns;
00181 columnInfo_t columnInfo[MAX_LB_COLUMNS];
00182 const char *doubleClick;
00183 qboolean notselectable;
00184
00185 qboolean scrollhidden;
00186 } listBoxDef_t;
00187
00188 typedef struct editFieldDef_s {
00189 float minVal;
00190 float maxVal;
00191 float defVal;
00192 float range;
00193 int maxChars;
00194 int maxPaintChars;
00195 int paintOffset;
00196 } editFieldDef_t;
00197
00198 #define MAX_MULTI_CVARS 32
00199
00200 typedef struct multiDef_s {
00201 const char *cvarList[MAX_MULTI_CVARS];
00202 const char *cvarStr[MAX_MULTI_CVARS];
00203 float cvarValue[MAX_MULTI_CVARS];
00204 int count;
00205 qboolean strDef;
00206 } multiDef_t;
00207
00208 typedef struct modelDef_s {
00209 int angle;
00210 vec3_t origin;
00211 float fov_x;
00212 float fov_y;
00213 int rotationSpeed;
00214
00215 vec3_t g2mins;
00216 vec3_t g2maxs;
00217 vec3_t g2scale;
00218 int g2skin;
00219 int g2anim;
00220
00221
00222 vec3_t g2mins2, g2maxs2, g2minsEffect, g2maxsEffect;
00223 float fov_x2, fov_y2, fov_Effectx, fov_Effecty;
00224 } modelDef_t;
00225
00226 typedef struct textScrollDef_s
00227 {
00228 int startPos;
00229 int endPos;
00230
00231 float lineHeight;
00232 int maxLineChars;
00233 int drawPadding;
00234
00235
00236
00237 int iLineCount;
00238 const char* pLines[MAX_TEXTSCROLL_LINES];
00239
00240 } textScrollDef_t;
00241
00242 #define ITEM_ALIGN_LEFT 0 // left alignment
00243 #define ITEM_ALIGN_CENTER 1 // center alignment
00244 #define ITEM_ALIGN_RIGHT 2 // right alignment
00245
00246 #define CVAR_ENABLE 0x00000001
00247 #define CVAR_DISABLE 0x00000002
00248 #define CVAR_SHOW 0x00000004
00249 #define CVAR_HIDE 0x00000008
00250
00251 #define ITF_G2VALID 0x0001 // indicates whether or not g2 instance is valid.
00252 #define ITF_ISCHARACTER 0x0002 // a character item, uses customRGBA
00253 #define ITF_ISSABER 0x0004 // first saber item, draws blade
00254 #define ITF_ISSABER2 0x0008 // second saber item, draws blade
00255
00256 #define ITF_ISANYSABER (ITF_ISSABER|ITF_ISSABER2) //either saber
00257
00258 typedef struct itemDef_s {
00259 Window window;
00260 Rectangle textRect;
00261 int type;
00262 int alignment;
00263 int textalignment;
00264 float textalignx;
00265 float textaligny;
00266 float textscale;
00267 int textStyle;
00268 const char *text;
00269 const char *text2;
00270 float text2alignx;
00271 float text2aligny;
00272 void *parent;
00273 qhandle_t asset;
00274 void *ghoul2;
00275 int flags;
00276 const char *mouseEnterText;
00277 const char *mouseExitText;
00278 const char *mouseEnter;
00279 const char *mouseExit;
00280 const char *action;
00281
00282 const char *accept;
00283
00284 const char * selectionNext;
00285 const char * selectionPrev;
00286
00287 const char *onFocus;
00288 const char *leaveFocus;
00289 const char *cvar;
00290 const char *cvarTest;
00291 const char *enableCvar;
00292 int cvarFlags;
00293 sfxHandle_t focusSound;
00294 int numColors;
00295 colorRangeDef_t colorRanges[MAX_COLOR_RANGES];
00296 float special;
00297 int cursorPos;
00298 void *typeData;
00299 const char *descText;
00300 int appearanceSlot;
00301 int iMenuFont;
00302 qboolean disabled;
00303 int invertYesNo;
00304 int xoffset;
00305 } itemDef_t;
00306
00307 typedef struct {
00308 Window window;
00309 const char *font;
00310 qboolean fullScreen;
00311 int itemCount;
00312 int fontIndex;
00313 int cursorItem;
00314 int fadeCycle;
00315 float fadeClamp;
00316 float fadeAmount;
00317 const char *onOpen;
00318 const char *onClose;
00319
00320 const char *onAccept;
00321
00322 const char *onESC;
00323 const char *soundName;
00324
00325 vec4_t focusColor;
00326 vec4_t disableColor;
00327 itemDef_t *items[MAX_MENUITEMS];
00328 int descX;
00329 int descY;
00330 vec4_t descColor;
00331 int descAlignment;
00332 float descScale;
00333 float appearanceTime;
00334 int appearanceCnt;
00335 float appearanceIncrement;
00336 } menuDef_t;
00337
00338 typedef struct {
00339 const char *fontStr;
00340 const char *cursorStr;
00341 const char *gradientStr;
00342 qhandle_t qhSmallFont;
00343 qhandle_t qhSmall2Font;
00344 qhandle_t qhMediumFont;
00345 qhandle_t qhBigFont;
00346 qhandle_t cursor;
00347 qhandle_t gradientBar;
00348 qhandle_t scrollBarArrowUp;
00349 qhandle_t scrollBarArrowDown;
00350 qhandle_t scrollBarArrowLeft;
00351 qhandle_t scrollBarArrowRight;
00352 qhandle_t scrollBar;
00353 qhandle_t scrollBarThumb;
00354 qhandle_t buttonMiddle;
00355 qhandle_t buttonInside;
00356 qhandle_t solidBox;
00357 qhandle_t sliderBar;
00358 qhandle_t sliderThumb;
00359 sfxHandle_t menuEnterSound;
00360 sfxHandle_t menuExitSound;
00361 sfxHandle_t menuBuzzSound;
00362 sfxHandle_t itemFocusSound;
00363 float fadeClamp;
00364 int fadeCycle;
00365 float fadeAmount;
00366 float shadowX;
00367 float shadowY;
00368 vec4_t shadowColor;
00369 float shadowFadeClamp;
00370 qboolean fontRegistered;
00371
00372 qhandle_t needPass;
00373 qhandle_t noForce;
00374 qhandle_t forceRestrict;
00375 qhandle_t saberOnly;
00376 qhandle_t trueJedi;
00377
00378 sfxHandle_t moveRollSound;
00379 sfxHandle_t moveJumpSound;
00380 sfxHandle_t datapadmoveSaberSound1;
00381 sfxHandle_t datapadmoveSaberSound2;
00382 sfxHandle_t datapadmoveSaberSound3;
00383 sfxHandle_t datapadmoveSaberSound4;
00384 sfxHandle_t datapadmoveSaberSound5;
00385 sfxHandle_t datapadmoveSaberSound6;
00386
00387
00388 qhandle_t fxBasePic;
00389 qhandle_t fxPic[7];
00390 qhandle_t crosshairShader[NUM_CROSSHAIRS];
00391
00392 } cachedAssets_t;
00393
00394 typedef struct
00395 {
00396 const char *name;
00397 qboolean (*handler) (itemDef_t *item, char** args);
00398 } commandDef_t;
00399
00400 typedef struct {
00401 qhandle_t (*registerShaderNoMip) (const char *p);
00402 void (*setColor) (const vec4_t v);
00403 void (*drawHandlePic) (float x, float y, float w, float h, qhandle_t asset);
00404 void (*drawStretchPic) (float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader );
00405 void (*drawText) (float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style, int iMenuFont);
00406 int (*textWidth) (const char *text, float scale, int iMenuFont);
00407 int (*textHeight) (const char *text, float scale, int iMenuFont);
00408 qhandle_t (*registerModel) (const char *p);
00409 void (*modelBounds) (qhandle_t model, vec3_t min, vec3_t max);
00410 void (*fillRect) ( float x, float y, float w, float h, const vec4_t color);
00411 void (*drawRect) ( float x, float y, float w, float h, float size, const vec4_t color);
00412 void (*drawSides) (float x, float y, float w, float h, float size);
00413 void (*drawTopBottom) (float x, float y, float w, float h, float size);
00414 void (*clearScene) ();
00415 void (*addRefEntityToScene) (const refEntity_t *re );
00416 void (*renderScene) ( const refdef_t *fd );
00417
00418 qhandle_t (*RegisterFont)( const char *fontName );
00419 int (*Font_StrLenPixels) (const char *text, const int iFontIndex, const float scale);
00420 int (*Font_StrLenChars) (const char *text);
00421 int (*Font_HeightPixels)(const int iFontIndex, const float scale);
00422 void (*Font_DrawString)(int ox, int oy, const char *text, const float *rgba, const int setIndex, int iCharLimit, const float scale);
00423 qboolean (*Language_IsAsian)(void);
00424 qboolean (*Language_UsesSpaces)(void);
00425 unsigned int (*AnyLanguage_ReadCharFromString)( const char *psText, int *piAdvanceCount, qboolean *pbIsTrailingPunctuation );
00426 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,int iMenuFont);
00427 float (*getValue) (int ownerDraw);
00428 qboolean (*ownerDrawVisible) (int flags);
00429 void (*runScript)(char **p);
00430 qboolean (*deferScript)(char **p);
00431 void (*getTeamColor)(vec4_t *color);
00432 void (*getCVarString)(const char *cvar, char *buffer, int bufsize);
00433 float (*getCVarValue)(const char *cvar);
00434 void (*setCVar)(const char *cvar, const char *value);
00435 void (*drawTextWithCursor)(float x, float y, float scale, vec4_t color, const char *text, int cursorPos, char cursor, int limit, int style, int iFontIndex);
00436 void (*setOverstrikeMode)(qboolean b);
00437 qboolean (*getOverstrikeMode)();
00438 void (*startLocalSound)( sfxHandle_t sfx, int channelNum );
00439 qboolean (*ownerDrawHandleKey)(int ownerDraw, int flags, float *special, int key);
00440 int (*feederCount)(float feederID);
00441 const char *(*feederItemText)(float feederID, int index, int column, qhandle_t *handle1, qhandle_t *handle2, qhandle_t *handle3);
00442 qhandle_t (*feederItemImage)(float feederID, int index);
00443 qboolean (*feederSelection)(float feederID, int index, itemDef_t *item);
00444 void (*keynumToStringBuf)( int keynum, char *buf, int buflen );
00445 void (*getBindingBuf)( int keynum, char *buf, int buflen );
00446 void (*setBinding)( int keynum, const char *binding );
00447 void (*executeText)(int exec_when, const char *text );
00448 void (*Error)(int level, const char *error, ...);
00449 void (*Print)(const char *msg, ...);
00450 void (*Pause)(qboolean b);
00451 int (*ownerDrawWidth)(int ownerDraw, float scale);
00452 sfxHandle_t (*registerSound)(const char *name);
00453 void (*startBackgroundTrack)( const char *intro, const char *loop, qboolean bReturnWithoutStarting);
00454 void (*stopBackgroundTrack)();
00455 int (*playCinematic)(const char *name, float x, float y, float w, float h);
00456 void (*stopCinematic)(int handle);
00457 void (*drawCinematic)(int handle, float x, float y, float w, float h);
00458 void (*runCinematicFrame)(int handle);
00459
00460 float yscale;
00461 float xscale;
00462 float bias;
00463 int realTime;
00464 int frameTime;
00465 int cursorx;
00466 int cursory;
00467 qboolean debug;
00468
00469 cachedAssets_t Assets;
00470
00471 glconfig_t glconfig;
00472 qhandle_t whiteShader;
00473 qhandle_t gradientImage;
00474 qhandle_t cursor;
00475 float FPS;
00476
00477 } displayContextDef_t;
00478
00479 #include "../namespace_begin.h"
00480
00481 const char *String_Alloc(const char *p);
00482 void String_Init();
00483 void String_Report();
00484 void Init_Display(displayContextDef_t *dc);
00485 void Display_ExpandMacros(char * buff);
00486 void Menu_Init(menuDef_t *menu);
00487 void Item_Init(itemDef_t *item);
00488 void Menu_PostParse(menuDef_t *menu);
00489 menuDef_t *Menu_GetFocused();
00490 void Menu_HandleKey(menuDef_t *menu, int key, qboolean down);
00491 void Menu_HandleMouseMove(menuDef_t *menu, float x, float y);
00492 void Menu_ScrollFeeder(menuDef_t *menu, int feeder, qboolean down);
00493 qboolean Float_Parse(char **p, float *f);
00494 qboolean Color_Parse(char **p, vec4_t *c);
00495 qboolean Int_Parse(char **p, int *i);
00496 qboolean Rect_Parse(char **p, rectDef_t *r);
00497 qboolean String_Parse(char **p, const char **out);
00498 qboolean Script_Parse(char **p, const char **out);
00499 qboolean PC_Float_Parse(int handle, float *f);
00500 qboolean PC_Color_Parse(int handle, vec4_t *c);
00501 qboolean PC_Int_Parse(int handle, int *i);
00502 qboolean PC_Rect_Parse(int handle, rectDef_t *r);
00503 qboolean PC_String_Parse(int handle, const char **out);
00504 qboolean PC_Script_Parse(int handle, const char **out);
00505 int Menu_Count();
00506 void Menu_New(int handle);
00507 void Menu_PaintAll();
00508 menuDef_t *Menus_ActivateByName(const char *p);
00509 void Menu_Reset();
00510 qboolean Menus_AnyFullScreenVisible();
00511 void Menus_Activate(menuDef_t *menu);
00512 itemDef_t *Menu_FindItemByName(menuDef_t *menu, const char *p);
00513
00514 displayContextDef_t *Display_GetContext();
00515 void *Display_CaptureItem(int x, int y);
00516 qboolean Display_MouseMove(void *p, int x, int y);
00517 int Display_CursorType(int x, int y);
00518 qboolean Display_KeyBindPending();
00519 void Menus_OpenByName(const char *p);
00520 menuDef_t *Menus_FindByName(const char *p);
00521 void Menus_ShowByName(const char *p);
00522 void Menus_CloseByName(const char *p);
00523 void Display_HandleKey(int key, qboolean down, int x, int y);
00524 void LerpColor(vec4_t a, vec4_t b, vec4_t c, float t);
00525 void Menus_CloseAll();
00526 void Menu_Paint(menuDef_t *menu, qboolean forcePaint);
00527 void Menu_SetFeederSelection(menuDef_t *menu, int feeder, int index, const char *name);
00528 void Display_CacheAll();
00529 void Menu_SetItemBackground(const menuDef_t *menu,const char *itemName, const char *background);
00530
00531 void *UI_Alloc( int size );
00532 void UI_InitMemory( void );
00533 qboolean UI_OutOfMemory();
00534
00535 void Controls_GetConfig( void );
00536 void Controls_SetConfig(qboolean restart);
00537
00538
00539 int trap_PC_AddGlobalDefine ( char *define );
00540 int trap_PC_LoadSource ( const char *filename );
00541 int trap_PC_FreeSource ( int handle );
00542 int trap_PC_ReadToken ( int handle, pc_token_t *pc_token );
00543 int trap_PC_SourceFileAndLine ( int handle, char *filename, int *line );
00544 int trap_PC_LoadGlobalDefines ( const char* filename );
00545 void trap_PC_RemoveAllGlobalDefines ( void );
00546
00547 int trap_R_Font_StrLenPixels(const char *text, const int iFontIndex, const float scale);
00548 int trap_R_Font_StrLenChars(const char *text);
00549 int trap_R_Font_HeightPixels(const int iFontIndex, const float scale);
00550 void trap_R_Font_DrawString(int ox, int oy, const char *text, const float *rgba, const int setIndex, int iCharLimit, const float scale);
00551 qboolean trap_Language_IsAsian(void);
00552 qboolean trap_Language_UsesSpaces(void);
00553 unsigned int trap_AnyLanguage_ReadCharFromString( const char *psText, int *piAdvanceCount, qboolean *pbIsTrailingPunctuation );
00554
00555 int trap_SP_GetStringTextString(const char *text, char *buffer, int bufferLength);
00556 int trap_SP_GetNumLanguages( void );
00557 void trap_GetLanguageName( const int languageIndex, char *buffer );
00558
00559
00560
00561
00562
00563
00564 void trap_G2API_CollisionDetect ( CollisionRecord_t *collRecMap, void* ghoul2, const vec3_t angles, const vec3_t position,int frameNumber, int entNum, const vec3_t rayStart, const vec3_t rayEnd, const vec3_t scale, int traceFlags, int useLod, float fRadius );
00565 void trap_G2API_CollisionDetectCache ( CollisionRecord_t *collRecMap, void* ghoul2, const vec3_t angles, const vec3_t position,int frameNumber, int entNum, const vec3_t rayStart, const vec3_t rayEnd, const vec3_t scale, int traceFlags, int useLod, float fRadius );
00566
00567
00568 void trap_G2_ListModelSurfaces(void *ghlInfo);
00569 void trap_G2_ListModelBones(void *ghlInfo, int frame);
00570 void trap_G2_SetGhoul2ModelIndexes(void *ghoul2, qhandle_t *modelList, qhandle_t *skinList);
00571 qboolean trap_G2_HaveWeGhoul2Models(void *ghoul2);
00572 qboolean trap_G2API_GetBoltMatrix(void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix,
00573 const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale);
00574 qboolean trap_G2API_GetBoltMatrix_NoReconstruct(void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix,
00575 const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale);
00576 qboolean trap_G2API_GetBoltMatrix_NoRecNoRot(void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix,
00577 const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale);
00578 int trap_G2API_InitGhoul2Model(void **ghoul2Ptr, const char *fileName, int modelIndex, qhandle_t customSkin,
00579 qhandle_t customShader, int modelFlags, int lodBias);
00580 qboolean trap_G2API_SetSkin(void *ghoul2, int modelIndex, qhandle_t customSkin, qhandle_t renderSkin);
00581 qboolean trap_G2API_AttachG2Model(void *ghoul2From, int modelIndexFrom, void *ghoul2To, int toBoltIndex, int toModel);
00582
00583
00584 int trap_G2API_CopyGhoul2Instance(void *g2From, void *g2To, int modelIndex);
00585 void trap_G2API_CopySpecificGhoul2Model(void *g2From, int modelFrom, void *g2To, int modelTo);
00586 void trap_G2API_DuplicateGhoul2Instance(void *g2From, void **g2To);
00587 qboolean trap_G2API_HasGhoul2ModelOnIndex(void *ghlInfo, int modelIndex);
00588 qboolean trap_G2API_RemoveGhoul2Model(void *ghlInfo, int modelIndex);
00589
00590 int trap_G2API_AddBolt(void *ghoul2, int modelIndex, const char *boneName);
00591
00592 void trap_G2API_SetBoltInfo(void *ghoul2, int modelIndex, int boltInfo);
00593 void trap_G2API_CleanGhoul2Models(void **ghoul2Ptr);
00594 qboolean trap_G2API_SetBoneAngles(void *ghoul2, int modelIndex, const char *boneName, const vec3_t angles, const int flags,
00595 const int up, const int right, const int forward, qhandle_t *modelList,
00596 int blendTime , int currentTime );
00597 void trap_G2API_GetGLAName(void *ghoul2, int modelIndex, char *fillBuf);
00598 qboolean trap_G2API_SetBoneAnim(void *ghoul2, const int modelIndex, const char *boneName, const int startFrame, const int endFrame,
00599 const int flags, const float animSpeed, const int currentTime, const float setFrame , const int blendTime );
00600 qboolean trap_G2API_GetBoneAnim(void *ghoul2, const char *boneName, const int currentTime, float *currentFrame, int *startFrame,
00601 int *endFrame, int *flags, float *animSpeed, int *modelList, const int modelIndex);
00602 qboolean trap_G2API_GetBoneFrame(void *ghoul2, const char *boneName, const int currentTime, float *currentFrame, int *modelList, const int modelIndex);
00603
00604 qboolean trap_G2API_SetRootSurface(void *ghoul2, const int modelIndex, const char *surfaceName);
00605 qboolean trap_G2API_SetSurfaceOnOff(void *ghoul2, const char *surfaceName, const int flags);
00606 qboolean trap_G2API_SetNewOrigin(void *ghoul2, const int boltIndex);
00607
00608 int trap_G2API_GetTime(void);
00609 void trap_G2API_SetTime(int time, int clock);
00610
00611 void trap_G2API_SetRagDoll(void *ghoul2, sharedRagDollParams_t *params);
00612 void trap_G2API_AnimateG2Models(void *ghoul2, int time, sharedRagDollUpdateParams_t *params);
00613
00614 qboolean trap_G2API_SetBoneIKState(void *ghoul2, int time, const char *boneName, int ikState, sharedSetBoneIKStateParams_t *params);
00615 qboolean trap_G2API_IKMove(void *ghoul2, int time, sharedIKMoveParams_t *params);
00616
00617 void trap_G2API_GetSurfaceName(void *ghoul2, int surfNumber, int modelIndex, char *fillBuf);
00618
00619 #include "../namespace_end.h"
00620
00621
00622
00623
00624 #endif