Files
wagic/projects/mtg/include/GameApp.h
Xawotihs 12a431ff8c - Merged QWidget and QML Qt frontends, just define QT_WIDGET to select the QWidget one
- Coded a resource package download GUI based on QWidget
- Removed compilation warning on unused variable
- Updated Maemo desktop file to start directly the binary
- Updated .pro file
- Updated version macros to be able to compose the resource package file
- Updated QML interface for Android
- Updated QML interface to not contain the name of the resource package
- Updated the file downloader class to be able to get the resource package hash from the google code server
- Updated the file downloaded class to verify the resource package hash from the remote server at each startup to be able to perform automatic update
- Defined several JGE operation as static to clean up the wagic wrapper
2012-01-15 18:50:38 +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);
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