diff --git a/Source/Client/Application/ErrorDialog.cpp b/Source/Client/Application/ErrorDialog.cpp index 0782c1acd..b847cdb3f 100644 --- a/Source/Client/Application/ErrorDialog.cpp +++ b/Source/Client/Application/ErrorDialog.cpp @@ -13,6 +13,12 @@ int ShowErrorDialog(const std::string& text, const UINT& type) { // OFFSET: 0x00AD6360 // FUNCTION: fn_17828 +int ShowErrorDialog(const char* text, UINT type) { + GetRenderSystemHolder()->PrepareErrorDialog(); + return MessageBoxA(nullptr, text, "Error", type); +} + +// INLINED int ShowErrorDialog(CRenderSystemBase* renderSystem, const char* text, UINT type) { if (renderSystem) { renderSystem->PrepareErrorDialog(); diff --git a/Source/Client/Application/ErrorDialog.h b/Source/Client/Application/ErrorDialog.h index be58e98ec..a3bbf14de 100644 --- a/Source/Client/Application/ErrorDialog.h +++ b/Source/Client/Application/ErrorDialog.h @@ -7,6 +7,7 @@ class CRenderSystemBase; int ShowErrorDialog(const std::string& text, const UINT& type); +int ShowErrorDialog(const char* text, UINT type); int ShowErrorDialog(CRenderSystemBase* renderSystem, const char* text, UINT type); int ShowErrorDialog(int code); diff --git a/Source/Resource/GifResource.cpp b/Source/Resource/GifResource.cpp index a88e3968f..ce72b1bfc 100644 --- a/Source/Resource/GifResource.cpp +++ b/Source/Resource/GifResource.cpp @@ -117,7 +117,7 @@ bool CGifRes::Decode(const char* name, const void* data, int bytes, bool iconOnl return this->image.DecodePng(data, bytes, name); } - ShowErrorDialog(GetRenderSystemHolder()->system, "Unsupport fileformat!", 0); + ShowErrorDialog("Unsupport fileformat!", 0); return false; } diff --git a/Source/Utility/Tokenizer.cpp b/Source/Utility/Tokenizer.cpp index b4d29a1da..7fa8b8445 100644 --- a/Source/Utility/Tokenizer.cpp +++ b/Source/Utility/Tokenizer.cpp @@ -8,9 +8,9 @@ // FUNCTION: fn_07779 std::string& CTokenizer::operator[](int index) { if (index < 0 || static_cast(index) >= this->tokens.size()) { - ShowErrorDialog(GetRenderSystemHolder()->system, "Error in CTokenizer :: operator []", 0); + ShowErrorDialog("Error in CTokenizer :: operator []", 0); for (unsigned int token = 0; token < this->tokens.size(); ++token) { - ShowErrorDialog(GetRenderSystemHolder()->system, this->tokens[token].c_str(), 0); + ShowErrorDialog(this->tokens[token].c_str(), 0); } }