Advertisement
Guest User

Untitled

a guest
Jun 9th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.73 KB | None | 0 0
  1. // Copyright (C) 1999-2000 Id Software, Inc.
  2. //
  3. #include "ui_local.h"
  4.  
  5. // this file is only included when building a dll
  6. // syscalls.asm is included instead when building a qvm
  7.  
  8. static int (QDECL *syscall)( int arg, ... ) = (int (QDECL *)( int, ...))-1;
  9.  
  10. #include "../namespace_begin.h"
  11. void dllEntry( int (QDECL *syscallptr)( int arg,... ) ) {
  12. syscall = syscallptr;
  13. }
  14.  
  15. int PASSFLOAT( float x ) {
  16. float floatTemp;
  17. floatTemp = x;
  18. return *(int *)&floatTemp;
  19. }
  20.  
  21. void trap_Print( const char *string ) {
  22. syscall( UI_PRINT, string );
  23. }
  24.  
  25. void trap_Error( const char *string ) {
  26. syscall( UI_ERROR, string );
  27. }
  28.  
  29. int trap_Milliseconds( void ) {
  30. return syscall( UI_MILLISECONDS );
  31. }
  32.  
  33. void trap_Cvar_Register( vmCvar_t *cvar, const char *var_name, const char *value, int flags ) {
  34. syscall( UI_CVAR_REGISTER, cvar, var_name, value, flags );
  35. }
  36.  
  37. void trap_Cvar_Update( vmCvar_t *cvar ) {
  38. syscall( UI_CVAR_UPDATE, cvar );
  39. }
  40.  
  41. void trap_Cvar_Set( const char *var_name, const char *value ) {
  42. syscall( UI_CVAR_SET, var_name, value );
  43. }
  44.  
  45. float trap_Cvar_VariableValue( const char *var_name ) {
  46. int temp;
  47. temp = syscall( UI_CVAR_VARIABLEVALUE, var_name );
  48. return (*(float*)&temp);
  49. }
  50.  
  51. void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize ) {
  52. syscall( UI_CVAR_VARIABLESTRINGBUFFER, var_name, buffer, bufsize );
  53. }
  54.  
  55. void trap_Cvar_SetValue( const char *var_name, float value ) {
  56. syscall( UI_CVAR_SETVALUE, var_name, PASSFLOAT( value ) );
  57. }
  58.  
  59. void trap_Cvar_Reset( const char *name ) {
  60. syscall( UI_CVAR_RESET, name );
  61. }
  62.  
  63. void trap_Cvar_Create( const char *var_name, const char *var_value, int flags ) {
  64. syscall( UI_CVAR_CREATE, var_name, var_value, flags );
  65. }
  66.  
  67. void trap_Cvar_InfoStringBuffer( int bit, char *buffer, int bufsize ) {
  68. syscall( UI_CVAR_INFOSTRINGBUFFER, bit, buffer, bufsize );
  69. }
  70.  
  71. int trap_Argc( void ) {
  72. return syscall( UI_ARGC );
  73. }
  74.  
  75. void trap_Argv( int n, char *buffer, int bufferLength ) {
  76. syscall( UI_ARGV, n, buffer, bufferLength );
  77. }
  78.  
  79. void trap_Cmd_ExecuteText( int exec_when, const char *text ) {
  80. syscall( UI_CMD_EXECUTETEXT, exec_when, text );
  81. }
  82.  
  83. int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode ) {
  84. return syscall( UI_FS_FOPENFILE, qpath, f, mode );
  85. }
  86.  
  87. void trap_FS_Read( void *buffer, int len, fileHandle_t f ) {
  88. syscall( UI_FS_READ, buffer, len, f );
  89. }
  90.  
  91. void trap_FS_Write( const void *buffer, int len, fileHandle_t f ) {
  92. syscall( UI_FS_WRITE, buffer, len, f );
  93. }
  94.  
  95. void trap_FS_FCloseFile( fileHandle_t f ) {
  96. syscall( UI_FS_FCLOSEFILE, f );
  97. }
  98.  
  99. int trap_FS_GetFileList( const char *path, const char *extension, char *listbuf, int bufsize ) {
  100. return syscall( UI_FS_GETFILELIST, path, extension, listbuf, bufsize );
  101. }
  102.  
  103. qhandle_t trap_R_RegisterModel( const char *name ) {
  104. return syscall( UI_R_REGISTERMODEL, name );
  105. }
  106.  
  107. qhandle_t trap_R_RegisterSkin( const char *name ) {
  108. return syscall( UI_R_REGISTERSKIN, name );
  109. }
  110.  
  111. qhandle_t trap_R_RegisterFont( const char *fontName )
  112. {
  113. return syscall( UI_R_REGISTERFONT, fontName);
  114. }
  115.  
  116. int trap_R_Font_StrLenPixels(const char *text, const int iFontIndex, const float scale)
  117. {
  118. return syscall( UI_R_FONT_STRLENPIXELS, text, iFontIndex, PASSFLOAT(scale));
  119. }
  120.  
  121. int trap_R_Font_StrLenChars(const char *text)
  122. {
  123. return syscall( UI_R_FONT_STRLENCHARS, text);
  124. }
  125.  
  126. int trap_R_Font_HeightPixels(const int iFontIndex, const float scale)
  127. {
  128. return syscall( UI_R_FONT_STRHEIGHTPIXELS, iFontIndex, PASSFLOAT(scale));
  129. }
  130.  
  131. void trap_R_Font_DrawString(int ox, int oy, const char *text, const float *rgba, const int setIndex, int iCharLimit, const float scale)
  132. {
  133. syscall( UI_R_FONT_DRAWSTRING, ox, oy, text, rgba, setIndex, iCharLimit, PASSFLOAT(scale));
  134. }
  135.  
  136. qboolean trap_Language_IsAsian(void)
  137. {
  138. return syscall( UI_LANGUAGE_ISASIAN );
  139. }
  140.  
  141. qboolean trap_Language_UsesSpaces(void)
  142. {
  143. return syscall( UI_LANGUAGE_USESSPACES );
  144. }
  145.  
  146. unsigned int trap_AnyLanguage_ReadCharFromString( const char *psText, int *piAdvanceCount, qboolean *pbIsTrailingPunctuation )
  147. {
  148. return syscall( UI_ANYLANGUAGE_READCHARFROMSTRING, psText, piAdvanceCount, pbIsTrailingPunctuation);
  149. }
  150.  
  151. qhandle_t trap_R_RegisterShaderNoMip( const char *name ) {
  152. char buf[1024];
  153.  
  154. if (name[0] == '*') {
  155. trap_Cvar_VariableStringBuffer(name+1, buf, sizeof(buf));
  156. if (buf[0]) {
  157. return syscall( UI_R_REGISTERSHADERNOMIP, &buf );
  158. }
  159. }
  160. return syscall( UI_R_REGISTERSHADERNOMIP, name );
  161. }
  162.  
  163. //added so I don't have to store a string containing the path of
  164. //the shader icon for a class -rww
  165. void trap_R_ShaderNameFromIndex(char *name, int index)
  166. {
  167. syscall( UI_R_SHADERNAMEFROMINDEX, name, index );
  168. }
  169.  
  170. void trap_R_ClearScene( void ) {
  171. syscall( UI_R_CLEARSCENE );
  172. }
  173.  
  174. void trap_R_AddRefEntityToScene( const refEntity_t *re ) {
  175. syscall( UI_R_ADDREFENTITYTOSCENE, re );
  176. }
  177.  
  178. void trap_R_AddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts ) {
  179. syscall( UI_R_ADDPOLYTOSCENE, hShader, numVerts, verts );
  180. }
  181.  
  182. void trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b ) {
  183. syscall( UI_R_ADDLIGHTTOSCENE, org, PASSFLOAT(intensity), PASSFLOAT(r), PASSFLOAT(g), PASSFLOAT(b) );
  184. }
  185.  
  186. void trap_R_RenderScene( const refdef_t *fd ) {
  187. syscall( UI_R_RENDERSCENE, fd );
  188. }
  189.  
  190. void trap_R_SetColor( const float *rgba ) {
  191. syscall( UI_R_SETCOLOR, rgba );
  192. }
  193.  
  194. void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader ) {
  195. syscall( UI_R_DRAWSTRETCHPIC, PASSFLOAT(x), PASSFLOAT(y), PASSFLOAT(w), PASSFLOAT(h), PASSFLOAT(s1), PASSFLOAT(t1), PASSFLOAT(s2), PASSFLOAT(t2), hShader );
  196. }
  197.  
  198. void trap_R_ModelBounds( clipHandle_t model, vec3_t mins, vec3_t maxs ) {
  199. syscall( UI_R_MODELBOUNDS, model, mins, maxs );
  200. }
  201.  
  202. void trap_UpdateScreen( void ) {
  203. syscall( UI_UPDATESCREEN );
  204. }
  205.  
  206. int trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame, float frac, const char *tagName ) {
  207. return syscall( UI_CM_LERPTAG, tag, mod, startFrame, endFrame, PASSFLOAT(frac), tagName );
  208. }
  209.  
  210. void trap_S_StartLocalSound( sfxHandle_t sfx, int channelNum ) {
  211. syscall( UI_S_STARTLOCALSOUND, sfx, channelNum );
  212. }
  213.  
  214. sfxHandle_t trap_S_RegisterSound( const char *sample ) {
  215. return syscall( UI_S_REGISTERSOUND, sample );
  216. }
  217.  
  218. void trap_Key_KeynumToStringBuf( int keynum, char *buf, int buflen ) {
  219. syscall( UI_KEY_KEYNUMTOSTRINGBUF, keynum, buf, buflen );
  220. }
  221.  
  222. void trap_Key_GetBindingBuf( int keynum, char *buf, int buflen ) {
  223. syscall( UI_KEY_GETBINDINGBUF, keynum, buf, buflen );
  224. }
  225.  
  226. void trap_Key_SetBinding( int keynum, const char *binding ) {
  227. syscall( UI_KEY_SETBINDING, keynum, binding );
  228. }
  229.  
  230. qboolean trap_Key_IsDown( int keynum ) {
  231. return syscall( UI_KEY_ISDOWN, keynum );
  232. }
  233.  
  234. qboolean trap_Key_GetOverstrikeMode( void ) {
  235. return syscall( UI_KEY_GETOVERSTRIKEMODE );
  236. }
  237.  
  238. void trap_Key_SetOverstrikeMode( qboolean state ) {
  239. syscall( UI_KEY_SETOVERSTRIKEMODE, state );
  240. }
  241.  
  242. void trap_Key_ClearStates( void ) {
  243. syscall( UI_KEY_CLEARSTATES );
  244. }
  245.  
  246. int trap_Key_GetCatcher( void ) {
  247. return syscall( UI_KEY_GETCATCHER );
  248. }
  249.  
  250. void trap_Key_SetCatcher( int catcher ) {
  251. syscall( UI_KEY_SETCATCHER, catcher );
  252. }
  253.  
  254. void trap_GetClipboardData( char *buf, int bufsize ) {
  255. syscall( UI_GETCLIPBOARDDATA, buf, bufsize );
  256. }
  257.  
  258. void trap_GetClientState( uiClientState_t *state ) {
  259. syscall( UI_GETCLIENTSTATE, state );
  260. }
  261.  
  262. void trap_GetGlconfig( glconfig_t *glconfig ) {
  263. syscall( UI_GETGLCONFIG, glconfig );
  264. }
  265.  
  266. int trap_GetConfigString( int index, char* buff, int buffsize ) {
  267. return syscall( UI_GETCONFIGSTRING, index, buff, buffsize );
  268. }
  269.  
  270. int trap_LAN_GetServerCount( int source ) {
  271. return syscall( UI_LAN_GETSERVERCOUNT, source );
  272. }
  273.  
  274. void trap_LAN_GetServerAddressString( int source, int n, char *buf, int buflen ) {
  275. syscall( UI_LAN_GETSERVERADDRESSSTRING, source, n, buf, buflen );
  276. }
  277.  
  278. void trap_LAN_GetServerInfo( int source, int n, char *buf, int buflen ) {
  279. syscall( UI_LAN_GETSERVERINFO, source, n, buf, buflen );
  280. }
  281.  
  282. int trap_LAN_GetServerPing( int source, int n ) {
  283. return syscall( UI_LAN_GETSERVERPING, source, n );
  284. }
  285.  
  286. int trap_LAN_GetPingQueueCount( void ) {
  287. return syscall( UI_LAN_GETPINGQUEUECOUNT );
  288. }
  289.  
  290. int trap_LAN_ServerStatus( const char *serverAddress, char *serverStatus, int maxLen ) {
  291. return syscall( UI_LAN_SERVERSTATUS, serverAddress, serverStatus, maxLen );
  292. }
  293.  
  294. void trap_LAN_SaveCachedServers() {
  295. syscall( UI_LAN_SAVECACHEDSERVERS );
  296. }
  297.  
  298. void trap_LAN_LoadCachedServers() {
  299. syscall( UI_LAN_LOADCACHEDSERVERS );
  300. }
  301.  
  302. void trap_LAN_ResetPings(int n) {
  303. syscall( UI_LAN_RESETPINGS, n );
  304. }
  305.  
  306. void trap_LAN_ClearPing( int n ) {
  307. syscall( UI_LAN_CLEARPING, n );
  308. }
  309.  
  310. void trap_LAN_GetPing( int n, char *buf, int buflen, int *pingtime ) {
  311. syscall( UI_LAN_GETPING, n, buf, buflen, pingtime );
  312. }
  313.  
  314. void trap_LAN_GetPingInfo( int n, char *buf, int buflen ) {
  315. syscall( UI_LAN_GETPINGINFO, n, buf, buflen );
  316. }
  317.  
  318. void trap_LAN_MarkServerVisible( int source, int n, qboolean visible ) {
  319. syscall( UI_LAN_MARKSERVERVISIBLE, source, n, visible );
  320. }
  321.  
  322. int trap_LAN_ServerIsVisible( int source, int n) {
  323. return syscall( UI_LAN_SERVERISVISIBLE, source, n );
  324. }
  325.  
  326. qboolean trap_LAN_UpdateVisiblePings( int source ) {
  327. return syscall( UI_LAN_UPDATEVISIBLEPINGS, source );
  328. }
  329.  
  330. int trap_LAN_AddServer(int source, const char *name, const char *addr) {
  331. return syscall( UI_LAN_ADDSERVER, source, name, addr );
  332. }
  333.  
  334. void trap_LAN_RemoveServer(int source, const char *addr) {
  335. syscall( UI_LAN_REMOVESERVER, source, addr );
  336. }
  337.  
  338. int trap_LAN_CompareServers( int source, int sortKey, int sortDir, int s1, int s2 ) {
  339. return syscall( UI_LAN_COMPARESERVERS, source, sortKey, sortDir, s1, s2 );
  340. }
  341.  
  342. int trap_MemoryRemaining( void ) {
  343. return syscall( UI_MEMORY_REMAINING );
  344. }
  345.  
  346. #ifdef USE_CD_KEY
  347.  
  348. void trap_GetCDKey( char *buf, int buflen ) {
  349. syscall( UI_GET_CDKEY, buf, buflen );
  350. }
  351.  
  352. void trap_SetCDKey( char *buf ) {
  353. syscall( UI_SET_CDKEY, buf );
  354. }
  355.  
  356. qboolean trap_VerifyCDKey( const char *key, const char *chksum) {
  357. return syscall( UI_VERIFY_CDKEY, key, chksum);
  358. }
  359.  
  360. #endif // USE_CD_KEY
  361.  
  362. int trap_PC_AddGlobalDefine( char *define ) {
  363. return syscall( UI_PC_ADD_GLOBAL_DEFINE, define );
  364. }
  365.  
  366. int trap_PC_LoadSource( const char *filename ) {
  367. return syscall( UI_PC_LOAD_SOURCE, filename );
  368. }
  369.  
  370. int trap_PC_FreeSource( int handle ) {
  371. return syscall( UI_PC_FREE_SOURCE, handle );
  372. }
  373.  
  374. int trap_PC_ReadToken( int handle, pc_token_t *pc_token ) {
  375. return syscall( UI_PC_READ_TOKEN, handle, pc_token );
  376. }
  377.  
  378. int trap_PC_SourceFileAndLine( int handle, char *filename, int *line ) {
  379. return syscall( UI_PC_SOURCE_FILE_AND_LINE, handle, filename, line );
  380. }
  381.  
  382. int trap_PC_LoadGlobalDefines ( const char* filename )
  383. {
  384. return syscall ( UI_PC_LOAD_GLOBAL_DEFINES, filename );
  385. }
  386.  
  387. void trap_PC_RemoveAllGlobalDefines ( void )
  388. {
  389. syscall ( UI_PC_REMOVE_ALL_GLOBAL_DEFINES );
  390. }
  391.  
  392. void trap_S_StopBackgroundTrack( void ) {
  393. syscall( UI_S_STOPBACKGROUNDTRACK );
  394. }
  395.  
  396. void trap_S_StartBackgroundTrack( const char *intro, const char *loop, qboolean bReturnWithoutStarting) {
  397. syscall( UI_S_STARTBACKGROUNDTRACK, intro, loop, bReturnWithoutStarting );
  398. }
  399.  
  400. int trap_RealTime(qtime_t *qtime) {
  401. return syscall( UI_REAL_TIME, qtime );
  402. }
  403.  
  404. // this returns a handle. arg0 is the name in the format "idlogo.roq", set arg1 to NULL, alteredstates to qfalse (do not alter gamestate)
  405. int trap_CIN_PlayCinematic( const char *arg0, int xpos, int ypos, int width, int height, int bits) {
  406. return syscall(UI_CIN_PLAYCINEMATIC, arg0, xpos, ypos, width, height, bits);
  407. }
  408.  
  409. // stops playing the cinematic and ends it. should always return FMV_EOF
  410. // cinematics must be stopped in reverse order of when they are started
  411. e_status trap_CIN_StopCinematic(int handle) {
  412. return syscall(UI_CIN_STOPCINEMATIC, handle);
  413. }
  414.  
  415.  
  416. // 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.
  417. e_status trap_CIN_RunCinematic (int handle) {
  418. return syscall(UI_CIN_RUNCINEMATIC, handle);
  419. }
  420.  
  421.  
  422. // draws the current frame
  423. void trap_CIN_DrawCinematic (int handle) {
  424. syscall(UI_CIN_DRAWCINEMATIC, handle);
  425. }
  426.  
  427.  
  428. // allows you to resize the animation dynamically
  429. void trap_CIN_SetExtents (int handle, int x, int y, int w, int h) {
  430. syscall(UI_CIN_SETEXTENTS, handle, x, y, w, h);
  431. }
  432.  
  433.  
  434. void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset )
  435. {
  436. char oldShaderTMP[MAX_QPATH];
  437. char newShaderTMP[MAX_QPATH];
  438. Q_strncpyz(oldShaderTMP, oldShader, sizeof(oldShaderTMP));
  439. Q_strncpyz(newShaderTMP, newShader, sizeof(newShaderTMP));
  440. COM_StripExtensionSafe(oldShaderTMP, oldShaderTMP, sizeof(oldShaderTMP));
  441. COM_StripExtensionSafe(newShaderTMP, newShaderTMP, sizeof(newShaderTMP));
  442. syscall( UI_R_REMAP_SHADER, oldShaderTMP, newShaderTMP, timeOffset );
  443. }
  444.  
  445.  
  446. int trap_SP_GetNumLanguages( void )
  447. {
  448. return syscall( UI_SP_GETNUMLANGUAGES );
  449. }
  450.  
  451. void trap_GetLanguageName( const int languageIndex, char *buffer )
  452. {
  453. syscall( UI_SP_GETLANGUAGENAME, languageIndex, buffer);
  454. }
  455.  
  456. int trap_SP_GetStringTextString(const char *text, char *buffer, int bufferLength)
  457. {
  458. return syscall( UI_SP_GETSTRINGTEXTSTRING, text, buffer, bufferLength );
  459. }
  460. /*
  461. Ghoul2 Insert Start
  462. */
  463. void trap_G2_ListModelSurfaces(void *ghlInfo)
  464. {
  465. syscall( UI_G2_LISTSURFACES, ghlInfo);
  466. }
  467.  
  468. void trap_G2_ListModelBones(void *ghlInfo, int frame)
  469. {
  470. syscall( UI_G2_LISTBONES, ghlInfo, frame);
  471. }
  472.  
  473. void trap_G2_SetGhoul2ModelIndexes(void *ghoul2, qhandle_t *modelList, qhandle_t *skinList)
  474. {
  475. syscall( UI_G2_SETMODELS, ghoul2, modelList, skinList);
  476. }
  477.  
  478. qboolean trap_G2_HaveWeGhoul2Models(void *ghoul2)
  479. {
  480. return (qboolean)(syscall(UI_G2_HAVEWEGHOULMODELS, ghoul2));
  481. }
  482.  
  483. qboolean trap_G2API_GetBoltMatrix(void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix,
  484. const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
  485. {
  486. return (qboolean)(syscall(UI_G2_GETBOLT, ghoul2, modelIndex, boltIndex, matrix, angles, position, frameNum, modelList, scale));
  487. }
  488.  
  489. qboolean trap_G2API_GetBoltMatrix_NoReconstruct(void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix,
  490. const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
  491. { //Same as above but force it to not reconstruct the skeleton before getting the bolt position
  492. return (qboolean)(syscall(UI_G2_GETBOLT_NOREC, ghoul2, modelIndex, boltIndex, matrix, angles, position, frameNum, modelList, scale));
  493. }
  494.  
  495. qboolean trap_G2API_GetBoltMatrix_NoRecNoRot(void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix,
  496. const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
  497. { //Same as above but force it to not reconstruct the skeleton before getting the bolt position
  498. return (qboolean)(syscall(UI_G2_GETBOLT_NOREC_NOROT, ghoul2, modelIndex, boltIndex, matrix, angles, position, frameNum, modelList, scale));
  499. }
  500.  
  501. int trap_G2API_InitGhoul2Model(void **ghoul2Ptr, const char *fileName, int modelIndex, qhandle_t customSkin,
  502. qhandle_t customShader, int modelFlags, int lodBias)
  503. {
  504. return syscall(UI_G2_INITGHOUL2MODEL, ghoul2Ptr, fileName, modelIndex, customSkin, customShader, modelFlags, lodBias);
  505. }
  506.  
  507. qboolean trap_G2API_SetSkin(void *ghoul2, int modelIndex, qhandle_t customSkin, qhandle_t renderSkin)
  508. {
  509. return syscall(UI_G2_SETSKIN, ghoul2, modelIndex, customSkin, renderSkin);
  510. }
  511.  
  512. void trap_G2API_CollisionDetect (
  513. CollisionRecord_t *collRecMap,
  514. void* ghoul2,
  515. const vec3_t angles,
  516. const vec3_t position,
  517. int frameNumber,
  518. int entNum,
  519. const vec3_t rayStart,
  520. const vec3_t rayEnd,
  521. const vec3_t scale,
  522. int traceFlags,
  523. int useLod,
  524. float fRadius
  525. )
  526. {
  527. syscall ( UI_G2_COLLISIONDETECT, collRecMap, ghoul2, angles, position, frameNumber, entNum, rayStart, rayEnd, scale, traceFlags, useLod, PASSFLOAT(fRadius) );
  528. }
  529.  
  530. void trap_G2API_CollisionDetectCache (
  531. CollisionRecord_t *collRecMap,
  532. void* ghoul2,
  533. const vec3_t angles,
  534. const vec3_t position,
  535. int frameNumber,
  536. int entNum,
  537. const vec3_t rayStart,
  538. const vec3_t rayEnd,
  539. const vec3_t scale,
  540. int traceFlags,
  541. int useLod,
  542. float fRadius
  543. )
  544. {
  545. syscall ( UI_G2_COLLISIONDETECTCACHE, collRecMap, ghoul2, angles, position, frameNumber, entNum, rayStart, rayEnd, scale, traceFlags, useLod, PASSFLOAT(fRadius) );
  546. }
  547.  
  548. void trap_G2API_CleanGhoul2Models(void **ghoul2Ptr)
  549. {
  550. syscall(UI_G2_CLEANMODELS, ghoul2Ptr);
  551. }
  552.  
  553. qboolean trap_G2API_SetBoneAngles(void *ghoul2, int modelIndex, const char *boneName, const vec3_t angles, const int flags,
  554. const int up, const int right, const int forward, qhandle_t *modelList,
  555. int blendTime , int currentTime )
  556. {
  557. return (syscall(UI_G2_ANGLEOVERRIDE, ghoul2, modelIndex, boneName, angles, flags, up, right, forward, modelList, blendTime, currentTime));
  558. }
  559.  
  560. qboolean trap_G2API_SetBoneAnim(void *ghoul2, const int modelIndex, const char *boneName, const int startFrame, const int endFrame,
  561. const int flags, const float animSpeed, const int currentTime, const float setFrame , const int blendTime )
  562. {
  563. return syscall(UI_G2_PLAYANIM, ghoul2, modelIndex, boneName, startFrame, endFrame, flags, PASSFLOAT(animSpeed), currentTime, PASSFLOAT(setFrame), blendTime);
  564. }
  565.  
  566. qboolean trap_G2API_GetBoneAnim(void *ghoul2, const char *boneName, const int currentTime, float *currentFrame,
  567. int *startFrame, int *endFrame, int *flags, float *animSpeed, int *modelList, const int modelIndex)
  568. {
  569. return syscall(UI_G2_GETBONEANIM, ghoul2, boneName, currentTime, currentFrame, startFrame, endFrame, flags, animSpeed, modelList, modelIndex);
  570. }
  571.  
  572. qboolean trap_G2API_GetBoneFrame(void *ghoul2, const char *boneName, const int currentTime, float *currentFrame, int *modelList, const int modelIndex)
  573. {
  574. return syscall(UI_G2_GETBONEFRAME, ghoul2, boneName, currentTime, currentFrame, modelList, modelIndex);
  575. }
  576.  
  577. void trap_G2API_GetGLAName(void *ghoul2, int modelIndex, char *fillBuf)
  578. {
  579. syscall(UI_G2_GETGLANAME, ghoul2, modelIndex, fillBuf);
  580. }
  581.  
  582. int trap_G2API_CopyGhoul2Instance(void *g2From, void *g2To, int modelIndex)
  583. {
  584. return syscall(UI_G2_COPYGHOUL2INSTANCE, g2From, g2To, modelIndex);
  585. }
  586.  
  587. void trap_G2API_CopySpecificGhoul2Model(void *g2From, int modelFrom, void *g2To, int modelTo)
  588. {
  589. syscall(UI_G2_COPYSPECIFICGHOUL2MODEL, g2From, modelFrom, g2To, modelTo);
  590. }
  591.  
  592. void trap_G2API_DuplicateGhoul2Instance(void *g2From, void **g2To)
  593. {
  594. syscall(UI_G2_DUPLICATEGHOUL2INSTANCE, g2From, g2To);
  595. }
  596.  
  597. qboolean trap_G2API_HasGhoul2ModelOnIndex(void *ghlInfo, int modelIndex)
  598. {
  599. return syscall(UI_G2_HASGHOUL2MODELONINDEX, ghlInfo, modelIndex);
  600. }
  601.  
  602. qboolean trap_G2API_RemoveGhoul2Model(void *ghlInfo, int modelIndex)
  603. {
  604. return syscall(UI_G2_REMOVEGHOUL2MODEL, ghlInfo, modelIndex);
  605. }
  606.  
  607. int trap_G2API_AddBolt(void *ghoul2, int modelIndex, const char *boneName)
  608. {
  609. return syscall(UI_G2_ADDBOLT, ghoul2, modelIndex, boneName);
  610. }
  611.  
  612. void trap_G2API_SetBoltInfo(void *ghoul2, int modelIndex, int boltInfo)
  613. {
  614. syscall(UI_G2_SETBOLTON, ghoul2, modelIndex, boltInfo);
  615. }
  616.  
  617. qboolean trap_G2API_SetRootSurface(void *ghoul2, const int modelIndex, const char *surfaceName)
  618. {
  619. return syscall(UI_G2_SETROOTSURFACE, ghoul2, modelIndex, surfaceName);
  620. }
  621.  
  622. qboolean trap_G2API_SetSurfaceOnOff(void *ghoul2, const char *surfaceName, const int flags)
  623. {
  624. return syscall(UI_G2_SETSURFACEONOFF, ghoul2, surfaceName, flags);
  625. }
  626.  
  627. qboolean trap_G2API_SetNewOrigin(void *ghoul2, const int boltIndex)
  628. {
  629. return syscall(UI_G2_SETNEWORIGIN, ghoul2, boltIndex);
  630. }
  631.  
  632. int trap_G2API_GetTime(void)
  633. {
  634. return syscall(UI_G2_GETTIME);
  635. }
  636.  
  637. void trap_G2API_SetTime(int time, int clock)
  638. {
  639. syscall(UI_G2_SETTIME, time, clock);
  640. }
  641.  
  642. //rww - RAGDOLL_BEGIN
  643. void trap_G2API_SetRagDoll(void *ghoul2, sharedRagDollParams_t *params)
  644. {
  645. syscall(UI_G2_SETRAGDOLL, ghoul2, params);
  646. }
  647.  
  648. void trap_G2API_AnimateG2Models(void *ghoul2, int time, sharedRagDollUpdateParams_t *params)
  649. {
  650. syscall(UI_G2_ANIMATEG2MODELS, ghoul2, time, params);
  651. }
  652. //rww - RAGDOLL_END
  653.  
  654. qboolean trap_G2API_SetBoneIKState(void *ghoul2, int time, const char *boneName, int ikState, sharedSetBoneIKStateParams_t *params)
  655. {
  656. return syscall(UI_G2_SETBONEIKSTATE, ghoul2, time, boneName, ikState, params);
  657. }
  658.  
  659. qboolean trap_G2API_IKMove(void *ghoul2, int time, sharedIKMoveParams_t *params)
  660. {
  661. return syscall(UI_G2_IKMOVE, ghoul2, time, params);
  662. }
  663.  
  664. void trap_G2API_GetSurfaceName(void *ghoul2, int surfNumber, int modelIndex, char *fillBuf)
  665. {
  666. syscall(UI_G2_GETSURFACENAME, ghoul2, surfNumber, modelIndex, fillBuf);
  667. }
  668.  
  669. qboolean trap_G2API_AttachG2Model(void *ghoul2From, int modelIndexFrom, void *ghoul2To, int toBoltIndex, int toModel)
  670. {
  671. return syscall(UI_G2_ATTACHG2MODEL, ghoul2From, modelIndexFrom, ghoul2To, toBoltIndex, toModel);
  672. }
  673. /*
  674. Ghoul2 Insert End
  675. */
  676.  
  677. #include "../namespace_end.h"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement