Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef CGRAPHICS_H
- #define CGRAPHICS_H
- #define PI 3.14159
- #define TWO_PI PI*2.0
- #define HALF_PI PI/2.0
- #include <wiisprite.h>
- #include "MasterHeader.h"
- #include "cTower.h"
- class CTargaImage;
- class cGraphics
- {
- private:
- int m_windowWidth;
- int m_windowHeight;
- int npcX, npcY;
- bool isAnimated;
- float mRotation; //to be passed to sprite rotate function
- static cGraphics* pGraphics;
- //images for the different creeps
- Image mSnailImage[2];
- Image mAphidImage[2];
- Image mWhiteFlyImage[2];
- Image mCrabGrassImage[2];
- Image mDandelionImage[2];
- Image mNutGrassImage[2];
- //images for the greenhouse and towers and healthbar
- Image mInsecticide;
- Image mBugBomb;
- Image mRoachMotel;
- Image mWeedSpray;
- Image mTowerImage;
- Image mTowerArrayImage;
- Image mGreenHouse;
- Image mHealthBar;
- Image mBackground;
- Image mCursor;
- //array of sprites for the creeps
- Sprite mSprites[6];
- Sprite mBackgroundEX;
- Sprite mHealthBarEX;
- Sprite mGreenHouseEX;
- Sprite mCursorSprite;
- //Sprites to draw the tower when in build mode
- Sprite mCInsecticide, mCBugBomb, mCRoachMotel, mCWeedSpray;
- // Define array containing current, hardcoded max number of towers
- Sprite mTowerSprites[12][16];
- Sprite mTowerImageEX;
- void SetRotation(npcDirection direction);
- public:
- cGraphics();
- virtual ~cGraphics();
- static cGraphics* GetInstance();
- bool Shutdown();
- void Prepare(float dt);
- void Render();
- void UpdateNPC(int image, int posX, int posY);
- //functions to draw the npc's, must accept an npc index and
- //img index for the animation
- void DrawSnail(npcDirection direction, int npcIndex, int imgIndex, int posX, int posY);
- void DrawAphid(npcDirection direction, int npcIndex, int imgIndex, int posX, int posY);
- void DrawDandilion(npcDirection direction, int npcIndex, int imgIndex, int posX, int posY);
- void DrawCrab(npcDirection direction, int npcIndex, int imgIndex, int posX, int posY);
- void DrawWhiteFly(npcDirection direction, int npcIndex, int imgIndex, int posX, int posY);
- void DrawNutGrass(npcDirection direction, int npcIndex, int imgIndex, int posX, int posY);
- //functions to draw the towers, must accept the x and y index
- void DrawInsecticide(int imgIndex, int xIndex, int yIndex);
- void DrawBugBomb(int imgIndex, int xIndex, int yIndex);
- void DrawRoachMotel(int imgIndex, int xIndex, int yIndex);
- void DrawWeedSpray(int imgIndex, int xIndex, int yIndex);
- void DrawInsecticide(int xPos, int yPos);
- void DrawBugBomb(int xPos, int yPos);
- void DrawRoachMotel(int xPos, int yPos);
- void DrawWeedSpray(int xPos, int yPos);
- void DrawCursor(int posX, int posY);
- // This one is for the cursor
- void DrawTower(TowerType type, int posX, int posY);
- // This one is for the play field/grid
- void DrawTower(TowerType tupe, int imgIndex, int xIndex, int yIndex);
- void DrawGreenHouse(int image, int posX, int posY);
- void DrawHealthBar(int image, int posX, int posY);
- //Layer Manager
- LayerManager * mLayerManager;
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement