diff --git a/source/common/scripting/backend/codegen.cpp b/source/common/scripting/backend/codegen.cpp index 10d1677da..a225988fa 100644 --- a/source/common/scripting/backend/codegen.cpp +++ b/source/common/scripting/backend/codegen.cpp @@ -48,6 +48,7 @@ #include "m_random.h" #include "v_font.h" #include "templates.h" +#include "palutil.h" extern FRandom pr_exrandom; FMemArena FxAlloc(65536); diff --git a/source/common/scripting/jit/jit_move.cpp b/source/common/scripting/jit/jit_move.cpp index 8e3f6ab4c..cf4e71944 100644 --- a/source/common/scripting/jit/jit_move.cpp +++ b/source/common/scripting/jit/jit_move.cpp @@ -3,6 +3,7 @@ #include "v_video.h" #include "s_soundinternal.h" #include "texturemanager.h" +#include "palutil.h" void JitCompiler::EmitMOVE() { @@ -53,11 +54,7 @@ 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() { diff --git a/source/common/scripting/vm/vmexec.cpp b/source/common/scripting/vm/vmexec.cpp index 6921d3dac..7180cb103 100644 --- a/source/common/scripting/vm/vmexec.cpp +++ b/source/common/scripting/vm/vmexec.cpp @@ -42,6 +42,7 @@ #include "types.h" #include "basics.h" #include "texturemanager.h" +#include "palutil.h" extern cycle_t VMCycles[10]; extern int VMCalls[10]; diff --git a/source/common/scripting/vm/vmexec.h b/source/common/scripting/vm/vmexec.h index f3565f388..72e0d0199 100644 --- a/source/common/scripting/vm/vmexec.h +++ b/source/common/scripting/vm/vmexec.h @@ -1848,10 +1848,8 @@ static void DoCast(const VMRegisters ®, 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; } diff --git a/source/common/textures/texturemanager.cpp b/source/common/textures/texturemanager.cpp index 3a4b6aab1..99b859314 100644 --- a/source/common/textures/texturemanager.cpp +++ b/source/common/textures/texturemanager.cpp @@ -119,6 +119,7 @@ void FTextureManager::FlushAll() { for (int j = 0; j < 2; j++) { + Textures[i].Texture->DeleteHardwareTextures(); #if 0 Textures[i].Texture->SystemTextures.Clean(true, true); DeleteSoftwareTexture(Textures[i].Texture->SoftwareTexture); diff --git a/source/core/texturemanager.h b/source/core/texturemanager.h deleted file mode 100644 index a8884b29a..000000000 --- a/source/core/texturemanager.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -// just a dummy to avoid editing other files. - -inline int V_GetColor(const void *m, const char *, void * a= nullptr) { return 0; } -