Correct a few FIXMEs + minor style improvements

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7227 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-01-03 18:23:52 +00:00
parent d5b619be98
commit 6ad54434e0
8 changed files with 39 additions and 33 deletions

View File

@ -151,6 +151,19 @@ public:
}
}
static bool hasAI(const MinorRaceModeType mode)
{
switch (mode)
{
case MINOR_MODE_NORMAL_RACE: return true;
case MINOR_MODE_TIME_TRIAL: return true;
case MINOR_MODE_FOLLOW_LEADER: return true;
case MINOR_MODE_3_STRIKES: return false;
default: assert(false); return NULL;
}
}
// ------------------------------------------------------------------------
/** Returns the minor mode id from a string identifier. This function is
* used from challenge_data, which reads the mode from a challenge file.

View File

@ -26,17 +26,13 @@
#include "io/file_manager.hpp"
#include "modes/world_with_rank.hpp"
#include "states_screens/dialogs/race_over_dialog.hpp"
#include "states_screens/feature_unlocked.hpp"
#include "states_screens/main_menu_screen.hpp"
#include "states_screens/race_setup_screen.hpp"
#include "utils/string_utils.hpp"
DEFINE_SCREEN_SINGLETON( RaceResultGUI );
// FIXME: debug only!!!!!!!!!
#include "karts/kart_properties_manager.hpp"
#include "states_screens/feature_unlocked.hpp"
// FIXME: debug end
/** Constructor, initialises internal data structures.
*/
RaceResultGUI::RaceResultGUI() : Screen("race_result.stkgui", /*pause race*/ false)

View File

