[MetaHook] R_SparkStreaks

By hzqst

 1 void R_SparkStreaks(vec_t *pos, int count, int velocityMin, int velocityMax)
 2 {
 3     int i;
 4     particle_t *p, *p2;
 5
 6     i = 0;
 7     p = free_particles;
 8
 9     while ( free_particles )
10     {
11         i ++;
12
13         free_particles = p->next;
14         p2 = gpActiveTracers;
15         gpActiveTracers = p;
16         p->next = p2;
17
18         p->die = RandomFloat(0.1, 0.5) + cl.time;
19         p->color = 5;
20         p->packedColor = 255;
21         p->type = pt_grav;
22         p->ramp = 0.5;
23         VectorCopy(pos, p->org);
24         p->vel[0] = RandomFloat(velocityMin, velocityMax);
25         p->vel[1] = RandomFloat(velocityMin, velocityMax);
26         p->vel[2] = RandomFloat(velocityMin, velocityMax);
27
28         if(i == count)
29             break;
30
31         p = free_particles;
32     }
33 }
时间: 2024-10-13 10:32:41

[MetaHook] R_SparkStreaks的相关文章

[MetaHook] Event Hook

1 #include <metahook.h> 2 3 struct event_hook_t 4 { 5 event_hook_t *next; 6 char *name; 7 void (*pfnEvent)(event_args_s *args); 8 }; 9 10 #define HOOKEVENT_SIG "\x8D\x44\x24\x08\x56\x8D\x4C\x24\x08\x50\x51\xFF\x15\x2A\x2A\x2A\x2A\x8B\x44\x24\x1

[MetaHook] Quake FMOD player demo

CFMOD.h 1 #ifndef CFMOD_H 2 #define CFMOD_H 3 4 #include "qfmod.h" 5 6 struct Sound_t 7 { 8 char *pszName; 9 FMOD_SOUND *pSound; 10 FMOD_CHANNEL *pChannel; 11 Sound_t *pNext; 12 }; 13 14 #ifdef PlaySound 15 #undef PlaySound 16 #endif 17 18 class

[MetaHook] R_SparkEffect

By hzqst 1 void R_SparkEffect(float *pos, int count, int velocityMin, int velocityMax) 2 { 3 efx.R_SparkStreaks(pos, count, velocityMin, velocityMax); 4 efx.R_RicochetSprite(pos, cl_sprite_ricochet, 0.1, RandomFloat(0.5, 1.0)); 5 }

[MetaHook] Load large texture from model

We need hook "GL_LoadTexture" engine function. GL_LOADTEXTURE_SIG from hw.dll(3266) engine, can not use for other engine version. 1 #include <metahook.h> 2 #include "qgl.h" 3 #include "surface.h" 4 5 extern DWORD g_dwEn

[MetaHook] Quake OpenGL function

Quake OpenGL function for MetaHook plugin. Thank hzqst :D QGL.h 1 #ifndef QGL_H 2 #define QGL_H 3 4 #include <gl/gl.h> 5 #include <gl/glext.h> 6 7 extern void (APIENTRY *qglAccum)(GLenum op, GLfloat value); 8 extern void (APIENTRY *qglAlphaFun

[MetaHook] Quake Bink function

If you want to play Bink video in game, maybe you need this code. QBink.h 1 #ifndef QBINK_H 2 #define QBINK_H 3 4 #include "bink.h" 5 6 extern void PTR4* (RADEXPLINK *qBinkLogoAddress)(void); 7 extern void (RADEXPLINK *qBinkSetError)(const char

[MetaHook] Surface hook

Hook ISurface function. 1 #include <metahook.h> 2 #include <vgui/ISurface.h> 3 4 using namespace vgui; 5 6 ISurface *g_pSurface = 0; 7 8 void (__fastcall *g_pfnCSurface_Shutdown)(void *pthis, int edx) = 0; 9 void (__fastcall *g_pfnCSurface_Run

[MetaHook] BaseUI hook

Hook IBaseUI function. 1 #include <metahook.h> 2 3 #include <IBaseUI.h> 4 5 IBaseUI *g_pBaseUI = 0; 6 7 void (__fastcall *g_pfnCBaseUI_Initialize)(void *pthis, int edx, CreateInterfaceFn *factories, int count) = 0; 8 void (__fastcall *g_pfnCBa

[MetaHook] SearchPattern function

By Nagi 1 void *SearchPattern(void *pStartSearch, DWORD dwSearchLen, char *pPattern, DWORD dwPatternLen) 2 { 3 DWORD dwStartAddr = (DWORD)pStartSearch; 4 DWORD dwEndAddr = dwStartAddr + dwSearchLen - dwPatternLen; 5 6 while (dwStartAddr < dwEndAddr)