void MainMenu::onOptions() {
	OptionsMenu* pOptionsMenu = new OptionsMenu();
	int ret = pOptionsMenu->showMenu();
	delete pOptionsMenu;

	if(ret == MENU_QUIT_REINITIALIZE) {
		quit(MENU_QUIT_REINITIALIZE);
	}
}
void MainMenu::OnOptions() {
	OptionsMenu* myOptions = new OptionsMenu();
	if(myOptions == NULL) {
		perror("MainMenu::OnOptions()");
		exit(EXIT_FAILURE);
	}
	int ret = myOptions->showMenu();
	delete myOptions;

	if(ret == 1) {
		quit(1);
	}
}
Exemple #3
0
OptionsMenu* OptionsMenu::create()
{
    OptionsMenu *pRet = new OptionsMenu();
    if (pRet && pRet->init("bg_opt.png"))
    {
        pRet->autorelease();
        return pRet;
    }
    else
    {
        delete pRet;
        pRet = NULL;
        return NULL;
    }
}
Exemple #4
0
void WindowManager::ProcessEvent(SDL_Event *event)
{
	MainMenu *mainmenu = (MainMenu *)SM->GetSceneByName("Main Menu");
	OptionsMenu *optionsmenu = (OptionsMenu *)SM->GetSceneByName("Options Menu");
	switch(event->type)					// See which event it is
    {
		// When window is resized or is toggled between window and fullscreen
	case SDL_VIDEORESIZE:
		//Cleanup();
		InitOpenGL();
		IsGLErrors("Video Resize");
		if(!WM->IsFullscreen())
		{
			SetWindowedMode(0, 0, event->resize.w, event->resize.h);
		}
		glViewport(0,0,event->resize.w,event->resize.h);		// Resize OpenGL Viewport to fit the screen/window
		SM->InitAll();
		break;
		// When user quits the game
	case SDL_VIDEOEXPOSE:
		if(Game->GetCurrentMode() != GM_PLAY)
		{
			mainmenu->Resize();
			optionsmenu->Resize();
		}
		break;
    case SDL_QUIT:
		_Running=false;
        break;
	case SDL_ACTIVEEVENT:
		if(event->active.state & SDL_APPACTIVE)
		{
			if(event->active.gain)
				_Active = true;
			else
				_Active = false;
		}
		break;
	default:
		break;
	}
}
Exemple #5
0
void OptionsMenu::_ControlsTabPressed(void *pData)
{
	OptionsMenu* lpOptionsMenu = (OptionsMenu*)pData;
	lpOptionsMenu->ControlsTabPressed();
}
Exemple #6
0
void OptionsMenu::_InterfaceTabPressed(void *pData)
{
	OptionsMenu* lpOptionsMenu = (OptionsMenu*)pData;
	lpOptionsMenu->InterfaceTabPressed();
}
Exemple #7
0
void OptionsMenu::_SoundTabPressed(void *pData)
{
	OptionsMenu* lpOptionsMenu = (OptionsMenu*)pData;
	lpOptionsMenu->SoundTabPressed();
}
Exemple #8
0
void OptionsMenu::_GraphicsTabPressed(void *pData)
{
	OptionsMenu* lpOptionsMenu = (OptionsMenu*)pData;
	lpOptionsMenu->GraphicsTabPressed();
}
Exemple #9
0
void OptionsMenu::_GameplayTabPressed(void *pData)
{
	OptionsMenu* lpOptionsMenu = (OptionsMenu*)pData;
	lpOptionsMenu->GameplayTabPressed();
}
Exemple #10
0
// Static functionality
void OptionsMenu::_CloseExitPressed(void *pData)
{
	OptionsMenu* lpOptionsMenu = (OptionsMenu*)pData;
	lpOptionsMenu->CloseExitPressed();
}