Fixed compilation problems when compiling without -DDEBUG.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6767 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2010-11-29 10:02:47 +00:00
parent d7e78fa23a
commit 9dbe8120e2
4 changed files with 52 additions and 11 deletions

View File

@@ -90,11 +90,23 @@ public:
#endif
}
void setName(const std::string &name_){ assert(m_magic_number == 0xABCD1234); m_name = name_; }
void setName(const std::string &name_) {
#ifdef DEBUG
assert(m_magic_number == 0xABCD1234);
#endif
m_name = name_; }
const char* getName() const { assert(m_magic_number == 0xABCD1234); return m_name.c_str(); }
const char* getName() const {
#ifdef DEBUG
assert(m_magic_number == 0xABCD1234);
#endif
return m_name.c_str(); }
bool isGuestAccount() const { assert(m_magic_number == 0xABCD1234); return m_is_guest_account; }
bool isGuestAccount() const {
#ifdef DEBUG
assert(m_magic_number == 0xABCD1234);
#endif
return m_is_guest_account; }
//int getLastKartId(){ return m_last_kart_id; }
//void setLastKartId(int newLastKartId){ m_last_kart_id = newLastKartId; }

View File

@@ -219,9 +219,8 @@ public:
PlayerKartWidget(KartSelectionScreen* parent, StateManager::ActivePlayer* associatedPlayer,
core::recti area, const int playerID, const int irrlichtWidgetID=-1) : Widget(WTYPE_DIV)
{
assert(associatedPlayer->ok());
#ifdef DEBUG
assert(associatedPlayer->ok());
m_magic_number = 0x33445566;
#endif
@@ -433,7 +432,9 @@ public:
bool mineInList = false;
for (int p=0; p<StateManager::get()->activePlayerCount(); p++)
{
#ifdef DEBUG
assert(StateManager::get()->getActivePlayer(p)->ok());
#endif
if (StateManager::get()->getActivePlayer(p) == m_associatedPlayer)
{
mineInList = true;

View File

@@ -253,7 +253,9 @@ StateManager::ActivePlayer::~ActivePlayer()
void StateManager::ActivePlayer::setPlayerProfile(PlayerProfile* player)
{
#ifdef DEBUG
assert(m_magic_number == 0xAC1EF1AE);
#endif
m_player = player;
} // setPlayerProfile
@@ -261,7 +263,9 @@ void StateManager::ActivePlayer::setPlayerProfile(PlayerProfile* player)
void StateManager::ActivePlayer::setDevice(InputDevice* device)
{
#ifdef DEBUG
assert(m_magic_number == 0xAC1EF1AE);
#endif
// unset player from previous device he was assigned to, if any
if (m_device != NULL) m_device->setPlayer(NULL);

View File

@@ -94,29 +94,53 @@ public:
#endif
/** \return the identity of this active player */
PlayerProfile* getProfile() { assert(m_magic_number == 0xAC1EF1AE); return m_player; }
PlayerProfile* getProfile() {
#ifdef DEBUG
assert(m_magic_number == 0xAC1EF1AE);
#endif
return m_player; }
/** \return the identity of this active player */
const PlayerProfile* getConstProfile() const { assert(m_magic_number == 0xAC1EF1AE); return m_player; }
const PlayerProfile* getConstProfile() const {
#ifdef DEBUG
assert(m_magic_number == 0xAC1EF1AE);
#endif
return m_player; }
/** Call to change the identity of this player (useful when player is
* selecting his identity) */
void setPlayerProfile(PlayerProfile* player);
/** ID of this player within the list of active players */
int getID() const { assert(m_magic_number == 0xAC1EF1AE); return m_id; }
int getID() const {
#ifdef DEBUG
assert(m_magic_number == 0xAC1EF1AE);
#endif
return m_id; }
/** \return Which input device this player is using, or NULL if none
* is set yet */
InputDevice* getDevice() const { assert(m_magic_number == 0xAC1EF1AE); return m_device; }
InputDevice* getDevice() const {
#ifdef DEBUG
assert(m_magic_number == 0xAC1EF1AE);
#endif
return m_device; }
void setDevice(InputDevice* device);
/** Sets the kart for this player. */
void setKart(Kart *kart) { assert(m_magic_number == 0xAC1EF1AE); m_kart = kart; }
void setKart(Kart *kart) {
#ifdef DEBUG
assert(m_magic_number == 0xAC1EF1AE);
#endif
m_kart = kart; }
/** \return the kart of this player. Only valid while world exists. */
Kart* getKart() { assert(m_magic_number == 0xAC1EF1AE); assert(m_kart != NULL); return m_kart; }
Kart* getKart() {
#ifdef DEBUG
assert(m_magic_number == 0xAC1EF1AE);
#endif
assert(m_kart != NULL); return m_kart; }
};