mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-06-04 19:00:59 +00:00
- 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:
parent
7c122d03e9
commit
7d99552903
10 changed files with 164 additions and 17 deletions
|
@ -127,6 +127,8 @@ enum
|
|||
CAST_So2S,
|
||||
CAST_V22S,
|
||||
CAST_V32S,
|
||||
CAST_SID2S,
|
||||
CAST_TID2S,
|
||||
};
|
||||
|
||||
// Register types for VMParam
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
#include <s_sound.h>
|
||||
#include "dobject.h"
|
||||
#include "xs_Float.h"
|
||||
#include "r_state.h"
|
||||
#include "textures/textures.h"
|
||||
#include "math/cmath.h"
|
||||
|
||||
#define IMPLEMENT_VMEXEC
|
||||
|
|
|
@ -1695,6 +1695,19 @@ static void DoCast(const VMRegisters ®, 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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue