mirror of
https://github.com/Garux/netradiant-custom.git
synced 2026-09-28 00:00:03 +02:00
make q3map_skyLight work w/o surfaceparm sky or q3map_sun
This commit is contained in:
@@ -106,7 +106,7 @@ bool LoadScriptFile( const char *filename, int index /* = 0 */, bool verbose /*
|
||||
ParseFromMemory
|
||||
==============
|
||||
*/
|
||||
void ParseFromMemory( char *buffer, size_t size ){
|
||||
void ParseFromMemory( const char *buffer, size_t size ){
|
||||
scriptstack.clear();
|
||||
tokenready = false;
|
||||
MemBuffer bu( size );
|
||||
|
||||
@@ -32,7 +32,7 @@ extern int scriptline;
|
||||
/// \param[in] index >= 0: \p filename is relative path in VSF, Nth occurrence of file
|
||||
/// \return true on success
|
||||
bool LoadScriptFile( const char *filename, int index = 0, bool verbose = true );
|
||||
void ParseFromMemory( char *buffer, size_t size );
|
||||
void ParseFromMemory( const char *buffer, size_t size );
|
||||
|
||||
/// \param[in] crossline true: write next token to \c token or return false on EOF
|
||||
/// \param[in] crossline false: find next token on the current line or emit \c Error
|
||||
|
||||
@@ -1094,7 +1094,7 @@ static void ParseShaderFile( const char *filename ){
|
||||
sun.numSamples = atoi( token );
|
||||
}
|
||||
|
||||
/* apply sky surfaceparm */
|
||||
/* apply sky surfaceparm, this is required by ELightType::Sun to work */
|
||||
ApplySurfaceParm( "sky", &si.contentFlags, &si.surfaceFlags, &si.compileFlags );
|
||||
|
||||
/* don't process any more tokens on this line */
|
||||
@@ -1179,13 +1179,12 @@ static void ParseShaderFile( const char *filename ){
|
||||
else if ( striEqual( token, "q3map_skyLight" ) ) {
|
||||
skylight_t& skylight = si.skylights.emplace_back();
|
||||
text.GetToken( false );
|
||||
skylight.value = atof( token );
|
||||
skylight.value = std::max( atof( token ), 0.0 );
|
||||
text.GetToken( false );
|
||||
skylight.iterations = atoi( token );
|
||||
skylight.iterations = std::max( atoi( token ), 2 );
|
||||
|
||||
/* clamp */
|
||||
value_maximize( skylight.value, 0.0f );
|
||||
value_maximize( skylight.iterations, 2 );
|
||||
/* apply sky surfaceparm, this is required by ELightType::Sun to work */
|
||||
ApplySurfaceParm( "sky", &si.contentFlags, &si.surfaceFlags, &si.compileFlags );
|
||||
|
||||
/* read optional extension: horizon_min horizon_max sample_color*/
|
||||
if( TokenAvailable() ){
|
||||
|
||||
Reference in New Issue
Block a user