Commit 2153e53f authored by gerstrong@gmail.com's avatar [email protected]

General Cleanups

parent 400bf7bf
......@@ -101,7 +101,7 @@ public:
//CEventContainer &EventList()
//{ return gEventManager; }
void setEpisode(const size_t Episode)
void setEpisode(const int Episode)
{ mEpisode = Episode; }
void setDemo(bool demo)
......
......@@ -18,6 +18,11 @@
#include "mode/CGameMode.h"
GameEngine::~GameEngine()
{
}
void GameEngine::pumpEvent(const CEvent *evPtr)
{
if(mpGameMode) // Otherwise send to the existing created mGameMode Object
......
......@@ -24,6 +24,8 @@ public:
mDataPath(datapath)
{}
virtual ~GameEngine() override;
virtual bool start() override = 0;
void ponder(const float deltaT) override;
......
......@@ -28,11 +28,13 @@ GameMenu(GsRect<float>(0.15f, 0.20f, 0.65f, 0.25f), style )
GameMenu(GsRect<float>(0.15f, 0.20f, 0.65f, 0.55f), style )
#endif
{
mpShowCursorSwitch = new Switch("Cursor", style);
mpMenuDialog->add( mpShowCursorSwitch );
mpTiltScreenSwitch = new Switch("TiltedScr", style);
mpMenuDialog->add( mpTiltScreenSwitch );
mpShowCursorSwitch =
mpMenuDialog->add( new Switch("Cursor", style) );
mpTiltScreenSwitch =
mpMenuDialog->add( new Switch("TiltedScr", style) );
mpFPSSelection =
mpMenuDialog->add(
......@@ -40,28 +42,23 @@ GameMenu(GsRect<float>(0.15f, 0.20f, 0.65f, 0.55f), style )
false, style) );
mpFrameSkip = new Switch( "FrameSkip", style );
mpMenuDialog->add( mpFrameSkip );
mpFrameSkip =
mpMenuDialog->add( new Switch( "FrameSkip", style ) );
#if !defined(EMBEDDED)
mpGameResSelection =
mpMenuDialog->add( new ComboSelection( "GameRes",
filledStrList(1, "?x?"),
style ) );
mpGameResSelection = new ComboSelection( "GameRes",
filledStrList(1, "?x?"),
style );
mpMenuDialog->add( mpGameResSelection );
#endif
mpBorderColorSwitch =
mpMenuDialog->add( new Switch( "Brdr Color", style ) );
mpBorderColorSwitch = new Switch( "Brdr Color", style );
mpMenuDialog->add( mpBorderColorSwitch );
mpHorizBordersSelection = new NumberControl( "H-Brdr",
0, 80, 5, 0,
false,
style);
mpMenuDialog->add( mpHorizBordersSelection );
mpHorizBordersSelection =
mpMenuDialog->add( new NumberControl( "H-Brdr",
0, 80, 5, 0,
false,
style) );
setMenuLabel("OPTIONSMENULABEL");
......@@ -93,9 +90,6 @@ void CVideoSettings::refresh()
mpHorizBordersSelection->setSelection( mUsersConf.mHorizBorders );
#if !defined(EMBEDDED)
const auto gamesResSet = gVideoDriver.getGameResStrSet();
mpGameResSelection->setList( gamesResSet );
......@@ -105,8 +99,6 @@ void CVideoSettings::refresh()
resStr += itoa(mUsersConf.mGameRect.dim.y);
mpGameResSelection->setSelection(resStr);
#endif
}
......@@ -128,14 +120,10 @@ void CVideoSettings::release()
mUsersConf.mBorderColorsEnabled = mpBorderColorSwitch->isEnabled();
#if !defined(EMBEDDED)
const std::string GameResStr = mpGameResSelection->getSelection();
sscanf( GameResStr.c_str(), "%hux%hux",
&mUsersConf.mGameRect.dim.x, &mUsersConf.mGameRect.dim.y );
#endif
#if defined(CAANOO) || defined(WIZ) || defined(DINGOO) || defined(NANONOTE) || defined(ANDROID)
mUsersConf.mDisplayRect.dim.x = 320;
......
......@@ -36,14 +36,13 @@ public:
private:
Switch *mpTiltScreenSwitch = nullptr;
Switch *mpShowCursorSwitch = nullptr;
std::shared_ptr<NumberControl> mpFPSSelection;
Switch *mpFrameSkip = nullptr;
ComboSelection *mpGameResSelection = nullptr;
Switch *mpBorderColorSwitch = nullptr;
NumberControl *mpHorizBordersSelection = nullptr;
std::shared_ptr<Switch> mpTiltScreenSwitch;
std::shared_ptr<Switch> mpShowCursorSwitch;
std::shared_ptr<NumberControl> mpFPSSelection;
std::shared_ptr<Switch> mpFrameSkip;
std::shared_ptr<ComboSelection> mpGameResSelection;
std::shared_ptr<Switch> mpBorderColorSwitch;
std::shared_ptr<NumberControl> mpHorizBordersSelection;
};
......
......@@ -29,8 +29,6 @@ GameMenu( GsRect<float>(0.25f, 0.24f, 0.5f, 0.40f),
style )
{
#if !defined(EMBEDDED)
mpMenuDialog->add(
new GameButton( "Display",
new OpenMenuEvent(
......@@ -44,8 +42,6 @@ GameMenu( GsRect<float>(0.25f, 0.24f, 0.5f, 0.40f),
new CVideoSettings(style) ),
style ) );
#endif
mpMenuDialog->add(
new GameButton( "Audio",
new OpenMenuEvent(
......
......@@ -20,18 +20,18 @@ GameMenu(GsRect<float>(0.075f, 0.24f, 0.85f, 0.4f), style )
{
setMenuLabel("KEYBMENULABEL");
mUsersConf = gVideoDriver.getVidConfig();
mpVPadSwitch = new Switch( "VirtPad", style );
mpMenuDialog->add( mpVPadSwitch );
const auto iSizeFac = gVideoDriver.getVidConfig().mVPadSize;
const auto iSizeFac = mUsersConf.mVPadSize;
mpSize =
mpVPadSize =
mpMenuDialog->add(
new NumberControl( "Size \%", 100, 400, 10, iSizeFac,
new NumberControl( "Size", 100, 400, 10, iSizeFac,
false, getStyle() ) );
mpMenuDialog->add( mpSize );
mpMenuDialog->fit();
select(1);
}
......@@ -39,7 +39,10 @@ GameMenu(GsRect<float>(0.075f, 0.24f, 0.85f, 0.4f), style )
void VPadSettingsMenu::refresh()
{
mpVPadSwitch->enable( mUsersConf.mVPad );
mUsersConf = gVideoDriver.getVidConfig();
mpVPadSwitch->enable(mUsersConf.mVPad);
mpVPadSize->setSelection(mUsersConf.mVPadSize);
}
......@@ -47,12 +50,10 @@ void VPadSettingsMenu::ponder(const float /*deltaT*/)
{
GameMenu::ponder(0);
if( gVideoDriver.VGamePadEnabled() )
{
auto &activeCfg = gVideoDriver.getVidConfig();
const auto iSize = mpSize->getSelection();
gVideoDriver.getVidConfig().mVPadSize = iSize;
}
activeCfg.mVPad = mpVPadSwitch->isEnabled();
activeCfg.mVPadSize = mpVPadSize->getSelection();
}
......@@ -60,8 +61,6 @@ void VPadSettingsMenu::release()
{
mUsersConf = gVideoDriver.getVidConfig();
mUsersConf.mVPad = mpVPadSwitch->isEnabled();
gVideoDriver.setVidConfig(mUsersConf);
gSettings.saveDrvCfg();
......
......@@ -43,7 +43,7 @@ private:
#endif
std::shared_ptr<NumberControl> mpSize;
std::shared_ptr<NumberControl> mpVPadSize;
std::list<std::string> mButtonSizes = { "large", "medium", "small" };
};
......
......@@ -13,10 +13,14 @@
#include <base/video/CVideoDriver.h>
KeenEngine::~KeenEngine()
{
gMusicPlayer.stop();
}
void KeenEngine::switchToGamePlayMode(const int startLevel)
{
const int episode = gBehaviorEngine.getEpisode();
const int episode = static_cast<int>(gBehaviorEngine.getEpisode());
std::string DataDirectory = gKeenFiles.gameDir;
gEventManager.add( new GMSwitchToPlayGameMode( episode,
......
#ifndef __KEENENGINE_H__
#define __KEENENGINE_H__
#ifndef KEENENGINE_H
#define KEENENGINE_H
#include "engine/core/GameEngine.h"
#include "engine/core/CBehaviorEngine.h"
......@@ -15,6 +15,8 @@ public:
mEp(ep),
mLockedMenu(true) {}
virtual ~KeenEngine();
void switchToGamePlayMode(const int startLevel = -1);
virtual void openMainMenu() = 0;
......@@ -69,4 +71,4 @@ struct SelectPlayerSpriteVarEvent : CEvent
#endif /* __KEENENGINE_H__ */
#endif /* KEENENGINE_H */
......@@ -30,7 +30,7 @@ struct KeenFiles : public GsSingleton<KeenFiles>
std::string gameDir;
CExeFile exeFile;
void setupFilenames(const unsigned int episode)
void setupFilenames(const int episode)
{
const std::string epStr = itoa(episode);
......
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