Skip to content

Commit

Permalink
[Tool] Allow compiling larger files other files types.
Browse files Browse the repository at this point in the history
It was only possible for TGA before.
  • Loading branch information
num0005 committed Nov 2, 2019
1 parent 594c999 commit 44fbd53
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion H2Codez/Common/H2EKCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions H2Codez/Common/H2EKCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ namespace H2CommonPatches {

std::string get_h2ek_documents_dir();
};

static constexpr int max_bitmap_size = 8192;
2 changes: 1 addition & 1 deletion H2Codez/H2Guerilla/H2Guerilla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<BYTE>(0x9AF809, conf.getBoolean("expert_mode", 1)); // set is_expert_mode to one
show_hidden_fields = conf.getBoolean("show_hidden_fields", true);

update_field_display();
Expand Down
7 changes: 7 additions & 0 deletions H2Codez/H2Tool/H2Tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit 44fbd53

Please sign in to comment.