Add hidden feature to remove the race GUI: will be helpful to take track screenshots.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6867 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2010-12-07 00:28:13 +00:00
parent c691f3bf01
commit c6b61f8a55
3 changed files with 17 additions and 1 deletions

View File

@@ -169,6 +169,15 @@ void InputManager::handleStaticAction(int key, int value)
kart->setPowerup(PowerupManager::POWERUP_ZIPPER, 10000);
}
break;
case KEY_F8:
if(value && control_is_pressed)
{
RaceGUIBase* gui = World::getWorld()->getRaceGUI();
if (gui != NULL) gui->m_enabled = !gui->m_enabled;
}
break;
case KEY_F11:
if(value && control_is_pressed)
{

View File

@@ -53,6 +53,8 @@ using namespace irr;
*/
RaceGUI::RaceGUI()
{
m_enabled = true;
// Originally m_map_height was 100, and we take 480 as minimum res
const float scaling = irr_driver->getFrameSize().Height / 480.0f;
// Marker texture has to be power-of-two for (old) OpenGL compliance
@@ -257,7 +259,7 @@ void RaceGUI::createRegularPolygon(unsigned int n, float radius,
void RaceGUI::renderGlobal(float dt)
{
cleanupMessages(dt);
// Special case : when 3 players play, use 4th window to display such
// stuff (but we must clear it)
if (race_manager->getNumLocalPlayers() == 3 &&
@@ -282,6 +284,7 @@ void RaceGUI::renderGlobal(float dt)
// Timer etc. are not displayed unless the game is actually started.
if(!world->isRacePhase()) return;
if (!m_enabled) return;
drawGlobalTimer();
if(world->getPhase() == WorldStatus::GO_PHASE ||
@@ -302,6 +305,8 @@ void RaceGUI::renderGlobal(float dt)
*/
void RaceGUI::renderPlayerView(const Kart *kart)
{
if (!m_enabled) return;
const core::recti &viewport = kart->getCamera()->getViewport();
core::vector2df scaling = kart->getCamera()->getScaling();
//std::cout << "Applied ratio : " << viewport.getWidth()/800.0f << std::endl;

View File

@@ -53,6 +53,8 @@ public:
}; // KartIconDisplayInfo
public:
bool m_enabled;
RaceGUIBase() {};
virtual ~RaceGUIBase() {};