@ -99,19 +99,19 @@ void RaceSetupScreen::eventCallback(Widget* widget, const std::string& name, con
DynamicRibbonWidget* w = dynamic_cast<DynamicRibbonWidget*>(widget);
const std::string selectedMode = w->getSelectionIDString(PLAYER_ID_GAME_MASTER);
if (selectedMode == "normal")
if (selectedMode == IDENT_STD)
{
race_manager->setMinorMode(RaceManager::MINOR_MODE_NORMAL_RACE);
UserConfigParams::m_game_mode = CONFIG_CODE_NORMAL;
StateManager::get()->pushScreen( TracksScreen::getInstance() );
}
else if (selectedMode == "timetrial")
else if (selectedMode == IDENT_TTRIAL)
{
race_manager->setMinorMode(RaceManager::MINOR_MODE_TIME_TRIAL);
UserConfigParams::m_game_mode = CONFIG_CODE_TIMETRIAL;
StateManager::get()->pushScreen( TracksScreen::getInstance() );
}
else if (selectedMode == "ftl")
else if (selectedMode == FTL_IDENT)
{
// Make sure there are at least three karts, otherwise FTL doesn't
if(race_manager->getNumberOfKarts()<3)
@ -121,7 +121,7 @@ void RaceSetupScreen::eventCallback(Widget* widget, const std::string& name, con
UserConfigParams::m_game_mode = CONFIG_CODE_FTL;
StateManager::get()->pushScreen( TracksScreen::getInstance() );
}
else if (selectedMode == "3strikes")
else if (selectedMode == STRIKES_IDENT)
{
race_manager->setMinorMode(RaceManager::MINOR_MODE_3_STRIKES);
UserConfigParams::m_game_mode = CONFIG_CODE_3STRIKES;
@ -148,12 +148,12 @@ void RaceSetupScreen::onGameModeChanged()
DynamicRibbonWidget* w2 = getWidget<DynamicRibbonWidget>("gamemode");
assert( w2 != NULL );
std::string gamemode = w2->getSelectionIDString(PLAYER_ID_GAME_MASTER);
std::string gamemode_str = w2->getSelectionIDString(PLAYER_ID_GAME_MASTER);
RaceManager::MinorRaceModeType gamemode = RaceManager::getModeIDFromInternalName(gamemode_str.c_str());
// deactivate the AI karts count widget for modes for which we have no AI
//FIXME? Don't hardcode here which modes have an AI and which don't
SpinnerWidget* kartamount = getWidget<SpinnerWidget>("aikartamount");
if (gamemode == "3strikes")
if (!RaceManager::hasAI(gamemode))
{
kartamount->setDeactivated();
@ -199,13 +199,13 @@ void RaceSetupScreen::init()
//FIXME: avoid duplicating descriptions from the help menu!
name1 += _("All blows allowed, so catch weapons and make clever use of them!");
w2->addItem( name1, "normal", RaceManager::getIconOf(RaceManager::MINOR_MODE_NORMAL_RACE));
w2->addItem( name1, IDENT_STD, RaceManager::getIconOf(RaceManager::MINOR_MODE_NORMAL_RACE));
irr::core::stringw name2 = irr::core::stringw(
RaceManager::getNameOf(RaceManager::MINOR_MODE_TIME_TRIAL)) + L"\n";
//FIXME: avoid duplicating descriptions from the help menu!
name2 += _("Contains no powerups, so only your driving skills matter!");
w2->addItem( name2, "timetrial", RaceManager::getIconOf(RaceManager::MINOR_MODE_TIME_TRIAL));
w2->addItem( name2, IDENT_TTRIAL, RaceManager::getIconOf(RaceManager::MINOR_MODE_TIME_TRIAL));
if (unlock_manager->isLocked("followtheleader"))
{
@ -218,7 +218,7 @@ void RaceSetupScreen::init()
RaceManager::getNameOf(RaceManager::MINOR_MODE_FOLLOW_LEADER)) + L"\n";
//I18N: short definition for follow-the-leader game mode
name3 += _("Keep up with the leader kart but don't overtake it!");
w2->addItem(name3, "ftl", RaceManager::getIconOf(RaceManager::MINOR_MODE_FOLLOW_LEADER), false);
w2->addItem(name3, FTL_IDENT, RaceManager::getIconOf(RaceManager::MINOR_MODE_FOLLOW_LEADER), false);
}
if (race_manager->getNumPlayers() > 1)
@ -227,7 +227,7 @@ void RaceSetupScreen::init()
RaceManager::getNameOf(RaceManager::MINOR_MODE_3_STRIKES)) + L"\n";
//FIXME: avoid duplicating descriptions from the help menu!
name4 += _("Hit others with weapons until they lose all their lives. (Only in multiplayer games)");
w2->addItem( name4, "3strikes", RaceManager::getIconOf(RaceManager::MINOR_MODE_3_STRIKES));
w2->addItem( name4, STRIKES_IDENT, RaceManager::getIconOf(RaceManager::MINOR_MODE_3_STRIKES));
}
@ -237,16 +237,16 @@ void RaceSetupScreen::init()
switch (UserConfigParams::m_game_mode)
{
case CONFIG_CODE_NORMAL :
w2->setSelection("normal", PLAYER_ID_GAME_MASTER, true);
w2->setSelection(IDENT_STD, PLAYER_ID_GAME_MASTER, true);
break;
case CONFIG_CODE_TIMETRIAL :
w2->setSelection("timetrial", PLAYER_ID_GAME_MASTER, true);
w2->setSelection(IDENT_TTRIAL, PLAYER_ID_GAME_MASTER, true);
break;
case CONFIG_CODE_FTL :
w2->setSelection("ftl", PLAYER_ID_GAME_MASTER, true);
w2->setSelection(FTL_IDENT, PLAYER_ID_GAME_MASTER, true);
break;
case CONFIG_CODE_3STRIKES :
w2->setSelection("3strikes", PLAYER_ID_GAME_MASTER, true);
w2->setSelection(STRIKES_IDENT, PLAYER_ID_GAME_MASTER, true);
break;
}

View File

@ -552,7 +552,6 @@ int QuadGraph::findOutOfRoadSector(const Vec3& xyz,
//-----------------------------------------------------------------------------
/** Takes a snapshot of the driveline quads so they can be used as minimap.
* \param where the top left and lower right corner for the mini map. ??? FIXME
*/
video::ITexture *QuadGraph::makeMiniMap(const core::dimension2du &dimension,
const std::string &name,

View File

@ -70,24 +70,24 @@ void QuadSet::getPoint(const XMLNode *xml, const std::string &attribute_name,
} // getPoint
// -----------------------------------------------------------------------------
void QuadSet::load(const std::string &filename) {
void QuadSet::load(const std::string &filename)
{
m_min = Vec3( 99999, 99999, 99999);
m_max = Vec3(-99999, -99999, -99999);
XMLNode *xml = file_manager->createXMLTree(filename);
if(!xml || xml->getName()!="quads")
{
fprintf(stderr, "QuadSet '%s' not found.\n", filename.c_str());
fprintf(stderr, "[QuadSet::load] ERROR : QuadSet '%s' not found.\n", filename.c_str());
return;
//FIXME exit(-1);
}
for(unsigned int i=0; i<xml->getNumNodes(); i++)
{
const XMLNode *xml_node = xml->getNode(i);
if(xml_node->getName()!="quad")
{
printf("Unsupported node type '%s' found in '%s' - ignored.\n",
xml_node->getName().c_str(), filename.c_str());
printf("[QuadSet::load] WARNING: Unsupported node type '%s' found in '%s' - ignored.\n",
xml_node->getName().c_str(), filename.c_str());
continue;
}
Vec3 p0, p1, p2, p3;

View File

@ -393,10 +393,12 @@ void Track::convertTrackToBullet(scene::ISceneNode *node)
// overwrite the elements on the diagonal, making any rotation incorrect.
mat_scale.setScale(scale);
mat *= mat_scale;
for(unsigned int i=0; i<mesh->getMeshBufferCount(); i++) {
for(unsigned int i=0; i<mesh->getMeshBufferCount(); i++)
{
scene::IMeshBuffer *mb = mesh->getMeshBuffer(i);
// FIXME: take translation/rotation into account
if(mb->getVertexType()!=video::EVT_STANDARD) {
if(mb->getVertexType()!=video::EVT_STANDARD)
{
fprintf(stderr, "WARNING: Physics::convertTrack: Ignoring type '%d'!",
mb->getVertexType());
continue;

View File

@ -90,9 +90,6 @@ TrackObject::TrackObject(const XMLNode &xml_node)
m_node->setPosition(m_init_xyz);
m_node->setRotation(m_init_hpr);
m_node->setScale(m_init_scale);
// FIXME (to-be-removed) If something looks polygonal
// re-export with normals instead of setting false here
//m_node->setMaterialFlag(video::EMF_LIGHTING, false);
}
reset();
} // TrackObject

View File

@ -73,7 +73,6 @@ Translations::Translations()
if (sizeof(wchar_t) == 4)
{
// FIXME: will probably not work on PPC maccs
if (IS_LITTLE_ENDIAN) bind_textdomain_codeset(PACKAGE, "UTF-32LE");
else bind_textdomain_codeset(PACKAGE, "UTF-32BE");
}
@ -187,7 +186,7 @@ const wchar_t* Translations::w_gettext(const char* original)
}
//std::cout << " (len=" << len << ")\n";
FriBidiCharType pbase_dir = FRIBIDI_TYPE_ON; //FIXME: what's that?
FriBidiCharType pbase_dir = FRIBIDI_TYPE_ON; // Not sure what's that for, but it seems to work...
static FriBidiChar fribidiOutput[FRIBIDI_BUFFER_SIZE];
for (n = 0; n < 512 ; n++) { fribidiOutput[n] = 0; }