diff --git a/H2Codez/Common/H2EKCommon.cpp b/H2Codez/Common/H2EKCommon.cpp index 4ebd06e..467f0b4 100644 --- a/H2Codez/Common/H2EKCommon.cpp +++ b/H2Codez/Common/H2EKCommon.cpp @@ -379,7 +379,7 @@ static void set_tag_data_max_size(size_t limit) static bool __cdecl check_bitmap_dimension(int format, int type, __int16 dimension) { - return dimension > 0 && dimension <= 8192; + return dimension > 0 && dimension <= max_bitmap_size; } void H2CommonPatches::Init() diff --git a/H2Codez/Common/H2EKCommon.h b/H2Codez/Common/H2EKCommon.h index 3956a98..93f26ea 100644 --- a/H2Codez/Common/H2EKCommon.h +++ b/H2Codez/Common/H2EKCommon.h @@ -24,3 +24,5 @@ namespace H2CommonPatches { std::string get_h2ek_documents_dir(); }; + +static constexpr int max_bitmap_size = 8192; diff --git a/H2Codez/H2Guerilla/H2Guerilla.cpp b/H2Codez/H2Guerilla/H2Guerilla.cpp index 8554880..f4d51cd 100644 --- a/H2Codez/H2Guerilla/H2Guerilla.cpp +++ b/H2Codez/H2Guerilla/H2Guerilla.cpp @@ -371,7 +371,7 @@ void H2GuerrilaPatches::Init() DetourTransactionCommit(); #pragma endregion - WriteValue(0x9AF809, (BYTE)conf.getBoolean("expert_mode", 1)); // set is_expert_mode to one + WriteValue(0x9AF809, conf.getBoolean("expert_mode", 1)); // set is_expert_mode to one show_hidden_fields = conf.getBoolean("show_hidden_fields", true); update_field_display(); diff --git a/H2Codez/H2Tool/H2Tool.cpp b/H2Codez/H2Tool/H2Tool.cpp index 7839bf5..824e609 100644 --- a/H2Codez/H2Tool/H2Tool.cpp +++ b/H2Codez/H2Tool/H2Tool.cpp @@ -642,6 +642,13 @@ void H2ToolPatches::Initialize() fix_bitmap_package(); NopFill(0x415D69, 6); // patch JMH version check + + // BMP importing + WriteValue(0x4EAE21 + 1, max_bitmap_size); + WriteValue(0x4EAE37 + 2, max_bitmap_size); + + // GDI based importing + WriteValue(0x4E7941 + 1, max_bitmap_size); }