Fixed compiler warnings.
This commit is contained in:
parent
971db902a8
commit
000b613b8b
@ -282,19 +282,27 @@ void IrrDriver::updateConfigIfRelevant()
|
|||||||
core::recti IrrDriver::getSplitscreenWindow(int WindowNum)
|
core::recti IrrDriver::getSplitscreenWindow(int WindowNum)
|
||||||
{
|
{
|
||||||
const int playernum = race_manager->getNumLocalPlayers();
|
const int playernum = race_manager->getNumLocalPlayers();
|
||||||
const float playernum_sqrt = sqrt(playernum);
|
const float playernum_sqrt = sqrtf((float)playernum);
|
||||||
|
|
||||||
int rows = UserConfigParams::split_screen_horizontally ? ceil(playernum_sqrt) : round(playernum_sqrt);
|
int rows = int( UserConfigParams::split_screen_horizontally
|
||||||
int cols = UserConfigParams::split_screen_horizontally ? round(playernum_sqrt) : ceil(playernum_sqrt);
|
? ceil(playernum_sqrt)
|
||||||
|
: round(playernum_sqrt) );
|
||||||
|
int cols = int( UserConfigParams::split_screen_horizontally
|
||||||
|
? round(playernum_sqrt)
|
||||||
|
: ceil(playernum_sqrt) );
|
||||||
|
|
||||||
if (rows == 0){rows = 1;}
|
if (rows == 0){rows = 1;}
|
||||||
if (cols == 0) {cols = 1;}
|
if (cols == 0) {cols = 1;}
|
||||||
//This could add a bit of overhang
|
//This could add a bit of overhang
|
||||||
const int width_of_space = ceil((float)irr_driver->getActualScreenSize().Width / (float)cols);
|
const int width_of_space =
|
||||||
const int height_of_space = ceil((float)irr_driver->getActualScreenSize().Height / (float)rows);
|
int(ceil( (float)irr_driver->getActualScreenSize().Width
|
||||||
|
/ (float)cols) );
|
||||||
|
const int height_of_space =
|
||||||
|
int (ceil( (float)irr_driver->getActualScreenSize().Height
|
||||||
|
/ (float)rows) );
|
||||||
|
|
||||||
const int x_grid_Position = WindowNum % cols;
|
const int x_grid_Position = WindowNum % cols;
|
||||||
const int y_grid_Position = floor((WindowNum) / cols);
|
const int y_grid_Position = int(floor((WindowNum) / cols));
|
||||||
int wid = (int)irr_driver->getActualScreenSize().Width;
|
int wid = (int)irr_driver->getActualScreenSize().Width;
|
||||||
|
|
||||||
//To prevent the viewport going over the right side, we use std::min to ensure the right corners are never larger than the total width
|
//To prevent the viewport going over the right side, we use std::min to ensure the right corners are never larger than the total width
|
||||||
|
Loading…
x
Reference in New Issue
Block a user