Started mammoth cleanup of GUI code. Separated the generic GUI engine and the STK-specific bits (still work to do on this side)

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3764 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2009-07-18 17:48:36 +00:00
parent b71d1c4557
commit 85266dfe10
37 changed files with 719 additions and 751 deletions

View File

@@ -72,31 +72,23 @@ supertuxkart_SOURCES = \
graphics/smoke.hpp \
graphics/water_splash.hpp \
graphics/water_splash.cpp \
gui/credits.cpp \
gui/credits.hpp \
gui/engine.cpp \
gui/engine.hpp \
gui/event_handler.cpp \
gui/event_handler.hpp \
gui/kart_selection.cpp \
gui/kart_selection.hpp \
gui/modaldialog.cpp \
gui/modaldialog.hpp \
gui/my_button.cpp \
gui/my_button.hpp \
gui/options_screen.cpp \
gui/options_screen.hpp \
gui/race_gui.cpp \
gui/race_gui.hpp \
gui/screen.cpp \
gui/screen.hpp \
gui/screen_loader.cpp \
gui/skin.cpp \
gui/skin.hpp \
gui/state_manager.cpp \
gui/state_manager.hpp \
gui/widget.cpp \
gui/widget.hpp \
guiengine/abstract_state_manager.cpp \
guiengine/abstract_state_manager.hpp \
guiengine/engine.cpp \
guiengine/engine.hpp \
guiengine/event_handler.hpp \
guiengine/modaldialog.cpp \
guiengine/modaldialog.hpp \
guiengine/my_button.cpp \
guiengine/my_button.hpp \
guiengine/screen_loader.cpp \
guiengine/screen.cpp \
guiengine/screen.hpp \
guiengine/skin.cpp \
guiengine/skin.hpp \
guiengine/widget.cpp \
guiengine/widget.hpp \
guiengine/event_handler.cpp \
input/device_manager.cpp \
input/device_manager.hpp \
input/input.cpp \
@@ -233,6 +225,16 @@ supertuxkart_SOURCES = \
replay/replay_recorder.hpp \
robots/default_robot.cpp \
robots/default_robot.hpp \
states_screens/credits.cpp \
states_screens/credits.hpp \
states_screens/kart_selection.cpp \
states_screens/kart_selection.hpp \
states_screens/options_screen.cpp \
states_screens/options_screen.hpp \
states_screens/race_gui.cpp \
states_screens/race_gui.hpp \
states_screens/state_manager.cpp \
states_screens/state_manager.hpp \
tracks/bezier_curve.cpp \
tracks/bezier_curve.hpp \
tracks/check_manager.cpp \

View File

