Minor code edits to Graphics.cpp from HRP branch

This commit is contained in:
NovaRain
2021-11-17 10:05:33 +08:00
parent 7e65aa2c64
commit 809cba44e8
3 changed files with 18 additions and 18 deletions
+8 -2
View File
@@ -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;
}
};
+1 -1
View File
@@ -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)
+9 -15
View File
@@ -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;