Esempio n. 1
0
EditorEngine::EditorEngine(ALLEGRO_DISPLAY *display, Settings *settings, Map *currentMap, AssetLibrary *assetLibrary)
{
	//init
	display_ = display;
	settings_ = settings;
	currentMap_ = currentMap;
	assetLibrary_ = assetLibrary;
	finished_ = false;
	running_ = true;
	chosenColor_ = al_map_rgb_f(1,1,1);
	chosenColorText_ = al_map_rgb_f(0,0,0);


	//new used to keep it in memory the state. This needs to be freed when EditorEngine is finished.
	PushNewState(new StateEditorMainMenu());
}
Esempio n. 2
0
Engine::Engine(ALLEGRO_DISPLAY *display, Settings *settings, Map *currentMap, ImageLoader *imageLoader)
{
	//init
	display_ = display;
	settings_ = settings;
	currentMap_ = currentMap;
	imageLoader_ = imageLoader;
	finished_ = false;
	running_ = true;
	chosenColor_ = al_map_rgb_f(1,1,1);
	chosenColorText_ = al_map_rgb_f(0,0,0);


	//new used to keep it in memory the state. This needs to be freed when Engine is finished.
	PushNewState(new StateGameMainMenu());
}
Esempio n. 3
0
/*
Takes current state of stack and pushes a new one onto the stack in its place
*/
void EditorEngine::PopPushState()
{
	int popLevel = states_.back()->GetPopLevel();
	State* pushState = states_.back()->GetNextState();
	int i = 0;
	while(i < popLevel){
		if ( !states_.empty() ) {
			if(states_.size() > 1){
				states_.back()->CleanUp();
				delete states_.back();
				states_.pop_back();
			}
		}
		i++;
	}
	//fprintf(stderr,"States Popped\n\n\n");

	PushNewState(pushState);
}