Commit cd7f2b37 authored by Gerhard Stein's avatar Gerhard Stein

Merge branch 'master' of gitlab.com:Dringgstein/Commander-Genius

parents c178fc26 b1f43160
......@@ -132,8 +132,10 @@ public:
*/
void unload()
{
assert(mpTexture != nullptr);
SDL_DestroyTexture( mpTexture );
if(mpTexture != nullptr)
SDL_DestroyTexture( mpTexture );
mpTexture = nullptr;
}
......
......@@ -54,27 +54,32 @@ public:
void enable( const bool value )
{ mEnabled = value; }
bool isEnabled()
bool isEnabled() const
{ return mEnabled; }
void select( const bool value )
{ mSelected = value; }
bool isSelected()
bool isSelected() const
{ return mSelected; }
bool isPressed() const
{ return mPressed; }
bool Up()
bool Up() const
{ return mReleased; }
#ifndef DISABLE_HOVER
void setDown( const bool value )
{
#ifndef DISABLE_HOVER
mHovered = value;
#endif
}
#else
void setDown( const bool ) {}
#endif
virtual bool sendEvent(const InputCommand) { return false; }
......
......@@ -30,10 +30,7 @@ CGUIInputText::CGUIInputText(const std::string& text ,
const int fontID,
const GsControl::Style style) :
GsControl(style),
mText(text),
mTyping(false),
mTypeTick(0),
mTick(false)
mText(text)
{
mFontID = fontID;
}
......
......@@ -45,9 +45,9 @@ protected:
std::string mText;
bool mTyping;
int mTypeTick;
bool mTick;
bool mTyping = false;
int mTypeTick = 0;
bool mTick = false;
std::unique_ptr<SDL_Surface> mpTextSfc;
......
......@@ -123,16 +123,17 @@ void DisplaySettings::refresh()
// The change are taken from the menu settings
mMyNewConf = gVideoDriver.getVidConfig();
#if defined(USE_OPENGL)
#if !defined(EMBEDDED)
#if defined(USE_OPENGL)
mpOpenGLSwitch->enable( mMyNewConf.mOpengl );
#endif
#endif
mpRenderScaleQualitySel->setSelection(mMyNewConf.mRenderScQuality);
#if !defined(EMBEDDED)
mpAspectSelection->setList( aspectList, NUM_ASPECTS );
std::string arcStr;
arcStr = itoa(mMyNewConf.mAspectCorrection.w);
......@@ -168,6 +169,9 @@ void DisplaySettings::refresh()
void DisplaySettings::release()
{
#if !defined(EMBEDDED)
// OpenGL Flag
mMyNewConf.mOpengl = mpOpenGLSwitch->isEnabled();
......@@ -252,9 +256,14 @@ void DisplaySettings::release()
// In case the user changed something in the camera settings, reload that.
mMyNewConf.m_CameraBounds = gVideoDriver.getCameraBounds();
#endif
CVidConfig oldVidConf = gVideoDriver.getVidConfig();
gVideoDriver.setVidConfig(mMyNewConf);
// At this point we also must apply and save the settings
if( !gVideoDriver.applyMode() )
{
......
......@@ -53,7 +53,7 @@ GameMenu( GsRect<float>(0.1f, 0.0f, 0.8f, 1.0f),
style);
mpMenuDialog->addControl( button,
GsRect<float>(
0.0f, 0.1f+(j*0.1f), 0.8f, 0.1f) );
0.0f, 0.1f+(j*0.1f), 0.7f, 0.1f) );
}
else
{
......
......@@ -37,7 +37,7 @@ GameMenu(GsRect<float>(0.1f, 0.0f, 0.8f, 1.0f), style )
mpMenuDialog->addControl( new InputText( text, style ),
GsRect<float>(
0.0f, 0.1f+(i*0.1f), 0.8f, 0.1f) );
0.0f, 0.1f+(i*0.1f), 0.7f, 0.1f) );
}
......@@ -60,6 +60,7 @@ void CSaveMenu::refresh()
for(Uint32 i=0 ; i<8 ; i++)
{
std::string text = EMPTY_TEXT;
if(i < StateFileList.size())
text = StateFileList.at(i);
......@@ -72,7 +73,7 @@ void CSaveMenu::refresh()
}
void CSaveMenu::ponder(const float deltaT)
void CSaveMenu::ponder(const float)
{
InputText *pInput = dynamic_cast<InputText*>(mpMenuDialog->CurrentControl());
......@@ -84,6 +85,7 @@ void CSaveMenu::ponder(const float deltaT)
minIC = IC_JUMP;
}
#if !defined(NOTYPESAVE)
// Command (Keyboard/Joystick) are handled here
for( int cmd = minIC ; cmd < MAX_COMMANDS ; cmd++ )
{
......@@ -94,6 +96,33 @@ void CSaveMenu::ponder(const float deltaT)
break;
}
}
#else
std::list< std::shared_ptr<GsControl> > &list =
mpMenuDialog->getControlList();
auto itCtrl = list.begin();
itCtrl++;
for(int i=0 ; i<8 ; i++)
{
std::shared_ptr<GsControl> &ctrl = *itCtrl;
InputText *input = dynamic_cast<InputText*>( ctrl.get() );
if(input->isPressed())
{
mpMenuDialog->setSelection(i+1);
std::shared_ptr<CEvent> command(
new CommandEvent( static_cast<InputCommand>(IC_JUMP) ));
sendEvent(command);
break;
}
itCtrl++;
}
#endif
mpMenuDialog->processLogic();
......
......@@ -17,7 +17,7 @@ public:
CSaveMenu(const GsControl::Style &style);
void refresh() override;
void processSpecific(){}
void ponder(const float deltaT) override;
void ponder(const float) override;
void sendEvent(std::shared_ptr<CEvent> &command) override;
void release() override;
......
......@@ -18,7 +18,7 @@
namespace galaxy {
const int ELDER_MOVE_SPEED = 1;
//const int ELDER_MOVE_SPEED = 1;
const int ELDER_MOVE_TIMER = 10;
int NumberToRescue;
......
......@@ -14,7 +14,7 @@ $1D9CW #Molly
$1DBAW #Molly
*/
const int MOLLY_MOVE_SPEED = 1;
//const int MOLLY_MOVE_SPEED = 1;
CMolly::CMolly(CMap* pmap, const Uint16 foeID, Uint32 x, Uint32 y) :
CGalaxySpriteObject(pmap, foeID, x, y, 0),
......
......@@ -89,6 +89,7 @@ public:
void processInLevel();
void touchedExit(int mpx);
void walkbehindexitdoor();
void kill(const bool force);
void kill();
void dieanim();
......
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