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 -1
View File
@@ -104,7 +104,7 @@ public:
int mCount; int mCount;
JGuiController(JGE* jge, int id, JGuiListener* listener); JGuiController(JGE* jge, int id, JGuiListener* listener);
~JGuiController(); virtual ~JGuiController();
virtual void Render(); virtual void Render();
virtual void Update(float dt); virtual void Update(float dt);
+2 -2
View File
@@ -235,8 +235,8 @@ typedef uint32_t u32;
#define BLEND_ONE_MINUS_DST_COLOR GL_ONE_MINUS_DST_COLOR #define BLEND_ONE_MINUS_DST_COLOR GL_ONE_MINUS_DST_COLOR
#define BLEND_SRC_ALPHA_SATURATE GL_SRC_ALPHA_SATURATE #define BLEND_SRC_ALPHA_SATURATE GL_SRC_ALPHA_SATURATE
#define ARGB(a, r, g, b) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) #define ARGB(a, r, g, b) ((PIXEL_TYPE)((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
#define RGBA(r, g, b, a) (((a) << 24) | ((b) << 16) | ((g) << 8) | (r)) #define RGBA(r, g, b, a) ((PIXEL_TYPE)((a) << 24) | ((b) << 16) | ((g) << 8) | (r))
#define TEXTURE_FORMAT 0 #define TEXTURE_FORMAT 0
#define GU_PSM_8888 0 #define GU_PSM_8888 0
+1
View File
@@ -162,6 +162,7 @@ void JNetwork::ThreadProc(void* param)
pThis->toSend.str(""); pThis->toSend.str("");
} }
} }
boost::this_thread::sleep(1);
} }
DebugTrace("Quitting Thread"); DebugTrace("Quitting Thread");
+1
View File
@@ -107,6 +107,7 @@ class SimpleCardEffect
public: public:
virtual void doEffect(Pos * card) = 0; virtual void doEffect(Pos * card) = 0;
virtual void undoEffect(Pos * card) = 0; virtual void undoEffect(Pos * card) = 0;
virtual ~SimpleCardEffect(){};
}; };
class SimpleCardEffectRotate:public SimpleCardEffect class SimpleCardEffectRotate:public SimpleCardEffect
+1 -1
View File
@@ -17,5 +17,5 @@ private:
public: public:
DeckEditorMenu(int id, JGuiListener* listener = NULL, int fontId = 1, const char * _title = "", DeckDataWrapper *selectedDeck = NULL, StatsWrapper *stats = NULL); DeckEditorMenu(int id, JGuiListener* listener = NULL, int fontId = 1, const char * _title = "", DeckDataWrapper *selectedDeck = NULL, StatsWrapper *stats = NULL);
void Render(); void Render();
~DeckEditorMenu(); virtual ~DeckEditorMenu();
}; };
+1 -1
View File
@@ -34,7 +34,7 @@ protected:
public: public:
DuelLayers(GameObserver* go, int playerViewIndex = 0); DuelLayers(GameObserver* go, int playerViewIndex = 0);
~DuelLayers(); virtual ~DuelLayers();
ActionLayer * actionLayer(); ActionLayer * actionLayer();
ActionStack * stackLayer(); ActionStack * stackLayer();
+1
View File
@@ -53,6 +53,7 @@ public:
virtual ~GameStateDuel(); virtual ~GameStateDuel();
#ifdef TESTSUITE #ifdef TESTSUITE
void loadTestSuitePlayers(); void loadTestSuitePlayers();
void setupTestSuite();
#endif #endif
#ifdef AI_CHANGE_TESTING #ifdef AI_CHANGE_TESTING
+1
View File
@@ -16,6 +16,7 @@ struct HandLimitor : public Limitor
virtual bool greyout(Target*); virtual bool greyout(Target*);
HandLimitor(GuiHand* hand); HandLimitor(GuiHand* hand);
virtual ~HandLimitor(){};
}; };
class GuiHand : public GuiLayer class GuiHand : public GuiLayer
-3
View File
@@ -31,9 +31,6 @@ typedef enum
PLAYER_TYPE_HUMAN = 1, PLAYER_TYPE_HUMAN = 1,
PLAYER_TYPE_TESTSUITE = 2, PLAYER_TYPE_TESTSUITE = 2,
PLAYER_TYPE_CPU_TEST = 3, PLAYER_TYPE_CPU_TEST = 3,
#ifdef NETWORK_SUPPORT
PLAYER_TYPE_REMOTE = 4
#endif //NETWORK_SUPPORT
} PlayerType; } PlayerType;
typedef enum typedef enum
+1 -1
View File
@@ -85,7 +85,7 @@ class MTGGameZone {
vector<MTGCardInstance *> cardsSeenLastTurn; vector<MTGCardInstance *> cardsSeenLastTurn;
int nb_cards; int nb_cards;
MTGGameZone(); MTGGameZone();
~MTGGameZone(); virtual ~MTGGameZone();
void shuffle(); void shuffle();
void addCard(MTGCardInstance * card); void addCard(MTGCardInstance * card);
void debugPrint(); void debugPrint();
+1 -1
View File
@@ -62,7 +62,7 @@ public:
int hasAnotherCost(); int hasAnotherCost();
ManaCost(std::vector<int16_t>& _cost, int nb_elems = 1); ManaCost(std::vector<int16_t>& _cost, int nb_elems = 1);
ManaCost(); ManaCost();
~ManaCost(); virtual ~ManaCost();
ManaCost(ManaCost * _manaCost); ManaCost(ManaCost * _manaCost);
ManaCost(const ManaCost& manaCost); ManaCost(const ManaCost& manaCost);
ManaCost& operator= (const ManaCost& manaCost); ManaCost& operator= (const ManaCost& manaCost);
+1 -1
View File
@@ -23,7 +23,7 @@ public:
virtual int canPutIntoZone(MTGCardInstance * card, MTGGameZone * destZone) = 0; virtual int canPutIntoZone(MTGCardInstance * card, MTGGameZone * destZone) = 0;
PlayRestriction(TargetChooser * tc); PlayRestriction(TargetChooser * tc);
~PlayRestriction(); virtual ~PlayRestriction();
}; };
class MaxPerTurnRestriction: public PlayRestriction class MaxPerTurnRestriction: public PlayRestriction
+1
View File
@@ -10,6 +10,7 @@ struct Pos
float width, height; float width, height;
PIXEL_TYPE mask; PIXEL_TYPE mask;
Pos(float, float, float, float, float); Pos(float, float, float, float, float);
virtual ~Pos(){};
virtual void Update(float dt); virtual void Update(float dt);
void UpdateNow(); void UpdateNow();
virtual void Render(); virtual void Render();
+1
View File
@@ -51,6 +51,7 @@ public:
// End of AI deck buffering code // End of AI deck buffering code
Task(char _type = ' '); Task(char _type = ' ');
virtual ~Task(){};
static Task* createFromStr(const string params, bool rand = false); static Task* createFromStr(const string params, bool rand = false);
virtual string toString(); virtual string toString();
+1 -6
View File
@@ -102,11 +102,6 @@ GameState(parent, "duel")
#endif #endif
credits = NULL; credits = NULL;
#ifdef NETWORK_SUPPORT
RegisterNetworkPlayers();
#endif //NETWORK_SUPPORT
} }
GameStateDuel::~GameStateDuel() GameStateDuel::~GameStateDuel()
@@ -907,7 +902,7 @@ void GameStateDuel::ButtonPressed(int controllerId, int controlId)
game->loadPlayer(0, mParent->players[0], deckNumber, premadeDeck); game->loadPlayer(0, mParent->players[0], deckNumber, premadeDeck);
deckmenu->Close(); deckmenu->Close();
#ifdef NETWORK_SUPPORT #ifdef NETWORK_SUPPORT
if(mParent->players[1] == PLAYER_TYPE_REMOTE) if(mParent->mpNetwork)
{ // no need to choose an opponent deck in network mode { // no need to choose an opponent deck in network mode
setGamePhase(DUEL_STATE_OPPONENT_WAIT); setGamePhase(DUEL_STATE_OPPONENT_WAIT);
} }
+1 -1
View File
@@ -835,7 +835,7 @@ void GameStateMenu::ButtonPressed(int controllerId, int controlId)
#ifdef NETWORK_SUPPORT #ifdef NETWORK_SUPPORT
case SUBMENUITEM_2PLAYERS: case SUBMENUITEM_2PLAYERS:
mParent->players[0] = PLAYER_TYPE_HUMAN; mParent->players[0] = PLAYER_TYPE_HUMAN;
mParent->players[1] = PLAYER_TYPE_REMOTE; mParent->players[1] = PLAYER_TYPE_HUMAN;
subMenuController->Close(); subMenuController->Close();
currentState = MENU_STATE_NETWORK_DEFINE | MENU_STATE_MINOR_SUBMENU_CLOSING; currentState = MENU_STATE_NETWORK_DEFINE | MENU_STATE_MINOR_SUBMENU_CLOSING;
break; break;
+1 -1
View File
@@ -41,7 +41,7 @@ struct Right: public Exp
JTexture* GuiCombat::ok_tex = NULL; JTexture* GuiCombat::ok_tex = NULL;
GuiCombat::GuiCombat(GameObserver* go) : 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) - MARGIN, TOP_LINE, 2, 0, 255), cursor_pos(NONE), step(DAMAGE)
{ {
if (NULL == ok_tex && go->getResourceManager()) if (NULL == ok_tex && go->getResourceManager())
-1
View File
@@ -2166,7 +2166,6 @@ WEvent * MTGDredgeRule::replace(WEvent * event)
list<ReplacementEffect *>::iterator it; list<ReplacementEffect *>::iterator it;
for (it = game->replacementEffects->modifiers.begin(); it != game->replacementEffects->modifiers.end(); it++) for (it = game->replacementEffects->modifiers.begin(); it != game->replacementEffects->modifiers.end(); it++)
{ {
ReplacementEffect *re = *it;
if(REDrawReplacement * DR = dynamic_cast<REDrawReplacement *>(*it)) if(REDrawReplacement * DR = dynamic_cast<REDrawReplacement *>(*it))
{ {
MTGAbility * otherA = NULL; MTGAbility * otherA = NULL;
+7 -6
View File
@@ -112,17 +112,18 @@ WEvent * REDrawReplacement::replace(WEvent *event)
if(replacementAbility->source->controller() == DrawerOfCard) if(replacementAbility->source->controller() == DrawerOfCard)
for (it = game->replacementEffects->modifiers.begin(); it != game->replacementEffects->modifiers.end(); it++) for (it = game->replacementEffects->modifiers.begin(); it != game->replacementEffects->modifiers.end(); it++)
{ {
ReplacementEffect *re = *it;
if(REDrawReplacement * DR = dynamic_cast<REDrawReplacement *>(*it)) if(REDrawReplacement * DR = dynamic_cast<REDrawReplacement *>(*it))
{ {
MTGAbility * otherA = NULL; MTGAbility * otherA = NULL;
if(DR->DrawerOfCard == e->player) 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()); if(DR->replacementAbility->oneShot)
selection.push_back(otherA); 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 && != GAME_TYPE_STORY &&
g->mRules->gamemode != GAME_TYPE_DEMO && (!g->players[0]->playMode == PLAYER_TYPE_CPU && !g->players[1]->playMode == PLAYER_TYPE_CPU) g->mRules->gamemode != GAME_TYPE_DEMO && (!g->players[0]->playMode == PLAYER_TYPE_CPU && !g->players[1]->playMode == PLAYER_TYPE_CPU)
#ifdef NETWORK_SUPPORT #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 #endif //NETWORK_SUPPORT
)//keep this out of momir and other game modes. )//keep this out of momir and other game modes.
{ {