minor cleanup; removed some code from old input module that was left over and not used; replaced 'hello's in the GUI with a more appropriate empty label

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3533 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2009-05-23 23:04:57 +00:00
parent 4f2574818d
commit becdbdf2f5
4 changed files with 28 additions and 99 deletions

View File

@ -136,86 +136,6 @@ void IrrDriver::initDevice()
m_race_font = m_gui_env->getFont(font.c_str());
}
//-----------------------------------------------------------------------------
/** Toggles to fullscreen mode.
*/
// TODO
/*
void toggleFullscreen(bool resetTextures)
{
user_config->m_fullscreen = !user_config->m_fullscreen;
if(user_config->m_fullscreen)
{
if(StateManager::isGameState())
showPointer();
// Store settings in user config file in case new video mode
// causes a crash
user_config->m_crashed = true; //set flag.
user_config->saveConfig();
}
else if(StateManager::isGameState())
hidePointer();
// setVideoMode(resetTextures);
} // toggleFullscreen
*/
// -----------------------------------------------------------------------------
// TODO
/** Sets the video mode. If 8 bit colours are not supported, 5 bits are used;
* and if this doesn't work, alpha is disabled, too - before giving up. So
* STK should now work with 16 bit windows.
* \param resetTextures Forces all textures to be reloaded after a change of
* resolution. Necessary with windows and Macs OpenGL
* versions.
*/
/*
void setVideoMode(bool resetTextures)
{
#if defined(WIN32) || defined(__APPLE__)
if(resetTextures)
{
// FIXME: clear texture cache here
// Windows needs to reload all textures, display lists, ... which means
// that all models have to be reloaded. So first, free all textures,
// models, then reload the textures from materials.dat, then reload
// all models, textures etc.
// startScreen -> removeTextures();
attachment_manager -> removeTextures();
projectile_manager -> removeTextures();
item_manager -> removeTextures();
kart_properties_manager -> removeTextures();
powerup_manager -> removeTextures();
material_manager->reInit();
powerup_manager -> loadPowerups();
kart_properties_manager -> loadKartData();
item_manager -> loadDefaultItems();
projectile_manager -> loadData();
attachment_manager -> loadModels();
// startScreen -> installMaterial();
//FIXME: the font reinit funcs should be inside the font class
//Reinit fonts
delete_fonts();
init_fonts();
//TODO: this function probably will get deleted in the future; if
//so, the widget_manager.hpp include has no other reason to be here.
//widget_manager->reloadFonts();
}
#endif
} // setVideoMode
*/
//-----------------------------------------------------------------------------
void IrrDriver::showPointer()
{

View File

@ -895,7 +895,7 @@ void RibbonGridWidget::add()
// set size to get proper ratio (as most textures are saved scaled down to 256x256)
icon->m_properties[PROP_WIDTH] = m_properties[PROP_CHILD_WIDTH];
icon->m_properties[PROP_HEIGHT] = m_properties[PROP_CHILD_HEIGHT];
if(m_properties[PROP_TEXT] == "all") icon->m_properties[PROP_TEXT] = "hello";
if(m_properties[PROP_TEXT] == "all") icon->m_properties[PROP_TEXT] = " ";
// std::cout << "ribbon text = " << m_properties[PROP_TEXT].c_str() << std::endl;

View File

@ -137,7 +137,7 @@ void UserConfig::setDefaults()
}
// Clear every entry.
memset(m_input_map, 0, sizeof(m_input_map));
//memset(m_input_map, 0, sizeof(m_input_map));
} // setDefaults
@ -361,7 +361,7 @@ void UserConfig::loadConfig(const std::string& filename)
lisp->get("background", m_background_index);
// Handle loading the stick config in it own method.
readStickConfigs(lisp);
//readStickConfigs(lisp);
// Address of server
lisp->get("server-address", m_server_address);
@ -449,6 +449,7 @@ void UserConfig::loadConfig(const std::string& filename)
} // loadConfig
// -----------------------------------------------------------------------------
/*
void UserConfig::readStickConfigs(const lisp::Lisp *r)
{
std::string temp;
@ -479,7 +480,7 @@ void UserConfig::readStickConfigs(const lisp::Lisp *r)
}
}
} // readStickConfigs
*/
// -----------------------------------------------------------------------------
/** Write settings to config file. */
void UserConfig::saveConfig(const std::string& filename)
@ -547,7 +548,7 @@ void UserConfig::saveConfig(const std::string& filename)
writer->write("server-address", m_server_address);
writer->write("server-port", m_server_port);
writeStickConfigs(writer);
//writeStickConfigs(writer);
// Write unlock information back
writer->beginList("unlock-info");
@ -586,6 +587,7 @@ void UserConfig::saveConfig(const std::string& filename)
} // saveConfig
// -----------------------------------------------------------------------------
/*
void UserConfig::writeStickConfigs(lisp::Writer *writer)
{
int count = 0;
@ -614,7 +616,7 @@ void UserConfig::writeStickConfigs(lisp::Writer *writer)
writer->endList("stick-configs");
} // writeStickConfigs
*/
// -----------------------------------------------------------------------------
std::string UserConfig::getInputAsString(const Input &input)
{
@ -709,6 +711,7 @@ void UserConfig::unsetDuplicates(GameAction ga, const Input &i)
} // unsetDuplicates
#endif
// -----------------------------------------------------------------------------
/*
void UserConfig::setStaticAction(StaticAction ga, const Input &i)
{
m_input_map[ga].count = 1;
@ -739,7 +742,7 @@ void UserConfig::setStaticAction(StaticAction ga, const Input &i0, const Input &
m_input_map[ga].inputs[2] = i2;
m_input_map[ga].inputs[3] = i3;
} // set(4 inputs)
*/
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -59,6 +59,7 @@ class UserConfig
{
public:
/** Stores information about joystick and gamepads. */
/*
class StickConfig
{
public:
@ -67,29 +68,33 @@ public:
int m_deadzone;
StickConfig(const std::string &id) : m_id(id) {}
};
*/
private:
// This class stores the last used input configuration (i.e. which action
// is used for left, right, ..., look back) for a certain input
// device (i.e. keyboard, joystick, ...)
/*
struct InputConfiguration
{
Input m_input[PA_COUNT];
};
*/
// The mapping of input device name to the last used configuration.
// Note that std::map can not be used with Input[KC_COUNT] as 2nd
// parameter
std::map<std::string, InputConfiguration> m_last_input_configuration;
// std::map<std::string, InputConfiguration> m_last_input_configuration;
std::string getInputDeviceName(int player_index) const;
std::vector <StickConfig *> m_stickconfigs;
//std::string getInputDeviceName(int player_index) const;
//std::vector <StickConfig *> m_stickconfigs;
/*
typedef struct
{
int count;
Input inputs[4];
} InputMapEntry;
*/
/** Filename of the user config file. */
std::string m_filename;
@ -101,7 +106,7 @@ private:
*
* It is named after what is put in as values.
*/
InputMapEntry m_input_map[GA_COUNT];
//InputMapEntry m_input_map[GA_COUNT];
void setFilename ();
@ -119,9 +124,9 @@ private:
/** Index of current background image. */
int m_background_index;
void readStickConfigs(const lisp::Lisp *);
//void readStickConfigs(const lisp::Lisp *);
void writeStickConfigs(lisp::Writer *);
//void writeStickConfigs(lisp::Writer *);
/** Iterates through the input mapping and unsets all
* where the given input occurs.
@ -131,16 +136,16 @@ private:
void unsetDuplicates(PlayerAction, const Input &);
/** Creates an GameAction->Input mapping with one Input */
void setStaticAction(StaticAction, const Input &);
//void setStaticAction(StaticAction, const Input &);
/** Creates an GameAction->Input mapping with two Inputs */
void setStaticAction(StaticAction, const Input &, const Input &);
//void setStaticAction(StaticAction, const Input &, const Input &);
/** Creates an GameAction->Input mapping with three Inputs */
void setStaticAction(StaticAction, const Input &, const Input &, const Input &);
//void setStaticAction(StaticAction, const Input &, const Input &, const Input &);
/** Creates an GameAction->Input mapping with four Inputs */
void setStaticAction(StaticAction, const Input &, const Input &, const Input &, const Input &);
//void setStaticAction(StaticAction, const Input &, const Input &, const Input &, const Input &);
std::string getInputAsString(const Input &);
@ -229,11 +234,12 @@ public:
void loadConfig(const std::string& filename);
void saveConfig() { saveConfig(m_filename); }
void saveConfig(const std::string& filename);
/*
void addStickConfig(UserConfig::StickConfig *sc)
{m_stickconfigs.push_back(sc);}
const std::vector<StickConfig *>
*getStickConfigs() const { return &m_stickconfigs; }
*/
const std::string
&getWarning() { return m_warning; }
void resetWarning() { m_warning=""; }