File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -4397,28 +4397,26 @@ static bool ParseShader( const char *_text )
4397
4397
}
4398
4398
4399
4399
// dpoffsetmapping - 2 match8 65
4400
- float off;
4401
- float div;
4400
+ reliefBias_t reliefBias = { 0 .0f , 1 .0f , 0 .0f };
4402
4401
4403
4402
if ( !Q_stricmp ( token, " bias" ) )
4404
4403
{
4405
- off = 0 .0f ;
4406
- div = 1 .0f ;
4404
+ // Use default values.
4407
4405
}
4408
4406
else if ( !Q_stricmp ( token, " match" ) )
4409
4407
{
4410
- off = 1 .0f ;
4411
- div = 1 .0f ;
4408
+ reliefBias. origin = 1 .0f ;
4409
+ reliefBias. divisor = 1 .0f ;
4412
4410
}
4413
4411
else if ( !Q_stricmp ( token, " match8" ) )
4414
4412
{
4415
- off = 1 .0f ;
4416
- div = 255 .0f ;
4413
+ reliefBias. origin = 1 .0f ;
4414
+ reliefBias. divisor = 255 .0f ;
4417
4415
}
4418
4416
else if ( !Q_stricmp ( token, " match16" ) )
4419
4417
{
4420
- off = 1 .0f ;
4421
- div = 65535 .0f ;
4418
+ reliefBias. origin = 1 .0f ;
4419
+ reliefBias. divisor = 65535 .0f ;
4422
4420
}
4423
4421
else
4424
4422
{
@@ -4435,8 +4433,8 @@ static bool ParseShader( const char *_text )
4435
4433
continue ;
4436
4434
}
4437
4435
4438
- float bias = atof ( token );
4439
- shader.reliefOffsetBias = off - bias / div ;
4436
+ reliefBias. offset = atof ( token );
4437
+ shader.reliefOffsetBias = reliefBias. origin - reliefBias. offset / reliefBias. divisor ;
4440
4438
continue ;
4441
4439
}
4442
4440
// entityMergable, allowing sprite surfaces from multiple entities
You can’t perform that action at this time.
0 commit comments