Fix noborder stuff
This commit is contained in:
parent
9b2d709211
commit
8a4c64c2db
2
deps/mongoose
vendored
2
deps/mongoose
vendored
@ -1 +1 @@
|
|||||||
Subproject commit ced823cd95b70b313fa56baad544ccec5d6ccd5b
|
Subproject commit 4d65cb1c0ff6c8e50127afd6d9e2a88fe5f30972
|
@ -61,18 +61,26 @@ namespace Components
|
|||||||
return ((point.x - rect.left) > 0 && (point.y - rect.top) > 0 && (rect.right - point.x) > 0 && (rect.bottom - point.y) > 0);
|
return ((point.x - rect.left) > 0 && (point.y - rect.top) > 0 && (rect.right - point.x) > 0 && (rect.bottom - point.y) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Window::IsNoBorder()
|
||||||
|
{
|
||||||
|
return Window::NoBorder.Get<bool>();
|
||||||
|
}
|
||||||
|
|
||||||
void __declspec(naked) Window::StyleHookStub()
|
void __declspec(naked) Window::StyleHookStub()
|
||||||
{
|
{
|
||||||
if (Window::NoBorder.Get<bool>())
|
__asm
|
||||||
{
|
{
|
||||||
__asm mov ebp, WS_VISIBLE | WS_POPUP
|
call Window::IsNoBorder
|
||||||
}
|
test al, al
|
||||||
else
|
jz setBorder
|
||||||
{
|
|
||||||
__asm mov ebp, WS_VISIBLE | WS_SYSMENU | WS_CAPTION
|
|
||||||
}
|
|
||||||
|
|
||||||
__asm retn
|
mov ebp, WS_VISIBLE | WS_POPUP
|
||||||
|
retn
|
||||||
|
|
||||||
|
setBorder:
|
||||||
|
mov ebp, WS_VISIBLE | WS_SYSMENU | WS_CAPTION
|
||||||
|
retn
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::DrawCursorStub(void *scrPlace, float x, float y, float w, float h, int horzAlign, int vertAlign, const float *color, Game::Material *material)
|
void Window::DrawCursorStub(void *scrPlace, float x, float y, float w, float h, int horzAlign, int vertAlign, const float *color, Game::Material *material)
|
||||||
|
@ -22,6 +22,8 @@ namespace Components
|
|||||||
|
|
||||||
static HWND MainWindow;
|
static HWND MainWindow;
|
||||||
|
|
||||||
|
static int IsNoBorder();
|
||||||
|
|
||||||
static int WINAPI ShowCursorHook(BOOL show);
|
static int WINAPI ShowCursorHook(BOOL show);
|
||||||
static void DrawCursorStub(void *scrPlace, float x, float y, float w, float h, int horzAlign, int vertAlign, const float *color, Game::Material *material);
|
static void DrawCursorStub(void *scrPlace, float x, float y, float w, float h, int horzAlign, int vertAlign, const float *color, Game::Material *material);
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ namespace Components
|
|||||||
FILETIME fileTime;
|
FILETIME fileTime;
|
||||||
GetSystemTimeAsFileTime(&fileTime);
|
GetSystemTimeAsFileTime(&fileTime);
|
||||||
|
|
||||||
Game::XFileHeader header = { XFILE_MAGIC_UNSIGNED, XFILE_VERSION_IW4X, Game::XFileLanguage::XLANG_NONE, fileTime.dwHighDateTime, fileTime.dwLowDateTime };
|
Game::XFileHeader header = { XFILE_MAGIC_UNSIGNED, XFILE_VERSION_IW4X, Game::XFileLanguage::XLANG_NONE, fileTime.dwHighDateTime, fileTime.dwLowDateTime };
|
||||||
|
|
||||||
std::string outBuffer;
|
std::string outBuffer;
|
||||||
outBuffer.append(reinterpret_cast<char*>(&header), sizeof(header));
|
outBuffer.append(reinterpret_cast<char*>(&header), sizeof(header));
|
||||||
@ -317,12 +317,16 @@ namespace Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add branding asset
|
// Add branding asset
|
||||||
// TODO: Check if a RawFile with the same name has already been added, to prevent conflicts.
|
|
||||||
void ZoneBuilder::Zone::AddBranding()
|
void ZoneBuilder::Zone::AddBranding()
|
||||||
{
|
{
|
||||||
char* data = "FastFile built using IW4x ZoneTool!";
|
char* data = "FastFile built using IW4x ZoneTool!";
|
||||||
ZoneBuilder::Zone::Branding = { ZoneBuilder::Zone::ZoneName.data(), (int)strlen(data), 0, data };
|
ZoneBuilder::Zone::Branding = { ZoneBuilder::Zone::ZoneName.data(), (int)strlen(data), 0, data };
|
||||||
|
|
||||||
|
if (ZoneBuilder::Zone::FindAsset(Game::XAssetType::ASSET_TYPE_RAWFILE, ZoneBuilder::Zone::Branding.name) != -1)
|
||||||
|
{
|
||||||
|
Logger::Error("Unable to add branding. Asset '%s' already exists!", ZoneBuilder::Zone::Branding.name);
|
||||||
|
}
|
||||||
|
|
||||||
Game::XAssetHeader header = { &Branding };
|
Game::XAssetHeader header = { &Branding };
|
||||||
Game::XAsset brandingAsset = { Game::XAssetType::ASSET_TYPE_RAWFILE, header };
|
Game::XAsset brandingAsset = { Game::XAssetType::ASSET_TYPE_RAWFILE, header };
|
||||||
ZoneBuilder::Zone::LoadedAssets.push_back(brandingAsset);
|
ZoneBuilder::Zone::LoadedAssets.push_back(brandingAsset);
|
||||||
@ -387,16 +391,14 @@ namespace Components
|
|||||||
// Find a local scriptString
|
// Find a local scriptString
|
||||||
int ZoneBuilder::Zone::FindScriptString(std::string str)
|
int ZoneBuilder::Zone::FindScriptString(std::string str)
|
||||||
{
|
{
|
||||||
int loc = 0;
|
for (unsigned int i = 0; i < ZoneBuilder::Zone::ScriptStrings.size(); ++i)
|
||||||
for (auto it : ZoneBuilder::Zone::ScriptStrings)
|
|
||||||
{
|
{
|
||||||
++loc;
|
if (ZoneBuilder::Zone::ScriptStrings[i] == str)
|
||||||
|
|
||||||
if (!it.compare(str))
|
|
||||||
{
|
{
|
||||||
return loc;
|
return (i + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,38 +463,12 @@ namespace Components
|
|||||||
|
|
||||||
ZoneBuilder::ZoneBuilder()
|
ZoneBuilder::ZoneBuilder()
|
||||||
{
|
{
|
||||||
static_assert(sizeof(Game::XFileHeader) == 21, "Invalid XFileHeader structure!");
|
Assert_Size(Game::XFileHeader, 21);
|
||||||
static_assert(sizeof(Game::XFile) == 40, "Invalid XFile structure!");
|
Assert_Size(Game::XFile, 40);
|
||||||
static_assert(Game::MAX_XFILE_COUNT == 8, "XFile block enum is invalid!");
|
static_assert(Game::MAX_XFILE_COUNT == 8, "XFile block enum is invalid!");
|
||||||
|
|
||||||
ZoneBuilder::EndAssetTrace();
|
ZoneBuilder::EndAssetTrace();
|
||||||
|
|
||||||
AssetHandler::OnLoad([] (Game::XAssetType type, Game::XAssetHeader asset, std::string name, bool* restrict)
|
|
||||||
{
|
|
||||||
// static void* blocTable = 0;
|
|
||||||
//
|
|
||||||
// if (FastFiles::Current() == "iw4x_ui_mp" && type == Game::XAssetType::ASSET_TYPE_MATERIAL)
|
|
||||||
// {
|
|
||||||
// if (name == "preview_mp_bloc"s)
|
|
||||||
// {
|
|
||||||
// blocTable = asset.material->stateBitTable;
|
|
||||||
// }
|
|
||||||
// else if (blocTable)
|
|
||||||
// {
|
|
||||||
// void* thisTable = asset.material->stateBitTable;
|
|
||||||
//
|
|
||||||
// if (thisTable != blocTable)
|
|
||||||
// {
|
|
||||||
// OutputDebugStringA("DIFF!");
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// OutputDebugStringA("YAY!");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
|
|
||||||
if (ZoneBuilder::IsEnabled())
|
if (ZoneBuilder::IsEnabled())
|
||||||
{
|
{
|
||||||
// Prevent loading textures (preserves loaddef)
|
// Prevent loading textures (preserves loaddef)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user