//David Seneker and Luisa Lu //events.h-header for the event manager #ifndef _EVENTS_H_ #define _EVENTS_H_ #include "texturemap.h" #include "coursecity.h" struct eventinfo {//stores the info about a particular event int type;//0=message, 1=cut int xstart; int ystart; int xend; int yend; unsigned int duration;//how much the event takes unsigned int frameduration;//time per frame in cut scenes int numtextures;//3 for messages, numslides for others TextureMap *textures;//array of textures-load from same pool as general stuff char *message;//for message events bool player1done; bool player2done; float playerx;//where the player goes after the event. make playerx <0 to stay where you were float playery;//make x <0 to stay float playertheta;//make this one <0 to not change theta }; class eventthing { public: int numevents; coursecity *thecourse; eventinfo *theevents; int player1event;//-1 for no event going on, -2 for manual events, else array index int player2event; unsigned int p1start;//time the current event started unsigned int p2start; int iWindowWidth; int iWindowHeight; eventthing() {}; virtual ~eventthing(); bool Init(char *eventfile, coursecity *coursepointer); int detectevents(int playerid, float x, float y); void checktime(int playerid); void repositionevent(int player, int eventid); bool manualmessage(int player, int duration, char *message); void drawmessages(int player, int numplayers, int width, int height); bool incutscene(int player);//true if a cut scene is going on for that player void continuecut(int player, int iWindowWidth, int iWindowHeight);//displays a cut scene frame and updates the state void RenderTexture(TextureMap *LoadingTexture, int iWindowWidth, int iWindowHeight); //TextureMap messagechar; //TextureMap windowback; TextureMap *defaultmessagetex; eventinfo manualevents[2]; }; #endif