@@ -29,8 +29,8 @@
#include "config/user_config.hpp"
#include "graphics/material_manager.hpp"
#include "gui/engine.hpp"
#include "gui/state_manager.hpp"
#include "guiengine/engine.hpp"
#include "states_screens/state_manager.hpp"
#include "io/file_manager.hpp"
#include "items/item_manager.hpp"
#include "items/powerup_manager.hpp"
@@ -178,7 +178,10 @@ void IrrDriver::changeResolution()
projectile_manager -> loadData();
attachment_manager -> loadModels();
StateManager::initGUI();
// Re-init GUI engine
IrrlichtDevice* device = irr_driver->getDevice();
video::IVideoDriver* driver = device->getVideoDriver();
GUIEngine::init(device, driver, StateManager::get());
GUIEngine::reshowCurrentScreen();
} // changeResolution
@@ -557,7 +560,7 @@ void IrrDriver::displayFPS()
const int fps = m_device->getVideoDriver()->getFPS();
// Min and max info tracking, per mode, so user can check game vs menus
bool current_state = StateManager::isGameState();
bool current_state = StateManager::get()->isGameState();
static bool prev_state = false;
static int min = 999; // Absurd values for start will print first time
static int max = 0; // but no big issue, maybe even "invisible"
@@ -593,7 +596,7 @@ void IrrDriver::update(float dt)
m_device->getVideoDriver()->beginScene(true, true, video::SColor(255,100,101,140));
{ // just to mark the beding/end scene block
if(!StateManager::isGameState())
if(!StateManager::get()->isGameState())
{
// this code needs to go outside beginScene() / endScene() since
// the model view widget will do off-screen rendering there

View File

@@ -1,490 +0,0 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2009 Marianne Gagnon
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "gui/state_manager.hpp"
#include <vector>
#include "main_loop.hpp"
#include "audio/sound_manager.hpp"
#include "config/player.hpp"
#include "config/user_config.hpp"
#include "graphics/irr_driver.hpp"
#include "gui/credits.hpp"
#include "gui/engine.hpp"
#include "gui/kart_selection.hpp"
#include "gui/modaldialog.hpp"
#include "gui/options_screen.hpp"
#include "gui/screen.hpp"
#include "gui/widget.hpp"
#include "input/device_manager.hpp"
#include "input/input_manager.hpp"
#include "io/file_manager.hpp"
#include "network/network_manager.hpp"
#include "race/race_manager.hpp"
#include "utils/translation.hpp"
using namespace GUIEngine;
namespace StateManager
{
static bool g_game_mode = false;
/**
* This stack will contain menu names (e.g. main.stkgui), and/or 'race'.
*/
std::vector<std::string> g_menu_stack;
/**
* A list of all currently playing players.
*/
ptr_vector<ActivePlayer, HOLD> g_active_players;
ptr_vector<ActivePlayer, HOLD>& getActivePlayers()
{
return g_active_players;
}
ActivePlayer* getActivePlayer(const int id)
{
return g_active_players.get(id);
}
void addActivePlayer(ActivePlayer* p)
{
g_active_players.push_back(p);
}
void removeActivePlayer(int id)
{
g_active_players.erase(id);
}
int activePlayerCount()
{
return g_active_players.size();
}
void resetActivePlayers()
{
const int amount = g_active_players.size();
for(int i=0; i<amount; i++)
{
g_active_players[i].setDevice(NULL);
}
g_active_players.clearWithoutDeleting();
}
#if 0
#pragma mark Callbacks
#endif
// -------------------------------------------------------------------------
/**
* Callback handling events from the main menu
*/
void menuEventMain(Widget* widget, std::string& name)
{
RibbonWidget* ribbon = dynamic_cast<RibbonWidget*>(widget);
if(ribbon == NULL) return; // only interesting stuff in main menu is the ribbons
std::string selection = ribbon->getSelectionIDString().c_str();
if(selection == "new")
{
InputDevice* device = input_manager->getDeviceList()->getLatestUsedDevice();
StateManager::setPlayer0Device(device);
StateManager::pushMenu("karts.stkgui");
}
else if(selection == "options")
{
StateManager::pushMenu("options_av.stkgui");
}
else if(selection == "quit")
{
main_loop->abort();
return;
}
else if (selection == "about")
{
StateManager::pushMenu("credits.stkgui");
}
else if (selection == "help")
{
pushMenu("help1.stkgui");
}
}
// -------------------------------------------------------------------------
/**
* Callback handling events from the race setup menu
*/
void menuEventRaceSetup(Widget* widget, std::string& name)
{
if(name == "init")
{
RibbonWidget* w = getCurrentScreen()->getWidget<RibbonWidget>("difficulty");
assert( w != NULL );
w->setSelection(UserConfigParams::m_difficulty);
race_manager->setDifficulty( (RaceManager::Difficulty)(int)UserConfigParams::m_difficulty );
SpinnerWidget* kartamount = getCurrentScreen()->getWidget<SpinnerWidget>("aikartamount");
race_manager->setNumKarts( kartamount->getValue() + 1 );
RibbonGridWidget* w2 = getCurrentScreen()->getWidget<RibbonGridWidget>("gamemode");
assert( w2 != NULL );
if(!getCurrentScreen()->m_inited)
{
w2->addItem( _("Snaky Competition\nAll blows allowed, so catch weapons and make clever use of them!"),
"normal",
"gui/mode_normal.png");
w2->addItem( _("Time Trial\nContains no powerups, so only your driving skills matter!"),
"timetrial",
"gui/mode_tt.png");
w2->addItem( _("Follow the Leader\nrun for second place, as the last kart will be disqualified every time the counter hits zero. Beware : going in front of the leader will get you eliminated too!"),
"ftl",
"gui/mode_ftl.png");
w2->addItem( _("3-Strikes Battle\nonly in multiplayer games. Hit others with weapons until they lose all their lives."),
"3strikes",
"gui/mode_3strikes.png");
getCurrentScreen()->m_inited = true;
}
w2->updateItemDisplay();
}
else if(name == "difficulty")
{
RibbonWidget* w = dynamic_cast<RibbonWidget*>(widget);
assert(w != NULL);
const std::string& selection = w->getSelectionIDString();
if(selection == "novice")
race_manager->setDifficulty(RaceManager::RD_EASY);
else if(selection == "intermediate")
race_manager->setDifficulty(RaceManager::RD_MEDIUM);
else if(selection == "expert")
race_manager->setDifficulty(RaceManager::RD_HARD);
}
else if(name == "gamemode")
{
// TODO - detect more game modes
RibbonGridWidget* w = dynamic_cast<RibbonGridWidget*>(widget);
if(w->getSelectionIDString() == "normal")
{
StateManager::pushMenu("tracks.stkgui");
}
}
else if(name == "aikartamount")
{
SpinnerWidget* w = dynamic_cast<SpinnerWidget*>(widget);
race_manager->setNumKarts( w->getValue() );
}
/*
289 race_manager->setDifficulty((RaceManager::Difficulty)m_difficulty);
290 UserConfigParams::setDefaultNumDifficulty(m_difficulty);
// if there is no AI, there's no point asking the player for the amount of karts.
299 // It will always be the same as the number of human players
300 if(RaceManager::isBattleMode( race_manager->getMinorMode() ))
301 {
302 race_manager->setNumKarts(race_manager->getNumLocalPlayers());
303 // Don't change the default number of karts in user_config
304 }
305 else
306 {
307 race_manager->setNumKarts(m_num_karts);
308 UserConfigParams::setDefaultNumKarts(race_manager->getNumKarts());
309 }
311 if( race_manager->getMajorMode() != RaceManager::MAJOR_MODE_GRAND_PRIX &&
312 RaceManager::modeHasLaps( race_manager->getMinorMode() ) )
313 {
314 race_manager->setNumLaps( m_num_laps );
315 UserConfigParams::setDefaultNumLaps(m_num_laps);
316 }
317 // Might still be set from a previous challenge
318 race_manager->setCoinTarget(0);
input_manager->setMode(InputManager::INGAME);
race_manager->setLocalKartInfo(0, argv[i+1]);
race_manager->setDifficulty(RaceManager::RD_EASY);
race_manager->setDifficulty(RaceManager::RD_HARD);
race_manager->setDifficulty(RaceManager::RD_HARD);
race_manager->setTrack(argv[i+1]);
UserConfigParams::setDefaultNumKarts(stk_config->m_max_karts);
race_manager->setNumKarts(UserConfigParams::getDefaultNumKarts() );
UserConfigParams::getDefaultNumKarts()
StateManager::enterGameState();
race_manager->startNew();
*/
}
// -------------------------------------------------------------------------
/**
* Callback handling events from the track menu
*/
void menuEventTracks(Widget* widget, std::string& name)
{
if(name == "init")
{
RibbonGridWidget* w = getCurrentScreen()->getWidget<RibbonGridWidget>("tracks");
assert( w != NULL );
if(!getCurrentScreen()->m_inited)
{
w->addItem("Track 1","t1","gui/track1.png");
w->addItem("Track 2","t2","gui/track2.png");
w->addItem("Track 3","t3","gui/track3.png");
w->addItem("Track 4","t4","gui/track4.png");
w->addItem("Track 5","t5","gui/track5.png");
w->addItem("Track 6","t6","gui/track6.png");
w->addItem("Track 7","t7","gui/track7.png");
w->addItem("Track 8","t8","gui/track8.png");
getCurrentScreen()->m_inited = true;
}
w->updateItemDisplay();
}
// -- track seelction screen
if(name == "tracks")
{
RibbonGridWidget* w2 = dynamic_cast<RibbonGridWidget*>(widget);
if(w2 != NULL)
{
std::cout << "Clicked on track " << w2->getSelectionIDString().c_str() << std::endl;
ITexture* screenshot = GUIEngine::getDriver()->getTexture( (file_manager->getDataDir() + "/gui/track1.png").c_str() );
new TrackInfoDialog( w2->getSelectionText().c_str(), screenshot, 0.8f, 0.7f);
}
}
else if(name == "gps")
{
RibbonWidget* w = dynamic_cast<RibbonWidget*>(widget);
if(w != NULL)
std::cout << "Clicked on GrandPrix " << w->getSelectionIDString().c_str() << std::endl;
}
}
// -----------------------------------------------------------------------------
/**
* Callback handling events from the options menus
*/
void menuEventHelp(Widget* widget, std::string& name)
{
if(name == "init")
{
RibbonWidget* w = getCurrentScreen()->getWidget<RibbonWidget>("category");
if(w != NULL)
{
const std::string& screen_name = getCurrentScreen()->getName();
if(screen_name == "help1.stkgui") w->select( "page1" );
else if(screen_name == "help2.stkgui") w->select( "page2" );
else if(screen_name == "help3.stkgui") w->select( "page3" );
}
}
// -- options
else if(name == "category")
{
std::string selection = ((RibbonWidget*)widget)->getSelectionIDString().c_str();
if(selection == "page1") replaceTopMostMenu("help1.stkgui");
else if(selection == "page2") replaceTopMostMenu("help2.stkgui");
else if(selection == "page3") replaceTopMostMenu("help3.stkgui");
}
else if(name == "back")
{
StateManager::escapePressed();
}
}
// -------------------------------------------------------------------------
/**
* All widget events will be dispatched to this function; arguments are
* a pointer to the widget from which the event originates, and its internal
* name. There is one exception : right after showing a new screen, an event with
* name 'init' and widget set to NULL will be fired, so the screen can be filled
* with the right values or so.
*/
void eventCallback(Widget* widget, std::string& name)
{
std::cout << "event!! " << name.c_str() << std::endl;
const std::string& screen_name = getCurrentScreen()->getName();
if( screen_name == "main.stkgui" )
menuEventMain(widget, name);
else if( screen_name == "karts.stkgui" )
menuEventKarts(widget, name);
else if( screen_name == "racesetup.stkgui" )
menuEventRaceSetup(widget, name);
else if( screen_name == "tracks.stkgui" )
menuEventTracks(widget, name);
else if( screen_name == "options_av.stkgui" || screen_name == "options_input.stkgui" || screen_name == "options_players.stkgui")
menuEventOptions(widget, name);
else if( screen_name == "help1.stkgui" || screen_name == "help2.stkgui" || screen_name == "help3.stkgui")
menuEventHelp(widget, name);
else if( screen_name == "credits.stkgui" )
{
if(name == "init")
{
Widget* w = getCurrentScreen()->getWidget<Widget>("animated_area");
assert(w != NULL);
Credits* credits = Credits::getInstance();
credits->reset();
credits->setArea(w->x, w->y, w->w, w->h);
}
else if(name == "back")
{
StateManager::escapePressed();
}
}
else
std::cerr << "Warning, unknown menu " << screen_name << " in event callback\n";
}
#if 0
#pragma mark -
#pragma mark Other
#endif
void initGUI()
{
IrrlichtDevice* device = irr_driver->getDevice();
video::IVideoDriver* driver = device->getVideoDriver();
init(device, driver, &eventCallback);
}
void enterGameState()
{
g_menu_stack.clear();
g_menu_stack.push_back("race");
g_game_mode = true;
cleanForGame();
input_manager->setMode(InputManager::INGAME);
}
bool isGameState()
{
return g_game_mode;
}
void escapePressed()
{
// in input sensing mode
if(input_manager->isInMode(InputManager::INPUT_SENSE_KEYBOARD) ||
input_manager->isInMode(InputManager::INPUT_SENSE_GAMEPAD) )
{
ModalDialog::dismiss();
input_manager->setMode(InputManager::MENU);
}
// when another modal dialog is visible
else if(ModalDialog::isADialogActive())
{
ModalDialog::dismiss();
}
// In-game
else if(g_game_mode)
{
// TODO : show in-game menu
resetAndGoToMenu("main.stkgui");
}
// In menus
else
{
popMenu();
}
}
#if 0
#pragma mark -
#pragma mark Push/pop menus
#endif
static std::string g_init_event = "init";
void pushMenu(std::string name)
{
input_manager->setMode(InputManager::MENU);
g_menu_stack.push_back(name);
g_game_mode = false;
switchToScreen(name.c_str());
eventCallback(NULL, g_init_event);
}
void replaceTopMostMenu(std::string name)
{
input_manager->setMode(InputManager::MENU);
g_menu_stack[g_menu_stack.size()-1] = name;
g_game_mode = false;
switchToScreen(name.c_str());
eventCallback(NULL, g_init_event);
}
void reshowTopMostMenu()
{
switchToScreen( g_menu_stack[g_menu_stack.size()-1].c_str() );
eventCallback(NULL, g_init_event);
}
void popMenu()
{
g_menu_stack.pop_back();
if(g_menu_stack.size() == 0)
{
main_loop->abort();
return;
}
g_game_mode = g_menu_stack[g_menu_stack.size()-1] == "race";
std::cout << "-- switching to screen " << g_menu_stack[g_menu_stack.size()-1].c_str() << std::endl;
switchToScreen(g_menu_stack[g_menu_stack.size()-1].c_str());
eventCallback(NULL, g_init_event);
}
void resetAndGoToMenu(std::string name)
{
race_manager->exitRace();
input_manager->setMode(InputManager::MENU);
g_menu_stack.clear();
g_menu_stack.push_back(name);
g_game_mode = false;
sound_manager->positionListener( Vec3(0,0,0), Vec3(0,1,0) );
switchToScreen(name.c_str());
eventCallback(NULL, g_init_event);
}
}

View File

@@ -16,20 +16,18 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "gui/engine.hpp"
#include "guiengine/engine.hpp"
#include <iostream>
#include <assert.h>
#include "io/file_manager.hpp"
#include "input/input_manager.hpp"
#include "gui/credits.hpp"
#include "gui/screen.hpp"
#include "gui/event_handler.hpp"
#include "gui/kart_selection.hpp"
#include "gui/skin.hpp"
#include "gui/state_manager.hpp"
#include "gui/widget.hpp"
#include "guiengine/screen.hpp"
#include "guiengine/event_handler.hpp"
#include "guiengine/skin.hpp"
#include "guiengine/widget.hpp"
namespace GUIEngine
{
@@ -43,6 +41,7 @@ namespace GUIEngine
Screen* g_current_screen = NULL;
ptr_vector<Widget, REF> needsUpdate;
AbstractStateManager* g_state_manager = NULL;
float dt = 0;
@@ -50,7 +49,6 @@ namespace GUIEngine
{
return dt;
}
// -----------------------------------------------------------------------------
IrrlichtDevice* getDevice()
{
@@ -71,6 +69,11 @@ IGUIEnvironment* getGUIEnv()
{
return g_env;
}
// -----------------------------------------------------------------------------
AbstractStateManager* getStateManager()
{
return g_state_manager;
}
// -----------------------------------------------------------------------------
void clear()
{
@@ -121,7 +124,7 @@ void switchToScreen(const char* screen_name)
void reshowCurrentScreen()
{
needsUpdate.clearWithoutDeleting();
StateManager::reshowTopMostMenu();
g_state_manager->reshowTopMostMenu();
//g_current_screen->addWidgets();
}
// -----------------------------------------------------------------------------
@@ -141,14 +144,14 @@ void cleanUp()
needsUpdate.clearWithoutDeleting();
// nothing else to delete for now AFAIK, irrlicht will automatically kill everything along the device
}
// -----------------------------------------------------------------------------
void (*g_event_callback)(Widget* widget, std::string& name);
void init(IrrlichtDevice* device_a, IVideoDriver* driver_a, void (*eventCallback)(Widget* widget, std::string& name) )
void init(IrrlichtDevice* device_a, IVideoDriver* driver_a, AbstractStateManager* state_manager )
{
g_env = device_a->getGUIEnvironment();
g_device = device_a;
g_driver = driver_a;
g_event_callback = eventCallback;
g_state_manager = state_manager;
/*
To make the g_font a little bit nicer, we load an external g_font
@@ -171,8 +174,8 @@ void init(IrrlichtDevice* device_a, IVideoDriver* driver_a, void (*eventCallback
/** transmit event to user event callback (out of encapsulated GUI module) */
void transmitEvent(Widget* widget, std::string& name)
{
assert(g_event_callback != NULL);
g_event_callback(widget, name);
assert(g_state_manager != NULL);
g_state_manager->eventCallback(widget, name);
}
// -----------------------------------------------------------------------------
@@ -182,7 +185,7 @@ void render(float elapsed_time)
// ---- menu drawing
// draw background image and sections
if(!StateManager::isGameState())
if(!g_state_manager->isGameState())
{
g_skin->drawBgImage();
g_skin->renderSections();
@@ -191,14 +194,10 @@ void render(float elapsed_time)
// let irrLicht do the rest (the Skin object will be called for further render)
g_env->drawAll();
// ---- additionnal drawing
if(!StateManager::isGameState())
// ---- some menus may need updating
if(!g_state_manager->isGameState())
{
// FIXME : don't hardcode?
if (getCurrentScreen()->getName() == "credits.stkgui")
Credits::getInstance()->render(elapsed_time);
else if (getCurrentScreen()->getName() == "karts.stkgui")
StateManager::kartSelectionUpdate(elapsed_time);
g_state_manager->onUpdate(elapsed_time);
}
}

View File

@@ -186,7 +186,8 @@ use rectangular icons (this will affect the type of focus/highlighting used)
#include <irrlicht.h>
#include <string>
#include "gui/widget.hpp"
#include "guiengine/abstract_state_manager.hpp"
#include "guiengine/widget.hpp"
#include "utils/ptr_vector.hpp"
using namespace irr;
@@ -206,13 +207,14 @@ namespace GUIEngine
extern IGUIEnvironment* getGUIEnv();
extern IVideoDriver* getDriver();
extern IGUIFont* getFont();
extern AbstractStateManager* getStateManager();
float getLatestDt();
// Widgets that need to be notified at every frame can add themselves there
extern ptr_vector<Widget, REF> needsUpdate;
void init(irr::IrrlichtDevice* device, irr::video::IVideoDriver* driver, void (*eventCallback)(Widget* widget, std::string& name) );
void init(irr::IrrlichtDevice* device, irr::video::IVideoDriver* driver, AbstractStateManager* state_manager);
void cleanUp();
void switchToScreen(const char* );
void clear();
@@ -224,6 +226,9 @@ namespace GUIEngine
void render(float dt);
void transmitEvent(Widget* widget, std::string& name);
void onUpdate(float elapsedTime);
}
#endif

View File

@@ -15,12 +15,11 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "gui/event_handler.hpp"
#include "gui/engine.hpp"
#include "gui/modaldialog.hpp"
#include "gui/screen.hpp"
#include "gui/state_manager.hpp"
#include "guiengine/abstract_state_manager.hpp"
#include "guiengine/event_handler.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/modaldialog.hpp"
#include "guiengine/screen.hpp"
#include "input/input_manager.hpp"
using GUIEngine::EventHandler;
@@ -36,7 +35,8 @@ EventHandler::~EventHandler()
bool EventHandler::OnEvent (const SEvent &event)
{
if(event.EventType == EET_GUI_EVENT ||
(!StateManager::isGameState() && event.EventType != EET_KEY_INPUT_EVENT && event.EventType != EET_JOYSTICK_INPUT_EVENT)
(!GUIEngine::getStateManager()->isGameState() && event.EventType != EET_KEY_INPUT_EVENT &&
event.EventType != EET_JOYSTICK_INPUT_EVENT)
)
{
return onGUIEvent(event);
@@ -46,6 +46,9 @@ bool EventHandler::OnEvent (const SEvent &event)
// FIXME : it's a bit unclean that all input events go trough the gui module
return input_manager->input(event);
}
// to shut up a warning. gcc is too stupid too see the code will never get here
return false;
}
bool EventHandler::onGUIEvent(const SEvent& event)
@@ -326,7 +329,7 @@ void EventHandler::processAction(const int action, const unsigned int value, Inp
case PA_RESCUE:
if(pressedDown)
StateManager::escapePressed();
GUIEngine::getStateManager()->escapePressed();
break;
case PA_FIRE:

View File

@@ -15,8 +15,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef __EVENT_HANDLER_HPP__
#define __EVENT_HANDLER_HPP__
#ifndef HEADER_EVENT_HANDLER_HPP
#define HEADER_EVENT_HANDLER_HPP
#include "irrlicht.h"
#include "input/input.hpp"

View File

@@ -16,16 +16,18 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config/player.hpp"
#include "gui/engine.hpp"
#include "gui/modaldialog.hpp"
#include "gui/options_screen.hpp"
#include "gui/state_manager.hpp"
#include "gui/widget.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/modaldialog.hpp"
#include "guiengine/widget.hpp"
#include "input/input_manager.hpp"
#include "network/network_manager.hpp"
#include "race/race_manager.hpp"
#include "utils/translation.hpp"
// FIXME : gui engine should not depend on the STK-specific implementation
#include "states_screens/options_screen.hpp"
#include "states_screens/state_manager.hpp"
using namespace irr;
namespace GUIEngine
@@ -241,7 +243,7 @@ void EnterPlayerNameDialog::onEnterPressedInternal()
// ---- Otherwise, accept entered name
stringw playerName = textCtrl->getText();
if(playerName.size() > 0)
StateManager::gotNewPlayerName( playerName );
OptionsScreen::gotNewPlayerName( playerName );
// irrLicht is too stupid to remove focus from deleted widgets
// so do it by hand
@@ -342,7 +344,7 @@ void startGame()
driver->endScene();
StateManager::enterGameState();
StateManager::get()->enterGameState();
//race_manager->setDifficulty(RaceManager::RD_HARD);
race_manager->setTrack("lighthouse");
race_manager->setNumLaps( 3 );
@@ -521,7 +523,7 @@ void PlayerInfoDialog::processEvent(std::string& eventSource)
stringw playerName = textCtrl->getText();
if(playerName.size() > 0)
{
StateManager::gotNewPlayerName( playerName, m_player );
OptionsScreen::gotNewPlayerName( playerName, m_player );
}
// irrLicht is too stupid to remove focus from deleted widgets
@@ -540,7 +542,7 @@ void PlayerInfoDialog::processEvent(std::string& eventSource)
}
else if(eventSource == "confirmremove")
{
StateManager::deletePlayer( m_player );
OptionsScreen::deletePlayer( m_player );
// irrLicht is too stupid to remove focus from deleted widgets
// so do it by hand

View File

@@ -17,7 +17,7 @@
#include "irrlicht.h"
#include "utils/ptr_vector.hpp"
#include "gui/skin.hpp"
#include "guiengine/skin.hpp"
class PlayerProfile;

View File

@@ -4,7 +4,7 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include <irrlicht.h>
#include "gui/my_button.hpp"
#include "guiengine/my_button.hpp"
using namespace GUIEngine;

View File

@@ -24,11 +24,10 @@
#include "input/input.hpp"
#include "io/file_manager.hpp"
#include "gui/engine.hpp"
#include "gui/modaldialog.hpp"
#include "gui/screen.hpp"
#include "gui/state_manager.hpp"
#include "gui/widget.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/modaldialog.hpp"
#include "guiengine/screen.hpp"
#include "guiengine/widget.hpp"
#include "utils/translation.hpp"
using namespace irr;

View File

@@ -16,9 +16,9 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "gui/screen.hpp"
#include "gui/engine.hpp"
#include "gui/widget.hpp"
#include "guiengine/screen.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/widget.hpp"
#include <irrlicht.h>
#include <iostream>
#include <irrXML.h>

View File

@@ -17,12 +17,11 @@
#include "config/user_config.hpp"
#include "gui/skin.hpp"
#include "gui/engine.hpp"
#include "gui/modaldialog.hpp"
#include "gui/screen.hpp"
#include "gui/widget.hpp"
#include "gui/state_manager.hpp"
#include "guiengine/skin.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/modaldialog.hpp"
#include "guiengine/screen.hpp"
#include "guiengine/widget.hpp"
#include "io/file_manager.hpp"
#include <cassert>
#include <iostream>
@@ -844,7 +843,7 @@ void Skin::renderSections(ptr_vector<Widget>* within_vector)
void Skin::draw2DRectangle (IGUIElement *element, const video::SColor &color, const core::rect< s32 > &rect, const core::rect< s32 > *clip)
{
if(StateManager::isGameState()) return; // ignore in game mode
if(GUIEngine::getStateManager()->isGameState()) return; // ignore in game mode
//const bool focused = GUIEngine::getGUIEnv()->hasFocus(element);
const int id = element->getID();

View File

@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "gui/widget.hpp"
#include "guiengine/widget.hpp"
#include <iostream>
#include <sstream>
@@ -30,9 +30,9 @@ using namespace gui;
using namespace GUIEngine;
#include "graphics/irr_driver.hpp"
#include "gui/screen.hpp"
#include "gui/engine.hpp"
#include "gui/my_button.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/my_button.hpp"
#include "guiengine/screen.hpp"
#include "io/file_manager.hpp"
#include "utils/string_utils.hpp"
#include "utils/translation.hpp"

View File

@@ -22,7 +22,7 @@
#include <irrlicht.h>
#include <map>
#include "gui/skin.hpp"
#include "guiengine/skin.hpp"
#include "utils/ptr_vector.hpp"
#include "utils/vec3.hpp"

View File

@@ -21,7 +21,6 @@
9507E9D10FC1CDCE00BD2B92 /* Ogg.framework in Copy frameworks */ = {isa = PBXBuildFile; fileRef = 9551C7F90FC1B63C00DB481B /* Ogg.framework */; };
9507E9D20FC1CDCE00BD2B92 /* OpenAL.framework in Copy frameworks */ = {isa = PBXBuildFile; fileRef = 9551C7FA0FC1B63C00DB481B /* OpenAL.framework */; };
9507E9DB0FC1CDD500BD2B92 /* Vorbis.framework in Copy frameworks */ = {isa = PBXBuildFile; fileRef = 9551C7FB0FC1B63C00DB481B /* Vorbis.framework */; };
9516162D0FFFB12B004B16D8 /* kart_selection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9516162C0FFFB12B004B16D8 /* kart_selection.cpp */; };
951BC65E0FFAF290006B5FF1 /* ipo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 951BC65C0FFAF290006B5FF1 /* ipo.cpp */; };
95263DEC0FD7471900CF5F92 /* grand_prix_data.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95263DE00FD7471900CF5F92 /* grand_prix_data.cpp */; };
95263DED0FD7471900CF5F92 /* grand_prix_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95263DE20FD7471900CF5F92 /* grand_prix_manager.cpp */; };
@@ -34,7 +33,6 @@
9540E24F0FD5F8A8002985B8 /* explosion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9540E2490FD5F8A8002985B8 /* explosion.cpp */; };
9540E2500FD5F8A8002985B8 /* material_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9540E24B0FD5F8A8002985B8 /* material_manager.cpp */; };
9540E2510FD5F8A8002985B8 /* material.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9540E24D0FD5F8A8002985B8 /* material.cpp */; };
954A57DC0FEC5AE40073C16C /* modaldialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 954A57DB0FEC5AE40073C16C /* modaldialog.cpp */; };
954E4C2D0FF98B6F0047FE3E /* animation_base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 954E4C250FF98B6E0047FE3E /* animation_base.cpp */; };
954E4C2E0FF98B6F0047FE3E /* animation_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 954E4C270FF98B6E0047FE3E /* animation_manager.cpp */; };
954E4C2F0FF98B6F0047FE3E /* billboard_animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 954E4C290FF98B6E0047FE3E /* billboard_animation.cpp */; };
@@ -213,21 +211,12 @@
9551C8EA0FC1B72500DB481B /* shadow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C65DA00F532FD400BE7BA7 /* shadow.cpp */; };
9551C8EB0FC1B72500DB481B /* nitro.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C65DA10F532FD400BE7BA7 /* nitro.cpp */; };
9551C8EC0FC1B72500DB481B /* file_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9505570E0F6963790056E88C /* file_manager.cpp */; };
9551C8ED0FC1B72500DB481B /* engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9505577A0F696A900056E88C /* engine.cpp */; };
9551C8EE0FC1B72500DB481B /* my_button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9505577C0F696A900056E88C /* my_button.cpp */; };
9551C8EF0FC1B72500DB481B /* screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9505577F0F696A900056E88C /* screen.cpp */; };
9551C8F00FC1B72500DB481B /* screen_loader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 950557810F696A900056E88C /* screen_loader.cpp */; };
9551C8F10FC1B72500DB481B /* skin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 950557820F696A900056E88C /* skin.cpp */; };
9551C8F20FC1B72500DB481B /* widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 950557840F696A900056E88C /* widget.cpp */; };
9551C8F30FC1B72500DB481B /* race_gui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C1E3F10F699079005D33E6 /* race_gui.cpp */; };
9551C8F50FC1B72500DB481B /* state_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 953F038B0F6C880D00C77FE2 /* state_manager.cpp */; };
9551C8F60FC1B72500DB481B /* input_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95A1182A0F77EA3100B18B3D /* input_manager.cpp */; };
9551C8F70FC1B72500DB481B /* input_device.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95A1184A0F77FC3900B18B3D /* input_device.cpp */; };
9551C8F80FC1B72500DB481B /* device_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95A1187A0F78024E00B18B3D /* device_manager.cpp */; };
9551C8F90FC1B72500DB481B /* physical_object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95CA59F70F82FCB7003323DB /* physical_object.cpp */; };
9551C8FA0FC1B72500DB481B /* quad_set.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 951C357E0FC05BF400A48379 /* quad_set.cpp */; };
9551C8FB0FC1B72500DB481B /* quad_graph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 951C35800FC05BF400A48379 /* quad_graph.cpp */; };
9551C8FC0FC1B72500DB481B /* credits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 951C35BE0FC066ED00A48379 /* credits.cpp */; };
9551C9F00FC1B7EE00DB481B /* libintl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9551C7F80FC1B63C00DB481B /* libintl.framework */; };
9551C9F10FC1B7EE00DB481B /* Ogg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9551C7F90FC1B63C00DB481B /* Ogg.framework */; };
9551C9F20FC1B7EE00DB481B /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9551C7FA0FC1B63C00DB481B /* OpenAL.framework */; };
@@ -244,10 +233,22 @@
955DE88C1004273B006A4F3C /* check_structure.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 955DE8871004273B006A4F3C /* check_structure.cpp */; };
955DE88D1004273B006A4F3C /* checkline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 955DE8891004273B006A4F3C /* checkline.cpp */; };
956D36A710095035007FCB95 /* player.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 956D36A610095035007FCB95 /* player.cpp */; };
958330391012248A00C5137E /* event_handler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330381012248A00C5137E /* event_handler.cpp */; };
958330CC10122B4A00C5137E /* engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330B210122B4A00C5137E /* engine.cpp */; };
958330CD10122B4A00C5137E /* event_handler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330B410122B4A00C5137E /* event_handler.cpp */; };
958330CE10122B4A00C5137E /* modaldialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330B610122B4A00C5137E /* modaldialog.cpp */; };
958330CF10122B4A00C5137E /* my_button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330B810122B4A00C5137E /* my_button.cpp */; };
958330D010122B4A00C5137E /* screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330BA10122B4A00C5137E /* screen.cpp */; };
958330D110122B4A00C5137E /* screen_loader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330BC10122B4A00C5137E /* screen_loader.cpp */; };
958330D210122B4A00C5137E /* skin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330BD10122B4A00C5137E /* skin.cpp */; };
958330D310122B4A00C5137E /* widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330BF10122B4A00C5137E /* widget.cpp */; };
958330D410122B4A00C5137E /* credits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330C210122B4A00C5137E /* credits.cpp */; };
958330D510122B4A00C5137E /* kart_selection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330C410122B4A00C5137E /* kart_selection.cpp */; };
958330D610122B4A00C5137E /* options_screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330C610122B4A00C5137E /* options_screen.cpp */; };
958330D710122B4A00C5137E /* race_gui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330C810122B4A00C5137E /* race_gui.cpp */; };
958330D810122B4A00C5137E /* state_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958330CA10122B4A00C5137E /* state_manager.cpp */; };
9583319910123B0200C5137E /* abstract_state_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9583319810123B0200C5137E /* abstract_state_manager.cpp */; };
95CB476C0FF30EF400413BAE /* bezier_curve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95CB476B0FF30EF400413BAE /* bezier_curve.cpp */; };
95D1F5F70FC8C3E300FF6968 /* input.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95D1F5F60FC8C3E300FF6968 /* input.cpp */; };
95D1F6190FC8CDBB00FF6968 /* options_screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95D1F6180FC8CDBB00FF6968 /* options_screen.cpp */; };
95D950D20FE473CA002E10AD /* stk_config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95D950CE0FE473CA002E10AD /* stk_config.cpp */; };
95D950D30FE473CA002E10AD /* user_config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95D950D00FE473CA002E10AD /* user_config.cpp */; };
95D950DB0FE4741D002E10AD /* water_splash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95D950D80FE4741D002E10AD /* water_splash.cpp */; };
@@ -277,17 +278,6 @@
950557570F6968860056E88C /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
9505575F0F6968A50056E88C /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = "<absolute>"; };
950557640F6968BE0056E88C /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
9505577A0F696A900056E88C /* engine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = engine.cpp; path = ../../gui/engine.cpp; sourceTree = SOURCE_ROOT; };
9505577B0F696A900056E88C /* engine.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = engine.hpp; path = ../../gui/engine.hpp; sourceTree = SOURCE_ROOT; };
9505577C0F696A900056E88C /* my_button.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = my_button.cpp; path = ../../gui/my_button.cpp; sourceTree = SOURCE_ROOT; };
9505577D0F696A900056E88C /* my_button.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = my_button.hpp; path = ../../gui/my_button.hpp; sourceTree = SOURCE_ROOT; };
9505577F0F696A900056E88C /* screen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = screen.cpp; path = ../../gui/screen.cpp; sourceTree = SOURCE_ROOT; };
950557800F696A900056E88C /* screen.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = screen.hpp; path = ../../gui/screen.hpp; sourceTree = SOURCE_ROOT; };
950557810F696A900056E88C /* screen_loader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = screen_loader.cpp; path = ../../gui/screen_loader.cpp; sourceTree = SOURCE_ROOT; };
950557820F696A900056E88C /* skin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = skin.cpp; path = ../../gui/skin.cpp; sourceTree = SOURCE_ROOT; };
950557830F696A900056E88C /* skin.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = skin.hpp; path = ../../gui/skin.hpp; sourceTree = SOURCE_ROOT; };
950557840F696A900056E88C /* widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = widget.cpp; path = ../../gui/widget.cpp; sourceTree = SOURCE_ROOT; };
950557850F696A900056E88C /* widget.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = widget.hpp; path = ../../gui/widget.hpp; sourceTree = SOURCE_ROOT; };
9507E9310FC1C8C100BD2B92 /* BMF_Api.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BMF_Api.cpp; path = ../../bullet/Demos/OpenGL/BMF_Api.cpp; sourceTree = SOURCE_ROOT; };
9507E9320FC1C8C100BD2B92 /* BMF_Api.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BMF_Api.h; path = games/supertuxkart/src/bullet/Demos/OpenGL/BMF_Api.h; sourceTree = SYSTEM_DEVELOPER_DIR; };
9507E9340FC1C8C100BD2B92 /* BMF_BitmapFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BMF_BitmapFont.cpp; path = ../../bullet/Demos/OpenGL/BMF_BitmapFont.cpp; sourceTree = SOURCE_ROOT; };
@@ -310,16 +300,12 @@
9507E9500FC1C8C200BD2B92 /* RenderTexture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderTexture.cpp; path = ../../bullet/Demos/OpenGL/RenderTexture.cpp; sourceTree = SOURCE_ROOT; };
9507E9510FC1C8C200BD2B92 /* RenderTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RenderTexture.h; path = games/supertuxkart/src/bullet/Demos/OpenGL/RenderTexture.h; sourceTree = SYSTEM_DEVELOPER_DIR; };
9507E9B60FC1CCE900BD2B92 /* stk.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = stk.icns; sourceTree = SOURCE_ROOT; };
9516162C0FFFB12B004B16D8 /* kart_selection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = kart_selection.cpp; path = ../../gui/kart_selection.cpp; sourceTree = SOURCE_ROOT; };
9516164D0FFFB1F0004B16D8 /* kart_selection.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kart_selection.hpp; path = ../../gui/kart_selection.hpp; sourceTree = SOURCE_ROOT; };
951BC65C0FFAF290006B5FF1 /* ipo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ipo.cpp; path = ../../animations/ipo.cpp; sourceTree = SOURCE_ROOT; };
951BC65D0FFAF290006B5FF1 /* ipo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ipo.hpp; path = ../../animations/ipo.hpp; sourceTree = SOURCE_ROOT; };
951C357D0FC05BF400A48379 /* quad_set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = quad_set.hpp; path = ../../tracks/quad_set.hpp; sourceTree = SOURCE_ROOT; };
951C357E0FC05BF400A48379 /* quad_set.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = quad_set.cpp; path = ../../tracks/quad_set.cpp; sourceTree = SOURCE_ROOT; };
951C357F0FC05BF400A48379 /* quad_graph.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = quad_graph.hpp; path = ../../tracks/quad_graph.hpp; sourceTree = SOURCE_ROOT; };
951C35800FC05BF400A48379 /* quad_graph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = quad_graph.cpp; path = ../../tracks/quad_graph.cpp; sourceTree = SOURCE_ROOT; };
951C35BD0FC066ED00A48379 /* credits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = credits.hpp; path = ../../gui/credits.hpp; sourceTree = SOURCE_ROOT; };
951C35BE0FC066ED00A48379 /* credits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = credits.cpp; path = ../../gui/credits.cpp; sourceTree = SOURCE_ROOT; };
95263DE00FD7471900CF5F92 /* grand_prix_data.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = grand_prix_data.cpp; path = ../../race/grand_prix_data.cpp; sourceTree = SOURCE_ROOT; };
95263DE10FD7471900CF5F92 /* grand_prix_data.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = grand_prix_data.hpp; path = ../../race/grand_prix_data.hpp; sourceTree = SOURCE_ROOT; };
95263DE20FD7471900CF5F92 /* grand_prix_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = grand_prix_manager.cpp; path = ../../race/grand_prix_manager.cpp; sourceTree = SOURCE_ROOT; };
@@ -342,8 +328,6 @@
953EAAB10F30A4410000D57D /* triangle_mesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = triangle_mesh.cpp; path = ../../physics/triangle_mesh.cpp; sourceTree = SOURCE_ROOT; };
953EAAB40F30A4650000D57D /* translation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = translation.hpp; path = ../../utils/translation.hpp; sourceTree = SOURCE_ROOT; };
953EAAB50F30A4650000D57D /* translation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = translation.cpp; path = ../../utils/translation.cpp; sourceTree = SOURCE_ROOT; };
953F038B0F6C880D00C77FE2 /* state_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = state_manager.cpp; path = ../../gui/state_manager.cpp; sourceTree = SOURCE_ROOT; };
953F038E0F6C8AD800C77FE2 /* state_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = state_manager.hpp; path = ../../gui/state_manager.hpp; sourceTree = SOURCE_ROOT; };
9540E2490FD5F8A8002985B8 /* explosion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = explosion.cpp; path = ../../graphics/explosion.cpp; sourceTree = SOURCE_ROOT; };
9540E24A0FD5F8A8002985B8 /* explosion.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = explosion.hpp; path = ../../graphics/explosion.hpp; sourceTree = SOURCE_ROOT; };
9540E24B0FD5F8A8002985B8 /* material_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = material_manager.cpp; path = ../../graphics/material_manager.cpp; sourceTree = SOURCE_ROOT; };
@@ -352,8 +336,6 @@
9540E24E0FD5F8A8002985B8 /* material.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = material.hpp; path = ../../graphics/material.hpp; sourceTree = SOURCE_ROOT; };
9540E2560FD5F8FD002985B8 /* ptr_vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ptr_vector.hpp; path = ../../utils/ptr_vector.hpp; sourceTree = SOURCE_ROOT; };
9540E2570FD5F8FD002985B8 /* no_copy.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = no_copy.hpp; path = ../../utils/no_copy.hpp; sourceTree = SOURCE_ROOT; };
954A57DB0FEC5AE40073C16C /* modaldialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = modaldialog.cpp; path = ../../gui/modaldialog.cpp; sourceTree = SOURCE_ROOT; };
954A57ED0FEC5BB00073C16C /* modaldialog.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = modaldialog.hpp; path = ../../gui/modaldialog.hpp; sourceTree = SOURCE_ROOT; };
954E4C250FF98B6E0047FE3E /* animation_base.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = animation_base.cpp; path = ../../animations/animation_base.cpp; sourceTree = SOURCE_ROOT; };
954E4C260FF98B6E0047FE3E /* animation_base.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = animation_base.hpp; path = ../../animations/animation_base.hpp; sourceTree = SOURCE_ROOT; };
954E4C270FF98B6E0047FE3E /* animation_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = animation_manager.cpp; path = ../../animations/animation_manager.cpp; sourceTree = SOURCE_ROOT; };
@@ -377,8 +359,33 @@
955DE8891004273B006A4F3C /* checkline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = checkline.cpp; path = ../../tracks/checkline.cpp; sourceTree = SOURCE_ROOT; };
955DE88A1004273B006A4F3C /* checkline.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = checkline.hpp; path = ../../tracks/checkline.hpp; sourceTree = SOURCE_ROOT; };
956D36A610095035007FCB95 /* player.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = player.cpp; path = games/supertuxkart/src/config/player.cpp; sourceTree = SYSTEM_DEVELOPER_DIR; };
958330371012248A00C5137E /* event_handler.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = event_handler.hpp; path = games/supertuxkart/src/gui/event_handler.hpp; sourceTree = SYSTEM_DEVELOPER_DIR; };
958330381012248A00C5137E /* event_handler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = event_handler.cpp; path = games/supertuxkart/src/gui/event_handler.cpp; sourceTree = SYSTEM_DEVELOPER_DIR; };
958330B210122B4A00C5137E /* engine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = engine.cpp; path = ../../guiengine/engine.cpp; sourceTree = SOURCE_ROOT; };
958330B310122B4A00C5137E /* engine.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = engine.hpp; path = ../../guiengine/engine.hpp; sourceTree = SOURCE_ROOT; };
958330B410122B4A00C5137E /* event_handler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = event_handler.cpp; path = ../../guiengine/event_handler.cpp; sourceTree = SOURCE_ROOT; };
958330B510122B4A00C5137E /* event_handler.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = event_handler.hpp; path = ../../guiengine/event_handler.hpp; sourceTree = SOURCE_ROOT; };
958330B610122B4A00C5137E /* modaldialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = modaldialog.cpp; path = ../../guiengine/modaldialog.cpp; sourceTree = SOURCE_ROOT; };
958330B710122B4A00C5137E /* modaldialog.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = modaldialog.hpp; path = ../../guiengine/modaldialog.hpp; sourceTree = SOURCE_ROOT; };
958330B810122B4A00C5137E /* my_button.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = my_button.cpp; path = ../../guiengine/my_button.cpp; sourceTree = SOURCE_ROOT; };
958330B910122B4A00C5137E /* my_button.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = my_button.hpp; path = ../../guiengine/my_button.hpp; sourceTree = SOURCE_ROOT; };
958330BA10122B4A00C5137E /* screen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = screen.cpp; path = ../../guiengine/screen.cpp; sourceTree = SOURCE_ROOT; };
958330BB10122B4A00C5137E /* screen.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = screen.hpp; path = ../../guiengine/screen.hpp; sourceTree = SOURCE_ROOT; };
958330BC10122B4A00C5137E /* screen_loader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = screen_loader.cpp; path = ../../guiengine/screen_loader.cpp; sourceTree = SOURCE_ROOT; };
958330BD10122B4A00C5137E /* skin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = skin.cpp; path = ../../guiengine/skin.cpp; sourceTree = SOURCE_ROOT; };
958330BE10122B4A00C5137E /* skin.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = skin.hpp; path = ../../guiengine/skin.hpp; sourceTree = SOURCE_ROOT; };
958330BF10122B4A00C5137E /* widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = widget.cpp; path = ../../guiengine/widget.cpp; sourceTree = SOURCE_ROOT; };
958330C010122B4A00C5137E /* widget.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = widget.hpp; path = ../../guiengine/widget.hpp; sourceTree = SOURCE_ROOT; };
958330C210122B4A00C5137E /* credits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = credits.cpp; path = ../../states_screens/credits.cpp; sourceTree = SOURCE_ROOT; };
958330C310122B4A00C5137E /* credits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = credits.hpp; path = ../../states_screens/credits.hpp; sourceTree = SOURCE_ROOT; };
958330C410122B4A00C5137E /* kart_selection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = kart_selection.cpp; path = ../../states_screens/kart_selection.cpp; sourceTree = SOURCE_ROOT; };
958330C510122B4A00C5137E /* kart_selection.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kart_selection.hpp; path = ../../states_screens/kart_selection.hpp; sourceTree = SOURCE_ROOT; };
958330C610122B4A00C5137E /* options_screen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = options_screen.cpp; path = ../../states_screens/options_screen.cpp; sourceTree = SOURCE_ROOT; };
958330C710122B4A00C5137E /* options_screen.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = options_screen.hpp; path = ../../states_screens/options_screen.hpp; sourceTree = SOURCE_ROOT; };
958330C810122B4A00C5137E /* race_gui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = race_gui.cpp; path = ../../states_screens/race_gui.cpp; sourceTree = SOURCE_ROOT; };
958330C910122B4A00C5137E /* race_gui.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = race_gui.hpp; path = ../../states_screens/race_gui.hpp; sourceTree = SOURCE_ROOT; };
958330CA10122B4A00C5137E /* state_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = state_manager.cpp; path = ../../states_screens/state_manager.cpp; sourceTree = SOURCE_ROOT; };
958330CB10122B4A00C5137E /* state_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = state_manager.hpp; path = ../../states_screens/state_manager.hpp; sourceTree = SOURCE_ROOT; };
9583319710123B0200C5137E /* abstract_state_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = abstract_state_manager.hpp; path = ../../guiengine/abstract_state_manager.hpp; sourceTree = SOURCE_ROOT; };
9583319810123B0200C5137E /* abstract_state_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = abstract_state_manager.cpp; path = ../../guiengine/abstract_state_manager.cpp; sourceTree = SOURCE_ROOT; };
95A118290F77EA3100B18B3D /* input.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = input.hpp; path = ../../input/input.hpp; sourceTree = SOURCE_ROOT; };
95A1182A0F77EA3100B18B3D /* input_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = input_manager.cpp; path = ../../input/input_manager.cpp; sourceTree = SOURCE_ROOT; };
95A1182B0F77EA3100B18B3D /* input_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = input_manager.hpp; path = ../../input/input_manager.hpp; sourceTree = SOURCE_ROOT; };
@@ -386,8 +393,6 @@
95A1184C0F77FC8800B18B3D /* input_device.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = input_device.hpp; path = ../../input/input_device.hpp; sourceTree = SOURCE_ROOT; };
95A1187A0F78024E00B18B3D /* device_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = device_manager.cpp; path = ../../input/device_manager.cpp; sourceTree = SOURCE_ROOT; };
95A1187C0F78026D00B18B3D /* device_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = device_manager.hpp; path = ../../input/device_manager.hpp; sourceTree = SOURCE_ROOT; };
95C1E3EB0F698F23005D33E6 /* race_gui.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = race_gui.hpp; path = ../../gui/race_gui.hpp; sourceTree = SOURCE_ROOT; };
95C1E3F10F699079005D33E6 /* race_gui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = race_gui.cpp; path = ../../gui/race_gui.cpp; sourceTree = SOURCE_ROOT; };
95C2AC270F296540000D3E5D /* music.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = music.hpp; path = ../../audio/music.hpp; sourceTree = SOURCE_ROOT; };
95C2AC280F296540000D3E5D /* music_information.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = music_information.cpp; path = ../../audio/music_information.cpp; sourceTree = SOURCE_ROOT; };
95C2AC290F296540000D3E5D /* music_information.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = music_information.hpp; path = ../../audio/music_information.hpp; sourceTree = SOURCE_ROOT; };
@@ -792,8 +797,6 @@
95CB476A0FF30EF400413BAE /* bezier_curve.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = bezier_curve.hpp; path = ../../tracks/bezier_curve.hpp; sourceTree = SOURCE_ROOT; };
95CB476B0FF30EF400413BAE /* bezier_curve.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bezier_curve.cpp; path = ../../tracks/bezier_curve.cpp; sourceTree = SOURCE_ROOT; };
95D1F5F60FC8C3E300FF6968 /* input.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = input.cpp; path = ../../input/input.cpp; sourceTree = SOURCE_ROOT; };
95D1F6170FC8CDBB00FF6968 /* options_screen.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = options_screen.hpp; path = ../../gui/options_screen.hpp; sourceTree = SOURCE_ROOT; };
95D1F6180FC8CDBB00FF6968 /* options_screen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = options_screen.cpp; path = ../../gui/options_screen.cpp; sourceTree = SOURCE_ROOT; };
95D464880FA37B1B00F50CA2 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = /usr/local/lib/libIrrlicht.a; sourceTree = "<absolute>"; };
95D538840F69D61C00B4062E /* aabbox3d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = aabbox3d.h; path = /usr/local/include/irrlicht/aabbox3d.h; sourceTree = "<absolute>"; };
95D538850F69D61C00B4062E /* CDynamicMeshBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDynamicMeshBuffer.h; path = /usr/local/include/irrlicht/CDynamicMeshBuffer.h; sourceTree = "<absolute>"; };
@@ -1018,39 +1021,6 @@
name = Products;
sourceTree = "<group>";
};
950557790F696A900056E88C /* gui */ = {
isa = PBXGroup;
children = (
951C35BE0FC066ED00A48379 /* credits.cpp */,
951C35BD0FC066ED00A48379 /* credits.hpp */,
9505577A0F696A900056E88C /* engine.cpp */,
9505577B0F696A900056E88C /* engine.hpp */,
958330381012248A00C5137E /* event_handler.cpp */,
958330371012248A00C5137E /* event_handler.hpp */,
9516162C0FFFB12B004B16D8 /* kart_selection.cpp */,
9516164D0FFFB1F0004B16D8 /* kart_selection.hpp */,
954A57DB0FEC5AE40073C16C /* modaldialog.cpp */,
954A57ED0FEC5BB00073C16C /* modaldialog.hpp */,
9505577C0F696A900056E88C /* my_button.cpp */,
9505577D0F696A900056E88C /* my_button.hpp */,
95D1F6180FC8CDBB00FF6968 /* options_screen.cpp */,
95D1F6170FC8CDBB00FF6968 /* options_screen.hpp */,
95C1E3F10F699079005D33E6 /* race_gui.cpp */,
95C1E3EB0F698F23005D33E6 /* race_gui.hpp */,
9505577F0F696A900056E88C /* screen.cpp */,
950557800F696A900056E88C /* screen.hpp */,
950557810F696A900056E88C /* screen_loader.cpp */,
953F038B0F6C880D00C77FE2 /* state_manager.cpp */,
953F038E0F6C8AD800C77FE2 /* state_manager.hpp */,
950557820F696A900056E88C /* skin.cpp */,
950557830F696A900056E88C /* skin.hpp */,
950557840F696A900056E88C /* widget.cpp */,
950557850F696A900056E88C /* widget.hpp */,
);
name = gui;
path = ../../gui;
sourceTree = SOURCE_ROOT;
};
9507E9260FC1C8C100BD2B92 /* OpenGL */ = {
isa = PBXGroup;
children = (
@@ -1137,6 +1107,49 @@
path = ../../animations;
sourceTree = SOURCE_ROOT;
};
958330B110122B4A00C5137E /* guiengine */ = {
isa = PBXGroup;
children = (
9583319810123B0200C5137E /* abstract_state_manager.cpp */,
9583319710123B0200C5137E /* abstract_state_manager.hpp */,
958330B210122B4A00C5137E /* engine.cpp */,
958330B310122B4A00C5137E /* engine.hpp */,
958330B410122B4A00C5137E /* event_handler.cpp */,
958330B510122B4A00C5137E /* event_handler.hpp */,
958330B610122B4A00C5137E /* modaldialog.cpp */,
958330B710122B4A00C5137E /* modaldialog.hpp */,
958330B810122B4A00C5137E /* my_button.cpp */,
958330B910122B4A00C5137E /* my_button.hpp */,
958330BA10122B4A00C5137E /* screen.cpp */,
958330BB10122B4A00C5137E /* screen.hpp */,
958330BC10122B4A00C5137E /* screen_loader.cpp */,
958330BD10122B4A00C5137E /* skin.cpp */,
958330BE10122B4A00C5137E /* skin.hpp */,
958330BF10122B4A00C5137E /* widget.cpp */,
958330C010122B4A00C5137E /* widget.hpp */,
);
name = guiengine;
path = ../../guiengine;
sourceTree = SOURCE_ROOT;
};
958330C110122B4A00C5137E /* states_screens */ = {
isa = PBXGroup;
children = (
958330C210122B4A00C5137E /* credits.cpp */,
958330C310122B4A00C5137E /* credits.hpp */,
958330C410122B4A00C5137E /* kart_selection.cpp */,
958330C510122B4A00C5137E /* kart_selection.hpp */,
958330C610122B4A00C5137E /* options_screen.cpp */,
958330C710122B4A00C5137E /* options_screen.hpp */,
958330C810122B4A00C5137E /* race_gui.cpp */,
958330C910122B4A00C5137E /* race_gui.hpp */,
958330CA10122B4A00C5137E /* state_manager.cpp */,
958330CB10122B4A00C5137E /* state_manager.hpp */,
);
name = states_screens;
path = ../../states_screens;
sourceTree = SOURCE_ROOT;
};
95A118280F77EA3100B18B3D /* input */ = {
isa = PBXGroup;
children = (
@@ -1160,9 +1173,9 @@
95C2AC260F296540000D3E5D /* audio */,
95C2AC360F296540000D3E5D /* bullet */,
95D950CC0FE473CA002E10AD /* config */,
958330B110122B4A00C5137E /* guiengine */,
95C2AE250F296541000D3E5D /* challenges */,
95C2AE370F296541000D3E5D /* enet */,
950557790F696A900056E88C /* gui */,
95C2AE870F296542000D3E5D /* graphics */,
95C65D750F532F7D00BE7BA7 /* io */,
95C2B0F50F296545000D3E5D /* items */,
@@ -1175,6 +1188,7 @@
95263DDF0FD7471900CF5F92 /* race */,
95C2B19C0F296545000D3E5D /* replay */,
95C2B1AA0F296545000D3E5D /* robots */,
958330C110122B4A00C5137E /* states_screens */,
95C2B1CE0F296545000D3E5D /* tracks */,
95C2B1DF0F296546000D3E5D /* utils */,
95C2B1360F296545000D3E5D /* main.cpp */,
@@ -2296,21 +2310,12 @@
9551C8EA0FC1B72500DB481B /* shadow.cpp in Sources */,
9551C8EB0FC1B72500DB481B /* nitro.cpp in Sources */,
9551C8EC0FC1B72500DB481B /* file_manager.cpp in Sources */,
9551C8ED0FC1B72500DB481B /* engine.cpp in Sources */,
9551C8EE0FC1B72500DB481B /* my_button.cpp in Sources */,
9551C8EF0FC1B72500DB481B /* screen.cpp in Sources */,
9551C8F00FC1B72500DB481B /* screen_loader.cpp in Sources */,
9551C8F10FC1B72500DB481B /* skin.cpp in Sources */,
9551C8F20FC1B72500DB481B /* widget.cpp in Sources */,
9551C8F30FC1B72500DB481B /* race_gui.cpp in Sources */,
9551C8F50FC1B72500DB481B /* state_manager.cpp in Sources */,
9551C8F60FC1B72500DB481B /* input_manager.cpp in Sources */,
9551C8F70FC1B72500DB481B /* input_device.cpp in Sources */,
9551C8F80FC1B72500DB481B /* device_manager.cpp in Sources */,
9551C8F90FC1B72500DB481B /* physical_object.cpp in Sources */,
9551C8FA0FC1B72500DB481B /* quad_set.cpp in Sources */,
9551C8FB0FC1B72500DB481B /* quad_graph.cpp in Sources */,
9551C8FC0FC1B72500DB481B /* credits.cpp in Sources */,
9507E95C0FC1C8C200BD2B92 /* BMF_Api.cpp in Sources */,
9507E95E0FC1C8C200BD2B92 /* BMF_BitmapFont.cpp in Sources */,
9507E9600FC1C8C200BD2B92 /* BMF_font_helv10.cpp in Sources */,
@@ -2323,7 +2328,6 @@
953789730FC7829100DD1F8E /* graph_node.cpp in Sources */,
953789820FC7831400DD1F8E /* quad.cpp in Sources */,
95D1F5F70FC8C3E300FF6968 /* input.cpp in Sources */,
95D1F6190FC8CDBB00FF6968 /* options_screen.cpp in Sources */,
9540E24F0FD5F8A8002985B8 /* explosion.cpp in Sources */,
9540E2500FD5F8A8002985B8 /* material_manager.cpp in Sources */,
9540E2510FD5F8A8002985B8 /* material.cpp in Sources */,
@@ -2336,19 +2340,30 @@
95D950D20FE473CA002E10AD /* stk_config.cpp in Sources */,
95D950D30FE473CA002E10AD /* user_config.cpp in Sources */,
95D950DB0FE4741D002E10AD /* water_splash.cpp in Sources */,
954A57DC0FEC5AE40073C16C /* modaldialog.cpp in Sources */,
95CB476C0FF30EF400413BAE /* bezier_curve.cpp in Sources */,
954E4C2D0FF98B6F0047FE3E /* animation_base.cpp in Sources */,
954E4C2E0FF98B6F0047FE3E /* animation_manager.cpp in Sources */,
954E4C2F0FF98B6F0047FE3E /* billboard_animation.cpp in Sources */,
954E4C300FF98B6F0047FE3E /* three_d_animation.cpp in Sources */,
951BC65E0FFAF290006B5FF1 /* ipo.cpp in Sources */,
9516162D0FFFB12B004B16D8 /* kart_selection.cpp in Sources */,
955DE88310042701006A4F3C /* check_manager.cpp in Sources */,
955DE88C1004273B006A4F3C /* check_structure.cpp in Sources */,
955DE88D1004273B006A4F3C /* checkline.cpp in Sources */,
956D36A710095035007FCB95 /* player.cpp in Sources */,
958330391012248A00C5137E /* event_handler.cpp in Sources */,
958330CC10122B4A00C5137E /* engine.cpp in Sources */,
958330CD10122B4A00C5137E /* event_handler.cpp in Sources */,
958330CE10122B4A00C5137E /* modaldialog.cpp in Sources */,
958330CF10122B4A00C5137E /* my_button.cpp in Sources */,
958330D010122B4A00C5137E /* screen.cpp in Sources */,
958330D110122B4A00C5137E /* screen_loader.cpp in Sources */,
958330D210122B4A00C5137E /* skin.cpp in Sources */,
958330D310122B4A00C5137E /* widget.cpp in Sources */,
958330D410122B4A00C5137E /* credits.cpp in Sources */,
958330D510122B4A00C5137E /* kart_selection.cpp in Sources */,
958330D610122B4A00C5137E /* options_screen.cpp in Sources */,
958330D710122B4A00C5137E /* race_gui.cpp in Sources */,
958330D810122B4A00C5137E /* state_manager.cpp in Sources */,
9583319910123B0200C5137E /* abstract_state_manager.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@@ -6,8 +6,8 @@
#include "config/player.hpp"
#include "config/user_config.hpp"
#include "graphics/irr_driver.hpp"
#include "gui/kart_selection.hpp"
#include "gui/state_manager.hpp"
#include "states_screens/kart_selection.hpp"
#include "states_screens/state_manager.hpp"
#include "io/file_manager.hpp"
DeviceManager::DeviceManager()
@@ -148,7 +148,7 @@ bool DeviceManager::mapInputToPlayerAndAction( Input::InputType type, int device
if (m_assign_mode == DETECT_NEW && *action == PA_RESCUE)
{
if (value > Input::MAX_VALUE/2) StateManager::playerPressedRescue( *player );
if (value > Input::MAX_VALUE/2) KartSelectionScreen::playerPressedRescue( *player );
*action = PA_FIRST; // FIXME : returning PA_FIRST is quite a hackish way to tell input was handled internally
}
return true;
@@ -166,7 +166,8 @@ bool DeviceManager::mapInputToPlayerAndAction( Input::InputType type, int device
{
if(localaction == PA_FIRE)
{
if (value > Input::MAX_VALUE/2) StateManager::firePressedOnNewDevice( m_keyboards.get(n) );
if (value > Input::MAX_VALUE/2)
KartSelectionScreen::firePressedOnNewDevice( m_keyboards.get(n) );
}
*action = PA_FIRST; // FIXME : returning PA_FIRST is quite a hackish way to tell input was handled internally
@@ -228,7 +229,8 @@ bool DeviceManager::mapInputToPlayerAndAction( Input::InputType type, int device
PlayerAction localaction = PA_FIRST; // none
if (m_gamepads[n].hasBinding(type, btnID, value, NULL, &localaction) && localaction == PA_FIRE)
{
if (value > Input::MAX_VALUE/2) StateManager::firePressedOnNewDevice( m_gamepads.get(n) );
if (value > Input::MAX_VALUE/2)
KartSelectionScreen::firePressedOnNewDevice( m_gamepads.get(n) );
*action = PA_FIRST;
return true;
}
@@ -243,7 +245,7 @@ bool DeviceManager::mapInputToPlayerAndAction( Input::InputType type, int device
{
if (m_assign_mode == DETECT_NEW && *action == PA_RESCUE)
{
if (value > Input::MAX_VALUE/2) StateManager::playerPressedRescue( *player );
if (value > Input::MAX_VALUE/2) KartSelectionScreen::playerPressedRescue( *player );
*action = PA_FIRST; // FIXME : returning PA_FIRST is quite a hackish way to tell input was handled internally
}

View File

@@ -1,5 +1,5 @@
#include "gui/state_manager.hpp"
#include "states_screens/state_manager.hpp"
#include "input/input.hpp"
#include "input/input_device.hpp"
#include "modes/world.hpp"
@@ -289,7 +289,7 @@ void GamePadDevice::editBinding(const PlayerAction action, const Input::InputTyp
// -----------------------------------------------------------------------------
void GamePadDevice::resetAxisDirection(const int axis, Input::AxisDirection direction, ActivePlayer* player)
{
if(!StateManager::isGameState()) return; // ignore this while in menus
if(!StateManager::get()->isGameState()) return; // ignore this while in menus
PlayerKart* pk = player->getKart();
if (pk == NULL)

View File

@@ -29,12 +29,12 @@
#include "config/player.hpp"
#include "config/user_config.hpp"
#include "graphics/irr_driver.hpp"
#include "gui/options_screen.hpp"
#include "gui/state_manager.hpp"
#include "gui/modaldialog.hpp"
#include "gui/engine.hpp"
#include "gui/event_handler.hpp"
#include "gui/screen.hpp"
#include "states_screens/options_screen.hpp"
#include "states_screens/state_manager.hpp"
#include "guiengine/modaldialog.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/event_handler.hpp"
#include "guiengine/screen.hpp"
#include "input/device_manager.hpp"
#include "input/input.hpp"
#include "items/projectile_manager.hpp"
@@ -227,7 +227,7 @@ void InputManager::inputSensing(Input::InputType type, int deviceID, int btnID,
if( abs(value) < Input::MAX_VALUE/2 && m_sensed_input->deviceID == deviceID &&
m_sensed_input->btnID == btnID)
{
StateManager::gotSensedInput(m_sensed_input);
OptionsScreen::gotSensedInput(m_sensed_input);
}
}
@@ -257,7 +257,7 @@ void InputManager::input(Input::InputType type, int deviceID, int btnID, int axi
// in menus, some keyboard keys are standard (before each player selected his device)
// FIXME: should enter always work to accept for a player using keyboard?
if(!StateManager::isGameState() && type == Input::IT_KEYBOARD && m_mode == MENU &&
if(!StateManager::get()->isGameState() && type == Input::IT_KEYBOARD && m_mode == MENU &&
m_device_manager->playerAssignMode() == NO_ASSIGN)
{
action = PA_FIRST;
@@ -287,7 +287,7 @@ void InputManager::input(Input::InputType type, int deviceID, int btnID, int axi
else if (action_found)
{
// ... when in-game
if(StateManager::isGameState())
if(StateManager::get()->isGameState())
{
// Find the corresponding PlayerKart from our ActivePlayer instance
PlayerKart* pk = player->getKart();
@@ -406,7 +406,7 @@ bool InputManager::input(const SEvent& event)
// escape is a little special
if(key == KEY_ESCAPE)
{
StateManager::escapePressed();
StateManager::get()->escapePressed();
return true;
}

View File

@@ -49,8 +49,8 @@
#include "graphics/irr_driver.hpp"
#include "graphics/material_manager.hpp"
#include "graphics/scene.hpp"
#include "gui/engine.hpp"
#include "gui/state_manager.hpp"
#include "guiengine/engine.hpp"
#include "states_screens/state_manager.hpp"
#include "io/file_manager.hpp"
#include "input/input_manager.hpp"
#include "items/attachment_manager.hpp"
@@ -586,11 +586,13 @@ int main(int argc, char *argv[] )
attachment_manager -> loadModels ();
stk_scene = new Scene();
// prepare main menu
StateManager::initGUI();
// Init GUI prepare main menu
IrrlichtDevice* device = irr_driver->getDevice();
video::IVideoDriver* driver = device->getVideoDriver();
GUIEngine::init(device, driver, StateManager::get());
if(!UserConfigParams::m_no_start_screen) StateManager::pushMenu("main.stkgui");
else StateManager::enterGameState();
if(!UserConfigParams::m_no_start_screen) StateManager::get()->pushMenu("main.stkgui");
else StateManager::get()->enterGameState();
// Replay a race
// =============
@@ -630,7 +632,7 @@ int main(int argc, char *argv[] )
// Quickstart (-N)
// ===============
// all defaults are set in InitTuxkart()
StateManager::addActivePlayer( new ActivePlayer( &(UserConfigParams::m_all_players[0]) ) );
StateManager::get()->addActivePlayer( new ActivePlayer( &(UserConfigParams::m_all_players[0]) ) );
race_manager->setNumLocalPlayers(1);
race_manager->setLocalKartInfo(0, "tux");
network_manager->setupPlayerKartInfo();

View File

@@ -26,8 +26,8 @@
#include "graphics/irr_driver.hpp"
#include "graphics/material_manager.hpp"
#include "graphics/scene.hpp"
#include "gui/engine.hpp"
#include "gui/state_manager.hpp"
#include "guiengine/engine.hpp"
#include "states_screens/state_manager.hpp"
#include "input/input_manager.hpp"
#include "modes/world.hpp"
#include "network/network_manager.hpp"
@@ -78,7 +78,7 @@ float MainLoop::getLimitedDt()
// Throttle fps if more than maximum, which can reduce
// the noise the fan on a graphics card makes.
// When in menus, reduce FPS much, it's not necessary to push to the maximum for plain menus
const int max_fps = StateManager::isGameState() ? UserConfigParams::m_max_fps : 35;
const int max_fps = StateManager::get()->isGameState() ? UserConfigParams::m_max_fps : 35;
const int current_fps = (int)(1000.0f/dt);
if( current_fps > max_fps )
{

View File

@@ -32,8 +32,8 @@
#include "config/user_config.hpp"
#include "graphics/camera.hpp"
#include "graphics/scene.hpp"
#include "gui/state_manager.hpp"
#include "gui/race_gui.hpp"
#include "states_screens/state_manager.hpp"
#include "states_screens/race_gui.hpp"
#include "io/file_manager.hpp"
#include "items/item_manager.hpp"
#include "items/projectile_manager.hpp"
@@ -126,7 +126,7 @@ void World::init()
case RaceManager::KT_PLAYER:
std::cout << "===== World : creating player kart for kart #" << i << " which has local_player_id " << local_player_id << " ===========\n";
newkart = new PlayerKart(kart_name, position,
StateManager::getActivePlayer(local_player_id),
StateManager::get()->getActivePlayer(local_player_id),
init_pos, local_player_id);
m_player_karts[global_player_id] = (PlayerKart*)newkart;
m_local_player_karts[local_player_id] = static_cast<PlayerKart*>(newkart);

View File

@@ -29,7 +29,7 @@
#include "config/user_config.hpp"
#include "config/player.hpp"
#include "karts/kart_properties_manager.hpp"
#include "gui/state_manager.hpp"
#include "states_screens/state_manager.hpp"
#include "tracks/track_manager.hpp"
// ----------------------------------------------------------------------------
@@ -72,7 +72,7 @@ void ConnectMessage::setId()
{
char hostname[256];
gethostname(hostname, 255);
const std::string& id = StateManager::getActivePlayer(0)->getProfile()->getName();
const std::string& id = StateManager::get()->getActivePlayer(0)->getProfile()->getName();
std::ostringstream o;
o << id << '@' << hostname;
m_id = o.str();

View File

@@ -25,8 +25,8 @@
#include "config/user_config.hpp"
#include "config/stk_config.hpp"
#include "graphics/scene.hpp"
#include "gui/kart_selection.hpp"
#include "gui/state_manager.hpp"
#include "states_screens/kart_selection.hpp"
#include "states_screens/state_manager.hpp"
#include "input/device_manager.hpp"
#include "input/input_manager.hpp"
#include "karts/kart_properties_manager.hpp"
@@ -119,7 +119,7 @@ void RaceManager::setLocalKartInfo(unsigned int player_id, const std::string& ka
assert(0<=player_id && player_id <m_local_kart_info.size());
m_local_kart_info[player_id] = RemoteKartInfo(player_id, kart,
StateManager::getActivePlayer(player_id)->getProfile()->getName(),
StateManager::get()->getActivePlayer(player_id)->getProfile()->getName(),
network_manager->getMyHostId());
} // setLocalKartInfo
@@ -189,7 +189,7 @@ void RaceManager::startNew()
if(UserConfigParams::m_no_start_screen == true)
{
InputDevice* device = input_manager->getDeviceList()->getLatestUsedDevice();
StateManager::setPlayer0Device(device);
KartSelectionScreen::setPlayer0Device(device);
}
if(m_major_mode==MAJOR_MODE_GRAND_PRIX) // GP: get tracks and laps from grand prix
{

View File

@@ -16,7 +16,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "gui/credits.hpp"
#include "states_screens/credits.hpp"
#include <fstream>
@@ -25,7 +25,7 @@ using irr::core::stringw;
using irr::core::stringc;
#include "config/user_config.hpp"
#include "gui/engine.hpp"
#include "guiengine/engine.hpp"
#include "io/file_manager.hpp"

View File

@@ -21,10 +21,10 @@
#include "config/user_config.hpp"
#include "kart_selection.hpp"
#include "graphics/irr_driver.hpp"
#include "gui/widget.hpp"
#include "gui/engine.hpp"
#include "gui/screen.hpp"
#include "gui/state_manager.hpp"
#include "guiengine/widget.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/screen.hpp"
#include "states_screens/state_manager.hpp"
#include "input/input.hpp"
#include "input/input_manager.hpp"
#include "input/device_manager.hpp"
@@ -40,7 +40,7 @@ InputDevice* player_1_device = NULL;
using namespace GUIEngine;
namespace StateManager
namespace KartSelectionScreen
{
class PlayerKartWidget;
@@ -166,7 +166,7 @@ namespace StateManager
void setPlayerID(const int newPlayerID)
{
if (StateManager::getActivePlayers().get(newPlayerID) != m_associatedPlayer)
if (StateManager::get()->getActivePlayers().get(newPlayerID) != m_associatedPlayer)
{
std::cerr << "Internal inconsistency, PlayerKartWidget has IDs and pointers that do not correspond to one player\n";
assert(false);
@@ -417,7 +417,7 @@ void firePressedOnNewDevice(InputDevice* device)
g_player_karts.push_back(newPlayer);
newPlayer->add();
StateManager::addActivePlayer(aplayer);
StateManager::get()->addActivePlayer(aplayer);
aplayer->setDevice(device);
const int amount = g_player_karts.size();
@@ -452,7 +452,7 @@ void setPlayer0Device(InputDevice* device)
}
ActivePlayer* newPlayer = new ActivePlayer(UserConfigParams::m_all_players.get(0));
StateManager::addActivePlayer( newPlayer );
StateManager::get()->addActivePlayer( newPlayer );
newPlayer->setDevice(device);
input_manager->getDeviceList()->setAssignMode(DETECT_NEW);
@@ -483,14 +483,14 @@ void playerPressedRescue(ActivePlayer* player)
}
removedWidget = g_player_karts.remove(playerID);
StateManager::removeActivePlayer(playerID);
StateManager::get()->removeActivePlayer(playerID);
const int amount = g_player_karts.size();
Widget* fullarea = getCurrentScreen()->getWidget("playerskarts");
const int splitWidth = fullarea->w / amount;
assert( amount == StateManager::activePlayerCount() );
assert( amount == StateManager::get()->activePlayerCount() );
for (int n=0; n<amount; n++)
{
@@ -526,7 +526,7 @@ void kartSelectionUpdate(float delta)
/**
* Callback handling events from the kart selection menu
*/
void menuEventKarts(Widget* widget, std::string& name)
void menuEventKarts(Widget* widget, const std::string& name)
{
if(name == "init")
{
@@ -557,7 +557,8 @@ void menuEventKarts(Widget* widget, std::string& name)
}
PlayerKartWidget* playerKart1 = new PlayerKartWidget(StateManager::getActivePlayers().get(0), area, 0 /* first player */);
PlayerKartWidget* playerKart1 = new PlayerKartWidget(StateManager::get()->getActivePlayers().get(0),
area, 0 /* first player */);
getCurrentScreen()->manualAddWidget(playerKart1);
playerKart1->add();
g_player_karts.push_back(playerKart1);
@@ -575,7 +576,7 @@ void menuEventKarts(Widget* widget, std::string& name)
RibbonGridWidget* w = getCurrentScreen()->getWidget<RibbonGridWidget>("karts");
assert( w != NULL );
ptr_vector< ActivePlayer, HOLD >& players = StateManager::getActivePlayers();
ptr_vector< ActivePlayer, HOLD >& players = StateManager::get()->getActivePlayers();
std::cout << "==========\n" << players.size() << " players :\n";
for(int n=0; n<players.size(); n++)
{
@@ -601,7 +602,7 @@ void menuEventKarts(Widget* widget, std::string& name)
input_manager->getDeviceList()->setAssignMode(ASSIGN);
StateManager::pushMenu("racesetup.stkgui");
StateManager::get()->pushMenu("racesetup.stkgui");
}
}

View File

@@ -26,7 +26,7 @@ namespace GUIEngine
class InputDevice;
class ActivePlayer;
namespace StateManager
namespace KartSelectionScreen
{
void setPlayer0Device(InputDevice* device);
void firePressedOnNewDevice(InputDevice* device);
@@ -34,5 +34,5 @@ namespace StateManager
void kartSelectionUpdate(float delta);
void menuEventKarts(GUIEngine::Widget* widget, std::string& name);
void menuEventKarts(GUIEngine::Widget* widget, const std::string& name);
}

View File

@@ -20,12 +20,12 @@
#include "audio/sfx_base.hpp"
#include "config/player.hpp"
#include "graphics/irr_driver.hpp"
#include "gui/engine.hpp"
#include "gui/modaldialog.hpp"
#include "gui/options_screen.hpp"
#include "gui/screen.hpp"
#include "gui/state_manager.hpp"
#include "gui/widget.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/modaldialog.hpp"
#include "states_screens/options_screen.hpp"
#include "guiengine/screen.hpp"
#include "states_screens/state_manager.hpp"
#include "guiengine/widget.hpp"
#include "input/input_manager.hpp"
#include "input/device_manager.hpp"
@@ -36,7 +36,7 @@ using namespace GUIEngine;
/**
* Callback handling events from the options menus
*/
namespace StateManager
namespace OptionsScreen
{
void eventInput(Widget* widget, const std::string& name);
@@ -597,13 +597,13 @@ namespace StateManager
{
std::string selection = ((RibbonWidget*)widget)->getSelectionIDString().c_str();
if(selection == "audio_video") StateManager::replaceTopMostMenu("options_av.stkgui");
else if(selection == "players") StateManager::replaceTopMostMenu("options_players.stkgui");
else if(selection == "controls") StateManager::replaceTopMostMenu("options_input.stkgui");
if(selection == "audio_video") StateManager::get()->replaceTopMostMenu("options_av.stkgui");
else if(selection == "players") StateManager::get()->replaceTopMostMenu("options_players.stkgui");
else if(selection == "controls") StateManager::get()->replaceTopMostMenu("options_input.stkgui");
}
else if(name == "back")
{
StateManager::escapePressed();
StateManager::get()->escapePressed();
}
else
{

View File

@@ -29,7 +29,7 @@ namespace GUIEngine
struct Input;
namespace StateManager
namespace OptionsScreen
{
void menuEventOptions(GUIEngine::Widget* widget, const std::string& name);

View File

@@ -18,7 +18,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "gui/race_gui.hpp"
#include "states_screens/race_gui.hpp"
#include "audio/sound_manager.hpp"
#include "config/user_config.hpp"

View File

@@ -0,0 +1,409 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2009 Marianne Gagnon
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "states_screens/state_manager.hpp"
#include <vector>
#include "main_loop.hpp"
#include "audio/sound_manager.hpp"
#include "config/player.hpp"
#include "config/user_config.hpp"
#include "graphics/irr_driver.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/modaldialog.hpp"
#include "guiengine/screen.hpp"
#include "guiengine/widget.hpp"
#include "input/device_manager.hpp"
#include "input/input_manager.hpp"
#include "io/file_manager.hpp"
#include "network/network_manager.hpp"
#include "race/race_manager.hpp"
#include "states_screens/options_screen.hpp"
#include "states_screens/kart_selection.hpp"
#include "states_screens/credits.hpp"
#include "utils/translation.hpp"
using namespace GUIEngine;
StateManager* state_manager_singleton = NULL;
StateManager* StateManager::get()
{
if (state_manager_singleton == NULL) state_manager_singleton = new StateManager();
return state_manager_singleton;
}
#if 0
#pragma mark -
#pragma mark Player Management
#endif
ptr_vector<ActivePlayer, HOLD>& StateManager::getActivePlayers()
{
return m_active_players;
}
ActivePlayer* StateManager::getActivePlayer(const int id)
{
return m_active_players.get(id);
}
void StateManager::addActivePlayer(ActivePlayer* p)
{
m_active_players.push_back(p);
}
void StateManager::removeActivePlayer(int id)
{
m_active_players.erase(id);
}
int StateManager::activePlayerCount()
{
return m_active_players.size();
}
void StateManager::resetActivePlayers()
{
const int amount = m_active_players.size();
for(int i=0; i<amount; i++)
{
m_active_players[i].setDevice(NULL);
}
m_active_players.clearWithoutDeleting();
}
#if 0
#pragma mark -
#pragma mark Callbacks
#endif
// -------------------------------------------------------------------------
/**
* Callback handling events from the main menu
*/
void StateManager::menuEventMain(Widget* widget, const std::string& name)
{
RibbonWidget* ribbon = dynamic_cast<RibbonWidget*>(widget);
if(ribbon == NULL) return; // only interesting stuff in main menu is the ribbons
std::string selection = ribbon->getSelectionIDString().c_str();
if(selection == "new")
{
InputDevice* device = input_manager->getDeviceList()->getLatestUsedDevice();
KartSelectionScreen::setPlayer0Device(device);
pushMenu("karts.stkgui");
}
else if(selection == "options")
{
StateManager::pushMenu("options_av.stkgui");
}
else if(selection == "quit")
{
main_loop->abort();
return;
}
else if (selection == "about")
{
pushMenu("credits.stkgui");
}
else if (selection == "help")
{
pushMenu("help1.stkgui");
}
}
// -------------------------------------------------------------------------
/**
* Callback handling events from the race setup menu
*/
void StateManager::menuEventRaceSetup(Widget* widget, const std::string& name)
{
if(name == "init")
{
RibbonWidget* w = getCurrentScreen()->getWidget<RibbonWidget>("difficulty");
assert( w != NULL );
w->setSelection(UserConfigParams::m_difficulty);
race_manager->setDifficulty( (RaceManager::Difficulty)(int)UserConfigParams::m_difficulty );
SpinnerWidget* kartamount = getCurrentScreen()->getWidget<SpinnerWidget>("aikartamount");
race_manager->setNumKarts( kartamount->getValue() + 1 );
RibbonGridWidget* w2 = getCurrentScreen()->getWidget<RibbonGridWidget>("gamemode");
assert( w2 != NULL );
if(!getCurrentScreen()->m_inited)
{
w2->addItem( _("Snaky Competition\nAll blows allowed, so catch weapons and make clever use of them!"),
"normal",
"gui/mode_normal.png");
w2->addItem( _("Time Trial\nContains no powerups, so only your driving skills matter!"),
"timetrial",
"gui/mode_tt.png");
w2->addItem( _("Follow the Leader\nrun for second place, as the last kart will be disqualified every time the counter hits zero. Beware : going in front of the leader will get you eliminated too!"),
"ftl",
"gui/mode_ftl.png");
w2->addItem( _("3-Strikes Battle\nonly in multiplayer games. Hit others with weapons until they lose all their lives."),
"3strikes",
"gui/mode_3strikes.png");
getCurrentScreen()->m_inited = true;
}
w2->updateItemDisplay();
}
else if(name == "difficulty")
{
RibbonWidget* w = dynamic_cast<RibbonWidget*>(widget);
assert(w != NULL);
const std::string& selection = w->getSelectionIDString();
if(selection == "novice")
race_manager->setDifficulty(RaceManager::RD_EASY);
else if(selection == "intermediate")
race_manager->setDifficulty(RaceManager::RD_MEDIUM);
else if(selection == "expert")
race_manager->setDifficulty(RaceManager::RD_HARD);
}
else if(name == "gamemode")
{
// TODO - detect more game modes
RibbonGridWidget* w = dynamic_cast<RibbonGridWidget*>(widget);
if(w->getSelectionIDString() == "normal")
{
pushMenu("tracks.stkgui");
}
}
else if(name == "aikartamount")
{
SpinnerWidget* w = dynamic_cast<SpinnerWidget*>(widget);
race_manager->setNumKarts( w->getValue() );
}
/*
289 race_manager->setDifficulty((RaceManager::Difficulty)m_difficulty);
290 UserConfigParams::setDefaultNumDifficulty(m_difficulty);
// if there is no AI, there's no point asking the player for the amount of karts.
299 // It will always be the same as the number of human players
300 if(RaceManager::isBattleMode( race_manager->getMinorMode() ))
301 {
302 race_manager->setNumKarts(race_manager->getNumLocalPlayers());
303 // Don't change the default number of karts in user_config
304 }
305 else
306 {
307 race_manager->setNumKarts(m_num_karts);
308 UserConfigParams::setDefaultNumKarts(race_manager->getNumKarts());
309 }
311 if( race_manager->getMajorMode() != RaceManager::MAJOR_MODE_GRAND_PRIX &&
312 RaceManager::modeHasLaps( race_manager->getMinorMode() ) )
313 {
314 race_manager->setNumLaps( m_num_laps );
315 UserConfigParams::setDefaultNumLaps(m_num_laps);
316 }
317 // Might still be set from a previous challenge
318 race_manager->setCoinTarget(0);
input_manager->setMode(InputManager::INGAME);
race_manager->setLocalKartInfo(0, argv[i+1]);
race_manager->setDifficulty(RaceManager::RD_EASY);
race_manager->setDifficulty(RaceManager::RD_HARD);
race_manager->setDifficulty(RaceManager::RD_HARD);
race_manager->setTrack(argv[i+1]);
UserConfigParams::setDefaultNumKarts(stk_config->m_max_karts);
race_manager->setNumKarts(UserConfigParams::getDefaultNumKarts() );
UserConfigParams::getDefaultNumKarts()
StateManager::enterGameState();
race_manager->startNew();
*/
}
// -------------------------------------------------------------------------
/**
* Callback handling events from the track menu
*/
void StateManager::menuEventTracks(Widget* widget, const std::string& name)
{
if(name == "init")
{
RibbonGridWidget* w = getCurrentScreen()->getWidget<RibbonGridWidget>("tracks");
assert( w != NULL );
if(!getCurrentScreen()->m_inited)
{
w->addItem("Track 1","t1","gui/track1.png");
w->addItem("Track 2","t2","gui/track2.png");
w->addItem("Track 3","t3","gui/track3.png");
w->addItem("Track 4","t4","gui/track4.png");
w->addItem("Track 5","t5","gui/track5.png");
w->addItem("Track 6","t6","gui/track6.png");
w->addItem("Track 7","t7","gui/track7.png");
w->addItem("Track 8","t8","gui/track8.png");
getCurrentScreen()->m_inited = true;
}
w->updateItemDisplay();
}
// -- track seelction screen
if(name == "tracks")
{
RibbonGridWidget* w2 = dynamic_cast<RibbonGridWidget*>(widget);
if(w2 != NULL)
{
std::cout << "Clicked on track " << w2->getSelectionIDString().c_str() << std::endl;
ITexture* screenshot = GUIEngine::getDriver()->getTexture( (file_manager->getDataDir() + "/gui/track1.png").c_str() );
new TrackInfoDialog( w2->getSelectionText().c_str(), screenshot, 0.8f, 0.7f);
}
}
else if(name == "gps")
{
RibbonWidget* w = dynamic_cast<RibbonWidget*>(widget);
if(w != NULL)
std::cout << "Clicked on GrandPrix " << w->getSelectionIDString().c_str() << std::endl;
}
}
// -----------------------------------------------------------------------------
/**
* Callback handling events from the options menus
*/
void StateManager::menuEventHelp(Widget* widget, const std::string& name)
{
if(name == "init")
{
RibbonWidget* w = getCurrentScreen()->getWidget<RibbonWidget>("category");
if(w != NULL)
{
const std::string& screen_name = getCurrentScreen()->getName();
if(screen_name == "help1.stkgui") w->select( "page1" );
else if(screen_name == "help2.stkgui") w->select( "page2" );
else if(screen_name == "help3.stkgui") w->select( "page3" );
}
}
// -- options
else if(name == "category")
{
std::string selection = ((RibbonWidget*)widget)->getSelectionIDString().c_str();
if(selection == "page1") replaceTopMostMenu("help1.stkgui");
else if(selection == "page2") replaceTopMostMenu("help2.stkgui");
else if(selection == "page3") replaceTopMostMenu("help3.stkgui");
}
else if(name == "back")
{
escapePressed();
}
}
// -------------------------------------------------------------------------
/**
* All widget events will be dispatched to this function; arguments are
* a pointer to the widget from which the event originates, and its internal
* name. There is one exception : right after showing a new screen, an event with
* name 'init' and widget set to NULL will be fired, so the screen can be filled
* with the right values or so.
*/
void StateManager::eventCallback(Widget* widget, const std::string& name)
{
std::cout << "event!! " << name.c_str() << std::endl;
const std::string& screen_name = getCurrentScreen()->getName();
if( screen_name == "main.stkgui" )
menuEventMain(widget, name);
else if( screen_name == "karts.stkgui" )
KartSelectionScreen::menuEventKarts(widget, name);
else if( screen_name == "racesetup.stkgui" )
menuEventRaceSetup(widget, name);
else if( screen_name == "tracks.stkgui" )
menuEventTracks(widget, name);
else if( screen_name == "options_av.stkgui" || screen_name == "options_input.stkgui" || screen_name == "options_players.stkgui")
OptionsScreen::menuEventOptions(widget, name);
else if( screen_name == "help1.stkgui" || screen_name == "help2.stkgui" || screen_name == "help3.stkgui")
menuEventHelp(widget, name);
else if( screen_name == "credits.stkgui" )
{
if(name == "init")
{
Widget* w = getCurrentScreen()->getWidget<Widget>("animated_area");
assert(w != NULL);
Credits* credits = Credits::getInstance();
credits->reset();
credits->setArea(w->x, w->y, w->w, w->h);
}
else if(name == "back")
{
StateManager::escapePressed();
}
}
else
std::cerr << "Warning, unknown menu " << screen_name << " in event callback\n";
}
void StateManager::escapePressed()
{
// in input sensing mode
if(input_manager->isInMode(InputManager::INPUT_SENSE_KEYBOARD) ||
input_manager->isInMode(InputManager::INPUT_SENSE_GAMEPAD) )
{
ModalDialog::dismiss();
input_manager->setMode(InputManager::MENU);
}
// when another modal dialog is visible
else if(ModalDialog::isADialogActive())
{
ModalDialog::dismiss();
}
// In-game
else if(m_game_mode)
{
// TODO : show in-game menu
resetAndGoToMenu("main.stkgui");
}
// In menus
else
{
popMenu();
}
}
void StateManager::onUpdate(float elapsed_time)
{
// FIXME : don't hardcode?
if (getCurrentScreen()->getName() == "credits.stkgui")
Credits::getInstance()->render(elapsed_time);
else if (getCurrentScreen()->getName() == "karts.stkgui")
KartSelectionScreen::kartSelectionUpdate(elapsed_time);
}

View File

@@ -20,23 +20,34 @@
#define STATE_MANAGER_HPP
#include <string>
#include "guiengine/abstract_state_manager.hpp"
#include "utils/ptr_vector.hpp"
struct Input;
class ActivePlayer;
namespace StateManager
namespace GUIEngine
{
void initGUI();
void pushMenu(std::string name);
void replaceTopMostMenu(std::string name);
void popMenu();
void resetAndGoToMenu(std::string name);
void enterGameState();
bool isGameState();
void reshowTopMostMenu();
class Widget;
}
class StateManager : public GUIEngine::AbstractStateManager
{
/**
* A list of all currently playing players.
*/
ptr_vector<ActivePlayer, HOLD> m_active_players;
/** The main 'eventCallback' will dispatch to one of those.
* A few screens have their callbacks in a file of their own because they are
* too big to fit in here.
*/
void menuEventHelp ( GUIEngine::Widget* widget, const std::string& name );
void menuEventTracks ( GUIEngine::Widget* widget, const std::string& name );
void menuEventRaceSetup ( GUIEngine::Widget* widget, const std::string& name );
void menuEventMain ( GUIEngine::Widget* widget, const std::string& name );
public:
ptr_vector<ActivePlayer, HOLD>& getActivePlayers();
ActivePlayer* getActivePlayer(const int id);
@@ -51,6 +62,12 @@ namespace StateManager
void resetActivePlayers();
void escapePressed();
}
void onUpdate(float elpased_time);
void eventCallback(GUIEngine::Widget* widget, const std::string& name);
// singleton
static StateManager* get();
};
#endif