/* THIS PROJECT IS USING OPEN SANS TRUE TYPE FONTS see: www.google.com/fonts/specimen/Open+Sans You find a copy ofthe license under /data/fonts/ */ #include "engine.h" using namespace std; #define LEVEL (1 << 30) #define MENU (1 << 29) #define LOAD (1 << 27) #define SAVE (1 << 26) #define GAME_QUIT (1 << 28) const int SCREEN_WIDTH = 500; const int SCREEN_HEIGHT = 500; const int SCREEN_BPP = 32; //class UpgradesMenu: public Menu //{ //public: // vector labels; // //}; class Shop: public AbstractInteractive { protected: Account** user; vector tu; vector weapons; vector weaponInfos; int currentWeapon; vector ships; vector shipInfos; int currentShip; vector disabledUpgrades; int gameMenu; Button* back; CompositMenu* menu; Label* goldLabel; public: Shop(){} ~Shop(); Shop(Account** user, int GameMenu); void draw(SDL_Surface *screen); int handleEvents(SDL_Event event); void frame(double time); void updateUpgradeMenu(); virtual void refresh(); }; class InventoryMenu: public AbstractInteractive { public: Label* title; SlidingBackground* BG; Account** user; int gameMenu; Button* back; Label* sellLabel; SDL_Rect sellDropzone; AbstractInteractive* shipMenu; vector ships; AbstractInteractive* weaponMenu; vector weapons; SDL_Rect weaponDropzone; vector slots; //always NULL if nothing is dragged SDL_Surface* cursor; //wich item is currently dragged int dragged; int MX; int MY; SDL_Surface* ship; ~InventoryMenu(); InventoryMenu(Account** user, int ngamMenu); void draw(SDL_Surface *screen); int handleEvents(SDL_Event event); void frame(double time); void refresh(); }; bool init(SDL_Surface*& screen); Menu* makeMainMenu(SDL_Surface *screen); Menu* makeGameMenu(SDL_Surface *screen); Menu* makeLevelMenu(vector levels, SDL_Surface *screen); class GameHandler { private: Account *user; SDL_Surface *screen; LevelGenerator *LG; vector menus; vector levelpaths; bool isGood; int state; string* acname; public: GameHandler(); ~GameHandler(); // returns 0 if succesfully quits, 1 otherwise int game(); }; int main(int argc, char* args[]);