mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-05 05:10:55 +00:00
- fixed error message spam when trying to load a non-existent voxel using .def.
This commit is contained in:
parent
3194efc646
commit
5d5af0cb09
1 changed files with 12 additions and 9 deletions
|
@ -653,6 +653,7 @@ void parseVoxel(FScanner& sc, FScriptPosition& pos)
|
||||||
FScanner::SavedPos blockend;
|
FScanner::SavedPos blockend;
|
||||||
int tile0 = MAXTILES, tile1 = -1;
|
int tile0 = MAXTILES, tile1 = -1;
|
||||||
FString fn;
|
FString fn;
|
||||||
|
bool error = false;
|
||||||
|
|
||||||
if (!sc.GetString(fn)) return;
|
if (!sc.GetString(fn)) return;
|
||||||
|
|
||||||
|
@ -661,13 +662,12 @@ void parseVoxel(FScanner& sc, FScriptPosition& pos)
|
||||||
if (nextvoxid == MAXVOXELS)
|
if (nextvoxid == MAXVOXELS)
|
||||||
{
|
{
|
||||||
pos.Message(MSG_ERROR, "Maximum number of voxels (%d) already defined.", MAXVOXELS);
|
pos.Message(MSG_ERROR, "Maximum number of voxels (%d) already defined.", MAXVOXELS);
|
||||||
return;
|
error = true;
|
||||||
}
|
}
|
||||||
|
else if (voxDefine(nextvoxid, fn))
|
||||||
if (voxDefine(nextvoxid, fn))
|
|
||||||
{
|
{
|
||||||
pos.Message(MSG_ERROR, "Unable to load voxel file \"%s\"", fn.GetChars());
|
pos.Message(MSG_ERROR, "Unable to load voxel file \"%s\"", fn.GetChars());
|
||||||
return;
|
error = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lastvoxid = nextvoxid++;
|
int lastvoxid = nextvoxid++;
|
||||||
|
@ -679,13 +679,16 @@ void parseVoxel(FScanner& sc, FScriptPosition& pos)
|
||||||
if (sc.Compare("tile"))
|
if (sc.Compare("tile"))
|
||||||
{
|
{
|
||||||
sc.GetNumber(true);
|
sc.GetNumber(true);
|
||||||
if (ValidateTilenum("voxel", sc.Number, pos)) tiletovox[sc.Number] = lastvoxid;
|
if (ValidateTilenum("voxel", sc.Number, pos))
|
||||||
|
{
|
||||||
|
if (!error) tiletovox[sc.Number] = lastvoxid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (sc.Compare("tile0")) sc.GetNumber(tile0, true);
|
if (sc.Compare("tile0")) sc.GetNumber(tile0, true);
|
||||||
if (sc.Compare("tile1"))
|
if (sc.Compare("tile1"))
|
||||||
{
|
{
|
||||||
sc.GetNumber(tile1, true);
|
sc.GetNumber(tile1, true);
|
||||||
if (ValidateTileRange("voxel", tile0, tile1, pos))
|
if (ValidateTileRange("voxel", tile0, tile1, pos) && !error)
|
||||||
{
|
{
|
||||||
for (int i = tile0; i <= tile1; i++) tiletovox[i] = lastvoxid;
|
for (int i = tile0; i <= tile1; i++) tiletovox[i] = lastvoxid;
|
||||||
}
|
}
|
||||||
|
@ -693,9 +696,9 @@ void parseVoxel(FScanner& sc, FScriptPosition& pos)
|
||||||
if (sc.Compare("scale"))
|
if (sc.Compare("scale"))
|
||||||
{
|
{
|
||||||
sc.GetFloat(true);
|
sc.GetFloat(true);
|
||||||
voxscale[lastvoxid] = (float)sc.Float;
|
if (!error) voxscale[lastvoxid] = (float)sc.Float;
|
||||||
}
|
}
|
||||||
if (sc.Compare("rotate")) voxrotate.Set(lastvoxid);
|
if (sc.Compare("rotate") && !error) voxrotate.Set(lastvoxid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue