Commit 1d756bec authored by Gerhard Stein's avatar Gerhard Stein

Virtual Controlpad added to the vorticon engine

parent 75cb5259
......@@ -441,11 +441,11 @@ bool CGameLauncher::start()
{
Font.loadinternalFont(8);
}
else if(height > 960)
else if(height >= 960)
{
Font.loadinternalFont(4);
}
else if(height > 480)
else if(height >= 480)
{
Font.loadinternalFont(2);
}
......
......@@ -486,11 +486,13 @@ void CPlayerWM::processMoving()
}
else
{
VirtualKeenControl *vkc = dynamic_cast<VirtualKeenControl*>(gInput.mpVirtPad.get());
assert(vkc);
vkc->mDPad.invisible = false;
vkc->mStatusButton.invisible = false;
vkc->mStartButton.invisible = false;
if( gVideoDriver.VGamePadEnabled() )
{
VirtualKeenControl *vkc = dynamic_cast<VirtualKeenControl*>(gInput.mpVirtPad.get());
vkc->mDPad.invisible = false;
vkc->mStatusButton.invisible = false;
vkc->mStartButton.invisible = true;
}
}
......
......@@ -8,11 +8,29 @@
#include "CPlayGameVorticon.h"
#include "../ai/CManglingMachine.h"
#include "engine/core/objenums.h"
#include "engine/core/VGamepads/vgamepadsimple.h"
#include "sdl/audio/Audio.h"
#include "../finale/CTantalusRay.h"
#include <base/video/CVideoDriver.h>
#include <base/CInput.h>
void CPlayGameVorticon::processInLevel()
{
if( gVideoDriver.VGamePadEnabled() )
{
VirtualKeenControl *vkc = dynamic_cast<VirtualKeenControl*>(gInput.mpVirtPad.get());
assert(vkc);
vkc->hideAllButtons();
vkc->mPadBackground.invisible = false;
vkc->mDPad.invisible = false;
vkc->mJumpButton.invisible = false;
vkc->mPogoButton.invisible = false;
vkc->mShootButton.invisible = false;
vkc->mStatusButton.invisible = false;
}
if(m_gameover)
return;
......
......@@ -17,6 +17,7 @@
#include "sdl/audio/Audio.h"
#include "engine/core/mode/CGameMode.h"
#include "engine/core/menu/MainMenu.h"
#include "engine/core/VGamepads/vgamepadsimple.h"
#include "../CVorticonMapLoader.h"
#include "graphics/GsGraphics.h"
#include "../ai/CTeleporter.h"
......@@ -281,6 +282,18 @@ void CPlayGameVorticon::pumpEvent(const CEvent *evPtr)
////
void CPlayGameVorticon::ponder(const float deltaT)
{
VirtualKeenControl *vkc = dynamic_cast<VirtualKeenControl*>(gInput.mpVirtPad.get());
if(!vkc)
{
gInput.mpVirtPad.reset(new VirtualKeenControl);
gInput.mpVirtPad->init();
vkc = dynamic_cast<VirtualKeenControl*>(gInput.mpVirtPad.get());
}
assert(vkc);
vkc->mDPad.invisible = false;
if( !mpFinale && !gMenuController.active() ) // Game is not paused, no messages have to be shown and no menu is open
{
if(mMessageBoxes.empty() && !StatusScreenOpen())
......
......@@ -13,13 +13,14 @@
#include "graphics/GsGraphics.h"
#include "graphics/effects/CColorMerge.h"
#include "sdl/audio/Audio.h"
#include "engine/core/VGamepads/vgamepadsimple.h"
#include "../ai/CTeleporter.h"
#include "../ai/CMessie.h"
const int LVLS_SHIP = 20;
void CPlayGameVorticon::processOnWorldMap()
{
{
const int numPlayers = m_Player.size();
for( int i=0 ; i<numPlayers ; i++ )
{
......@@ -97,6 +98,17 @@ void CPlayGameVorticon::processOnWorldMap()
}
}
}
if( gVideoDriver.VGamePadEnabled() )
{
VirtualKeenControl *vkc = dynamic_cast<VirtualKeenControl*>(gInput.mpVirtPad.get());
assert(vkc);
vkc->hideAllButtons();
vkc->mDPad.invisible = false;
vkc->mStartButton.invisible = false;
}
}
void CPlayGameVorticon::goBacktoMap()
......
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