mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: add litwater support
This commit is contained in:
@@ -2407,6 +2407,9 @@ static void Mod_LoadEntities( model_t *mod, const dbspmodel_t *bmod )
|
||||
world.wadlist = NULL;
|
||||
world.wadcount = 0;
|
||||
|
||||
world.litwater_minlight = -1;
|
||||
world.litwater_scale = -1.0f;
|
||||
|
||||
// parse all the wads for loading textures in right ordering
|
||||
while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL )
|
||||
{
|
||||
@@ -2450,6 +2453,15 @@ static void Mod_LoadEntities( model_t *mod, const dbspmodel_t *bmod )
|
||||
Mem_Free( world.generator );
|
||||
world.generator = copystring( token );
|
||||
}
|
||||
else if( !Q_stricmp( keyname, "_litwater" ))
|
||||
{
|
||||
if( Q_atoi( token ) != 0 )
|
||||
SetBits( world.flags, FWORLD_HAS_LITWATER );
|
||||
}
|
||||
else if( !Q_stricmp( keyname, "_litwater_minlight" ))
|
||||
world.litwater_minlight = Q_atoi( token );
|
||||
else if( !Q_stricmp( keyname, "_litwater_scale" ))
|
||||
world.litwater_scale = Q_atof( token );
|
||||
}
|
||||
return; // all done
|
||||
}
|
||||
|
||||
@@ -124,6 +124,10 @@ typedef struct world_static_s
|
||||
|
||||
wadentry_t *wadlist;
|
||||
int wadcount;
|
||||
|
||||
// lightmapped water extra info
|
||||
float litwater_scale;
|
||||
int litwater_minlight;
|
||||
} world_static_t;
|
||||
|
||||
#ifndef REF_DLL
|
||||
|
||||
@@ -105,6 +105,7 @@ GNU General Public License for more details.
|
||||
#define FWORLD_CUSTOM_SKYBOX BIT( 1 )
|
||||
#define FWORLD_WATERALPHA BIT( 2 )
|
||||
#define FWORLD_HAS_DELUXEMAP BIT( 3 )
|
||||
#define FWORLD_HAS_LITWATER BIT( 4 )
|
||||
|
||||
// special rendermode for screenfade modulate
|
||||
// (probably will be expanded at some point)
|
||||
|
||||
Reference in New Issue
Block a user