Skip to content

Commit

Permalink
Fix crash if resolution gets set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Oct 14, 2024
1 parent 1883ddc commit 4559bbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mods/VR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2261,7 +2261,7 @@ uint32_t VR::get_hmd_width() const {
return g_framework->get_rt_size().x;
}

return get_runtime()->get_width();
return std::max<uint32_t>(get_runtime()->get_width(), 128);
}

uint32_t VR::get_hmd_height() const {
Expand All @@ -2277,7 +2277,7 @@ uint32_t VR::get_hmd_height() const {
return g_framework->get_rt_size().y;
}

return get_runtime()->get_height();
return std::max<uint32_t>(get_runtime()->get_height(), 128);
}

void VR::on_draw_sidebar_entry(std::string_view name) {
Expand Down

0 comments on commit 4559bbe

Please sign in to comment.