codemp/ui/ui_syscalls.c

Go to the documentation of this file.
00001 // Copyright (C) 1999-2000 Id Software, Inc.
00002 //
00003 #include "ui_local.h"
00004 
00005 // this file is only included when building a dll
00006 // syscalls.asm is included instead when building a qvm
00007 
00008 static int (QDECL *syscall)( int arg, ... ) = (int (QDECL *)( int, ...))-1;
00009 
00010 #include "../namespace_begin.h"
00011 void dllEntry( int (QDECL *syscallptr)( int arg,... ) ) {
00012         syscall = syscallptr;
00013 }
00014 
00015 int PASSFLOAT( float x ) {
00016         float   floatTemp;
00017         floatTemp = x;
00018         return *(int *)&floatTemp;
00019 }
00020 
00021 void trap_Print( const char *string ) {
00022         syscall( UI_PRINT, string );
00023 }
00024 
00025 void trap_Error( const char *string ) {
00026         syscall( UI_ERROR, string );
00027 }
00028 
00029 int trap_Milliseconds( void ) {
00030         return syscall( UI_MILLISECONDS ); 
00031 }
00032 
00033 void trap_Cvar_Register( vmCvar_t *cvar, const char *var_name, const char *value, int flags ) {
00034         syscall( UI_CVAR_REGISTER, cvar, var_name, value, flags );
00035 }
00036 
00037 void trap_Cvar_Update( vmCvar_t *cvar ) {
00038         syscall( UI_CVAR_UPDATE, cvar );
00039 }
00040 
00041 void trap_Cvar_Set( const char *var_name, const char *value ) {
00042         syscall( UI_CVAR_SET, var_name, value );
00043 }
00044 
00045 float trap_Cvar_VariableValue( const char *var_name ) {
00046         int temp;
00047         temp = syscall( UI_CVAR_VARIABLEVALUE, var_name );
00048         return (*(float*)&temp);
00049 }
00050 
00051 void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize ) {
00052         syscall( UI_CVAR_VARIABLESTRINGBUFFER, var_name, buffer, bufsize );
00053 }
00054 
00055 void trap_Cvar_SetValue( const char *var_name, float value ) {
00056         syscall( UI_CVAR_SETVALUE, var_name, PASSFLOAT( value ) );
00057 }
00058 
00059 void trap_Cvar_Reset( const char *name ) {
00060         syscall( UI_CVAR_RESET, name ); 
00061 }
00062 
00063 void trap_Cvar_Create( const char *var_name, const char *var_value, int flags ) {
00064         syscall( UI_CVAR_CREATE, var_name, var_value, flags );
00065 }
00066 
00067 void trap_Cvar_InfoStringBuffer( int bit, char *buffer, int bufsize ) {
00068         syscall( UI_CVAR_INFOSTRINGBUFFER, bit, buffer, bufsize );
00069 }
00070 
00071 int trap_Argc( void ) {
00072         return syscall( UI_ARGC );
00073 }
00074 
00075 void trap_Argv( int n, char *buffer, int bufferLength ) {
00076         syscall( UI_ARGV, n, buffer, bufferLength );
00077 }
00078 
00079 void trap_Cmd_ExecuteText( int exec_when, const char *text ) {
00080         syscall( UI_CMD_EXECUTETEXT, exec_when, text );
00081 }
00082 
00083 int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode ) {
00084         return syscall( UI_FS_FOPENFILE, qpath, f, mode );
00085 }
00086 
00087 void trap_FS_Read( void *buffer, int len, fileHandle_t f ) {
00088         syscall( UI_FS_READ, buffer, len, f );
00089 }
00090 
00091 void trap_FS_Write( const void *buffer, int len, fileHandle_t f ) {
00092         syscall( UI_FS_WRITE, buffer, len, f );
00093 }
00094 
00095 void trap_FS_FCloseFile( fileHandle_t f ) {
00096         syscall( UI_FS_FCLOSEFILE, f );
00097 }
00098 
00099 int trap_FS_GetFileList(  const char *path, const char *extension, char *listbuf, int bufsize ) {
00100         return syscall( UI_FS_GETFILELIST, path, extension, listbuf, bufsize );
00101 }
00102 
00103 qhandle_t trap_R_RegisterModel( const char *name ) {
00104         return syscall( UI_R_REGISTERMODEL, name );
00105 }
00106 
00107 qhandle_t trap_R_RegisterSkin( const char *name ) {
00108         return syscall( UI_R_REGISTERSKIN, name );
00109 }
00110 
00111 qhandle_t trap_R_RegisterFont( const char *fontName )
00112 {
00113         return syscall( UI_R_REGISTERFONT, fontName);
00114 }
00115 
00116 int     trap_R_Font_StrLenPixels(const char *text, const int iFontIndex, const float scale)
00117 {
00118         return syscall( UI_R_FONT_STRLENPIXELS, text, iFontIndex, PASSFLOAT(scale));
00119 }
00120 
00121 int trap_R_Font_StrLenChars(const char *text)
00122 {
00123         return syscall( UI_R_FONT_STRLENCHARS, text);
00124 }
00125 
00126 int trap_R_Font_HeightPixels(const int iFontIndex, const float scale)
00127 {
00128         return syscall( UI_R_FONT_STRHEIGHTPIXELS, iFontIndex, PASSFLOAT(scale));
00129 }
00130 
00131 void trap_R_Font_DrawString(int ox, int oy, const char *text, const float *rgba, const int setIndex, int iCharLimit, const float scale)
00132 {
00133         syscall( UI_R_FONT_DRAWSTRING, ox, oy, text, rgba, setIndex, iCharLimit, PASSFLOAT(scale));
00134 }
00135 
00136 qboolean trap_Language_IsAsian(void)
00137 {
00138         return syscall( UI_LANGUAGE_ISASIAN );
00139 }
00140 
00141 qboolean trap_Language_UsesSpaces(void)
00142 {
00143         return syscall( UI_LANGUAGE_USESSPACES );
00144 }
00145 
00146 unsigned int trap_AnyLanguage_ReadCharFromString( const char *psText, int *piAdvanceCount, qboolean *pbIsTrailingPunctuation )
00147 {
00148         return syscall( UI_ANYLANGUAGE_READCHARFROMSTRING, psText, piAdvanceCount, pbIsTrailingPunctuation);
00149 }
00150 
00151 qhandle_t trap_R_RegisterShaderNoMip( const char *name ) {
00152         char buf[1024];
00153         
00154         if (name[0] == '*') {
00155                 trap_Cvar_VariableStringBuffer(name+1, buf, sizeof(buf));
00156                 if (buf[0]) {
00157                         return syscall( UI_R_REGISTERSHADERNOMIP, &buf );
00158                 }
00159         }
00160         return syscall( UI_R_REGISTERSHADERNOMIP, name );
00161 }
00162 
00163 //added so I don't have to store a string containing the path of
00164 //the shader icon for a class -rww
00165 void trap_R_ShaderNameFromIndex(char *name, int index)
00166 {
00167         syscall( UI_R_SHADERNAMEFROMINDEX, name, index );
00168 }
00169 
00170 void trap_R_ClearScene( void ) {
00171         syscall( UI_R_CLEARSCENE );
00172 }
00173 
00174 void trap_R_AddRefEntityToScene( const refEntity_t *re ) {
00175         syscall( UI_R_ADDREFENTITYTOSCENE, re );
00176 }
00177 
00178 void trap_R_AddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts ) {
00179         syscall( UI_R_ADDPOLYTOSCENE, hShader, numVerts, verts );
00180 }
00181 
00182 void trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b ) {
00183         syscall( UI_R_ADDLIGHTTOSCENE, org, PASSFLOAT(intensity), PASSFLOAT(r), PASSFLOAT(g), PASSFLOAT(b) );
00184 }
00185 
00186 void trap_R_RenderScene( const refdef_t *fd ) {
00187         syscall( UI_R_RENDERSCENE, fd );
00188 }
00189 
00190 void trap_R_SetColor( const float *rgba ) {
00191         syscall( UI_R_SETCOLOR, rgba );
00192 }
00193 
00194 void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader ) {
00195         syscall( UI_R_DRAWSTRETCHPIC, PASSFLOAT(x), PASSFLOAT(y), PASSFLOAT(w), PASSFLOAT(h), PASSFLOAT(s1), PASSFLOAT(t1), PASSFLOAT(s2), PASSFLOAT(t2), hShader );
00196 }
00197 
00198 void    trap_R_ModelBounds( clipHandle_t model, vec3_t mins, vec3_t maxs ) {
00199         syscall( UI_R_MODELBOUNDS, model, mins, maxs );
00200 }
00201 
00202 void trap_UpdateScreen( void ) {
00203         syscall( UI_UPDATESCREEN );
00204 }
00205 
00206 int trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame, float frac, const char *tagName ) {
00207         return syscall( UI_CM_LERPTAG, tag, mod, startFrame, endFrame, PASSFLOAT(frac), tagName );
00208 }
00209 
00210 void trap_S_StartLocalSound( sfxHandle_t sfx, int channelNum ) {
00211         syscall( UI_S_STARTLOCALSOUND, sfx, channelNum );
00212 }
00213 
00214 sfxHandle_t     trap_S_RegisterSound( const char *sample ) {
00215         return syscall( UI_S_REGISTERSOUND, sample );
00216 }
00217 
00218 void trap_Key_KeynumToStringBuf( int keynum, char *buf, int buflen ) {
00219         syscall( UI_KEY_KEYNUMTOSTRINGBUF, keynum, buf, buflen );
00220 }
00221 
00222 void trap_Key_GetBindingBuf( int keynum, char *buf, int buflen ) {
00223         syscall( UI_KEY_GETBINDINGBUF, keynum, buf, buflen );
00224 }
00225 
00226 void trap_Key_SetBinding( int keynum, const char *binding ) {
00227         syscall( UI_KEY_SETBINDING, keynum, binding );
00228 }
00229 
00230 qboolean trap_Key_IsDown( int keynum ) {
00231         return syscall( UI_KEY_ISDOWN, keynum );
00232 }
00233 
00234 qboolean trap_Key_GetOverstrikeMode( void ) {
00235         return syscall( UI_KEY_GETOVERSTRIKEMODE );
00236 }
00237 
00238 void trap_Key_SetOverstrikeMode( qboolean state ) {
00239         syscall( UI_KEY_SETOVERSTRIKEMODE, state );
00240 }
00241 
00242 void trap_Key_ClearStates( void ) {
00243         syscall( UI_KEY_CLEARSTATES );
00244 }
00245 
00246 int trap_Key_GetCatcher( void ) {
00247         return syscall( UI_KEY_GETCATCHER );
00248 }
00249 
00250 void trap_Key_SetCatcher( int catcher ) {
00251         syscall( UI_KEY_SETCATCHER, catcher );
00252 }
00253 
00254 void trap_GetClipboardData( char *buf, int bufsize ) {
00255         syscall( UI_GETCLIPBOARDDATA, buf, bufsize );
00256 }
00257 
00258 void trap_GetClientState( uiClientState_t *state ) {
00259         syscall( UI_GETCLIENTSTATE, state );
00260 }
00261 
00262 void trap_GetGlconfig( glconfig_t *glconfig ) {
00263         syscall( UI_GETGLCONFIG, glconfig );
00264 }
00265 
00266 int trap_GetConfigString( int index, char* buff, int buffsize ) {
00267         return syscall( UI_GETCONFIGSTRING, index, buff, buffsize );
00268 }
00269 
00270 int     trap_LAN_GetServerCount( int source ) {
00271         return syscall( UI_LAN_GETSERVERCOUNT, source );
00272 }
00273 
00274 void trap_LAN_GetServerAddressString( int source, int n, char *buf, int buflen ) {
00275         syscall( UI_LAN_GETSERVERADDRESSSTRING, source, n, buf, buflen );
00276 }
00277 
00278 void trap_LAN_GetServerInfo( int source, int n, char *buf, int buflen ) {
00279         syscall( UI_LAN_GETSERVERINFO, source, n, buf, buflen );
00280 }
00281 
00282 int trap_LAN_GetServerPing( int source, int n ) {
00283         return syscall( UI_LAN_GETSERVERPING, source, n );
00284 }
00285 
00286 int trap_LAN_GetPingQueueCount( void ) {
00287         return syscall( UI_LAN_GETPINGQUEUECOUNT );
00288 }
00289 
00290 int trap_LAN_ServerStatus( const char *serverAddress, char *serverStatus, int maxLen ) {
00291         return syscall( UI_LAN_SERVERSTATUS, serverAddress, serverStatus, maxLen );
00292 }
00293 
00294 void trap_LAN_SaveCachedServers() {
00295         syscall( UI_LAN_SAVECACHEDSERVERS );
00296 }
00297 
00298 void trap_LAN_LoadCachedServers() {
00299         syscall( UI_LAN_LOADCACHEDSERVERS );
00300 }
00301 
00302 void trap_LAN_ResetPings(int n) {
00303         syscall( UI_LAN_RESETPINGS, n );
00304 }
00305 
00306 void trap_LAN_ClearPing( int n ) {
00307         syscall( UI_LAN_CLEARPING, n );
00308 }
00309 
00310 void trap_LAN_GetPing( int n, char *buf, int buflen, int *pingtime ) {
00311         syscall( UI_LAN_GETPING, n, buf, buflen, pingtime );
00312 }
00313 
00314 void trap_LAN_GetPingInfo( int n, char *buf, int buflen ) {
00315         syscall( UI_LAN_GETPINGINFO, n, buf, buflen );
00316 }
00317 
00318 void trap_LAN_MarkServerVisible( int source, int n, qboolean visible ) {
00319         syscall( UI_LAN_MARKSERVERVISIBLE, source, n, visible );
00320 }
00321 
00322 int trap_LAN_ServerIsVisible( int source, int n) {
00323         return syscall( UI_LAN_SERVERISVISIBLE, source, n );
00324 }
00325 
00326 qboolean trap_LAN_UpdateVisiblePings( int source ) {
00327         return syscall( UI_LAN_UPDATEVISIBLEPINGS, source );
00328 }
00329 
00330 int trap_LAN_AddServer(int source, const char *name, const char *addr) {
00331         return syscall( UI_LAN_ADDSERVER, source, name, addr );
00332 }
00333 
00334 void trap_LAN_RemoveServer(int source, const char *addr) {
00335         syscall( UI_LAN_REMOVESERVER, source, addr );
00336 }
00337 
00338 int trap_LAN_CompareServers( int source, int sortKey, int sortDir, int s1, int s2 ) {
00339         return syscall( UI_LAN_COMPARESERVERS, source, sortKey, sortDir, s1, s2 );
00340 }
00341 
00342 int trap_MemoryRemaining( void ) {
00343         return syscall( UI_MEMORY_REMAINING );
00344 }
00345 
00346 #ifdef USE_CD_KEY
00347 
00348 void trap_GetCDKey( char *buf, int buflen ) {
00349         syscall( UI_GET_CDKEY, buf, buflen );
00350 }
00351 
00352 void trap_SetCDKey( char *buf ) {
00353         syscall( UI_SET_CDKEY, buf );
00354 }
00355 
00356 qboolean trap_VerifyCDKey( const char *key, const char *chksum) {
00357         return syscall( UI_VERIFY_CDKEY, key, chksum);
00358 }
00359 
00360 #endif // USE_CD_KEY
00361 
00362 int trap_PC_AddGlobalDefine( char *define ) {
00363         return syscall( UI_PC_ADD_GLOBAL_DEFINE, define );
00364 }
00365 
00366 int trap_PC_LoadSource( const char *filename ) {
00367         return syscall( UI_PC_LOAD_SOURCE, filename );
00368 }
00369 
00370 int trap_PC_FreeSource( int handle ) {
00371         return syscall( UI_PC_FREE_SOURCE, handle );
00372 }
00373 
00374 int trap_PC_ReadToken( int handle, pc_token_t *pc_token ) {
00375         return syscall( UI_PC_READ_TOKEN, handle, pc_token );
00376 }
00377 
00378 int trap_PC_SourceFileAndLine( int handle, char *filename, int *line ) {
00379         return syscall( UI_PC_SOURCE_FILE_AND_LINE, handle, filename, line );
00380 }
00381 
00382 int trap_PC_LoadGlobalDefines ( const char* filename )
00383 {
00384         return syscall ( UI_PC_LOAD_GLOBAL_DEFINES, filename );
00385 }
00386 
00387 void trap_PC_RemoveAllGlobalDefines ( void )
00388 {
00389         syscall ( UI_PC_REMOVE_ALL_GLOBAL_DEFINES );
00390 }
00391 
00392 void trap_S_StopBackgroundTrack( void ) {
00393         syscall( UI_S_STOPBACKGROUNDTRACK );
00394 }
00395 
00396 void trap_S_StartBackgroundTrack( const char *intro, const char *loop, qboolean bReturnWithoutStarting) {
00397         syscall( UI_S_STARTBACKGROUNDTRACK, intro, loop, bReturnWithoutStarting );
00398 }
00399 
00400 int trap_RealTime(qtime_t *qtime) {
00401         return syscall( UI_REAL_TIME, qtime );
00402 }
00403 
00404 // this returns a handle.  arg0 is the name in the format "idlogo.roq", set arg1 to NULL, alteredstates to qfalse (do not alter gamestate)
00405 int trap_CIN_PlayCinematic( const char *arg0, int xpos, int ypos, int width, int height, int bits) {
00406   return syscall(UI_CIN_PLAYCINEMATIC, arg0, xpos, ypos, width, height, bits);
00407 }
00408  
00409 // stops playing the cinematic and ends it.  should always return FMV_EOF
00410 // cinematics must be stopped in reverse order of when they are started
00411 e_status trap_CIN_StopCinematic(int handle) {
00412   return syscall(UI_CIN_STOPCINEMATIC, handle);
00413 }
00414 
00415 
00416 // will run a frame of the cinematic but will not draw it.  Will return FMV_EOF if the end of the cinematic has been reached.
00417 e_status trap_CIN_RunCinematic (int handle) {
00418   return syscall(UI_CIN_RUNCINEMATIC, handle);
00419 }
00420  
00421 
00422 // draws the current frame
00423 void trap_CIN_DrawCinematic (int handle) {
00424   syscall(UI_CIN_DRAWCINEMATIC, handle);
00425 }
00426  
00427 
00428 // allows you to resize the animation dynamically
00429 void trap_CIN_SetExtents (int handle, int x, int y, int w, int h) {
00430   syscall(UI_CIN_SETEXTENTS, handle, x, y, w, h);
00431 }
00432 
00433 
00434 void    trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ) {
00435         syscall( UI_R_REMAP_SHADER, oldShader, newShader, timeOffset );
00436 }
00437 
00438 int trap_SP_GetNumLanguages( void )
00439 {
00440         return syscall( UI_SP_GETNUMLANGUAGES );
00441 }
00442 
00443 void trap_GetLanguageName( const int languageIndex, char *buffer )
00444 {
00445         syscall( UI_SP_GETLANGUAGENAME, languageIndex, buffer);
00446 }
00447 
00448 int trap_SP_GetStringTextString(const char *text, char *buffer, int bufferLength)
00449 {
00450         return syscall( UI_SP_GETSTRINGTEXTSTRING, text, buffer, bufferLength );
00451 }
00452 /*
00453 Ghoul2 Insert Start
00454 */
00455 void trap_G2_ListModelSurfaces(void *ghlInfo)
00456 {
00457         syscall( UI_G2_LISTSURFACES, ghlInfo);
00458 }
00459 
00460 void trap_G2_ListModelBones(void *ghlInfo, int frame)
00461 {
00462         syscall( UI_G2_LISTBONES, ghlInfo, frame);
00463 }
00464 
00465 void trap_G2_SetGhoul2ModelIndexes(void *ghoul2, qhandle_t *modelList, qhandle_t *skinList)
00466 {
00467         syscall( UI_G2_SETMODELS, ghoul2, modelList, skinList);
00468 }
00469 
00470 qboolean trap_G2_HaveWeGhoul2Models(void *ghoul2)
00471 {
00472         return (qboolean)(syscall(UI_G2_HAVEWEGHOULMODELS, ghoul2));
00473 }
00474 
00475 qboolean trap_G2API_GetBoltMatrix(void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix,
00476                                                                 const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
00477 {
00478         return (qboolean)(syscall(UI_G2_GETBOLT, ghoul2, modelIndex, boltIndex, matrix, angles, position, frameNum, modelList, scale));
00479 }
00480 
00481 qboolean trap_G2API_GetBoltMatrix_NoReconstruct(void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix,
00482                                                                 const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
00483 { //Same as above but force it to not reconstruct the skeleton before getting the bolt position
00484         return (qboolean)(syscall(UI_G2_GETBOLT_NOREC, ghoul2, modelIndex, boltIndex, matrix, angles, position, frameNum, modelList, scale));
00485 }
00486 
00487 qboolean trap_G2API_GetBoltMatrix_NoRecNoRot(void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix,
00488                                                                 const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
00489 { //Same as above but force it to not reconstruct the skeleton before getting the bolt position
00490         return (qboolean)(syscall(UI_G2_GETBOLT_NOREC_NOROT, ghoul2, modelIndex, boltIndex, matrix, angles, position, frameNum, modelList, scale));
00491 }
00492 
00493 int trap_G2API_InitGhoul2Model(void **ghoul2Ptr, const char *fileName, int modelIndex, qhandle_t customSkin,
00494                                                   qhandle_t customShader, int modelFlags, int lodBias)
00495 {
00496         return syscall(UI_G2_INITGHOUL2MODEL, ghoul2Ptr, fileName, modelIndex, customSkin, customShader, modelFlags, lodBias);
00497 }
00498 
00499 qboolean trap_G2API_SetSkin(void *ghoul2, int modelIndex, qhandle_t customSkin, qhandle_t renderSkin)
00500 {
00501         return syscall(UI_G2_SETSKIN, ghoul2, modelIndex, customSkin, renderSkin);
00502 }
00503 
00504 void trap_G2API_CollisionDetect ( 
00505         CollisionRecord_t *collRecMap, 
00506         void* ghoul2, 
00507         const vec3_t angles, 
00508         const vec3_t position,
00509         int frameNumber, 
00510         int entNum, 
00511         const vec3_t rayStart, 
00512         const vec3_t rayEnd, 
00513         const vec3_t scale, 
00514         int traceFlags, 
00515         int useLod,
00516         float fRadius
00517         )
00518 {
00519         syscall ( UI_G2_COLLISIONDETECT, collRecMap, ghoul2, angles, position, frameNumber, entNum, rayStart, rayEnd, scale, traceFlags, useLod, PASSFLOAT(fRadius) );
00520 }
00521 
00522 void trap_G2API_CollisionDetectCache ( 
00523         CollisionRecord_t *collRecMap, 
00524         void* ghoul2, 
00525         const vec3_t angles, 
00526         const vec3_t position,
00527         int frameNumber, 
00528         int entNum, 
00529         const vec3_t rayStart, 
00530         const vec3_t rayEnd, 
00531         const vec3_t scale, 
00532         int traceFlags, 
00533         int useLod,
00534         float fRadius
00535         )
00536 {
00537         syscall ( UI_G2_COLLISIONDETECTCACHE, collRecMap, ghoul2, angles, position, frameNumber, entNum, rayStart, rayEnd, scale, traceFlags, useLod, PASSFLOAT(fRadius) );
00538 }
00539 
00540 void trap_G2API_CleanGhoul2Models(void **ghoul2Ptr)
00541 {
00542         syscall(UI_G2_CLEANMODELS, ghoul2Ptr);
00543 }
00544 
00545 qboolean trap_G2API_SetBoneAngles(void *ghoul2, int modelIndex, const char *boneName, const vec3_t angles, const int flags,
00546                                                                 const int up, const int right, const int forward, qhandle_t *modelList,
00547                                                                 int blendTime , int currentTime )
00548 {
00549         return (syscall(UI_G2_ANGLEOVERRIDE, ghoul2, modelIndex, boneName, angles, flags, up, right, forward, modelList, blendTime, currentTime));
00550 }
00551 
00552 qboolean trap_G2API_SetBoneAnim(void *ghoul2, const int modelIndex, const char *boneName, const int startFrame, const int endFrame,
00553                                                           const int flags, const float animSpeed, const int currentTime, const float setFrame , const int blendTime )
00554 {
00555         return syscall(UI_G2_PLAYANIM, ghoul2, modelIndex, boneName, startFrame, endFrame, flags, PASSFLOAT(animSpeed), currentTime, PASSFLOAT(setFrame), blendTime);
00556 }
00557 
00558 qboolean trap_G2API_GetBoneAnim(void *ghoul2, const char *boneName, const int currentTime, float *currentFrame,
00559                                                    int *startFrame, int *endFrame, int *flags, float *animSpeed, int *modelList, const int modelIndex)
00560 {
00561         return syscall(UI_G2_GETBONEANIM, ghoul2, boneName, currentTime, currentFrame, startFrame, endFrame, flags, animSpeed, modelList, modelIndex);
00562 }
00563 
00564 qboolean trap_G2API_GetBoneFrame(void *ghoul2, const char *boneName, const int currentTime, float *currentFrame, int *modelList, const int modelIndex)
00565 {
00566         return syscall(UI_G2_GETBONEFRAME, ghoul2, boneName, currentTime, currentFrame, modelList, modelIndex);
00567 }
00568 
00569 void trap_G2API_GetGLAName(void *ghoul2, int modelIndex, char *fillBuf)
00570 {
00571         syscall(UI_G2_GETGLANAME, ghoul2, modelIndex, fillBuf);
00572 }
00573 
00574 int trap_G2API_CopyGhoul2Instance(void *g2From, void *g2To, int modelIndex)
00575 {
00576         return syscall(UI_G2_COPYGHOUL2INSTANCE, g2From, g2To, modelIndex);
00577 }
00578 
00579 void trap_G2API_CopySpecificGhoul2Model(void *g2From, int modelFrom, void *g2To, int modelTo)
00580 {
00581         syscall(UI_G2_COPYSPECIFICGHOUL2MODEL, g2From, modelFrom, g2To, modelTo);
00582 }
00583 
00584 void trap_G2API_DuplicateGhoul2Instance(void *g2From, void **g2To)
00585 {
00586         syscall(UI_G2_DUPLICATEGHOUL2INSTANCE, g2From, g2To);
00587 }
00588 
00589 qboolean trap_G2API_HasGhoul2ModelOnIndex(void *ghlInfo, int modelIndex)
00590 {
00591         return syscall(UI_G2_HASGHOUL2MODELONINDEX, ghlInfo, modelIndex);
00592 }
00593 
00594 qboolean trap_G2API_RemoveGhoul2Model(void *ghlInfo, int modelIndex)
00595 {
00596         return syscall(UI_G2_REMOVEGHOUL2MODEL, ghlInfo, modelIndex);
00597 }
00598 
00599 int     trap_G2API_AddBolt(void *ghoul2, int modelIndex, const char *boneName)
00600 {
00601         return syscall(UI_G2_ADDBOLT, ghoul2, modelIndex, boneName);
00602 }
00603 
00604 void trap_G2API_SetBoltInfo(void *ghoul2, int modelIndex, int boltInfo)
00605 {
00606         syscall(UI_G2_SETBOLTON, ghoul2, modelIndex, boltInfo);
00607 }
00608 
00609 qboolean trap_G2API_SetRootSurface(void *ghoul2, const int modelIndex, const char *surfaceName)
00610 {
00611         return syscall(UI_G2_SETROOTSURFACE, ghoul2, modelIndex, surfaceName);
00612 }
00613 
00614 qboolean trap_G2API_SetSurfaceOnOff(void *ghoul2, const char *surfaceName, const int flags)
00615 {
00616         return syscall(UI_G2_SETSURFACEONOFF, ghoul2, surfaceName, flags);
00617 }
00618 
00619 qboolean trap_G2API_SetNewOrigin(void *ghoul2, const int boltIndex)
00620 {
00621         return syscall(UI_G2_SETNEWORIGIN, ghoul2, boltIndex);
00622 }
00623 
00624 int trap_G2API_GetTime(void)
00625 {
00626         return syscall(UI_G2_GETTIME);
00627 }
00628 
00629 void trap_G2API_SetTime(int time, int clock)
00630 {
00631         syscall(UI_G2_SETTIME, time, clock);
00632 }
00633 
00634 //rww - RAGDOLL_BEGIN
00635 void trap_G2API_SetRagDoll(void *ghoul2, sharedRagDollParams_t *params)
00636 {
00637         syscall(UI_G2_SETRAGDOLL, ghoul2, params);
00638 }
00639 
00640 void trap_G2API_AnimateG2Models(void *ghoul2, int time, sharedRagDollUpdateParams_t *params)
00641 {
00642         syscall(UI_G2_ANIMATEG2MODELS, ghoul2, time, params);
00643 }
00644 //rww - RAGDOLL_END
00645 
00646 qboolean trap_G2API_SetBoneIKState(void *ghoul2, int time, const char *boneName, int ikState, sharedSetBoneIKStateParams_t *params)
00647 {
00648         return syscall(UI_G2_SETBONEIKSTATE, ghoul2, time, boneName, ikState, params);
00649 }
00650 
00651 qboolean trap_G2API_IKMove(void *ghoul2, int time, sharedIKMoveParams_t *params)
00652 {
00653         return syscall(UI_G2_IKMOVE, ghoul2, time, params);
00654 }
00655 
00656 void trap_G2API_GetSurfaceName(void *ghoul2, int surfNumber, int modelIndex, char *fillBuf)
00657 {
00658         syscall(UI_G2_GETSURFACENAME, ghoul2, surfNumber, modelIndex, fillBuf);
00659 }
00660 
00661 qboolean trap_G2API_AttachG2Model(void *ghoul2From, int modelIndexFrom, void *ghoul2To, int toBoltIndex, int toModel)
00662 {
00663         return syscall(UI_G2_ATTACHG2MODEL, ghoul2From, modelIndexFrom, ghoul2To, toBoltIndex, toModel);
00664 }
00665 /*
00666 Ghoul2 Insert End
00667 */
00668 
00669 #include "../namespace_end.h"