Skip to content

Commit

Permalink
Fix MSVC build errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalh committed Dec 4, 2019
1 parent eb5db37 commit 06261e9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion game_patch/graphics/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ CodeInjection setup_stretched_window_patch{
SetWindowLongA(rf::main_wnd, GWL_STYLE, WS_POPUP | WS_SYSMENU);
SetWindowLongA(rf::main_wnd, GWL_EXSTYLE, 0);
SetWindowPos(rf::main_wnd, HWND_NOTOPMOST, 0, 0, cx, cy, SWP_SHOWWINDOW);
rf::gr_screen.aspect = static_cast<double>(cx) / static_cast<double>(cy) * 0.75;
rf::gr_screen.aspect = static_cast<float>(cx) / static_cast<float>(cy) * 0.75f;
regs.eip = 0x0050C551;
}
},
Expand Down
4 changes: 2 additions & 2 deletions game_patch/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,10 +968,10 @@ CodeInjection face_scroll_fix{
std::byte* scroll_data_vec = geometry + 0x2F4;
int num = *reinterpret_cast<uint32_t*>(scroll_data_vec);
void **scroll_data = *reinterpret_cast<void***>(scroll_data_vec + 8);
auto RflFaceScroll_SetupFaces = reinterpret_cast<void __thiscall(*)(void* self, void* geometry)>(0x004E60C0);
auto RflFaceScroll_SetupFaces = reinterpret_cast<void(__fastcall*)(void* self, void* edx, void* geometry)>(0x004E60C0);
return;
for (int i = 0; i < num; ++i) {
RflFaceScroll_SetupFaces(scroll_data[i], geometry);
RflFaceScroll_SetupFaces(scroll_data[i], nullptr, geometry);
}
},
};
Expand Down
2 changes: 1 addition & 1 deletion game_patch/purefaction/pf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void process_pf_players_request_packet([[ maybe_unused ]] const void* data, [[ m
auto packet_buf = std::make_unique<std::byte[]>(sizeof(pf_players_packet) + players_str.size());
auto& response = *reinterpret_cast<pf_players_packet*>(packet_buf.get());
response.hdr.type = static_cast<u8>(pf_packet_type::players);
response.hdr.size = sizeof(pf_players_packet) + players_str.size() - sizeof(rf_packet_header);
response.hdr.size = static_cast<u16>(sizeof(pf_players_packet) + players_str.size() - sizeof(rf_packet_header));
response.version = 1;
response.show_ip = 0;
std::copy(players_str.begin(), players_str.end(), reinterpret_cast<char*>(packet_buf.get() + sizeof(pf_players_packet)));
Expand Down
4 changes: 2 additions & 2 deletions game_patch/rf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1894,11 +1894,11 @@ namespace rf

static auto ClearLevelSound = AddrAsRef<int(LevelSound* lvl_snd)>(0x00505680);
static auto SndStop = AddrAsRef<char(int sig)>(0x005442B0);
static auto SndGetDuration = AddrAsRef<double(int game_snd_id)>(0x00544760);
static auto SndGetDuration = AddrAsRef<float(int game_snd_id)>(0x00544760);
static auto SndDsCloseChannel = AddrAsRef<bool(int channel)>(0x00521930);
static auto SndDsChannelIsPlaying = AddrAsRef<void*(int channel)>(0x005224D0);
static auto SndDsIsChannelPaused = AddrAsRef<bool(int channel)>(0x00522500);
static auto SndDsEstimateDuration = AddrAsRef<double(int snd_buf_id)>(0x00523170);
static auto SndDsEstimateDuration = AddrAsRef<float(int snd_buf_id)>(0x00523170);

/* RF stdlib functions are not compatible with GCC */

Expand Down

0 comments on commit 06261e9

Please sign in to comment.