diff --git a/sfall/FalloutEngine/Structs.h b/sfall/FalloutEngine/Structs.h index ff31f373..e397296c 100644 --- a/sfall/FalloutEngine/Structs.h +++ b/sfall/FalloutEngine/Structs.h @@ -50,6 +50,12 @@ struct GameObject; struct Program; struct ScriptInstance; +struct PALETTE { // F2 palette + BYTE B; + BYTE G; + BYTE R; +}; + struct Art { long flags; char path[16]; @@ -531,9 +537,9 @@ struct UnlistedFrm { frameAreaSize = 0; frames = nullptr; } + ~UnlistedFrm() { - if (frames != nullptr) - delete[] frames; + if (frames != nullptr) delete[] frames; } }; diff --git a/sfall/Game/GUI/Text.cpp b/sfall/Game/GUI/Text.cpp index e02e1b34..b88125fb 100644 --- a/sfall/Game/GUI/Text.cpp +++ b/sfall/Game/GUI/Text.cpp @@ -54,7 +54,7 @@ static long GetPositionWidth(const char* text, long width) { static void __fastcall DisplayPrintLineBreak(const char* message) { if (*message == 0 || !fo::var::getInt(FO_VAR_disp_init)) return; - sfall::Console::PrintFile(message); + sf::Console::PrintFile(message); const long max_lines = 100; // aka FO_VAR_max long max_disp_chars = 256; // HRP value (vanilla 80) diff --git a/sfall/Modules/Graphics.cpp b/sfall/Modules/Graphics.cpp index b56861cd..62ae6a58 100644 --- a/sfall/Modules/Graphics.cpp +++ b/sfall/Modules/Graphics.cpp @@ -76,12 +76,6 @@ static struct PALCOLOR { }; }; } *palette; - -struct PALETTE { // F2 palette - BYTE B; - BYTE G; - BYTE R; -}; #pragma pack(pop) //static bool paletteInit = false; @@ -657,7 +651,7 @@ public: if (primary && Graphics::GPUBlt) { // use the mainTex texture as source buffer } else { - lockTarget = new BYTE[ResWidth * ResHeight]; + lockTarget = new BYTE[ResWidth * ResHeight](); } } @@ -935,7 +929,7 @@ public: if (!windowInit || (long)c <= 0) return DDERR_INVALIDPARAMS; //palCounter++; - PALETTE* destPal = (PALETTE*)d; + fo::PALETTE* destPal = (fo::PALETTE*)d; if (Graphics::GPUBlt) { D3DLOCKED_RECT pal; @@ -1063,14 +1057,14 @@ public: } dlog("Creating D3D9 Device window...", DL_MAIN); - if (Graphics::mode >= 5) { - if (ResWidth != gWidth || ResHeight != gHeight) { - std::sprintf(windowTitle, "%s @sfall " VERSION_STRING " %ix%i >> %ix%i", (const char*)0x50AF08, ResWidth, ResHeight, gWidth, gHeight); - } else { - std::sprintf(windowTitle, "%s @sfall " VERSION_STRING, (const char*)0x50AF08); - } - SetWindowTextA(a, windowTitle); + if (ResWidth != gWidth || ResHeight != gHeight) { + std::sprintf(windowTitle, "%s @sfall " VERSION_STRING " %ix%i >> %ix%i", (const char*)0x50AF08, ResWidth, ResHeight, gWidth, gHeight); + } else { + std::sprintf(windowTitle, "%s @sfall " VERSION_STRING, (const char*)0x50AF08); + } + SetWindowTextA(a, windowTitle); + if (Graphics::mode >= 5) { SetWindowLongA(a, GWL_STYLE, windowStyle); RECT r; r.left = 0;