mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
- extended the voxeldef parser to allow negative numbers where appropriate.
This commit is contained in:
parent
86b647ed41
commit
f387199442
1 changed files with 12 additions and 4 deletions
|
@ -501,25 +501,33 @@ static void VOX_ReadOptions(FScanner &sc, VoxelOptions &opts)
|
|||
}
|
||||
else if (sc.Compare("spin"))
|
||||
{
|
||||
int mul = 1;
|
||||
sc.MustGetToken('=');
|
||||
if (sc.CheckToken('-')) mul = -1;
|
||||
sc.MustGetToken(TK_IntConst);
|
||||
opts.DroppedSpin = opts.PlacedSpin = sc.Number;
|
||||
opts.DroppedSpin = opts.PlacedSpin = sc.Number*mul;
|
||||
}
|
||||
else if (sc.Compare("placedspin"))
|
||||
{
|
||||
int mul = 1;
|
||||
sc.MustGetToken('=');
|
||||
if (sc.CheckToken('-')) mul = -1;
|
||||
sc.MustGetToken(TK_IntConst);
|
||||
opts.PlacedSpin = sc.Number;
|
||||
opts.PlacedSpin = sc.Number*mul;
|
||||
}
|
||||
else if (sc.Compare("droppedspin"))
|
||||
{
|
||||
int mul = 1;
|
||||
sc.MustGetToken('=');
|
||||
if (sc.CheckToken('-')) mul = -1;
|
||||
sc.MustGetToken(TK_IntConst);
|
||||
opts.DroppedSpin = sc.Number;
|
||||
opts.DroppedSpin = sc.Number*mul;
|
||||
}
|
||||
else if (sc.Compare("angleoffset"))
|
||||
{
|
||||
int mul = 1;
|
||||
sc.MustGetToken('=');
|
||||
if (sc.CheckToken('-')) mul = -1;
|
||||
sc.MustGetAnyToken();
|
||||
if (sc.TokenType == TK_IntConst)
|
||||
{
|
||||
|
@ -529,7 +537,7 @@ static void VOX_ReadOptions(FScanner &sc, VoxelOptions &opts)
|
|||
{
|
||||
sc.TokenMustBe(TK_FloatConst);
|
||||
}
|
||||
opts.AngleOffset = sc.Float + 90.;
|
||||
opts.AngleOffset = mul * sc.Float + 90.;
|
||||
}
|
||||
else if (sc.Compare("overridepalette"))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue