Wrap some lines with {} so g++ 4.3 does not abort.

For reference, and in case there is a better fix, the error reported was:
graphics/camera.cpp:124: error: jump to case label
graphics/camera.cpp:117: error:   crosses initialization of "const int y2"
graphics/camera.cpp:116: error:   crosses initialization of "const int x2"
graphics/camera.cpp:115: error:   crosses initialization of "const int y1"
graphics/camera.cpp:114: error:   crosses initialization of "const int x1"


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4269 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
mbjornstk 2009-12-06 21:03:59 +00:00
parent 363849fd24
commit 22d233b46c

View File

@ -86,7 +86,7 @@ void Camera::setupCamera()
m_aspect *= 2.0f;
m_fov = DEGREE_TO_RAD*65.0f;
break;
case 3:
case 3:
/*
if(m_index<2)
{
@ -110,6 +110,7 @@ void Camera::setupCamera()
}
break;*/
case 4:
{ // g++ 4.3 whines about the variables in switch/case if not {}-wrapped (???)
const int x1 = (m_index%2==0 ? 0 : UserConfigParams::m_width>>1);
const int y1 = (m_index<2 ? 0 : UserConfigParams::m_height>>1);
const int x2 = (m_index%2==0 ? UserConfigParams::m_width>>1 : UserConfigParams::m_width);
@ -119,6 +120,7 @@ void Camera::setupCamera()
<< m_viewport.getWidth() << "x" << m_viewport.getHeight() << "\n";
m_scaling = core::vector2df(0.5f, 0.5f);
m_fov = DEGREE_TO_RAD*50.0f;
}
break;
default:fprintf(stderr, "Incorrect number of players: '%d' - assuming 1.\n",
race_manager->getNumLocalPlayers());