- fixed compilation.

Much of this commit will have to be undone later, once the texture manager becomes available.
This commit is contained in:
Christoph Oelckers 2020-05-23 15:18:10 +02:00
parent c0217c9152
commit daf77e55f7
9 changed files with 22 additions and 4 deletions

View file

@ -72,7 +72,7 @@
#elif defined __cplusplus && __cplusplus >= 201103L
# define CXXSTD 2011
#elif defined __cplusplus && __cplusplus >= 199711L
# define CXXSTD 1998
# define CXXSTD 2014 // Thanks, Microsoft... :?
#else
# define CXXSTD 0
#endif

View file

@ -1062,6 +1062,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, float &value, float *d
FSerializer &Serialize(FSerializer &arc, const char *key, FTextureID &value, FTextureID *defval)
{
#if 0
if (arc.isWriting())
{
if (!arc.w->inObject() || defval == nullptr || value != *defval)
@ -1138,6 +1139,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, FTextureID &value, FTe
}
}
}
#endif
return arc;
}
@ -1503,7 +1505,7 @@ template<> FSerializer &Serialize(FSerializer &arc, const char *key, Dictionary
{
if (arc.isWriting())
{
FString contents { dict ? DictionaryToString(*dict) : "null" };
FString contents { dict ? DictionaryToString(*dict) : FString("null") };
return arc(key, contents);
}
else

View file

@ -2917,6 +2917,7 @@ ExpEmit FxAddSub::Emit(VMFunctionBuilder *build)
texcheck:
// Do a bounds check for the texture index. Note that count can change at run time so this needs to read the value from the texture manager.
#if 0
auto * ptr = (FArray*)&TexMan.Textures;
auto * countptr = &ptr->Count;
ExpEmit bndp(build, REGT_POINTER);
@ -2926,6 +2927,7 @@ texcheck:
build->Emit(OP_BOUND_R, to.RegNum, bndc.RegNum);
bndp.Free(build);
bndc.Free(build);
#endif
return to;
}

View file

@ -198,7 +198,7 @@ struct ExpVal
const FString GetString() const
{
return Type == TypeString ? *(FString *)&pointer : Type == TypeName ? FString(FName(ENamedName(Int)).GetChars()) : "";
return Type == TypeString ? *(FString *)&pointer : Type == TypeName ? FString(FName(ENamedName(Int)).GetChars()) : FString();
}
bool GetBool() const

View file

@ -62,7 +62,7 @@ static void DictInsert(Dictionary *dict, const FString &key, const FString &valu
static void DictAt(const Dictionary *dict, const FString &key, FString *result)
{
const FString *value = dict->Map.CheckKey(key);
*result = value ? *value : "";
*result = value ? *value : FString("");
}
static void DictToString(const Dictionary *dict, FString *result)

View file

@ -53,7 +53,11 @@ static void CastCo2S(FString *a, int b) { PalEntry c(b); a->Format("%02x %02x %0
static int CastS2So(FString *b) { return FSoundID(*b); }
static void CastSo2S(FString* a, int b) { *a = soundEngine->GetSoundName(b); }
static void CastSID2S(FString* a, unsigned int b) { VM_CastSpriteIDToString(a, b); }
#if 0
static void CastTID2S(FString *a, int b) { auto tex = TexMan.GetTexture(*(FTextureID*)&b); *a = (tex == nullptr) ? "(null)" : tex->GetName().GetChars(); }
#else
static void CastTID2S(FString* a, int b) { *a = "(null)"; }
#endif
void JitCompiler::EmitCAST()
{

View file

@ -1848,8 +1848,10 @@ static void DoCast(const VMRegisters &reg, const VMFrame *f, int a, int b, int c
case CAST_TID2S:
{
ASSERTS(a); ASSERTD(b);
#if 0
auto tex = TexMan.GetTexture(*(FTextureID*)&(reg.d[b]));
reg.s[a] = tex == nullptr ? "(null)" : tex->GetName().GetChars();
#endif
break;
}

View file

@ -28,6 +28,8 @@
* unsigned int and 64-bit unsigned int in hexadecimal format.
*/
#include <inttypes.h>
#ifndef SFMT_H
#define SFMT_H

View file

@ -0,0 +1,6 @@
#pragma once
// just a dummy to avoid editing other files.
inline int V_GetColor(const void *m, const char *, void * a= nullptr) { return 0; }