diff options
| author | Tim Angus <tim@ngus.net> | 2003-09-21 18:23:47 +0000 | 
|---|---|---|
| committer | Tim Angus <tim@ngus.net> | 2003-09-21 18:23:47 +0000 | 
| commit | 51f8195fe9846eaf3482da7ccce44064a7c2900a (patch) | |
| tree | 62fa42690362537f3419753bf738765a12aaac80 /src/game | |
| parent | 84e75ec07a5027e76726bc28073438d8c9a8d04a (diff) | |
* Fully generalised scriptable paricle system
* Changes to Makefile and depend file for above
* Tweaks to entities.def
* Apparently a bunch of other stuff I've forgotten about
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/bg_public.h | 4 | ||||
| -rw-r--r-- | src/game/g_main.c | 29 | ||||
| -rw-r--r-- | src/game/q_shared.h | 7 | 
3 files changed, 35 insertions, 5 deletions
diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 494c3cf7..920df33b 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -76,9 +76,9 @@  #define CS_PLAYERS          (CS_SHADERS+MAX_SHADERS)  #define CS_PRECACHES        (CS_PLAYERS+MAX_CLIENTS)  #define CS_LOCATIONS        (CS_PRECACHES+MAX_CLIENTS) -/*#define CS_PARTICLES        (CS_LOCATIONS+MAX_LOCATIONS) TA: never used?!*/ +#define CS_PARTICLE_FILES   (CS_LOCATIONS+MAX_LOCATIONS) -#define CS_MAX              (CS_LOCATIONS+MAX_LOCATIONS) +#define CS_MAX              (CS_PARTICLE_FILES+MAX_PARTICLE_FILES)  #if (CS_MAX) > MAX_CONFIGSTRINGS  #error overflow: (CS_MAX) > MAX_CONFIGSTRINGS diff --git a/src/game/g_main.c b/src/game/g_main.c index 4283b8eb..f74f7e7d 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -402,6 +402,34 @@ void G_UpdateCvars( void )  /* +=============== +G_GenerateParticleFileList + +Make a list of particle files for each client to parse since fsr +the client does not have trap_FS_GetFileList +=============== +*/ +static void G_GenerateParticleFileList( void ) +{ +  int   i, numFiles, fileLen; +  char  fileList[ MAX_PARTICLE_FILES ]; +  char  fileName[ MAX_QPATH ]; +  char  *filePtr; + +  numFiles = trap_FS_GetFileList( "scripts", ".particle", fileList, 1024 ); +  filePtr = fileList; +   +  for( i = 0; i < numFiles; i++, filePtr += fileLen + 1 ) +  { +    fileLen = strlen( filePtr ); +    strcpy( fileName, "scripts/" ); +    strcat( fileName, filePtr ); +    trap_SetConfigstring( CS_PARTICLE_FILES + i, fileName );   +  } +} + + +/*  ============  G_InitGame @@ -482,6 +510,7 @@ void G_InitGame( int levelTime, int randomSeed, int restart )    //TA:    G_InitDamageLocations( ); +  G_GenerateParticleFileList( );    //reset stages    trap_Cvar_Set( "g_alienStage", va( "%d", S1 ) ); diff --git a/src/game/q_shared.h b/src/game/q_shared.h index fefeed3b..34d2ffb7 100644 --- a/src/game/q_shared.h +++ b/src/game/q_shared.h @@ -1095,9 +1095,10 @@ typedef enum {  #define	ENTITYNUM_MAX_NORMAL	(MAX_GENTITIES-2) -#define	MAX_MODELS			256		// these are sent over the net as 8 bits -#define	MAX_SOUNDS			256		// so they cannot be blindly increased -#define	MAX_SHADERS			256		//TA: should be in bg_public.h +#define	MAX_MODELS			    256		// these are sent over the net as 8 bits +#define	MAX_SOUNDS			    256		// so they cannot be blindly increased +#define	MAX_SHADERS			    128		//TA: should be in bg_public.h +#define MAX_PARTICLE_FILES  128  #define	MAX_CONFIGSTRINGS	1024  | 
