Files
wagic/projects/mtg/include/GameApp.h
techdragon.nguyen@gmail.com a2179017d4 Extended Scroll() and OnScroll() to also take in magnitude as one of its parameters. magnitude is currently used in the deck editor to figure out how many cards to rotate around per swipe as function of velocity and the number of cards displayed on the screen.
fixed a compiler warning in SimplePopup in the constructor declaration
===DECK Editor changes ===
Added two touch buttons , one for "Sell Card", the other to switch between Deck and Collection.
changed swipe Left/Right to rotate card collection; removing the previous action which was to swap between deck/collection viewing

Note: GameStateDeckViewer isn't a JGuiController so can't leverage off the mButtons vector.  Thus, the buttons have to be handled by this class separately. (setButtonState, userPressedButton)
2012-01-26 13:53:03 +00:00

104 lines
2.6 KiB
C++

/*
* Wagic, The Homebrew ?! is licensed under the BSD license
* See LICENSE in the Folder's root
* http://wololo.net/wagic/
*/
#ifndef _GAMEAPP_H_
#define _GAMEAPP_H_
#include <JApp.h>
#include <JGE.h>
#include <JSprite.h>
#include <JLBFont.h>
#include <hge/hgeparticle.h>
#include "WResourceManager.h"
#include "GameState.h"
#include "MTGDeck.h"
#include "MTGCard.h"
#include "MTGGameZones.h"
#include "CardEffect.h"
#ifdef NETWORK_SUPPORT
#include "JNetwork.h"
#endif //NETWORK_SUPPORT
#include "GameObserver.h"
/* Wagic versions */
#define WAGIC_VERSION_MAJOR 0
#define WAGIC_VERSION_MEDIUM 17
#define WAGIC_VERSION_MINOR 1
#define VERSION_DOT(a, b, c) a ##.## b ##.## c
#define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c
#define VERSION_GAME(a, b, c) VERSION_DOT(a, b, c)
#define VERSION_FILE(a, b, c) VERSION_WITHOUT_DOT(a, b, c)
#define VERSION_TOSTRING(a) #a
#define VERSION_STRINGIFY(a) VERSION_TOSTRING(a)
#define WAGIC_VERSION VERSION_GAME(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
#define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
#define WAGIC_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION)
#define WAGIC_RESOURCE_NAME "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION) ".zip"
class Rules;
class MTGAllCards;
class TransitionBase;
class GameApp: public JApp
{
private:
#ifdef DEBUG
int nbUpdates;
float totalFPS;
#endif
bool mShowDebugInfo;
int mScreenShotCount;
GameState* mCurrentState;
GameState* mNextState;
GameState* mGameStates[GAME_STATE_MAX];
public:
GameType gameType;
Rules * rules;
CardEffect *effect;
#ifdef NETWORK_SUPPORT
JNetwork* mpNetwork;
#endif //NETWORK_SUPPORT
GameApp();
virtual ~GameApp();
virtual void Create();
virtual void Destroy();
virtual void Update();
virtual void Render();
virtual void Pause();
virtual void Resume();
virtual void OnScroll(int inXVelocity, int inYVelocity, int magnitude = 0);
void LoadGameStates();
void SetNextState(int state);
void SetCurrentState(GameState * state);
void DoTransition(int trans, int tostate, float dur = -1, bool animonly = false);
void DoAnimation(int trans, float dur = -1);
static hgeParticleSystem * Particles[6];
static bool HasMusic;
static string systemError;
static JMusic* music;
static string currentMusicFile;
static void playMusic(string filename = "", bool loop = true);
static void stopMusic();
static PlayerType players[2];
};
extern vector<JQuadPtr> manaIcons;
#endif