mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Minor code edits to Graphics.cpp from HRP branch
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user