Back to index

supertuxkart  0.5+dfsg1
start_race_feedback.cpp
Go to the documentation of this file.
00001 //  SuperTuxKart - a fun racing game with go-kart
00002 //  Copyright (C) 2006 SuperTuxKart-Team
00003 //
00004 //  This program is free software; you can redistribute it and/or
00005 //  modify it under the terms of the GNU General Public License
00006 //  as published by the Free Software Foundation; either version 2
00007 //  of the License, or (at your option) any later version.
00008 //
00009 //  This program is distributed in the hope that it will be useful,
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 //  GNU General Public License for more details.
00013 //
00014 //  You should have received a copy of the GNU General Public License
00015 //  along with this program; if not, write to the Free Software
00016 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 
00018 #include <SDL/SDL.h>
00019 
00020 #include "widget_manager.hpp"
00021 #include "race_manager.hpp"
00022 #include "translation.hpp"
00023 
00024 #include "start_race_feedback.hpp"
00025 
00026 enum WidgetTokens
00027 {
00028     WTOK_MSG
00029 };
00030 
00031 StartRaceFeedback::StartRaceFeedback() : m_updated( false )
00032 {
00033     //Add some feedback so people know they are going to start the race
00034     widget_manager->reset();
00035     widget_manager->addTextWgt( WTOK_MSG, 60, 7, _("Loading race...") );
00036     widget_manager->layout(WGT_AREA_ALL);
00037 }
00038 
00039 //-----------------------------------------------------------------------------
00040 StartRaceFeedback::~StartRaceFeedback()
00041 {
00042     widget_manager->reset();
00043 }
00044 
00045 
00046 //-----------------------------------------------------------------------------
00047 void StartRaceFeedback::update(float DELTA)
00048 {
00049     widget_manager->update(0.0f);
00050 
00051     //I consider that in this case, a static variable is cleaner than a
00052     //member variable of this class. -Coz
00053     if( m_updated == true ) race_manager->startNew();
00054     else m_updated = true;
00055 }
00056