Skip to content

Commit

Permalink
Merge pull request #68 from mir-diablo-ii-tools/hotfix/fix-interface-…
Browse files Browse the repository at this point in the history
…bar-off-screen

Fix interface bar background off screen
  • Loading branch information
IAmTrial authored Aug 12, 2021
2 parents b2fed13 + dc89002 commit b3240ac
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ d2::CelFile_Api& GetCelFile(std::string_view cel_file_path) {

cel_file_collection.insert_or_assign(
cel_file_path_key,
::d2::CelFile_Api(cel_file_path_key, false)
::d2::CelFile_Api(cel_file_path_key.c_str(), false)
);
}
#if defined(FLAG_CHECKSUM)
Expand All @@ -95,7 +95,7 @@ d2::CelFile_Api& GetCelFile(std::string_view cel_file_path) {

cel_file_collection.insert_or_assign(
cel_file_path_key,
::d2::CelFile_Api(cel_file_path_key, false)
::d2::CelFile_Api(cel_file_path_key.c_str(), false)
);
#if defined(FLAG_CHECKSUM)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void LoadMpqOnce() {
}

GetCustomMpq().Open(
config::GetCustomMpqPath(),
config::GetCustomMpqPath().data(),
false,
5000
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static void DrawLeftInterfaceBarBackground() {
frame += 1) {
interface_bar_background_left.DrawFrame(
width_covered,
std::get<1>(width_and_height),
std::get<1>(width_and_height) - 1,
0,
frame,
frame_options
Expand Down Expand Up @@ -126,7 +126,7 @@ static void DrawLeftInterfaceBarBackground() {

interface_bar_background_center.DrawFrame(
width_covered,
std::get<1>(width_and_height),
std::get<1>(width_and_height) - 1,
0,
frame_to_draw,
frame_options
Expand Down Expand Up @@ -160,7 +160,7 @@ static void DrawRightInterfaceBarBackground() {
frame += 1) {
interface_bar_background_right.DrawFrame(
std::get<0>(width_and_height) - width_covered,
std::get<1>(width_and_height),
std::get<1>(width_and_height) - 1,
0,
frame,
frame_options
Expand Down Expand Up @@ -189,7 +189,7 @@ static void DrawRightInterfaceBarBackground() {

interface_bar_background_center.DrawFrame(
std::get<0>(width_and_height) - width_covered,
std::get<1>(width_and_height),
std::get<1>(width_and_height) - 1,
0,
frame_to_draw,
frame_options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,43 +65,43 @@ void __cdecl Sgd2fr_Glide3x_SetWindowWidthAndHeight(
switch (running_glide3x_version) {
case Glide3xVersion::kSven1_4_4_21: {
width = *reinterpret_cast<std::int32_t**>(
::mapi::GameAddress::FromOffset("glide3x.dll", 0x1C9A0).raw_address()
::mapi::GameAddress::FromOffset(L"glide3x.dll", 0x1C9A0).raw_address()
);
height = *reinterpret_cast<std::int32_t**>(
::mapi::GameAddress::FromOffset("glide3x.dll", 0x1C82C).raw_address()
::mapi::GameAddress::FromOffset(L"glide3x.dll", 0x1C82C).raw_address()
);

break;
}

case Glide3xVersion::kSven1_4_6_1: {
width = *reinterpret_cast<std::int32_t**>(
::mapi::GameAddress::FromOffset("glide3x.dll", 0x1C870).raw_address()
::mapi::GameAddress::FromOffset(L"glide3x.dll", 0x1C870).raw_address()
);
height = *reinterpret_cast<std::int32_t**>(
::mapi::GameAddress::FromOffset("glide3x.dll", 0x1C830).raw_address()
::mapi::GameAddress::FromOffset(L"glide3x.dll", 0x1C830).raw_address()
);

break;
}

case Glide3xVersion::kSven1_4_8_3: {
width = *reinterpret_cast<std::int32_t**>(
::mapi::GameAddress::FromOffset("glide3x.dll", 0x1D870).raw_address()
::mapi::GameAddress::FromOffset(L"glide3x.dll", 0x1D870).raw_address()
);
height = *reinterpret_cast<std::int32_t**>(
::mapi::GameAddress::FromOffset("glide3x.dll", 0x1D830).raw_address()
::mapi::GameAddress::FromOffset(L"glide3x.dll", 0x1D830).raw_address()
);

break;
}

case Glide3xVersion::kNGlide3_10_0_658: {
width = reinterpret_cast<std::int32_t*>(
::mapi::GameAddress::FromOffset("glide3x.dll", 0x169DA4).raw_address()
::mapi::GameAddress::FromOffset(L"glide3x.dll", 0x169DA4).raw_address()
);
height = reinterpret_cast<std::int32_t*>(
::mapi::GameAddress::FromOffset("glide3x.dll", 0x169F04).raw_address()
::mapi::GameAddress::FromOffset(L"glide3x.dll", 0x169F04).raw_address()
);

break;
Expand Down

0 comments on commit b3240ac

Please sign in to comment.