Thread: Module: Rage
View Single Post
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-04-2012 , 13:27   Re: Module: Rage
Reply With Quote #3

Rules for naming handlers

You should use this rules if you are creating a handler that you want to distribute and if it handles everything one is supposed to do.
They are normative so if you are testing or just doing for yourself do as you wish.

[[thiscall|stdcall]__]returnType__argType1_argType2_[...]

Notes :
thiscall is a compiler convention for calling functions that are members of a class. The purpose its to call those functions in the context of an object.
stdcall is a convention that makes the function called responsible for cleaning the stack so in relation to cdecl it makes the code more compact because the code to clean the stack isnt spread around in each calling function
No return, use Void.
Special types :
Code:
edict_s*      : Edict
entvars_s*    : Entvars
char*         : String
CBaseEntity*  : CBaseEntity
CBase[...]*   : CBaseEntity
Normal types :
Code:
bool    : Bool
int     : Int
float   : Float
Vector  : Vector
int&    : Int-ref
[...]&  : [...]-ref
Void*   : ptr
Int*    : Int-ptr
[...]*  : [...]-ptr
Examples :

Code:
Vector CBaseEntity::FireBullets3( Vector source, Vector dirShooting, float spread, Float distance, int penetration, int bulletType, int damage, float rangerModifier, entvars_s *pevAttacker, bool isPistol, int sharedRand );
int CBaseAnimating::ExtractBbox( int sequence, float *mins, float *maxs );
int UTIL_EntitiesInBox( CBaseEntity **pList, int listMax, const Vector &mins, const Vector &maxs, int flagMask );
CBaseEntity *UTIL_FindEntityInSphere( CBaseEntity *pStartEntity, const Vector &vecCenter, float flRadius );
->
Code:
thiscall_Vector__CBaseEntity_Vector_Vector_Float_Float_Int_Int_Int_Float_Entvars_Bool_Int
thiscall_Int__CBaseEntity_Int_Float-ptr_Float-ptr
Int__CBaseEntity-ptr-ptr_Int_Vector-ref_Vector-ref_Int
CBaseEntity__CBaseEntity_Vector-ref_Float


__________________

Last edited by Arkshine; 03-19-2012 at 14:36.
Arkshine is offline