- 3rd splitscreen player gets the whole width

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1259 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
thebohemian 2007-09-24 12:28:19 +00:00
parent 9104e88171
commit 83703fdcf7
2 changed files with 39 additions and 9 deletions

View File

@ -47,7 +47,21 @@ Camera::setScreenPosition ( int numPlayers, int pos )
break; break;
} }
} }
else if (numPlayers == 3 || numPlayers == 4) else if (numPlayers == 3)
{
m_context -> setFOV ( 50.0f, 0.0f );
switch ( pos )
{
case 0 : m_x = 0.0f; m_y = 0.5f; m_w = 0.5f; m_h = 0.5f;
break;
case 1 : m_x = 0.5f; m_y = 0.5f; m_w = 0.5f; m_h = 0.5f;
break;
case 2 : m_x = 0.0f; m_y = 0.0f; m_w = 1.0f; m_h = 0.5f;
m_context -> setFOV ( 85.0f, 85.0f*3.0f/8.0f ) ;
break;
}
}
else if (numPlayers == 4)
{ {
m_context -> setFOV ( 50.0f, 0.0f ); m_context -> setFOV ( 50.0f, 0.0f );
switch ( pos ) switch ( pos )

View File

@ -946,22 +946,38 @@ void RaceGUI::drawStatusText (const RaceSetup& raceSetup, const float dt)
if ( world->getPhase() == World::RACE_PHASE || if ( world->getPhase() == World::RACE_PHASE ||
world->getPhase() == World::DELAY_FINISH_PHASE ) world->getPhase() == World::DELAY_FINISH_PHASE )
{ {
for(int pla = 0; pla < raceSetup.getNumPlayers(); pla++) const int numPlayers = raceSetup.getNumPlayers();
for(int pla = 0; pla < numPlayers; pla++)
{ {
int offset_x, offset_y; int offset_x, offset_y;
offset_x = offset_y = 0; offset_x = offset_y = 0;
if(raceSetup.getNumPlayers() == 2) if(numPlayers == 2)
{ {
if(pla == 0) offset_y = user_config->m_height/2; if(pla == 0) offset_y = user_config->m_height/2;
} }
else if(raceSetup.getNumPlayers() > 2) else if (numPlayers == 3)
{ {
if((pla == 0 && raceSetup.getNumPlayers() > 1) || (pla == 1)) if (pla == 0 || pla == 1)
offset_y = user_config->m_height/2; offset_y = user_config->m_height/2;
else
{
// Fixes width for player 3
split_screen_ratio_x = 1.0;
}
if((pla == 1) || pla == 3) if (pla == 1)
offset_x = user_config->m_width/2; offset_x = user_config->m_width/2;
}
else if(numPlayers == 4)
{
if(pla == 0 || pla == 1)
offset_y = user_config->m_height/2;
if((pla == 1) || pla == 3)
offset_x = user_config->m_width/2;
} }
Kart* player_kart=world->getPlayerKart(pla); Kart* player_kart=world->getPlayerKart(pla);