Commit d3dbc29b authored by gerstrong@gmail.com's avatar gerstrong@gmail.com

Thrown out some obsolete files

parent 2666bd1b
......@@ -80,12 +80,9 @@ set(CXXSRC
menu/cheatsmenu.cpp
menu/CHelpMenu.cpp
menu/CLoadMenu.cpp
menu/CMainMenu.cpp
menu/COptions.cpp
menu/CProfilesMenu.cpp
menu/CSaveMenu.cpp
menu/CSettingsMenu.cpp
menu/CVideoSettings.cpp
menu/VorticonMenu.cpp
menu/widgets/Button.cpp
menu/widgets/ComboSelection.cpp
......@@ -167,13 +164,10 @@ set(HSRC
menu/cheatsmenu.h
menu/CHelpMenu.h
menu/CLoadMenu.h
menu/CMainMenu.h
menu/COptions.h
menu/CProfilesMenu.h
menu/CSaveMenu.h
menu/CSelectionMenu.h
menu/CSettingsMenu.h
menu/CVideoSettings.h
menu/VorticonMenu.h
menu/widgets/Button.h
menu/widgets/ComboSelection.h
......
......@@ -22,7 +22,6 @@
#include "CPassiveVort.h"
#include "CAudioVorticon.h"
#include "menu/CMainMenu.h"
#include "menu/CSelectionMenu.h"
#include "playgame/CPlayGameVorticon.h"
......
/*
* CMainMenu.cpp
*
* Created on: 19.02.2012
* Author: gerstrong and pizza2004
*/
#include "CMainMenu.h"
#include <base/GsApp.h>
#include <widgets/GsMenuController.h>
#include "CSettingsMenu.h"
#include "CSelectionMenu.h"
#include "CLoadMenu.h"
#include "CSaveMenu.h"
#include "CHelpMenu.h"
#include "../CHighScores.h"
#include "engine/core/CBehaviorEngine.h"
#include "engine/core/mode/CGameMode.h"
#include "widgets/Button.h"
/*
namespace vorticon
{
void MainMenu::createVorticonMenu( const bool openedGamePlay )
{
#if defined (SINGLEPLAYER)
gBehaviorEngine.setNumPlayers(1);
Button *button = new Button( "New Game",
new OpenMenuEvent(new CDifficultySelection) );
#else
Button *button = new Button
( "New Game",
new OpenMenuEvent
(
new vorticon::CPlayersSelection
<NewGamePlayersEvent>
(true)
)
);
#endif
mpMenuDialog->addControl( button );
// TODO: Some items are still disabled, because those are not yet implemented in Galaxy
GsButton *loadButton = new Button( "Load",
new OpenMenuEvent( new CLoadMenu() ) );
mpMenuDialog->addControl( loadButton );
loadButton->enable(true);
Button *saveButton = new Button( "Save",
new OpenMenuEvent( new CSaveMenu() ) );
mpMenuDialog->addControl( saveButton );
saveButton->enable(openedGamePlay);
mpMenuDialog->addControl(new Button( "Configure",
new OpenMenuEvent( new CSettingsMenu() ) ) );
GsButton *highscoreButton = new Button( "High Scores",
new StartInfoSceneEvent( new CHighScores ) );
mpMenuDialog->addControl( highscoreButton );
highscoreButton->enable(true);
GsButton *infoButton = new Button( "Info",
new OpenMenuEvent( new CHelpMenu() ) );
mpMenuDialog->addControl( infoButton );
infoButton->enable(true);
mpMenuDialog->addControl(new Button( "End Game", new EventEndGamePlay() ) );
mpMenuDialog->addControl(new Button( "Quit", new GMQuit() ) );
}
MainMenu::MainMenu( const bool openedGamePlay ) :
VorticonMenu( GsRect<float>(0.25f, 0.23f, 0.5f, 0.5f) )
{
createVorticonMenu(openedGamePlay);
}
}
*/
/*
* CMainMenu.h
*
* Created on: 19.02.2012
* Author: gerstrong and pizza2004
*/
#include "VorticonMenu.h"
#include <base/GsEvent.h>
#ifndef _VORTICON_MAINMENU_H_
#define _VORTICON_MAINMENU_H_
/*
namespace vorticon
{
class MainMenu : public VorticonMenu
{
public:
MainMenu(const bool openedGamePlay);
void createVorticonMenu( const bool openedGamePlay );
};
struct OpenMainMenuEvent : public CEvent {};
}
*/
#endif /* _VORTICON_MAINMENU_H_ */
/*
* CSettingsMenu.cpp
*
* Created on: 19.05.2010
* Author: gerstrong
*/
#include <base/GsTimer.h>
#include <widgets/GsButton.h>
#include <widgets/GsMenuController.h>
#include "CSettingsMenu.h"
#include "CVideoSettings.h"
#include "CCameraSettings.h"
#include "CAudioSettings.h"
#include "COptions.h"
#include "cheatsmenu.h"
//#include "CControlsettings.h"
#include "CProfilesMenu.h"
#include "CSelectionMenu.h"
#include "widgets/Button.h"
/*
namespace vorticon
{
CSettingsMenu::CSettingsMenu() :
VorticonMenu( GsRect<float>(0.25f, 0.24f, 0.5f, 0.32f) )
{
mpMenuDialog->addControl(new Button( "Video",
new OpenMenuEvent( new CVideoSettings() ) ) );
mpMenuDialog->addControl(new Button( "Audio",
new OpenMenuEvent( new CAudioSettings() ) ) );
mpMenuDialog->addControl(new Button( "Options",
new OpenMenuEvent( new COptions() ) ) );
#if defined (SINGLEPLAYER)
mpMenuDialog->addControl( new Button( "Controls",
new OpenMenuEvent( new vorticon::CControlsettings(1) ) ) );
#else
mpMenuDialog->addControl(new Button( "Controls",
new OpenMenuEvent( new vorticon::CPlayersSelection<OpenControlMenuEvent>() ) ) );
#endif
#if !defined(EMBEDDED)
mpMenuDialog->addControl( new Button( "Camera",
new OpenMenuEvent( new CCameraSettings() ) ) );
#endif
mpMenuDialog->addControl(new Button( "Cheats",
new OpenMenuEvent( new CheatsMenu() ) ) );
}
}
*/
/*
* CSettingsMenu.h
*
* Created on: 19.05.2010
* Author: gerstrong
*/
#ifndef __VORTICONSETTINGSMENU_H_
#define __VORTICONSETTINGSMENU_H_
#include "VorticonMenu.h"
#include "engine/core/options.h"
#include "fileio/CExeFile.h"
#include "engine/core/CBehaviorEngine.h"
/*
namespace vorticon
{
class CSettingsMenu : public VorticonMenu
{
public:
CSettingsMenu();
private:
};
}
*/
#endif /* __VORTICONSETTINGSMENU_H_ */
/*
* CVideoSettings.cpp
*
* Created on: 28.11.2009
* Author: gerstrong
*/
#include <base/CInput.h>
#include <base/GsTimer.h>
#include <base/video/resolutionlist.h>
#include <base/video/CVideoDriver.h>
#include <base/utils/StringUtils.h>
#include <widgets/GsMenuController.h>
#include "engine/core/CBehaviorEngine.h"
#include "CCameraSettings.h"
#include "CVideoSettings.h"
#include "engine/core/CSettings.h"
#include "engine/core/videoAspect.h"
/*
namespace vorticon
{
class toggleFullscreenFunctor : public InvokeFunctorEvent
{
public:
toggleFullscreenFunctor( CVideoSettings& VSettings ) :
mVSettings(VSettings) {}
private:
void operator()() const
{
mVSettings.mUserVidConf.mFullscreen = !mVSettings.mUserVidConf.mFullscreen;
mVSettings.release();
mVSettings.refresh();
}
CVideoSettings& mVSettings;
};
CVideoSettings::CVideoSettings() :
#if defined(EMBEDDED)
VorticonMenu(GsRect<float>(0.15f, 0.24f, 0.65f, 0.25f) )
#else
VorticonMenu(GsRect<float>(0.15f, 0.24f, 0.65f, 0.55f) )
#endif
{
// Create the fps config selection control
std::list<std::string> List;
for( int i = 10 ; i <= 120 ; i += 10 )
List.push_back( itoa (i) );
mpFPSSelection = new NumberControl( "FPS", 10, 120, 10, 60, false );
mpMenuDialog->addControl( mpFPSSelection );
mpFrameSkip = new Switch( "FrameSkip" );
mpMenuDialog->addControl( mpFrameSkip );
#if !defined(EMBEDDED)
mpGameResSelection = new ComboSelection( "GameRes",
filledStrList(1, "?x?") );
mpMenuDialog->addControl( mpGameResSelection );
mpAspectSelection = new ComboSelection( "Aspect",
filledStrList(1, "disabled") );
mpMenuDialog->addControl( mpAspectSelection );
mpFilterSelection =
new ComboSelection( "Filter",
filledStrList( 4, "none",
"scale2x",
"scale3x",
"scale4x" ) );
mpMenuDialog->addControl( mpFilterSelection );
mpVSyncSwitch = new Switch( "VSync" );
mpMenuDialog->addControl( mpVSyncSwitch );
mpResolutionSelection = new ComboSelection( "Size",
filledStrList(1, "?x?") );
mpMenuDialog->addControl( mpResolutionSelection );
mpFullScreenSwitch = new Button( "Unknown mode",
new toggleFullscreenFunctor(*this) );
mpMenuDialog->addControl( mpFullScreenSwitch );
#endif
//mpVPadSwitch = new Switch( "VirtPad" );
#if defined(USE_OPENGL)
mpOpenGLSwitch = new Switch( "OpenGL" );
mpMenuDialog->addControl( mpOpenGLSwitch );
mpRenderScaleQualitySel = new ComboSelection( "OGL Filter",
filledStrList( 2, "nearest", "linear" ) );
#else
mpRenderScaleQualitySel = new ComboSelection( "Quality",
filledStrList( 3, "nearest", "linear", "best" ) );
#endif
mpMenuDialog->addControl( mpRenderScaleQualitySel );
mpBorderColorSwitch = new Switch( "Border Color" );
mpMenuDialog->addControl( mpBorderColorSwitch );
mpHorizBordersSelection = new NumberControl( "H-Borders", 0, 80, 5, 0, false);
mpMenuDialog->addControl( mpHorizBordersSelection );
}
void CVideoSettings::refresh()
{
mUserVidConf = gVideoDriver.getVidConfig();
// Load the config into the GUI
// TODO: Temporary. This must become a float later...
const auto iFPS = static_cast<int>( gTimer.FPS() );
mpFPSSelection->setSelection( iFPS );
mpFrameSkip->enable( (iFPS> 0.0) ? true : false );
#if defined(USE_OPENGL)
mpOpenGLSwitch->enable( mUserVidConf.mOpengl );
#endif
//mpShowCursorSwitch->enable( mUserVidConf.mShowCursor );
//mpVPadSwitch->enable(mpVPadSwitch->isEnabled());
mpRenderScaleQualitySel->setSelection(mUserVidConf.mRenderScQuality);
// TODO: find a way to indicate a color
mpBorderColorSwitch->enable( mUserVidConf.mBorderColorsEnabled );
mpHorizBordersSelection->setSelection( static_cast<int>( mUserVidConf.mHorizBorders ) );
#if !defined(EMBEDDED)
//mpAspectSwitch->enable( mUserVidConf.m_aspect_correction );
mpAspectSelection->setList( aspectList, NUM_ASPECTS );
std::string arcStr;
arcStr = itoa(mUserVidConf.mAspectCorrection.w);
arcStr += ":";
arcStr += itoa(mUserVidConf.mAspectCorrection.h);
if( arcStr == "0:0")
arcStr = "disabled";
mpAspectSelection->setSelection(arcStr);
mpFilterSelection->setSelection( mUserVidConf.m_ScaleXFilter==1 ? "none" : (mUserVidConf.m_normal_scale ? "normal" : "scale") + itoa(mUserVidConf.m_ScaleXFilter) + "x" );
mpVSyncSwitch->enable( mUserVidConf.mVSync );
mpFullScreenSwitch->setText( mUserVidConf.mFullscreen ? "Go Windowed" : "Go Fullscreen" );
mpResolutionSelection->setList( ResolutionsList, NUM_MAIN_RESOLUTIONS );
std::string resStr;
resStr = itoa(mUserVidConf.mDisplayRect.w);
resStr += "x";
resStr += itoa(mUserVidConf.mDisplayRect.h);
mpResolutionSelection->setSelection(resStr);
mpGameResSelection->setList( GamesResList, NUM_GAME_RESOLUTIONS );
resStr = itoa(mUserVidConf.mGameRect.w);
resStr += "x";
resStr += itoa(mUserVidConf.mGameRect.h);
mpGameResSelection->setSelection(resStr);
#endif
}
void CVideoSettings::release()
{
// Save up the changed stuff
gTimer.setFPS( mpFPSSelection->getSelection() );
if(!mpFrameSkip->isEnabled())
{
gTimer.setFPS( 0.0 );
}
#if defined(USE_OPENGL)
mUserVidConf.mOpengl = mpOpenGLSwitch->isEnabled();
#endif
//mUserVidConf.mVPad = mpVPadSwitch->isEnabled();
mUserVidConf.mRenderScQuality = mpRenderScaleQualitySel->getSelection();
// TODO: Better way to setup colors in the menu
if(mpBorderColorSwitch->isEnabled())
{
mUserVidConf.mBorderColors.r = 0x00;
mUserVidConf.mBorderColors.g = 0xAA;
mUserVidConf.mBorderColors.b = 0xAA;
}
mUserVidConf.mHorizBorders = mpHorizBordersSelection->getSelection();
mUserVidConf.mBorderColorsEnabled = mpBorderColorSwitch->isEnabled();
#if !defined(EMBEDDED)
//mUserVidConf.mVPad = mpVPadSwitch->isEnabled();
// Disable OpenGL when using Virtual GL
if(mUserVidConf.mVPad)
{
mUserVidConf.mOpengl = false;
}
mUserVidConf.mVSync = mpVSyncSwitch->isEnabled();
std::string scalerStr = mpFilterSelection->getSelection();
const std::string res = mpResolutionSelection->getSelection();
sscanf( res.c_str(), "%hux%hux", &mUserVidConf.mDisplayRect.w, &mUserVidConf.mDisplayRect.h );
const std::string GameResStr = mpGameResSelection->getSelection();
sscanf( GameResStr.c_str(), "%hux%hux", &mUserVidConf.mGameRect.w, &mUserVidConf.mGameRect.h );
int w, h;
const std::string aspect = mpAspectSelection->getSelection();
if( sscanf( aspect.c_str(), "%i:%i", &w, &h ) == 2 )
{
mUserVidConf.mAspectCorrection.w = w;
mUserVidConf.mAspectCorrection.h = h;
}
else
{
mUserVidConf.mAspectCorrection.w = 0;
mUserVidConf.mAspectCorrection.h = 0;
}
if( scalerStr != "none" )
{
mUserVidConf.m_normal_scale = (scalerStr.at(0) == 'n');
if (mUserVidConf.m_normal_scale)
mUserVidConf.m_ScaleXFilter = (filterOptionType)(scalerStr.at(6)-'0');
else
mUserVidConf.m_ScaleXFilter = (filterOptionType)(scalerStr.at(5)-'0');
}
else
{
mUserVidConf.m_ScaleXFilter = NONE;
}
#endif
#if defined(CAANOO) || defined(WIZ) || defined(DINGOO) || defined(NANONOTE) || defined(ANDROID)
mUserVidConf.mDisplayRect.w = 320;
mUserVidConf.mDisplayRect.h = 200;
#endif
if(mpBorderColorSwitch->isEnabled())
{
mUserVidConf.mBorderColors.r = 0x00;
mUserVidConf.mBorderColors.g = 0xAA;
mUserVidConf.mBorderColors.b = 0xAA;
}
// In case the user changed something in the camera settings, reload that.
mUserVidConf.m_CameraBounds = gVideoDriver.getCameraBounds();
CVidConfig oldVidConf = gVideoDriver.getVidConfig();
gVideoDriver.setVidConfig(mUserVidConf);
// At this point we also must apply and save the settings
if( !gVideoDriver.applyMode() )
{
gSettings.loadDrvCfg(); // If it fails load the old settings
return;
}
if( !gVideoDriver.start() ) // Here the same situation
{
gVideoDriver.setVidConfig(oldVidConf);
gVideoDriver.start();
}
gSettings.saveDrvCfg();
gMenuController.updateGraphics();
gVideoDriver.setRefreshSignal(true);
}
}
*/
/*
* CVideoSettings.h
*
* Created on: 28.11.2009
* Author: gerstrong
*/
#ifndef CVIDEOSETTINGS_H_
#define CVIDEOSETTINGS_H_
#include <SDL.h>
#include <string>
#include "VorticonMenu.h"
#include "widgets/ComboSelection.h"
#include "widgets/Switch.h"
#include "widgets/NumberControl.h"
#include "widgets/Button.h"
#include <base/video/CVidConfig.h>
/*
namespace vorticon
{
class CVideoSettings : public VorticonMenu
{
public:
CVideoSettings();
void refresh();
void release();
CVidConfig mUserVidConf;
private:
NumberControl *mpFPSSelection;
Switch *mpFrameSkip;
#if defined(USE_OPENGL)
Switch *mpOpenGLSwitch;
#endif
Switch *mpShowCursorSwitch = nullptr;
//Switch *mpVPadSwitch = nullptr;
ComboSelection *mpRenderScaleQualitySel = nullptr;
ComboSelection *mpFilterSelection = nullptr;
ComboSelection *mpAspectSelection = nullptr;
Switch *mpVSyncSwitch = nullptr;
Switch *mpBorderColorSwitch = nullptr;
NumberControl *mpHorizBordersSelection = nullptr;
Button *mpFullScreenSwitch = nullptr;
ComboSelection *mpResolutionSelection = nullptr;
ComboSelection *mpGameResSelection = nullptr;
};
}
*/
#endif /* CVIDEOSETTINGS_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment