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

View File

@@ -104,7 +104,7 @@ public:
int mCount;
JGuiController(JGE* jge, int id, JGuiListener* listener);
~JGuiController();
virtual ~JGuiController();
virtual void Render();
virtual void Update(float dt);

View File

@@ -235,8 +235,8 @@ typedef uint32_t u32;
#define BLEND_ONE_MINUS_DST_COLOR GL_ONE_MINUS_DST_COLOR
#define BLEND_SRC_ALPHA_SATURATE GL_SRC_ALPHA_SATURATE
#define ARGB(a, r, g, b) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
#define RGBA(r, g, b, a) (((a) << 24) | ((b) << 16) | ((g) << 8) | (r))
#define ARGB(a, r, g, b) ((PIXEL_TYPE)((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
#define RGBA(r, g, b, a) ((PIXEL_TYPE)((a) << 24) | ((b) << 16) | ((g) << 8) | (r))
#define TEXTURE_FORMAT 0
#define GU_PSM_8888 0

View File

@@ -162,6 +162,7 @@ void JNetwork::ThreadProc(void* param)
pThis->toSend.str("");
}
}
boost::this_thread::sleep(1);
}
DebugTrace("Quitting Thread");

View File

@@ -107,6 +107,7 @@ class SimpleCardEffect
public:
virtual void doEffect(Pos * card) = 0;
virtual void undoEffect(Pos * card) = 0;
virtual ~SimpleCardEffect(){};
};
class SimpleCardEffectRotate:public SimpleCardEffect

View File

@@ -17,5 +17,5 @@ private:
public:
DeckEditorMenu(int id, JGuiListener* listener = NULL, int fontId = 1, const char * _title = "", DeckDataWrapper *selectedDeck = NULL, StatsWrapper *stats = NULL);
void Render();
~DeckEditorMenu();
virtual ~DeckEditorMenu();
};

View File

@@ -34,7 +34,7 @@ protected:
public:
DuelLayers(GameObserver* go, int playerViewIndex = 0);
~DuelLayers();
virtual ~DuelLayers();
ActionLayer * actionLayer();
ActionStack * stackLayer();

View File

@@ -53,6 +53,7 @@ public:
virtual ~GameStateDuel();
#ifdef TESTSUITE
void loadTestSuitePlayers();
void setupTestSuite();
#endif
#ifdef AI_CHANGE_TESTING

View File

@@ -16,6 +16,7 @@ struct HandLimitor : public Limitor
virtual bool greyout(Target*);
HandLimitor(GuiHand* hand);
virtual ~HandLimitor(){};
};
class GuiHand : public GuiLayer

View File

@@ -31,9 +31,6 @@ typedef enum
PLAYER_TYPE_HUMAN = 1,
PLAYER_TYPE_TESTSUITE = 2,
PLAYER_TYPE_CPU_TEST = 3,
#ifdef NETWORK_SUPPORT
PLAYER_TYPE_REMOTE = 4
#endif //NETWORK_SUPPORT
} PlayerType;
typedef enum

View File

@@ -85,7 +85,7 @@ class MTGGameZone {
vector<MTGCardInstance *> cardsSeenLastTurn;
int nb_cards;
MTGGameZone();
~MTGGameZone();
virtual ~MTGGameZone();
void shuffle();
void addCard(MTGCardInstance * card);
void debugPrint();

View File

@@ -62,7 +62,7 @@ public:
int hasAnotherCost();
ManaCost(std::vector<int16_t>& _cost, int nb_elems = 1);
ManaCost();
~ManaCost();
virtual ~ManaCost();
ManaCost(ManaCost * _manaCost);
ManaCost(const ManaCost& manaCost);
ManaCost& operator= (const ManaCost& manaCost);

View File

@@ -23,7 +23,7 @@ public:
virtual int canPutIntoZone(MTGCardInstance * card, MTGGameZone * destZone) = 0;
PlayRestriction(TargetChooser * tc);
~PlayRestriction();
virtual ~PlayRestriction();
};
class MaxPerTurnRestriction: public PlayRestriction

View File

@@ -10,6 +10,7 @@ struct Pos
float width, height;
PIXEL_TYPE mask;
Pos(float, float, float, float, float);
virtual ~Pos(){};
virtual void Update(float dt);
void UpdateNow();
virtual void Render();

View File

@@ -51,6 +51,7 @@ public:
// End of AI deck buffering code
Task(char _type = ' ');
virtual ~Task(){};
static Task* createFromStr(const string params, bool rand = false);
virtual string toString();

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);
}

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;

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())

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;

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);
}
}
}
}

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.
{