- added two new integral types SpriteID and TextureID, both are needed to allow proper serialization as they require something different to be written out than a regular integer.

This commit is contained in:
Christoph Oelckers 2016-11-21 13:45:33 +01:00
commit 7d99552903
10 changed files with 164 additions and 17 deletions

View file

@ -1695,6 +1695,19 @@ static void DoCast(const VMRegisters &reg, const VMFrame *f, int a, int b, int c
reg.s[a] = S_sfx[reg.d[b]].name;
break;
case CAST_SID2S:
ASSERTS(a); ASSERTD(b);
reg.s[a] = unsigned(reg.d[b]) >= sprites.Size() ? "TNT1" : sprites[reg.d[b]].name;
break;
case CAST_TID2S:
{
ASSERTS(a); ASSERTD(b);
auto tex = TexMan[*(FTextureID*)&(reg.d[b])];
reg.s[a] = tex == nullptr ? "(null)" : tex->Name.GetChars();
break;
}
default:
assert(0);
}