File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -293,7 +293,8 @@ void CarnageGame::SetupScreenLayout(int playersCount)
293293 int currRow = icurr / MaxCols;
294294 int currCol = icurr % MaxCols;
295295
296- int colsOnCurrentRow = ((playersCount - currRow) + MaxCols - 1 ) / MaxCols;
296+ int colsOnCurrentRow = glm::clamp (playersCount - (currRow * MaxCols), 1 , MaxCols);
297+ debug_assert (colsOnCurrentRow);
297298 int frameSizePerW = fullViewport.w / colsOnCurrentRow;
298299
299300 mHumanCharacters [icurr].mCharView .mRenderCamera .mViewportRect .h = frameSizePerH;
@@ -304,5 +305,4 @@ void CarnageGame::SetupScreenLayout(int playersCount)
304305 mHumanCharacters [icurr].mCharView .SetCameraController (&mHumanCharacters [icurr].mCharView .mFollowCameraController );
305306 gRenderManager .AttachRenderView (&mHumanCharacters [icurr].mCharView );
306307 }
307-
308308}
You can’t perform that action at this time.
0 commit comments