Commit 0b1ff59f authored by Gerhard Stein's avatar Gerhard Stein

Cheating structure improved and finally we have a cheat menu for android

users. Yay!
parent 7a471443
...@@ -206,7 +206,7 @@ void GsTilemap::drawTile(SDL_Surface *dst, int x, int y, Uint16 t) ...@@ -206,7 +206,7 @@ void GsTilemap::drawTile(SDL_Surface *dst, int x, int y, Uint16 t)
BlitSurface(m_Tilesurface, &src_rect, dst, &dst_rect); BlitSurface(m_Tilesurface, &src_rect, dst, &dst_rect);
#ifdef DEBUG_COLLISION #ifdef DEBUG_COLLISION
//std::vector<CTileProperties> &TileProp = g_pBehaviorEngine->getTileProperties(1); //std::vector<CTileProperties> &TileProp = gpBehaviorEngine->getTileProperties(1);
//FillSlopeRect(dst, dst_rect, 0xFFFFFFFF, TileProp[t].bup); //FillSlopeRect(dst, dst_rect, 0xFFFFFFFF, TileProp[t].bup);
#endif #endif
......
...@@ -54,7 +54,7 @@ void CGUISwitch::processRender(const GsRect<float> &RectDispCoordFloat) ...@@ -54,7 +54,7 @@ void CGUISwitch::processRender(const GsRect<float> &RectDispCoordFloat)
displayRect.transform(RectDispCoordFloat); displayRect.transform(RectDispCoordFloat);
/* SDL_Rect lRect = displayRect.SDLRect(); /* SDL_Rect lRect = displayRect.SDLRect();
if(g_pBehaviorEngine->getEngine() == ENGINE_VORTICON) if(gpBehaviorEngine->getEngine() == ENGINE_VORTICON)
{ {
drawVorticonStyle(lRect); drawVorticonStyle(lRect);
} }
......
...@@ -18,7 +18,7 @@ CDlgFrame::CDlgFrame(int x, int y, int w, int h, int tilewidth, int tileheight) ...@@ -18,7 +18,7 @@ CDlgFrame::CDlgFrame(int x, int y, int w, int h, int tilewidth, int tileheight)
m_y = y; m_y = y;
resize(w, h); resize(w, h);
m_theme = g_pBehaviorEngine->getEngine(); m_theme = gpBehaviorEngine->getEngine();
} }
......
...@@ -57,7 +57,7 @@ m_start_level(start_level) ...@@ -57,7 +57,7 @@ m_start_level(start_level)
{ {
g_pSound->unloadSoundData(); g_pSound->unloadSoundData();
// The last menu has been removed. Restore back the game status // The last menu has been removed. Restore back the game status
g_pBehaviorEngine->setPause(false); gpBehaviorEngine->setPause(false);
gMenuController.clearMenuStack(); gMenuController.clearMenuStack();
letchooseagain(); letchooseagain();
...@@ -758,7 +758,7 @@ void CGameLauncher::ponderPatchDialog() ...@@ -758,7 +758,7 @@ void CGameLauncher::ponderPatchDialog()
// We have to check which Episode will be used // We have to check which Episode will be used
const int episode = getEpisode( m_chosenGame ); const int episode = getEpisode( m_chosenGame );
g_pBehaviorEngine->mPatchFname = mPatchFilename; gpBehaviorEngine->mPatchFname = mPatchFilename;
if( episode > 0 ) // The game has to have a valid episode! if( episode > 0 ) // The game has to have a valid episode!
{ {
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <base/TypeDefinitions.h> #include <base/TypeDefinitions.h>
#include <base/GsEvent.h> #include <base/GsEvent.h>
#include "engine/core/options.h" #include "engine/core/options.h"
#include "Cheat.h"
#include <base/GsEvent.h> #include <base/GsEvent.h>
...@@ -38,7 +39,7 @@ const unsigned int MAX_PLAYERS = 1; ...@@ -38,7 +39,7 @@ const unsigned int MAX_PLAYERS = 1;
const unsigned int MAX_PLAYERS = 4; const unsigned int MAX_PLAYERS = 4;
#endif #endif
#define g_pBehaviorEngine CBehaviorEngine::Get() #define gpBehaviorEngine CBehaviorEngine::Get()
/* /*
* This enumerator will hold and tell what engine we are using. * This enumerator will hold and tell what engine we are using.
...@@ -125,6 +126,8 @@ public: ...@@ -125,6 +126,8 @@ public:
std::string mapLevelName; std::string mapLevelName;
stCheat mCheatmode;
private: private:
std::vector<CTileProperties> m_TileProperties[2]; std::vector<CTileProperties> m_TileProperties[2];
CPhysicsSettings m_PhysicsSettings; CPhysicsSettings m_PhysicsSettings;
...@@ -137,8 +140,7 @@ private: ...@@ -137,8 +140,7 @@ private:
bool mPausedGamePlay; bool mPausedGamePlay;
EpisodeInfoStruct *pEpisodeInfo; EpisodeInfoStruct *pEpisodeInfo;
}; };
#endif /* CBEHAVIORENGINE_H_ */ #endif /* CBEHAVIORENGINE_H_ */
...@@ -41,7 +41,7 @@ mp_AttachedObject(p_attacher) ...@@ -41,7 +41,7 @@ mp_AttachedObject(p_attacher)
void CCamera::cycleCamlead() void CCamera::cycleCamlead()
{ {
const int numPlayers = g_pBehaviorEngine->mPlayers; const int numPlayers = gpBehaviorEngine->mPlayers;
if( numPlayers == 1 ) // For one player this doesn't make sense to change if( numPlayers == 1 ) // For one player this doesn't make sense to change
return; return;
......
...@@ -58,12 +58,12 @@ void CHUD::setup(const int id) ...@@ -58,12 +58,12 @@ void CHUD::setup(const int id)
m_Rect.x = 8; m_Rect.y = 4; m_Rect.x = 8; m_Rect.y = 4;
if(g_pBehaviorEngine->mPlayers > 3) if(gpBehaviorEngine->mPlayers > 3)
{ {
m_Rect.x = 0; m_Rect.y = 0; m_Rect.x = 0; m_Rect.y = 0;
} }
size_t Episode = g_pBehaviorEngine->getEpisode(); size_t Episode = gpBehaviorEngine->getEpisode();
if( Episode >= 1 && Episode <= 3 ) if( Episode >= 1 && Episode <= 3 )
{ {
...@@ -131,7 +131,7 @@ void CHUD::CreateVorticonBackground() ...@@ -131,7 +131,7 @@ void CHUD::CreateVorticonBackground()
int sprite=0; int sprite=0;
const int Episode = g_pBehaviorEngine->getEpisode(); const int Episode = gpBehaviorEngine->getEpisode();
if(Episode == 1) sprite = OBJ_RAY_DEFSPRITE_EP1; if(Episode == 1) sprite = OBJ_RAY_DEFSPRITE_EP1;
else if(Episode == 2) sprite = OBJ_RAY_DEFSPRITE_EP2; else if(Episode == 2) sprite = OBJ_RAY_DEFSPRITE_EP2;
else if(Episode == 3) sprite = OBJ_RAY_DEFSPRITE_EP3; else if(Episode == 3) sprite = OBJ_RAY_DEFSPRITE_EP3;
...@@ -231,7 +231,7 @@ void CHUD::renderGalaxy() ...@@ -231,7 +231,7 @@ void CHUD::renderGalaxy()
gGraphics.drawDigits(getRightAlignedString(itoa(charges),2),60, 20, blitsfc ); gGraphics.drawDigits(getRightAlignedString(itoa(charges),2),60, 20, blitsfc );
gGraphics.drawDigits(getRightAlignedString(itoa(lives),2), 20, 20, blitsfc ); gGraphics.drawDigits(getRightAlignedString(itoa(lives),2), 20, 20, blitsfc );
if(g_pBehaviorEngine->mPlayers > 1 && mId == CCamera::getLead()) if(gpBehaviorEngine->mPlayers > 1 && mId == CCamera::getLead())
{ {
SDL_Rect rect; SDL_Rect rect;
rect.x = 7; rect.y = 29; rect.x = 7; rect.y = 29;
...@@ -275,7 +275,7 @@ void CHUD::renderVorticon() ...@@ -275,7 +275,7 @@ void CHUD::renderVorticon()
void CHUD::render() void CHUD::render()
{ {
size_t Episode = g_pBehaviorEngine->getEpisode(); size_t Episode = gpBehaviorEngine->getEpisode();
timer++; timer++;
......
...@@ -147,9 +147,9 @@ void CMap::collectBlockersCoordiantes() ...@@ -147,9 +147,9 @@ void CMap::collectBlockersCoordiantes()
scrollBlockY.push_back(2<<CSF); scrollBlockY.push_back(2<<CSF);
scrollBlockX.push_back(2<<CSF); scrollBlockX.push_back(2<<CSF);
int ep = g_pBehaviorEngine->getEpisode(); int ep = gpBehaviorEngine->getEpisode();
if(g_pBehaviorEngine->getEngine() == ENGINE_GALAXY) if(gpBehaviorEngine->getEngine() == ENGINE_GALAXY)
{ {
const word* map_ptr = m_Plane[2].getMapDataPtr(); const word* map_ptr = m_Plane[2].getMapDataPtr();
...@@ -203,7 +203,7 @@ void CMap::fetchNearestVertBlockers(const int x, int &leftCoord, int &rightCoord ...@@ -203,7 +203,7 @@ void CMap::fetchNearestVertBlockers(const int x, int &leftCoord, int &rightCoord
{ {
leftCoord = blockXleft; leftCoord = blockXleft;
if(leftCoord > (2<<CSF) && g_pBehaviorEngine->getEngine() == ENGINE_GALAXY) if(leftCoord > (2<<CSF) && gpBehaviorEngine->getEngine() == ENGINE_GALAXY)
{ {
// This will hide even more level blockers in Galaxy. In Vorticon // This will hide even more level blockers in Galaxy. In Vorticon
// this is not needed // this is not needed
...@@ -251,7 +251,7 @@ void CMap::fetchNearestHorBlockers(const int y, int &upCoord, int &downCoord) ...@@ -251,7 +251,7 @@ void CMap::fetchNearestHorBlockers(const int y, int &upCoord, int &downCoord)
{ {
upCoord = blockYup; upCoord = blockYup;
if(g_pBehaviorEngine->getEngine() == ENGINE_GALAXY) if(gpBehaviorEngine->getEngine() == ENGINE_GALAXY)
{ {
// This will hide even more level blockers in Galaxy. In Vorticon // This will hide even more level blockers in Galaxy. In Vorticon
// this is not needed // this is not needed
...@@ -803,7 +803,7 @@ void CMap::_drawForegroundTiles() ...@@ -803,7 +803,7 @@ void CMap::_drawForegroundTiles()
Uint16 y2 = (m_scrolly+num_h_tiles)>>TILE_S; Uint16 y2 = (m_scrolly+num_h_tiles)>>TILE_S;
std::vector<CTileProperties> &TileProperties = std::vector<CTileProperties> &TileProperties =
g_pBehaviorEngine->getTileProperties(1); gpBehaviorEngine->getTileProperties(1);
auto visGA = gVideoDriver.mpVideoEngine->mRelativeVisGameArea; auto visGA = gVideoDriver.mpVideoEngine->mRelativeVisGameArea;
...@@ -900,11 +900,11 @@ void CMap::animateAllTiles() ...@@ -900,11 +900,11 @@ void CMap::animateAllTiles()
num_h_tiles = m_height-m_mapy; num_h_tiles = m_height-m_mapy;
std::vector<CTileProperties> &frontTileProperties = std::vector<CTileProperties> &frontTileProperties =
g_pBehaviorEngine->getTileProperties(1); gpBehaviorEngine->getTileProperties(1);
word *p_front_tile = m_Plane[1].getMapDataPtr(); word *p_front_tile = m_Plane[1].getMapDataPtr();
std::vector<CTileProperties> &backTileProperties = std::vector<CTileProperties> &backTileProperties =
g_pBehaviorEngine->getTileProperties(0); gpBehaviorEngine->getTileProperties(0);
word *p_back_tile = m_Plane[0].getMapDataPtr(); word *p_back_tile = m_Plane[0].getMapDataPtr();
std::vector<Uint8> &timersBack = m_Plane[0].getTimers(); std::vector<Uint8> &timersBack = m_Plane[0].getTimers();
......
...@@ -382,7 +382,7 @@ bool CMessages::extractGlobalStrings() ...@@ -382,7 +382,7 @@ bool CMessages::extractGlobalStrings()
std::map<std::string, std::string>::iterator i; std::map<std::string, std::string>::iterator i;
for( i = StringMap.begin() ; i != StringMap.end() ; i++ ) for( i = StringMap.begin() ; i != StringMap.end() ; i++ )
{ {
g_pBehaviorEngine->setMessage(i->first, i->second); gpBehaviorEngine->setMessage(i->first, i->second);
} }
gLogging.ftextOut("Loaded %d strings from the exe-file.<br>", StringMap.size()); gLogging.ftextOut("Loaded %d strings from the exe-file.<br>", StringMap.size());
return true; return true;
......
...@@ -25,7 +25,7 @@ const int BLOCK_TOLERANCE_VORTICON = (2<<STC); ...@@ -25,7 +25,7 @@ const int BLOCK_TOLERANCE_VORTICON = (2<<STC);
void CSpriteObject::setupCollisionModel() void CSpriteObject::setupCollisionModel()
{ {
// In future we might more stuff here. For now only the episode number so certain are considered or ignored. // In future we might more stuff here. For now only the episode number so certain are considered or ignored.
episode = g_pBehaviorEngine->getEpisode(); episode = gpBehaviorEngine->getEpisode();
if(episode >= 4) if(episode >= 4)
{ {
...@@ -177,7 +177,7 @@ void CSpriteObject::adjustSlopedTiles( int x, int y1, int y2, const int xspeed ) ...@@ -177,7 +177,7 @@ void CSpriteObject::adjustSlopedTiles( int x, int y1, int y2, const int xspeed )
return; return;
// process the sloped tiles here. Galaxy only or special patch!! // process the sloped tiles here. Galaxy only or special patch!!
if(g_pBehaviorEngine->getEpisode() > 3) if(gpBehaviorEngine->getEpisode() > 3)
{ {
if(!moveSlopedTileDown(x, y2, xspeed)) if(!moveSlopedTileDown(x, y2, xspeed))
moveSlopedTileUp(x, y1, xspeed); moveSlopedTileUp(x, y1, xspeed);
...@@ -189,7 +189,7 @@ bool CSpriteObject::moveSlopedTileDown( int x, int y, const int xspeed ) ...@@ -189,7 +189,7 @@ bool CSpriteObject::moveSlopedTileDown( int x, int y, const int xspeed )
if(yinertia!=0) if(yinertia!=0)
return false; return false;
std::vector<CTileProperties> &TileProperty = g_pBehaviorEngine->getTileProperties(); std::vector<CTileProperties> &TileProperty = gpBehaviorEngine->getTileProperties();
const Sint8 slope = TileProperty[mp_Map->at(x>>CSF, y>>CSF)].bup; const Sint8 slope = TileProperty[mp_Map->at(x>>CSF, y>>CSF)].bup;
...@@ -230,7 +230,7 @@ void CSpriteObject::moveSlopedTileUp( int x, int y, const int xspeed ) ...@@ -230,7 +230,7 @@ void CSpriteObject::moveSlopedTileUp( int x, int y, const int xspeed )
if(yinertia!=0) if(yinertia!=0)
return; return;
std::vector<CTileProperties> &TileProperty = g_pBehaviorEngine->getTileProperties(); std::vector<CTileProperties> &TileProperty = gpBehaviorEngine->getTileProperties();
const Sint8 slope = TileProperty[mp_Map->at(x>>CSF, y>>CSF)].bdown; const Sint8 slope = TileProperty[mp_Map->at(x>>CSF, y>>CSF)].bdown;
// Check first, if there is a tile on players level // Check first, if there is a tile on players level
...@@ -317,7 +317,7 @@ bool CSpriteObject::hitdetectWithTile(const int num, const int lx, const int ly, ...@@ -317,7 +317,7 @@ bool CSpriteObject::hitdetectWithTile(const int num, const int lx, const int ly,
*/ */
bool CSpriteObject::hitdetectWithTilePropertyRect(const Uint16 Property, int &lx, int &ly, const int lw, const int lh, const int res) bool CSpriteObject::hitdetectWithTilePropertyRect(const Uint16 Property, int &lx, int &ly, const int lw, const int lh, const int res)
{ {
std::vector<CTileProperties> &Tile = g_pBehaviorEngine->getTileProperties(1); std::vector<CTileProperties> &Tile = gpBehaviorEngine->getTileProperties(1);
int i,j; int i,j;
Sint8 behavior; Sint8 behavior;
...@@ -355,7 +355,7 @@ bool CSpriteObject::hitdetectWithTilePropertyRect(const Uint16 Property, int &lx ...@@ -355,7 +355,7 @@ bool CSpriteObject::hitdetectWithTilePropertyRect(const Uint16 Property, int &lx
// Read only version. The detected position is not read. Just returns true and false. That's it! // Read only version. The detected position is not read. Just returns true and false. That's it!
bool CSpriteObject::hitdetectWithTilePropertyRectRO(const Uint16 Property, const int lx, const int ly, const int lw, const int lh, const int res) bool CSpriteObject::hitdetectWithTilePropertyRectRO(const Uint16 Property, const int lx, const int ly, const int lw, const int lh, const int res)
{ {
std::vector<CTileProperties> &Tile = g_pBehaviorEngine->getTileProperties(1); std::vector<CTileProperties> &Tile = gpBehaviorEngine->getTileProperties(1);
int i,j; int i,j;
Sint8 behavior; Sint8 behavior;
...@@ -383,7 +383,7 @@ bool CSpriteObject::hitdetectWithTilePropertyRectRO(const Uint16 Property, const ...@@ -383,7 +383,7 @@ bool CSpriteObject::hitdetectWithTilePropertyRectRO(const Uint16 Property, const
bool CSpriteObject::hitdetectWithTilePropertyHor(const Uint16 Property, const int lxl, const int lxr, const int ly, const int res) bool CSpriteObject::hitdetectWithTilePropertyHor(const Uint16 Property, const int lxl, const int lxr, const int ly, const int res)
{ {
std::vector<CTileProperties> &Tile = g_pBehaviorEngine->getTileProperties(1); std::vector<CTileProperties> &Tile = gpBehaviorEngine->getTileProperties(1);
int i; int i;
Sint8 behavior; Sint8 behavior;
...@@ -404,7 +404,7 @@ bool CSpriteObject::hitdetectWithTilePropertyHor(const Uint16 Property, const in ...@@ -404,7 +404,7 @@ bool CSpriteObject::hitdetectWithTilePropertyHor(const Uint16 Property, const in
bool CSpriteObject::hitdetectWithTilePropertyVert(const Uint16 Property, const int lx, const int lyu, const int lyd, const int res) bool CSpriteObject::hitdetectWithTilePropertyVert(const Uint16 Property, const int lx, const int lyu, const int lyd, const int res)
{ {
std::vector<CTileProperties> &Tile = g_pBehaviorEngine->getTileProperties(1); std::vector<CTileProperties> &Tile = gpBehaviorEngine->getTileProperties(1);
int i; int i;
Sint8 behavior; Sint8 behavior;
...@@ -431,7 +431,7 @@ bool CSpriteObject::hitdetectWithTilePropertyVert(const Uint16 Property, const i ...@@ -431,7 +431,7 @@ bool CSpriteObject::hitdetectWithTilePropertyVert(const Uint16 Property, const i
*/ */
bool CSpriteObject::hitdetectWithTileProperty(const int Property, const int x, const int y) bool CSpriteObject::hitdetectWithTileProperty(const int Property, const int x, const int y)
{ {
std::vector<CTileProperties> &Tile = g_pBehaviorEngine->getTileProperties(1); std::vector<CTileProperties> &Tile = gpBehaviorEngine->getTileProperties(1);
const int tileID = mp_Map->getPlaneDataAt(1, x, y); const int tileID = mp_Map->getPlaneDataAt(1, x, y);
const Sint8 behavior = Tile[tileID].behaviour; const Sint8 behavior = Tile[tileID].behaviour;
if( (behavior&0x7F) == Property ) // 0x7F is the mask which covers for foreground properties if( (behavior&0x7F) == Property ) // 0x7F is the mask which covers for foreground properties
...@@ -442,7 +442,7 @@ bool CSpriteObject::hitdetectWithTileProperty(const int Property, const int x, c ...@@ -442,7 +442,7 @@ bool CSpriteObject::hitdetectWithTileProperty(const int Property, const int x, c
bool CSpriteObject::turnAroundOnCliff( int x1, int x2, int y2 ) bool CSpriteObject::turnAroundOnCliff( int x1, int x2, int y2 )
{ {
std::vector<CTileProperties> &TileProperty = g_pBehaviorEngine->getTileProperties(); std::vector<CTileProperties> &TileProperty = gpBehaviorEngine->getTileProperties();
const int x_left = (x1-(1<<STC))>>CSF; const int x_left = (x1-(1<<STC))>>CSF;
const int x_right = (x2+(1<<STC))>>CSF; const int x_right = (x2+(1<<STC))>>CSF;
const int y_bottom = (y2+(1<<STC))>>CSF; const int y_bottom = (y2+(1<<STC))>>CSF;
...@@ -541,7 +541,7 @@ bool CSpriteObject::checkMapBoundaryU(const int y1) ...@@ -541,7 +541,7 @@ bool CSpriteObject::checkMapBoundaryU(const int y1)
int CSpriteObject::checkSolidR( int x1, int x2, int y1, int y2) int CSpriteObject::checkSolidR( int x1, int x2, int y1, int y2)
{ {
std::vector<CTileProperties> &TileProperty = g_pBehaviorEngine->getTileProperties(); std::vector<CTileProperties> &TileProperty = gpBehaviorEngine->getTileProperties();
int blocker; int blocker;
x2 += COLISION_RES; x2 += COLISION_RES;
...@@ -575,7 +575,7 @@ int CSpriteObject::checkSolidR( int x1, int x2, int y1, int y2) ...@@ -575,7 +575,7 @@ int CSpriteObject::checkSolidR( int x1, int x2, int y1, int y2)
int CSpriteObject::checkSolidL( int x1, int x2, int y1, int y2) int CSpriteObject::checkSolidL( int x1, int x2, int y1, int y2)
{ {
int blocker; int blocker;
std::vector<CTileProperties> &TileProperty = g_pBehaviorEngine->getTileProperties(); std::vector<CTileProperties> &TileProperty = gpBehaviorEngine->getTileProperties();
x1 -= COLISION_RES; x1 -= COLISION_RES;
...@@ -612,7 +612,7 @@ int CSpriteObject::checkSolidL( int x1, int x2, int y1, int y2) ...@@ -612,7 +612,7 @@ int CSpriteObject::checkSolidL( int x1, int x2, int y1, int y2)
int CSpriteObject::checkSolidU(int x1, int x2, int y1, const bool push_mode ) int CSpriteObject::checkSolidU(int x1, int x2, int y1, const bool push_mode )
{ {
std::vector<CTileProperties> &TileProperty = g_pBehaviorEngine->getTileProperties(); std::vector<CTileProperties> &TileProperty = gpBehaviorEngine->getTileProperties();
y1 -= COLISION_RES; y1 -= COLISION_RES;
...@@ -636,7 +636,7 @@ int CSpriteObject::checkSolidU(int x1, int x2, int y1, const bool push_mode ) ...@@ -636,7 +636,7 @@ int CSpriteObject::checkSolidU(int x1, int x2, int y1, const bool push_mode )
int CSpriteObject::checkSolidD( int x1, int x2, int y2, const bool push_mode ) int CSpriteObject::checkSolidD( int x1, int x2, int y2, const bool push_mode )
{ {
std::vector<CTileProperties> &TileProperty = g_pBehaviorEngine->getTileProperties(); std::vector<CTileProperties> &TileProperty = gpBehaviorEngine->getTileProperties();
y2 += COLISION_RES; y2 += COLISION_RES;
...@@ -750,7 +750,7 @@ void CSpriteObject::processMoveBitUp() ...@@ -750,7 +750,7 @@ void CSpriteObject::processMoveBitUp()
if( (blockedu = checkSolidU(x1, x2, y1)) == true) if( (blockedu = checkSolidU(x1, x2, y1)) == true)
{ {
if(g_pBehaviorEngine->getEpisode()<=3) // Galaxy only! if(gpBehaviorEngine->getEpisode()<=3) // Galaxy only!
return; return;
// additionally if there is a narrow space and the object might fit in, try to move it into that space // additionally if there is a narrow space and the object might fit in, try to move it into that space
......
...@@ -38,7 +38,7 @@ void CPassive::pumpEvent(const CEvent *evPtr) ...@@ -38,7 +38,7 @@ void CPassive::pumpEvent(const CEvent *evPtr)
if( dynamic_cast<const EventEndGamePlay*>(evPtr) ) if( dynamic_cast<const EventEndGamePlay*>(evPtr) )
{ {
// The last menu has been removed. Restore back the game status // The last menu has been removed. Restore back the game status
g_pBehaviorEngine->setPause(false); gpBehaviorEngine->setPause(false);
gMenuController.clearMenuStack(); gMenuController.clearMenuStack();
mEndEpisode = true; mEndEpisode = true;
} }
......
...@@ -255,7 +255,7 @@ void CSettings::loadDefaultGraphicsCfg() //Loads default graphics ...@@ -255,7 +255,7 @@ void CSettings::loadDefaultGraphicsCfg() //Loads default graphics
*/ */
void CSettings::setOption( e_OptionKeyword opt, const std::string &menuname, const std::string &name, char value) void CSettings::setOption( e_OptionKeyword opt, const std::string &menuname, const std::string &name, char value)
{ {
stOption &option = g_pBehaviorEngine->m_option[opt]; stOption &option = gpBehaviorEngine->m_option[opt];
option.menuname = menuname; option.menuname = menuname;
option.name = name; option.name = name;
option.value = value; option.value = value;
...@@ -289,7 +289,7 @@ bool CSettings::loadGameOptions() ...@@ -289,7 +289,7 @@ bool CSettings::loadGameOptions()
loadDefaultGameCfg(); loadDefaultGameCfg();
stOption *p_option = g_pBehaviorEngine->m_option; stOption *p_option = gpBehaviorEngine->m_option;
for (i = 0; i < NUM_OPTIONS; i++) for (i = 0; i < NUM_OPTIONS; i++)
{ {
bool newvalue; bool newvalue;
...@@ -310,7 +310,7 @@ bool CSettings::saveGameOptions() ...@@ -310,7 +310,7 @@ bool CSettings::saveGameOptions()
if(!Configuration.Parse()) return false; if(!Configuration.Parse()) return false;
stOption *p_option = g_pBehaviorEngine->m_option; stOption *p_option = gpBehaviorEngine->m_option;
for (int i = 0; i < NUM_OPTIONS; i++) for (int i = 0; i < NUM_OPTIONS; i++)
Configuration.SetKeyword("Game", p_option[i].name, p_option[i].value); Configuration.SetKeyword("Game", p_option[i].name, p_option[i].value);
......
...@@ -78,7 +78,7 @@ bool CSpriteObject::PoleCollision() ...@@ -78,7 +78,7 @@ bool CSpriteObject::PoleCollision()
// This used for objects that only can trigger, when it's really worth to do so. // This used for objects that only can trigger, when it's really worth to do so.
bool CSpriteObject::calcVisibility() bool CSpriteObject::calcVisibility()
{ {
int visibility = g_pBehaviorEngine->getPhysicsSettings().misc.visibility; int visibility = gpBehaviorEngine->getPhysicsSettings().misc.visibility;
SDL_Rect gameres = gVideoDriver.getGameResolution().SDLRect(); SDL_Rect gameres = gVideoDriver.getGameResolution().SDLRect();
...@@ -103,9 +103,9 @@ bool CSpriteObject::verifyForFalling() ...@@ -103,9 +103,9 @@ bool CSpriteObject::verifyForFalling()
const auto fall1 = mp_Map->getPlaneDataAt(1, getXMidPos(), getYDownPos()); const auto fall1 = mp_Map->getPlaneDataAt(1, getXMidPos(), getYDownPos());
const auto fall2 = mp_Map->getPlaneDataAt(1, getXMidPos(), getYDownPos()+(1<<(CSF))); const auto fall2 = mp_Map->getPlaneDataAt(1, getXMidPos(), getYDownPos()+(1<<(CSF)));
const auto fall3 = mp_Map->getPlaneDataAt(1, getXMidPos(), getYDownPos()+(2<<(CSF))); const auto fall3 = mp_Map->getPlaneDataAt(1, getXMidPos(), getYDownPos()+(2<<(CSF)));
const CTileProperties &TileProp1 = g_pBehaviorEngine->getTileProperties(1)[fall1]; const CTileProperties &TileProp1 = gpBehaviorEngine->getTileProperties(1)[fall1];
const CTileProperties &TileProp2 = g_pBehaviorEngine->getTileProperties(1)[fall2]; const CTileProperties &TileProp2 = gpBehaviorEngine->getTileProperties(1)[fall2];
const CTileProperties &TileProp3 = g_pBehaviorEngine->getTileProperties(1)[fall3]; const CTileProperties &TileProp3 = gpBehaviorEngine->getTileProperties(1)[fall3];
const bool nothing_on_feet = (TileProp1.bup == 0); const bool nothing_on_feet = (TileProp1.bup == 0);
const bool nothing_below_feet = (TileProp2.bup == 0) && (TileProp3.bup == 0); const bool nothing_below_feet = (TileProp2.bup == 0) && (TileProp3.bup == 0);
const bool can_fall = (nothing_on_feet && nothing_below_feet); const bool can_fall = (nothing_on_feet && nothing_below_feet);
...@@ -275,7 +275,7 @@ void CSpriteObject::InertiaAndFriction_X(const int friction_rate) ...@@ -275,7 +275,7 @@ void CSpriteObject::InertiaAndFriction_X(const int friction_rate)
void CSpriteObject::processFallPhysics(const int boost) void CSpriteObject::processFallPhysics(const int boost)
{ {
CPhysicsSettings &Physics = g_pBehaviorEngine->getPhysicsSettings(); CPhysicsSettings &Physics = gpBehaviorEngine->getPhysicsSettings();
// In this case foe is jumping? // In this case foe is jumping?
// Not sure here. We should use another variable... // Not sure here. We should use another variable...
...@@ -302,7 +302,7 @@ void CSpriteObject::processFallPhysics(const int boost) ...@@ -302,7 +302,7 @@ void CSpriteObject::processFallPhysics(const int boost)
void CSpriteObject::processFallPhysics() void CSpriteObject::processFallPhysics()
{ {
CPhysicsSettings &Physics = g_pBehaviorEngine->getPhysicsSettings(); CPhysicsSettings &Physics = gpBehaviorEngine->getPhysicsSettings();
processFallPhysics(Physics.fallspeed_increase); processFallPhysics(Physics.fallspeed_increase);
} }
......
...@@ -47,7 +47,7 @@ void CGamePlayMode::ponder(const float deltaT) ...@@ -47,7 +47,7 @@ void CGamePlayMode::ponder(const float deltaT)
} }
else if( mp_PlayGame->getStartGame() ) else if( mp_PlayGame->getStartGame() )
{ // Start another new game { // Start another new game
EventContainer.add( new GMSwitchToPlayGameMode(m_Episode, g_pBehaviorEngine->mPlayers, m_DataDirectory) ); EventContainer.add( new GMSwitchToPlayGameMode(m_Episode, gpBehaviorEngine->mPlayers, m_DataDirectory) );
} }
else if( mp_PlayGame->getExitEvent() ) else if( mp_PlayGame->getExitEvent() )
{ {
...@@ -60,7 +60,7 @@ void CGamePlayMode::render() ...@@ -60,7 +60,7 @@ void CGamePlayMode::render()
{ {
mp_PlayGame->render(); mp_PlayGame->render();
if(g_pBehaviorEngine->m_option[OPT_SHOWFPS].value) if(gpBehaviorEngine->m_option[OPT_SHOWFPS].value)
{ {
SDL_Rect rect; SDL_Rect rect;
rect.x = 5; rect.x = 5;
......
...@@ -21,7 +21,7 @@ m_startgame(false), ...@@ -21,7 +21,7 @@ m_startgame(false),
m_exitgame(false), m_exitgame(false),
m_gameover(false), m_gameover(false),
m_restartVideo(false), m_restartVideo(false),
mp_option(g_pBehaviorEngine->m_option) mp_option(gpBehaviorEngine->m_option)
{ {
m_NumSprites = gGraphics.getNumSprites(0); m_NumSprites = gGraphics.getNumSprites(0);
m_Gamepath = gKeenFiles.gameDir; m_Gamepath = gKeenFiles.gameDir;
...@@ -37,7 +37,7 @@ void CPlayGame::pumpEvent(const CEvent *evPtr) ...@@ -37,7 +37,7 @@ void CPlayGame::pumpEvent(const CEvent *evPtr)
if( dynamic_cast<const EventEndGamePlay*>(evPtr) ) if( dynamic_cast<const EventEndGamePlay*>(evPtr) )
{ {
// The last menu has been removed. Restore back the game status // The last menu has been removed. Restore back the game status
g_pBehaviorEngine->setPause(false); gpBehaviorEngine->setPause(false);
gMenuController.clearMenuStack(); gMenuController.clearMenuStack();
m_endgame = true; m_endgame = true;
} }
......