Fixed warnings from linux and Android compilers

Cleaned up network code on Linux, it still does not work correctly
This commit is contained in:
Xawotihs@gmail.com
2013-01-26 22:17:43 +00:00
parent 5b0f5bd90f
commit eec9bb44a8
20 changed files with 25 additions and 27 deletions
+1 -6
View File
@@ -102,11 +102,6 @@ GameState(parent, "duel")
#endif
credits = NULL;
#ifdef NETWORK_SUPPORT
RegisterNetworkPlayers();
#endif //NETWORK_SUPPORT
}
GameStateDuel::~GameStateDuel()
@@ -907,7 +902,7 @@ void GameStateDuel::ButtonPressed(int controllerId, int controlId)
game->loadPlayer(0, mParent->players[0], deckNumber, premadeDeck);
deckmenu->Close();
#ifdef NETWORK_SUPPORT
if(mParent->players[1] == PLAYER_TYPE_REMOTE)
if(mParent->mpNetwork)
{ // no need to choose an opponent deck in network mode
setGamePhase(DUEL_STATE_OPPONENT_WAIT);
}
+1 -1
View File
@@ -835,7 +835,7 @@ void GameStateMenu::ButtonPressed(int controllerId, int controlId)
#ifdef NETWORK_SUPPORT
case SUBMENUITEM_2PLAYERS:
mParent->players[0] = PLAYER_TYPE_HUMAN;
mParent->players[1] = PLAYER_TYPE_REMOTE;
mParent->players[1] = PLAYER_TYPE_HUMAN;
subMenuController->Close();
currentState = MENU_STATE_NETWORK_DEFINE | MENU_STATE_MINOR_SUBMENU_CLOSING;
break;
+1 -1
View File
@@ -41,7 +41,7 @@ struct Right: public Exp
JTexture* GuiCombat::ok_tex = NULL;
GuiCombat::GuiCombat(GameObserver* go) :
GuiLayer(go), active(false), activeAtk(NULL), ok(SCREEN_WIDTH - MARGIN, 210, 1, 0, 255), enemy_avatar(SCREEN_WIDTH
GuiLayer(go), active(0), activeAtk(NULL), ok(SCREEN_WIDTH - MARGIN, 210, 1, 0, 255), enemy_avatar(SCREEN_WIDTH
- MARGIN, TOP_LINE, 2, 0, 255), cursor_pos(NONE), step(DAMAGE)
{
if (NULL == ok_tex && go->getResourceManager())
-1
View File
@@ -2166,7 +2166,6 @@ WEvent * MTGDredgeRule::replace(WEvent * event)
list<ReplacementEffect *>::iterator it;
for (it = game->replacementEffects->modifiers.begin(); it != game->replacementEffects->modifiers.end(); it++)
{
ReplacementEffect *re = *it;
if(REDrawReplacement * DR = dynamic_cast<REDrawReplacement *>(*it))
{
MTGAbility * otherA = NULL;
+7 -6
View File
@@ -112,17 +112,18 @@ WEvent * REDrawReplacement::replace(WEvent *event)
if(replacementAbility->source->controller() == DrawerOfCard)
for (it = game->replacementEffects->modifiers.begin(); it != game->replacementEffects->modifiers.end(); it++)
{
ReplacementEffect *re = *it;
if(REDrawReplacement * DR = dynamic_cast<REDrawReplacement *>(*it))
{
MTGAbility * otherA = NULL;
if(DR->DrawerOfCard == e->player)
if(DR->replacementAbility->oneShot)
selection.push_back(DR->replacementAbility->clone());
else
{
otherA = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), source->source,NULL,DR->replacementAbility->clone());
selection.push_back(otherA);
if(DR->replacementAbility->oneShot)
selection.push_back(DR->replacementAbility->clone());
else
{
otherA = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), source->source,NULL,DR->replacementAbility->clone());
selection.push_back(otherA);
}
}
}
}
+1 -1
View File
@@ -161,7 +161,7 @@ void Rules::addExtraRules(GameObserver* g)
!= GAME_TYPE_STORY &&
g->mRules->gamemode != GAME_TYPE_DEMO && (!g->players[0]->playMode == PLAYER_TYPE_CPU && !g->players[1]->playMode == PLAYER_TYPE_CPU)
#ifdef NETWORK_SUPPORT
&& !(g->players[1]->playMode == PLAYER_TYPE_REMOTE) && !(g->players[1]->playMode == PLAYER_TYPE_HUMAN)
&& !(g->players[1]->playMode == Player::MODE_HUMAN)
#endif //NETWORK_SUPPORT
)//keep this out of momir and other game modes.
{