engine: add litwater support

This commit is contained in:
Alibek Omarov
2026-04-09 11:58:15 +05:00
parent dbfeacfecc
commit 68dba8b4e0
3 changed files with 17 additions and 0 deletions

View File

@@ -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
}

View File

@@ -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

View File

@@ -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)