TapestryEngine

A 2D Platformer Game Engine
Log | Files | Refs

166c34c7a6f9af980d6a2dcca21b35b804804a28.svn-base (1522B)


      1 #ifndef LEVEL_H
      2 #define LEVEL_H
      3 
      4 #include "Utils.h"
      5 #include "Console.h"
      6 #include "Context.h"
      7 
      8 #include "Actor.h"
      9 #include "ActorCollision.h"
     10 #include "Particle.h"
     11 #include "Camera.h"
     12 #include "Event.h"
     13 #include "Input.h"
     14 #include "symbol.h"
     15 #include "MiscDraw.h"
     16 #include "sound.h"
     17 #include "HUD.h"
     18 #include "Dialogue.h"
     19 
     20 struct ActorName
     21 {
     22 	char* name;
     23 	Actor* act;
     24 };
     25 
     26 Actor* FindRef(std::vector<ActorName*> refs, char* name);
     27 
     28 class Level : public Context, public EventReceiver
     29 {
     30 public:
     31 
     32 	Level() {}
     33 
     34 	Level(SDL_Renderer* ren, Control* ctrl)
     35 	{
     36 		mRen = ren;
     37 		mInput = ctrl;
     38 	}
     39 
     40 	bool LoadWorld(cJSON* level);
     41 
     42 	bool LoadCamera(cJSON* level);
     43 
     44 	bool LoadAnimations(cJSON* level);
     45 
     46 	bool LoadAnimGraph(cJSON* anim_pack);
     47 
     48 	bool LoadActors(cJSON* level);
     49 
     50 	bool LoadParticles(cJSON* level);
     51 
     52 	bool LoadSounds(cJSON* level);
     53 
     54 	bool LoadHud(cJSON* level);
     55 
     56 	bool Load(const char* filename);
     57 
     58 	bool Update();
     59 
     60 	bool EventProcess(Event eve);
     61 	
     62 	ActorHandleManager mAHM;
     63 	SpatialMonitor mSpatMon;
     64 	Control* mInput;
     65 	ParticleManager mPrtLib;
     66 	SoundManager mSoundLib;
     67 	
     68 
     69 	int mHeight;
     70 	int mWidth;
     71 	Camera mCam;
     72 
     73 	SDL_Surface* mColMap;
     74 
     75 	std::vector<AnimDataPack*> mAnimData;
     76 	std::vector<AnimGraphData*> mAnimGraphs;
     77 
     78 	std::vector<Actor*> mCast; //does this do anything?
     79 
     80 	std::vector<SDL_Texture*> mBack;
     81 	std::vector<float> mParallax_back;
     82 
     83 	std::vector<SDL_Texture*> mFore;
     84 
     85 	std::vector<SDL_Texture*> mOver;
     86 	std::vector<float> mParallax_over;
     87 
     88 	HUD mHUD;
     89 
     90 protected:
     91 
     92 	char** mAnim_names;
     93 	Player* mPlayer;
     94 
     95 };
     96 
     97 #endif