Skip to content

Commit

Permalink
Graphics (DD2+): Fix get_Size hook causing crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Jul 22, 2024
1 parent f7179fb commit f2254d2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mods/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,15 @@ void Graphics::on_view_get_size(REManagedObject* scene_view, float* result) {
return;
}

#if TDB_VER < 73
result[0] = (float)(*m_backbuffer_size)[0];
result[1] = (float)(*m_backbuffer_size)[1];
#else
auto regenny_view = (regenny::via::SceneView*)scene_view;

regenny_view->size.w = (float)(*m_backbuffer_size)[0];
regenny_view->size.h = (float)(*m_backbuffer_size)[1];
#endif
}

void Graphics::do_scope_tweaks(sdk::renderer::layer::Scene* layer) {
Expand Down

0 comments on commit f2254d2

Please sign in to comment.