Commit 84810195 authored by Gerhard Stein's avatar Gerhard Stein

Cleanups

parent 11a78eff
......@@ -234,7 +234,7 @@ void CGameLauncher::pumpEvent(const CEvent *evPtr)
void CGameLauncher::ponder()
{
// Did the user press (X)?
if( g_pInput->getExitEvent() )
if( gInput.getExitEvent() )
{
m_mustquit = true;
return;
......@@ -244,7 +244,7 @@ void CGameLauncher::ponder()
// Command (Keyboard/Joystick) are handled here
for( int cmd = IC_LEFT ; cmd < MAX_COMMANDS ; cmd++ )
{
if( g_pInput->getPressedCommand(cmd) )
if( gInput.getPressedCommand(cmd) )
{
mLauncherDialog.sendEvent(new CommandEvent( static_cast<InputCommands>(cmd) ));
break;
......
......@@ -729,44 +729,44 @@ void CPlayer::ProcessInput()
playpushed_decreasetimer++;
if(g_pInput->getHoldedCommand(m_index, IC_LEFT) && playpushed_decreasetimer<=0 )
if(gInput.getHoldedCommand(m_index, IC_LEFT) && playpushed_decreasetimer<=0 )
{
const int newval = g_pInput->isJoystickAssgmnt(m_index, IC_LEFT) && g_pInput->isAnalog(m_index) ? -g_pInput->getJoyValue(m_index, IC_LEFT) : 100;
const int newval = gInput.isJoystickAssgmnt(m_index, IC_LEFT) && gInput.isAnalog(m_index) ? -gInput.getJoyValue(m_index, IC_LEFT) : 100;
playcontrol[PA_X] -= newval;
}
else if(g_pInput->getHoldedCommand(m_index, IC_RIGHT) && playpushed_decreasetimer>=0 )
else if(gInput.getHoldedCommand(m_index, IC_RIGHT) && playpushed_decreasetimer>=0 )
{
const int newval = g_pInput->isJoystickAssgmnt(m_index, IC_RIGHT) && g_pInput->isAnalog(m_index) ? g_pInput->getJoyValue(m_index, IC_RIGHT) : 100;
const int newval = gInput.isJoystickAssgmnt(m_index, IC_RIGHT) && gInput.isAnalog(m_index) ? gInput.getJoyValue(m_index, IC_RIGHT) : 100;
playcontrol[PA_X] += newval;
}
if(g_pInput->getHoldedCommand(m_index, IC_DOWN) )
if(gInput.getHoldedCommand(m_index, IC_DOWN) )
{
const int newval = g_pInput->isJoystickAssgmnt(m_index, IC_DOWN) && g_pInput->isAnalog(m_index) ? g_pInput->getJoyValue(m_index, IC_DOWN) : 100;
const int newval = gInput.isJoystickAssgmnt(m_index, IC_DOWN) && gInput.isAnalog(m_index) ? gInput.getJoyValue(m_index, IC_DOWN) : 100;
playcontrol[PA_Y] += newval;
}
else if(g_pInput->getHoldedCommand(m_index, IC_UP))
else if(gInput.getHoldedCommand(m_index, IC_UP))
{
const int newval = g_pInput->isJoystickAssgmnt(m_index, IC_UP) && g_pInput->isAnalog(m_index) ? -g_pInput->getJoyValue(m_index, IC_UP) : 100;
const int newval = gInput.isJoystickAssgmnt(m_index, IC_UP) && gInput.isAnalog(m_index) ? -gInput.getJoyValue(m_index, IC_UP) : 100;
playcontrol[PA_Y] -= newval;
}
if(g_pInput->getHoldedCommand(m_index, IC_UPPERLEFT))
if(gInput.getHoldedCommand(m_index, IC_UPPERLEFT))
{
playcontrol[PA_X] -= 100;
playcontrol[PA_Y] -= 100;
}
else if(g_pInput->getHoldedCommand(m_index, IC_UPPERRIGHT))
else if(gInput.getHoldedCommand(m_index, IC_UPPERRIGHT))
{
playcontrol[PA_X] += 100;
playcontrol[PA_Y] -= 100;
}
else if(g_pInput->getHoldedCommand(m_index, IC_LOWERLEFT))
else if(gInput.getHoldedCommand(m_index, IC_LOWERLEFT))
{
playcontrol[PA_X] -= 100;
playcontrol[PA_Y] += 100;
}
else if(g_pInput->getHoldedCommand(m_index, IC_LOWERRIGHT))
else if(gInput.getHoldedCommand(m_index, IC_LOWERRIGHT))
{
playcontrol[PA_X] += 100;
playcontrol[PA_Y] += 100;
......@@ -775,22 +775,22 @@ void CPlayer::ProcessInput()
if(!pfiring)
{
if(g_pInput->getHoldedCommand(m_index, IC_JUMP))
if(gInput.getHoldedCommand(m_index, IC_JUMP))
playcontrol[PA_JUMP]++;
else
playcontrol[PA_JUMP] = 0;
}
else
playcontrol[PA_JUMP] = g_pInput->getHoldedCommand(m_index, IC_JUMP) ? 1 : 0;
playcontrol[PA_JUMP] = gInput.getHoldedCommand(m_index, IC_JUMP) ? 1 : 0;
playcontrol[PA_POGO] = g_pInput->getHoldedCommand(m_index, IC_POGO) ? 1 : 0;
playcontrol[PA_POGO] = gInput.getHoldedCommand(m_index, IC_POGO) ? 1 : 0;
// The possibility to charge jumps. This is mainly used for the pogo.
if( playcontrol[PA_JUMP] > 50) playcontrol[PA_JUMP] = 50;
// Two button firing process
if(g_pInput->getTwoButtonFiring(m_index))
if(gInput.getTwoButtonFiring(m_index))
{
if(playcontrol[PA_JUMP] && playcontrol[PA_POGO])
{
......@@ -803,14 +803,14 @@ void CPlayer::ProcessInput()
playcontrol[PA_FIRE] = 0;
playcontrol[PA_JUMP] = 0;
playcontrol[PA_POGO] = 0;
g_pInput->flushCommand(IC_JUMP);
g_pInput->flushCommand(IC_FIRE);
g_pInput->flushCommand(IC_POGO);
gInput.flushCommand(IC_JUMP);
gInput.flushCommand(IC_FIRE);
gInput.flushCommand(IC_POGO);
}
}
else
playcontrol[PA_FIRE] = g_pInput->getHoldedCommand(m_index, IC_FIRE) ? 1 : 0;
playcontrol[PA_FIRE] = gInput.getHoldedCommand(m_index, IC_FIRE) ? 1 : 0;
}
/**
......@@ -855,7 +855,7 @@ void CPlayer::ProcessExitLevel()
void CPlayer::StatusBox()
{
if( g_pInput->getPressedCommand(m_index, IC_STATUS) && !level_done )
if( gInput.getPressedCommand(m_index, IC_STATUS) && !level_done )
m_showStatusScreen=true; // PlayGame class detects that variable and launches drawStatusScreen()
}
......
......@@ -408,9 +408,9 @@ void CPlayer::JumpAndPogo()
// jump high if JUMP key down, else bounce low
if (playcontrol[PA_JUMP])
{
if( !g_pInput->SuperPogo(m_index) )
if( !gInput.SuperPogo(m_index) )
{ // normal high pogo jump
if( playcontrol[PA_JUMP] > 12 || !g_pInput->ImpossiblePogo(m_index) )
if( playcontrol[PA_JUMP] > 12 || !gInput.ImpossiblePogo(m_index) )
{
if(!pogofirsttime)
{
......@@ -679,7 +679,7 @@ void CPlayer::Playerfalling()
pfallspeed += PhysicsSettings.fallspeed_increase;
// add current fall speed to player Y or make him fly in godmode with pogo
if( !godmode || !ppogostick || !g_pInput->getHoldedCommand(IC_JUMP) )
if( !godmode || !ppogostick || !gInput.getHoldedCommand(IC_JUMP) )
moveDown(pfallspeed);
}
else
......@@ -716,14 +716,14 @@ void CPlayer::raygun()
if (pfireframetimer) pfireframetimer--;
// FIRE button down, and not keencicled?
if ( playcontrol[PA_FIRE] && !pfrozentime && !(g_pInput->getHoldedKey(KC) && g_pInput->getHoldedKey(KT)) )
if ( playcontrol[PA_FIRE] && !pfrozentime && !(gInput.getHoldedKey(KC) && gInput.getHoldedKey(KT)) )
{ // fire is pressed
inhibitwalking = 1; // prevent moving
pfiring = true; // flag that we're firing
ppogostick = false; // put away pogo stick if out
// limit how quickly shots can be fired
if ( !plastfire || g_pInput->AutoGun(m_index) )
if ( !plastfire || gInput.AutoGun(m_index) )
{
if (pfireframetimer < PFIRE_LIMIT_SHOT_FREQ_FA) canRefire = true;
else canRefire = false;
......@@ -969,9 +969,9 @@ void CPlayer::processStatusScreen()
m_showStatusScreen = false;
mpStatusScr.release();
}
else if( g_pInput->getPressedAnyButtonCommand(m_index) )
else if( gInput.getPressedAnyButtonCommand(m_index) )
{
mpStatusScr->close();
g_pInput->flushCommands();
gInput.flushCommands();
}
}
......@@ -111,7 +111,7 @@ bool CPlayer::isWMSolid(int xb, int yb)
if( mp_levels_completed[level_coordinates & 0x7fff] ) // check if level is done
return false;
if( (g_pInput->getHoldedKey(KTAB) && g_pInput->getHoldedKey(KSHIFT)) || godmode )
if( (gInput.getHoldedKey(KTAB) && gInput.getHoldedKey(KSHIFT)) || godmode )
return false;
else
return true;
......
......@@ -66,7 +66,7 @@ void CBaseMenu::ponder()
// Command (Keyboard/Joystick) are handled here
for( int cmd = IC_LEFT ; cmd < MAX_COMMANDS ; cmd++ )
{
if( g_pInput->getPressedCommand(cmd) )
if( gInput.getPressedCommand(cmd) )
{
std::shared_ptr<CEvent> command(new CommandEvent( static_cast<InputCommands>(cmd) ));
sendEvent(command);
......
......@@ -37,7 +37,7 @@ public:
void operator()() const
{
g_pInput->setupNewEvent(mSelPlayer-1, mCommand);
gInput.setupNewEvent(mSelPlayer-1, mCommand);
const std::string buf = mCommandName;
mpButton->setText(buf + "=Reading=");
......@@ -63,7 +63,7 @@ public:
void operator()() const
{
g_pInput->resetControls(mSelPlayer);
gInput.resetControls(mSelPlayer);
}
int mSelPlayer;
......@@ -84,19 +84,19 @@ mSelectedPlayer(selectedPlayer)
mpMenuDialog->addControl( button );
mpTwoButtonSwitch = new CGUISwitch( "Two Button Fire" );
mpTwoButtonSwitch->enable(g_pInput->getTwoButtonFiring(mSelectedPlayer-1));
mpTwoButtonSwitch->enable(gInput.getTwoButtonFiring(mSelectedPlayer-1));
mpAnalogSwitch = new CGUISwitch( "Analog Movement" );
mpAnalogSwitch->enable(g_pInput->isAnalog(mSelectedPlayer-1));
mpAnalogSwitch->enable(gInput.isAnalog(mSelectedPlayer-1));
mpSuperPogoSwitch = new CGUISwitch( "Super Pogo" );
mpSuperPogoSwitch->enable(g_pInput->SuperPogo(mSelectedPlayer-1));
mpSuperPogoSwitch->enable(gInput.SuperPogo(mSelectedPlayer-1));
mpImpPogoSwitch = new CGUISwitch( "Impossible Pogo" );
mpImpPogoSwitch->enable(g_pInput->ImpossiblePogo(mSelectedPlayer-1));
mpImpPogoSwitch->enable(gInput.ImpossiblePogo(mSelectedPlayer-1));
mpAutoGunSwitch = new CGUISwitch( "Auto Gun" );
mpAutoGunSwitch->enable(g_pInput->AutoGun(mSelectedPlayer-1));
mpAutoGunSwitch->enable(gInput.AutoGun(mSelectedPlayer-1));
mpMenuDialog->addControl( mpTwoButtonSwitch );
mpMenuDialog->addControl( mpAnalogSwitch );
......@@ -116,12 +116,12 @@ void CControlsettings::init()
void CControlsettings::release()
{
g_pInput->setTwoButtonFiring(mSelectedPlayer-1, mpTwoButtonSwitch->isEnabled() );
g_pInput->enableAnalog(mSelectedPlayer-1, mpAnalogSwitch->isEnabled() );
g_pInput->setSuperPogo(mSelectedPlayer-1, mpSuperPogoSwitch->isEnabled() );
g_pInput->setImpossiblePogo(mSelectedPlayer-1, mpImpPogoSwitch->isEnabled() );
g_pInput->setAutoGun(mSelectedPlayer-1, mpAutoGunSwitch->isEnabled() );
g_pInput->saveControlconfig();
gInput.setTwoButtonFiring(mSelectedPlayer-1, mpTwoButtonSwitch->isEnabled() );
gInput.enableAnalog(mSelectedPlayer-1, mpAnalogSwitch->isEnabled() );
gInput.setSuperPogo(mSelectedPlayer-1, mpSuperPogoSwitch->isEnabled() );
gInput.setImpossiblePogo(mSelectedPlayer-1, mpImpPogoSwitch->isEnabled() );
gInput.setAutoGun(mSelectedPlayer-1, mpAutoGunSwitch->isEnabled() );
gInput.saveControlconfig();
}
......@@ -151,7 +151,7 @@ void CControlSettingsMovement::init()
for ( ; it != mCommandName.end(); it++ )
{
const std::string buf = it->second;
const std::string buf2 = g_pInput->getEventShortName( it->first, mSelectedPlayer-1 );
const std::string buf2 = gInput.getEventShortName( it->first, mSelectedPlayer-1 );
ReadInputEvent *rie = new ReadInputEvent(mSelectedPlayer, it->first, it->second);
CGUIButton *guiButton = new CGUIButton( buf+buf2, rie );
......@@ -168,12 +168,12 @@ void CControlSettingsMovement::ponder()
{
if( !mapping )
{
if(g_pInput->MappingInput()) // mapping changed!
if(gInput.MappingInput()) // mapping changed!
mapping = true;
}
else
{
if( !g_pInput->MappingInput() )
if( !gInput.MappingInput() )
{
// mapping changed!
mapping = false;
......@@ -182,7 +182,7 @@ void CControlSettingsMovement::ponder()
if(button)
{
int pos; unsigned char input;
std::string evName = g_pInput->getNewMappedEvent(pos, input);
std::string evName = gInput.getNewMappedEvent(pos, input);
InputCommands com = static_cast<InputCommands>(pos);
button->setText(mCommandName[com] + evName);
}
......@@ -196,7 +196,7 @@ void CControlSettingsMovement::release()
if(!mCommandName.empty())
mCommandName.clear();
g_pInput->saveControlconfig();
gInput.saveControlconfig();
}
......@@ -226,7 +226,7 @@ void CControlSettingsButtons::init()
for ( ; it != mCommandName.end(); it++ )
{
const std::string buf = it->second;
const std::string buf2 = g_pInput->getEventShortName( it->first, mSelectedPlayer-1 );
const std::string buf2 = gInput.getEventShortName( it->first, mSelectedPlayer-1 );
ReadInputEvent *rie = new ReadInputEvent(mSelectedPlayer, it->first, it->second);
CGUIButton *guiButton = new CGUIButton( buf+buf2, rie );
......@@ -245,12 +245,12 @@ void CControlSettingsButtons::ponder()
{
if( !mapping )
{
if(g_pInput->MappingInput()) // mapping changed!
if(gInput.MappingInput()) // mapping changed!
mapping = true;
}
else
{
if( !g_pInput->MappingInput() )
if( !gInput.MappingInput() )
{
// mapping changed!
mapping = false;
......@@ -259,7 +259,7 @@ void CControlSettingsButtons::ponder()
if(button)
{
int pos; unsigned char input;
std::string evName = g_pInput->getNewMappedEvent(pos, input);
std::string evName = gInput.getNewMappedEvent(pos, input);
InputCommands com = static_cast<InputCommands>(pos);
button->setText(mCommandName[com] + evName);
}
......@@ -274,6 +274,6 @@ void CControlSettingsButtons::release()
if(!mCommandName.empty())
mCommandName.clear();
g_pInput->saveControlconfig();
gInput.saveControlconfig();
}
......@@ -100,7 +100,7 @@ void CMenuController::ponder()
// Did the player press the quit/back button
if( g_pInput->getPressedCommand(IC_BACK) )
if( gInput.getPressedCommand(IC_BACK) )
{
if( mMenuStack.empty() ) // If no menu is open, open the main menu
{
......
......@@ -51,7 +51,7 @@ void CSaveMenu::ponder()
// Command (Keyboard/Joystick) are handled here
for( int cmd = minIC ; cmd < MAX_COMMANDS ; cmd++ )
{
if( g_pInput->getPressedCommand(cmd) )
if( gInput.getPressedCommand(cmd) )
{
std::shared_ptr<CEvent> command(new CommandEvent( static_cast<InputCommands>(cmd) ));
sendEvent(command);
......
......@@ -113,7 +113,7 @@ void CGameMain::ponder()
{
mpInfoScene->teardown();
mpInfoScene = nullptr;
g_pInput->flushAll();
gInput.flushAll();
gpMenuController->lock(false);
gpMenuController->hide(false);
}
......
......@@ -69,7 +69,7 @@ m_mustclose(false)
void CMessageBox::processLogic()
{
if(g_pInput->getPressedCommand(IC_STATUS))
if(gInput.getPressedCommand(IC_STATUS))
m_mustclose = true;
CGUIDialog::processLogic();
......
......@@ -208,13 +208,13 @@ void CTextViewer::drawTextlines()
void CTextViewer::ponder()
{
// Normal Keys/Axes
if( g_pInput->getHoldedCommand(IC_DOWN) )
if( gInput.getHoldedCommand(IC_DOWN) )
{
m_timer++;
if(m_timer >= 2)
scrollDown();
}
if( g_pInput->getHoldedCommand(IC_UP) )
if( gInput.getHoldedCommand(IC_UP) )
{
m_timer++;
if(m_timer >= 2)
......@@ -222,14 +222,14 @@ void CTextViewer::ponder()
}
// Page Keys
if( g_pInput->getPressedKey(KPGDN) )
if( gInput.getPressedKey(KPGDN) )
setPosition(m_linepos+16);
if( g_pInput->getPressedKey(KPGUP) )
if( gInput.getPressedKey(KPGUP) )
setPosition(m_linepos-16);
if(m_timer>=8) m_timer=0;
if(g_pInput->getPressedKey(KQUIT) || g_pInput->getPressedKey(KQ) || g_pInput->getPressedCommand(IC_BACK) )
if(gInput.getPressedKey(KQUIT) || gInput.getPressedKey(KQ) || gInput.getPressedCommand(IC_BACK) )
m_mustclose = true;
}
......
......@@ -104,7 +104,7 @@ void CCamera::setPosition(const VectorD2<int>& newpos)
void CCamera::process(const bool force)
{
// Cycle Cam Code
if( g_pInput->getPressedCommand(mCamlead, IC_CAMLEAD) )
if( gInput.getPressedCommand(mCamlead, IC_CAMLEAD) )
{
cycleCamlead();
}
......@@ -133,13 +133,13 @@ void CCamera::process(const bool force)
{ // This means, that there is no attached object. Let the camera scroll freely!
size_t movespeed = 100;
if(g_pInput->getHoldedCommand(IC_LEFT))
if(gInput.getHoldedCommand(IC_LEFT))
moveLeft(movespeed);
else if(g_pInput->getHoldedCommand(IC_RIGHT))
else if(gInput.getHoldedCommand(IC_RIGHT))
moveRight(movespeed);
if(g_pInput->getHoldedCommand(IC_UP))
if(gInput.getHoldedCommand(IC_UP))
moveUp(movespeed);
else if(g_pInput->getHoldedCommand(IC_DOWN))
else if(gInput.getHoldedCommand(IC_DOWN))
moveDown(movespeed);
}
else
......
......@@ -56,7 +56,7 @@ void CIntro::ponder()
}
if( g_pInput->getPressedAnyCommand() )
if( gInput.getPressedAnyCommand() )
{
m_finished = true;
}
......
......@@ -84,7 +84,7 @@ void CTitle::ponder()
if( !g_pGfxEngine->runningEffect() && !gpMenuController->active() )
{
if( g_pInput->getPressedAnyCommand() )
if( gInput.getPressedAnyCommand() )
{
gpMenuController->openMainMenu();
}
......
......@@ -97,7 +97,7 @@ mKeenTextSfc(g_pGfxEngine->getMiscBitmap(1))
mMaxSeparationWidth,
cmdTextRect.h,
32, 0, 0, 0, 0), &SDL_FreeSurface );
g_pInput->flushAll();
gInput.flushAll();
}
bool CPassiveGalaxy::init(char mode)
......@@ -201,7 +201,7 @@ void CPassiveGalaxy::processIntro()
const int textSeparation = (mCommanderTextPos.x+mCommanderTextSfc.getWidth()) - mKeenTextPos.x;
if(textSeparation <= -mMaxSeparationWidth || g_pInput->getPressedAnyCommand())
if(textSeparation <= -mMaxSeparationWidth || gInput.getPressedAnyCommand())
{
mZoomSfcPos.x = (gameRes.w-mpZoomSurface->w)/2;
mZoomSfcZoom.x = mpZoomSurface->w;
......@@ -211,7 +211,7 @@ void CPassiveGalaxy::processIntro()
//processPonderMode = &CPassiveGalaxy::processTitle;
//processRenderMode = &CPassiveGalaxy::renderTitle;
g_pInput->flushAll();
gInput.flushAll();
mCommanderTextSfc._draw(0,0, mpZoomSurface.get() );
mKeenTextSfc._draw(mCommanderTextSfc.getWidth()+59*mScaleFactor, 0, mpZoomSurface.get() );
......@@ -265,9 +265,9 @@ void CPassiveGalaxy::processIntroZoom()
mZoomSfcPos.y <= 8 &&
mZoomSfcZoom.x <= gameRes.w &&
mZoomSfcZoom.y <= mScaleFactor*32 ) ||
g_pInput->getPressedAnyCommand())
gInput.getPressedAnyCommand())
{
g_pInput->flushAll();
gInput.flushAll();
processPonderMode = &CPassiveGalaxy::processTitle;
processRenderMode = &CPassiveGalaxy::renderTitle;
m_BackgroundBitmap = *g_pGfxEngine->getBitmapFromStr("TITLE");
......@@ -324,9 +324,9 @@ void CPassiveGalaxy::processTitle()
// If something is pressed, popup the menu
if( !g_pGfxEngine->runningEffect() && !gpMenuController->active() )
{
if( g_pInput->getPressedAnyCommand() )
if( gInput.getPressedAnyCommand() )
{
g_pInput->flushAll();
gInput.flushAll();
gpMenuController->openMainMenu();
}
}
......
......@@ -344,7 +344,7 @@ void CPlayGameGalaxy::pumpEvent(const CEvent *evPtr)
}
}
g_pInput->flushAll();
gInput.flushAll();
mMessageBoxes.push_back( move(pMsgBox) );
}
else if( const EventSendBitmapDialogMessages *ev = dynamic_cast<const EventSendBitmapDialogMessages*>(evPtr) )
......@@ -356,7 +356,7 @@ void CPlayGameGalaxy::pumpEvent(const CEvent *evPtr)
mMessageBoxes.push_back( move(pMsgBox) );
}
g_pInput->flushAll();
gInput.flushAll();
}
else if( const EventSendDialog *ev = dynamic_cast<const EventSendDialog*>(evPtr) )
{
......@@ -364,7 +364,7 @@ void CPlayGameGalaxy::pumpEvent(const CEvent *evPtr)
pMsgBox->init();
mMessageBoxes.push_back( move(pMsgBox) );
g_pInput->flushAll();
gInput.flushAll();
}
else if( const EventSendSelectionDialogMsg* ev = dynamic_cast<const EventSendSelectionDialogMsg*>(evPtr) )
{
......@@ -462,7 +462,7 @@ void CPlayGameGalaxy::ponder()
// Trigger the Status screen here
if(inv.showStatus())
{
if( g_pInput->getPressedAnyButtonCommand(playerCount) )
if( gInput.getPressedAnyButtonCommand(playerCount) )
{
g_pSound->playSound(SOUND_STATUS_SLIDE_OUT);
inv.toggleStatusScreen();
......@@ -470,7 +470,7 @@ void CPlayGameGalaxy::ponder()
}
else
{
if(!msgboxactive && g_pInput->getPressedCommand(playerCount, IC_STATUS))
if(!msgboxactive && gInput.getPressedCommand(playerCount, IC_STATUS))
{
g_pSound->playSound(SOUND_STATUS_SLIDE_IN);
inv.toggleStatusScreen();
......@@ -509,23 +509,23 @@ void CPlayGameGalaxy::ponder()
//// Special Keyboard Input
/// Cheat Codes
if( g_pInput->getHoldedKey(KF10) )
if( gInput.getHoldedKey(KF10) )
{
if(g_pInput->getHoldedKey(KJ))
if(gInput.getHoldedKey(KJ))
{
m_Cheatmode.jump = !m_Cheatmode.jump;
std::string jumpstring = "Jump-Cheat has been ";
jumpstring += ((m_Cheatmode.jump) ? "enabled" : "disabled");
eventContainer.add( new EventSendDialog(jumpstring) );
}
else if(g_pInput->getHoldedKey(KG))
else if(gInput.getHoldedKey(KG))
{
m_Cheatmode.god = !m_Cheatmode.god;
std::string godstring = "God-Mode has been ";
godstring += ((m_Cheatmode.god) ? "enabled" : "disabled");
eventContainer.add( new EventSendDialog(godstring) );
}
else if(g_pInput->getHoldedKey(KI))
else if(gInput.getHoldedKey(KI))
{
eventContainer.add( new EventSendDialog("Get all Items!") );
......@@ -534,12 +534,12 @@ void CPlayGameGalaxy::ponder()
m_Cheatmode.items = true;
}
else if(g_pInput->getHoldedKey(KN))
else if(gInput.getHoldedKey(KN))
{
m_Cheatmode.noclipping = true;
eventContainer.add( new EventSendDialog("No clipping toggle!") );
}
else if(g_pInput->getHoldedKey(KS))
else if(gInput.getHoldedKey(KS))
{
for( auto &inv : mInventoryVec )
inv.Item.triggerAllItemsCheat();
......
......@@ -104,7 +104,7 @@ void CInventory::toggleStatusScreen()
mp_StatusBgrnd = NULL;
}
g_pInput->flushAll();
gInput.flushAll();
}
......
......@@ -218,45 +218,45 @@ void CPlayerBase::processInput()
m_playcontrol[PA_X] = 0;
m_playcontrol[PA_Y] = 0;
if(g_pInput->getHoldedCommand(mPlayerNum, IC_LEFT))
if(gInput.getHoldedCommand(mPlayerNum, IC_LEFT))
m_playcontrol[PA_X] -= 100;
else if(g_pInput->getHoldedCommand(mPlayerNum, IC_RIGHT))
else if(gInput.getHoldedCommand(mPlayerNum, IC_RIGHT))
m_playcontrol[PA_X] += 100;
if(g_pInput->getHoldedCommand(mPlayerNum, IC_DOWN))
if(gInput.getHoldedCommand(mPlayerNum, IC_DOWN))
m_playcontrol[PA_Y] += 100;
else if(g_pInput->getHoldedCommand(mPlayerNum, IC_UP))
else if(gInput.getHoldedCommand(mPlayerNum, IC_UP))
m_playcontrol[PA_Y] -= 100;
if(g_pInput->getHoldedCommand(mPlayerNum, IC_UPPERLEFT))
if(gInput.getHoldedCommand(mPlayerNum, IC_UPPERLEFT))
{
m_playcontrol[PA_X] -= 100;
m_playcontrol[PA_Y] -= 100;
}
else if(g_pInput->getHoldedCommand(mPlayerNum, IC_UPPERRIGHT))
else if(gInput.getHoldedCommand(mPlayerNum, IC_UPPERRIGHT))
{
m_playcontrol[PA_X] += 100;
m_playcontrol[PA_Y] -= 100;
}
else if(g_pInput->getHoldedCommand(mPlayerNum, IC_LOWERLEFT))
else if(gInput.getHoldedCommand(mPlayerNum, IC_LOWERLEFT))
{
m_playcontrol[PA_X] -= 100;
m_playcontrol[PA_Y] += 100;
}
else if(g_pInput->getHoldedCommand(mPlayerNum, IC_LOWERRIGHT))
else if(gInput.getHoldedCommand(mPlayerNum, IC_LOWERRIGHT))
{
m_playcontrol[PA_X] += 100;
m_playcontrol[PA_Y] += 100;
}
m_playcontrol[PA_JUMP] = g_pInput->getHoldedCommand(mPlayerNum, IC_JUMP) ? 1 : 0;
m_playcontrol[PA_POGO] = g_pInput->getHoldedCommand(mPlayerNum, IC_POGO) ? 1 : 0;
m_playcontrol[PA_JUMP] = gInput.getHoldedCommand(mPlayerNum, IC_JUMP) ? 1 : 0;
m_playcontrol[PA_POGO] = gInput.getHoldedCommand(mPlayerNum, IC_POGO) ? 1 : 0;
// The possibility to charge jumps. This is mainly used for the pogo. it is limited to 50
if( m_playcontrol[PA_JUMP] > 50) m_playcontrol[PA_JUMP] = 50;
// Two button firing process
if(g_pInput->getTwoButtonFiring(mPlayerNum))
if(gInput.getTwoButtonFiring(mPlayerNum))
{
if(m_playcontrol[PA_JUMP] && m_playcontrol[PA_POGO])
{
......@@ -269,15 +269,15 @@ void CPlayerBase::processInput()
m_playcontrol[PA_FIRE] = 0;
m_playcontrol[PA_JUMP] = 0;
m_playcontrol[PA_POGO] = 0;
g_pInput->flushCommand(IC_JUMP);
g_pInput->flushCommand(IC_FIRE);
g_pInput->flushCommand(IC_POGO);
gInput.flushCommand(IC_JUMP);
gInput.flushCommand(IC_FIRE);
gInput.flushCommand(IC_POGO);
}
}
else
{
m_playcontrol[PA_FIRE] = g_pInput->getHoldedCommand(mPlayerNum, IC_FIRE) ? 1 : 0;
m_playcontrol[PA_FIRE] = gInput.getHoldedCommand(mPlayerNum, IC_FIRE) ? 1 : 0;
}
}
......
......@@ -402,7 +402,7 @@ void CPlayerWM::processMoving()
{
// start the level
startLevel(object);
g_pInput->flushCommands();