mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-07 09:01:57 +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"))
|
else if (sc.Compare("spin"))
|
||||||
{
|
{
|
||||||
|
int mul = 1;
|
||||||
sc.MustGetToken('=');
|
sc.MustGetToken('=');
|
||||||
|
if (sc.CheckToken('-')) mul = -1;
|
||||||
sc.MustGetToken(TK_IntConst);
|
sc.MustGetToken(TK_IntConst);
|
||||||
opts.DroppedSpin = opts.PlacedSpin = sc.Number;
|
opts.DroppedSpin = opts.PlacedSpin = sc.Number*mul;
|
||||||
}
|
}
|
||||||
else if (sc.Compare("placedspin"))
|
else if (sc.Compare("placedspin"))
|
||||||
{
|
{
|
||||||
|
int mul = 1;
|
||||||
sc.MustGetToken('=');
|
sc.MustGetToken('=');
|
||||||
|
if (sc.CheckToken('-')) mul = -1;
|
||||||
sc.MustGetToken(TK_IntConst);
|
sc.MustGetToken(TK_IntConst);
|
||||||
opts.PlacedSpin = sc.Number;
|
opts.PlacedSpin = sc.Number*mul;
|
||||||
}
|
}
|
||||||
else if (sc.Compare("droppedspin"))
|
else if (sc.Compare("droppedspin"))
|
||||||
{
|
{
|
||||||
|
int mul = 1;
|
||||||
sc.MustGetToken('=');
|
sc.MustGetToken('=');
|
||||||
|
if (sc.CheckToken('-')) mul = -1;
|
||||||
sc.MustGetToken(TK_IntConst);
|
sc.MustGetToken(TK_IntConst);
|
||||||
opts.DroppedSpin = sc.Number;
|
opts.DroppedSpin = sc.Number*mul;
|
||||||
}
|
}
|
||||||
else if (sc.Compare("angleoffset"))
|
else if (sc.Compare("angleoffset"))
|
||||||
{
|
{
|
||||||
|
int mul = 1;
|
||||||
sc.MustGetToken('=');
|
sc.MustGetToken('=');
|
||||||
|
if (sc.CheckToken('-')) mul = -1;
|
||||||
sc.MustGetAnyToken();
|
sc.MustGetAnyToken();
|
||||||
if (sc.TokenType == TK_IntConst)
|
if (sc.TokenType == TK_IntConst)
|
||||||
{
|
{
|
||||||
|
@ -529,7 +537,7 @@ static void VOX_ReadOptions(FScanner &sc, VoxelOptions &opts)
|
||||||
{
|
{
|
||||||
sc.TokenMustBe(TK_FloatConst);
|
sc.TokenMustBe(TK_FloatConst);
|
||||||
}
|
}
|
||||||
opts.AngleOffset = sc.Float + 90.;
|
opts.AngleOffset = mul * sc.Float + 90.;
|
||||||
}
|
}
|
||||||
else if (sc.Compare("overridepalette"))
|
else if (sc.Compare("overridepalette"))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue