Commit 0956e6d2 authored by gerstrong@gmail.com's avatar gerstrong@gmail.com

Preparation for more flexible Bitmap mapping in coop mode.

parent 93c545c7
......@@ -488,6 +488,7 @@ void InitBaseSearchPaths() {
#else // all other systems (Linux, *BSD, OS/2, ...)
#ifdef ANDROID
//AddToFileList(&basesearchpaths, "${HOME}/SaveData");
AddToFileList(&basesearchpaths, SDL_AndroidGetInternalStoragePath());
AddToFileList(&basesearchpaths, "/storage/emulated/0/Android/data/net.sourceforge.clonekeenplusplus/files/SaveData");
#else
AddToFileList(&basesearchpaths, "${HOME}/.CommanderGenius");
......
......@@ -61,7 +61,7 @@ public:
* @param VidConfig Video Configuration flags used to setup the Video Engine
*/
CVideoEngine(const CVidConfig& VidConfig);
~CVideoEngine();
virtual ~CVideoEngine();
virtual bool init();
......
......@@ -76,11 +76,25 @@ void GsGraphics::optimizeSprites()
}
}
void GsGraphics::createEmptyBitmaps(Uint16 num_bmps)
void GsGraphics::createEmptyBitmaps(const size_t numVar,
Uint16 num_bmps)
{
freeBitmaps(mBitmap);
GsBitmap bitmap;
mBitmap.assign(num_bmps, bitmap);
for(auto &bitmap : mBitmap)
{
freeBitmaps(bitmap);
}
mBitmap.clear();
for(size_t i=0 ; i<numVar ; i++)
{
std::vector<GsBitmap> bitmapVec;
GsBitmap bitmap;
bitmapVec.assign(num_bmps, bitmap);
mBitmap.push_back( bitmapVec );
}
}
void GsGraphics::createEmptyMaskedBitmaps(Uint16 num_bmps)
......@@ -153,12 +167,12 @@ void GsGraphics::freeFonts()
Font.pop_back();
}
void GsGraphics::freeBitmaps(std::vector<GsBitmap> &Bitmap)
{
while ( !Bitmap.empty() )
{
Bitmap.pop_back();
}
void GsGraphics::freeBitmaps(std::vector<GsBitmap> &bitmapVec)
{
while ( !bitmapVec.empty() )
{
bitmapVec.pop_back();
}
}
void GsGraphics::freeSprites()
......@@ -249,8 +263,10 @@ GsTilemap &GsGraphics::getTileMap(size_t tilemap)
std::vector<GsTilemap> &GsGraphics::getTileMaps()
{ return Tilemap; }
GsBitmap &GsGraphics::getBitmapFromId(Uint16 slot)
{ return mBitmap[slot]; }
GsBitmap &GsGraphics::getBitmapFromId(const int var,
const int slot)
//{ return mBitmap[var][slot]; }
{ return mBitmap[0][slot]; }
GsBitmap &GsGraphics::getMaskedBitmap(Uint16 slot)
{ return maskedBitmap[slot]; }
......@@ -271,16 +287,23 @@ GsSprite &GsGraphics::getSpecialSpriteRef(const std::string &name)
GsFont &GsGraphics::getFont(Uint8 index)
{ return Font.at(index); }
GsBitmap *GsGraphics::getBitmapFromStr(const std::string &name) const
GsBitmap *GsGraphics::getBitmapFromStr(const int sprVar,
const std::string &name) const
{
std::string s_name;
for(unsigned int i=0 ; i<mBitmap.size() ; i++)
//const auto bmpVecIdx = sprVar;
const auto bmpVecIdx = 0;
for(unsigned int i=0 ; i<mBitmap[bmpVecIdx].size() ; i++)
{
s_name = mBitmap[i].getName();
auto &bitmap = mBitmap[bmpVecIdx][i];
s_name = bitmap.getName();
if(s_name == name)
{
return const_cast<GsBitmap*>(&mBitmap[i]);
return const_cast<GsBitmap*>(&bitmap);
}
}
......@@ -317,7 +340,7 @@ GsSprite *GsGraphics::getSprite(const int var, const std::string &name) const
GsGraphics::~GsGraphics()
{
freeBitmaps(maskedBitmap);
freeBitmaps(mBitmap);
freeSprites();
freeFonts();
freeTilemap();
......
......@@ -42,7 +42,7 @@ public:
void appendSpriteVec(const std::vector<GsSprite> &spriteVec);
void createEmptyBitmaps(Uint16 num_bmps);
void createEmptyBitmaps(const size_t numVar, Uint16 num_bmps);
void createEmptyMaskedBitmaps(Uint16 num_bmps);
void createEmptyMisGsBitmaps(Uint16 num_bmps);
void createEmptyFontmaps(Uint8 num_fonts);
......@@ -62,10 +62,12 @@ public:
GsTilemap &getTileMap(size_t tilemap);
std::vector<GsTilemap> &getTileMaps();
GsBitmap &getBitmapFromId(Uint16 slot);
GsBitmap &getBitmapFromId(const int var,
const int slot);
GsBitmap &getMaskedBitmap(Uint16 slot);
GsBitmap &getMiscGsBitmap(Uint16 slot);
GsBitmap *getBitmapFromStr(const std::string &name) const;
GsBitmap *getBitmapFromStr(const int sprVar,
const std::string &name) const;
GsSprite *getSprite(const int var, const std::string &name) const;
......@@ -91,7 +93,7 @@ private:
std::vector<GsFont> Font;
std::vector<GsTilemap> Tilemap;
std::vector<GsBitmap> mBitmap;
std::vector< std::vector<GsBitmap> > mBitmap;
std::vector<GsBitmap> maskedBitmap;
std::vector<GsBitmap> miscGsBitmap;
std::vector< std::vector<GsSprite> > mSprite;
......
......@@ -54,7 +54,7 @@ void CGUIBitmap::updateGraphics()
// Copy the bitmap to the smart pointer
mScaledBitmapPtr.reset(new GsBitmap);
*mpBitmap = *gGraphics.getBitmapFromStr(mTextID);
*mpBitmap = *gGraphics.getBitmapFromStr(0, mTextID);
}
sizeForScreen.w /= 320;
......
......@@ -21,19 +21,14 @@ void drawMenuInGameButton(const SDL_Rect &buttonRect)
SDL_FillRect(dst, &tempRect, SDL_MapRGB(dst->format, 255, 0, 0) );
SDL_Rect line = buttonRect;
line.x += 2; line.y += 2;
line.w -= 4; line.h = 1;
line.w -= 4; line.h = 2; line.x += 2;
line.y +=2;
// This draws the classical sandwich icon
SDL_FillRect(dst, &line, SDL_MapRGB(dst->format, 255, 255, 255) );
line.y += 2;
SDL_FillRect(dst, &line, SDL_MapRGB(dst->format, 255, 255, 255) );
line.y += 2;
SDL_FillRect(dst, &line, SDL_MapRGB(dst->format, 255, 255, 255) );
for(;line.y<buttonRect.h-2;line.y+=5)
{
SDL_FillRect(dst, &line, SDL_MapRGB(dst->format, 255, 255, 255) );
}
}
......@@ -44,14 +39,7 @@ bool checkSandwichMenuClicked(GsRect<float> &rRect)
const bool hasPoint = rRect.HasPoint(pointingState.mPos);
const bool bDown = (pointingState.mActionButton > 0);
if(bDown && hasPoint)
{
return true;
}
else
{
return false;
}
return (bDown && hasPoint);
}
......
......@@ -25,18 +25,18 @@ CIntro::CIntro()
void CIntro::init()
{
// Load the Title Bitmap
mp_bm[0] = gGraphics.getBitmapFromStr("AN");
mp_bm[1] = gGraphics.getBitmapFromStr("APOGEE");
mp_bm[2] = gGraphics.getBitmapFromStr("PRESENT");
mp_bm[3] = gGraphics.getBitmapFromStr("OFAN");
mp_bm[4] = gGraphics.getBitmapFromStr("IDSOFT");
mp_bm[5] = gGraphics.getBitmapFromStr("PRODUCT");
mp_bm[0] = gGraphics.getBitmapFromStr(0,"AN");
mp_bm[1] = gGraphics.getBitmapFromStr(0, "APOGEE");
mp_bm[2] = gGraphics.getBitmapFromStr(0, "PRESENT");
mp_bm[3] = gGraphics.getBitmapFromStr(0, "OFAN");
mp_bm[4] = gGraphics.getBitmapFromStr(0, "IDSOFT");
mp_bm[5] = gGraphics.getBitmapFromStr(0, "PRODUCT");
GsRect<Uint16> gameRes = gVideoDriver.getGameResolution();
for(int j=0 ; j<6 ; j++)
{
if(mp_bm[j] == NULL)
if(mp_bm[j] == nullptr)
continue;
if (j==0)
m_mid[j] = gameRes.w - (320/2)-((mp_bm[j]->width()+4)/2);
......
......@@ -147,7 +147,7 @@ void CResourceLoaderBackground::render()
}
else if(m_style == PROGRESS_STYLE_BITMAP)
{
GsBitmap &Bitmap = *gGraphics.getBitmapFromStr("ONEMOMEN");
GsBitmap &Bitmap = *gGraphics.getBitmapFromStr(0, "ONEMOMEN");
SDL_Rect rect;
int width = Bitmap.width();
int height = Bitmap.height();
......
......@@ -345,13 +345,13 @@ class CSpriteObject
virtual ~CSpriteObject();
int getSpecialIdx() const
{ return mSpecialIdx; }
{ return mPlayerIdx; }
int getSpriteVariantId() const
{ return mSprVar; }
void setSpecialIdx(const int i)
{ mSpecialIdx = i; }
{ mPlayerIdx = i; }
void setSpriteVariantId(const int i)
{ mSprVar = i; }
......@@ -422,7 +422,7 @@ protected:
int mSprVar = 0; // Sprite variant, which is used by the Spritemap
int mSpecialIdx = 0; // Special index for different usages. In case of players, that is it's index
int mPlayerIdx = 0; // Special index for different usages. In case of players, that is its index
};
......
......@@ -356,41 +356,6 @@ bool VirtualKeenControl::mouseFingerState(const Vector2D<float> &Pos,
bool ok = false;
auto bindButtonCommand = [&](TouchButton &button,
const InputCommand &cmd) -> bool
{
if(button.invisible)
return false;
if( button.Rect().HasPoint(Pos) )
{
gInput.setCommand(0, cmd, down);
if(down)
{
button.insertFingerId(touchFingerEvent.fingerId);
}
else
{
button.removeFingerId(touchFingerEvent.fingerId);
}
return true;
}
else
{
auto it = button.mFingerSet.find(touchFingerEvent.fingerId);
if( it != button.mFingerSet.end() )
{
gInput.setCommand(0, cmd, false);
button.mFingerSet.erase(it);
}
return false;
}
};
SDL_Event ev;
ev.type = (down ? SDL_KEYDOWN : SDL_KEYUP);
......@@ -486,6 +451,42 @@ bool VirtualKeenControl::mouseFingerState(const Vector2D<float> &Pos,
}
auto bindButtonCommand = [&](TouchButton &button,
const InputCommand &cmd) -> bool
{
if(button.invisible)
return false;
if( button.Rect().HasPoint(Pos) )
{
gInput.setCommand(0, cmd, down);
if(down)
{
button.insertFingerId(touchFingerEvent.fingerId);
}
else
{
button.removeFingerId(touchFingerEvent.fingerId);
}
return true;
}
else
{
auto it = button.mFingerSet.find(touchFingerEvent.fingerId);
if( it != button.mFingerSet.end() )
{
gInput.setCommand(0, cmd, false);
button.mFingerSet.erase(it);
}
return false;
}
};
ok |= bindButtonCommand(mConfirmButton, IC_JUMP);
ok |= bindButtonCommand(mStartButton, IC_JUMP);
ok |= bindButtonCommand(mStatusButton, IC_STATUS);
......
......@@ -4,7 +4,7 @@
void GameMenu::createGalaxyBackground()
{
GsBitmap backgroundBmp( *gGraphics.getBitmapFromStr("KEENSWATCH") );
GsBitmap backgroundBmp( *gGraphics.getBitmapFromStr(0, "KEENSWATCH") );
GsRect<Uint16> gameRes = gVideoDriver.getGameResolution();
backgroundBmp.scaleTo(gameRes);
......
......@@ -16,7 +16,7 @@ public:
* @brief pumpEvent Events like user closes windows or mouse presses are processed here.
* @param evPtr
*/
void pumpEvent(const CEvent *evPtr);
void pumpEvent(const CEvent *evPtr) override;
/**
* @brief ponder Logic cycle run usually at 120 LPS
......
......@@ -17,7 +17,9 @@
#include "dreamsintro.h"
#include "dreamsgameplay.h"
#ifndef REFKEEN_VER_KDREAMS_ANYEGA_ALL
#define REFKEEN_VER_KDREAMS_ANYEGA_ALL
#endif
dreams::DreamsEngine *gDreamsEngine;
......
......@@ -81,7 +81,7 @@ void CLevelPlay::reloadLevel()
loadMap( mMap.getLevel() );
}
bool CLevelPlay::loadLevel(const Uint16 level)
bool CLevelPlay::loadLevel(const int sprVar, const Uint16 level)
{
loadMap( level );
......@@ -89,7 +89,7 @@ bool CLevelPlay::loadLevel(const Uint16 level)
const std::string level_text = "LEVEL" + itoa(level) + "_LOAD_TEXT";
const std::string loading_text = gBehaviorEngine.getString(level_text);
showMsgWithBmp( loading_text, "KEENTHUMBSUPLOADING", LEFT, true );
showMsgWithBmp( sprVar, loading_text, "KEENTHUMBSUPLOADING", LEFT, true );
mMap.drawAll();
......
......@@ -24,7 +24,7 @@ public:
* @param level level number
* @return true opon success, otherwise false
*/
bool loadLevel(const Uint16 level);
bool loadLevel(const int sprVar, const Uint16 level);
/**
* @brief reloadLevel load the opened level again
......
......@@ -29,7 +29,7 @@ SDL_Surface *keenSfc;
// 10 Seconds are for 1200 logic cycles
const int INTRO_TIME = 1200;
const int STARWARS_TIME = 1200;
//const int STARWARS_TIME = 1200;
const int STARWARS_SCROLL_TIME = 3;
......@@ -40,8 +40,8 @@ namespace galaxy
CPassiveGalaxy::CPassiveGalaxy() :
processPonderMode(&CPassiveGalaxy::processIntro),
processRenderMode(&CPassiveGalaxy::renderIntro),
mBackgroundTitle(*gGraphics.getBitmapFromStr("TITLE")),
mBackgroundStarWars(*gGraphics.getBitmapFromStr("STARWARS")),
mBackgroundTitle(*gGraphics.getBitmapFromStr(0, "TITLE")),
mBackgroundStarWars(*gGraphics.getBitmapFromStr(0, "STARWARS")),
mCommanderTextSfc(gGraphics.getMiscGsBitmap(0)),
mKeenTextSfc(gGraphics.getMiscGsBitmap(1)),
mSkipSection(false)
......@@ -58,7 +58,7 @@ mSkipSection(false)
else if(episode == 6)
mCreditsBmpID = gBehaviorEngine.isDemo() ? 18 : 23;
mCurrentLogoBmp = gGraphics.getBitmapFromId(mCreditsBmpID);
mCurrentLogoBmp = gGraphics.getBitmapFromId(0, mCreditsBmpID);
GsRect<Uint16> gameRes = gVideoDriver.getGameResolution();
......@@ -220,7 +220,7 @@ void CPassiveGalaxy::processIntro()
mTerminatorLogoNum++;
mTerminatorTimer = 0;
mCurrentLogoBmp = gGraphics.getBitmapFromId(mCreditsBmpID+mTerminatorLogoNum);
mCurrentLogoBmp = gGraphics.getBitmapFromId(0, mCreditsBmpID+mTerminatorLogoNum);
mCurrentLogoBmp.optimizeSurface();
GsRect<Uint16> logoBmpRect;
......@@ -310,7 +310,7 @@ void CPassiveGalaxy::processIntroZoom()
gInput.flushAll();
processPonderMode = &CPassiveGalaxy::processTitle;
processRenderMode = &CPassiveGalaxy::renderTitle;
mBackgroundTitle = *gGraphics.getBitmapFromStr("TITLE");
mBackgroundTitle = *gGraphics.getBitmapFromStr(0, "TITLE");
mIntroTimer = INTRO_TIME;
......@@ -390,7 +390,7 @@ void CPassiveGalaxy::processTitle()
processPonderMode = &CPassiveGalaxy::processStarWars;
processRenderMode = &CPassiveGalaxy::renderStarWars;
mBackgroundStarWars = *gGraphics.getBitmapFromStr("STARWARS");
mBackgroundStarWars = *gGraphics.getBitmapFromStr(0, "STARWARS");
GsRect<Uint16> gameRes = gVideoDriver.getGameResolution();
mBackgroundStarWars.scaleTo(gameRes);
......
......@@ -224,7 +224,7 @@ bool CPlayGameGalaxy::init()
else
{
// manually a level has been loaded
m_LevelPlay.loadLevel(m_Level);
m_LevelPlay.loadLevel(0, m_Level);
m_LevelPlay.setActive(true);
}
......@@ -303,7 +303,7 @@ void CPlayGameGalaxy::looseManagement( const int playerIdx,
if(allGameOver) // Game over?
{
const std::string end_text("GAME OVER!\n");
showMsg(end_text, new EventEndGamePlay());
showMsg(0, end_text, new EventEndGamePlay());
return;
}
else if(allDead) // not yet!
......@@ -386,7 +386,7 @@ void CPlayGameGalaxy::pumpEvent(const CEvent *evPtr)
{
gMusicPlayer.stop();
m_WorldMap.setActive(false);
m_LevelPlay.loadLevel(newLevel);
m_LevelPlay.loadLevel(ev->mSprVar, newLevel);
gSound.playSound( SOUND_ENTER_LEVEL );
m_LevelPlay.setActive(true);
}
......@@ -438,7 +438,7 @@ void CPlayGameGalaxy::pumpEvent(const CEvent *evPtr)
m_WorldMap.loadAndPlayMusic();
}
showMsgWithBmp( loading_text, "KEENTHUMBSUPLOADING", LEFT, true);
showMsgWithBmp( ev->who, loading_text, "KEENTHUMBSUPLOADING", LEFT, true);
const EventExitLevel &evCopy = *ev;
......@@ -448,7 +448,7 @@ void CPlayGameGalaxy::pumpEvent(const CEvent *evPtr)
{
gMusicPlayer.stop();
m_WorldMap.setActive(false);
m_LevelPlay.loadLevel(newLevel);
m_LevelPlay.loadLevel(ev->who, newLevel);
m_LevelPlay.setActive(true);
}
}
......@@ -587,14 +587,14 @@ void CPlayGameGalaxy::ponder(const float deltaT)
cheat.jump = !cheat.jump;
std::string jumpstring = "Jump-Cheat has been ";
jumpstring += ((cheat.jump) ? "enabled" : "disabled");
showMsg(jumpstring);
showMsg(0, jumpstring);
}
else if(gInput.getHoldedKey(KG))
{
cheat.god = !cheat.god;
std::string godstring = "God-Mode has been ";
godstring += ((cheat.god) ? "enabled" : "disabled");
showMsg(godstring);
showMsg(0, godstring);
}
else if(gInput.getHoldedKey(KI))
{
......@@ -603,7 +603,7 @@ void CPlayGameGalaxy::ponder(const float deltaT)
else if(gInput.getHoldedKey(KN))
{
cheat.noclipping = true;
showMsg("No clipping toggle!");
showMsg(0, "No clipping toggle!");
}
else if(gInput.getHoldedKey(KS))
{
......@@ -613,14 +613,14 @@ void CPlayGameGalaxy::ponder(const float deltaT)
cheat.items = true;
cheat.god = true;
cheat.jump = true;
showMsg("Super Cheat!");
showMsg(0, "Super Cheat!");
}
}
if(cheat.items)
{
showMsg("Free items!");
showMsg(0, "Free items!");
for( auto &inv : mInventoryVec )
inv.Item.triggerAllItemsCheat();
......@@ -657,7 +657,7 @@ void CPlayGameGalaxy::render()
const bool msgboxactive = !mMessageBoxes.empty();
// The position of the sandwich menu depends on the configured blit resolution
mMenuButtonRect.x = gVideoDriver.getBlitSurface()->w-10;
mMenuButtonRect.x = gVideoDriver.getBlitSurface()->w-mMenuButtonRect.w;
auto menuButtonRectWithBorder = mMenuButtonRect;
menuButtonRectWithBorder.y += gVideoDriver.getVidConfig().mHorizBorders;
......
......@@ -63,7 +63,7 @@ private:
std::vector<bool> mGameOver;
// Menu-Button
SDL_Rect mMenuButtonRect = {310, 0, 10, 10};
SDL_Rect mMenuButtonRect = {0, 0, 24, 16};
};
}
......
......@@ -18,7 +18,7 @@ CSpriteObject(pmap, x, y, sprVar),
mFoeID(foeID)
{
EpisodeInfoStruct* eiStructPtr = gBehaviorEngine.getEpisodeInfoStructRef();
spriteOffset = eiStructPtr->IndexSprites;
spriteOffset = int(eiStructPtr->IndexSprites);
}
void CGalaxySpriteObject::setupGalaxyObjectOnMap(const size_t ActionBaseOffset,
......
......@@ -36,7 +36,8 @@ bool CWorldMap::init()
}
else if(gBehaviorEngine.getEpisode() == 6)
{
MapLoader.reset( new CMapLoaderGalaxyEp6( mObjectPtr, mInventoryVec, gBehaviorEngine.isDemo() ) );
MapLoader.reset( new CMapLoaderGalaxyEp6( mObjectPtr, mInventoryVec,
gBehaviorEngine.isDemo() ) );
}
const bool ok = MapLoader->loadMap( mMap, 0 );
......@@ -54,7 +55,7 @@ bool CWorldMap::init()
if(!gSaveGameController.busy())
{
showMsgWithBmp(loading_text, "KEENTHUMBSUPLOADING", LEFT, true);
showMsgWithBmp(0, loading_text, "KEENTHUMBSUPLOADING", LEFT, true);
}
mMap.drawAll();
......
......@@ -164,7 +164,7 @@ CPlayerBase(CMap *pmap,
mPlayerNum(playerIdx),
mPlayerCtrlNum(playerIdx)
{
mSpecialIdx = playerIdx;
mPlayerIdx = playerIdx;
mActionMap[A_KEEN_DIE] = &CPlayerBase::processDying;
mActionMap[A_KEEN_DIE_ALT] = &CPlayerBase::processDying;
......@@ -197,7 +197,7 @@ void CPlayerBase::processExiting()
gEffectController.setupEffect(new CDimDark(8));
auto evExit = new EventExitLevel(mpMap->getLevel(),
true, false, mSpecialIdx);
true, false, mPlayerIdx);
evExit->playSound = true;
gEventManager.add( evExit );
m_Inventory.Item.m_gem.clear();
......
......@@ -30,7 +30,10 @@
struct EventEnterLevel : CEvent {
uint16_t data;
EventEnterLevel(const uint16_t d) : data(d) {}
int mSprVar = 0;
EventEnterLevel(const int sprVar,
const uint16_t d) : data(d),
mSprVar(sprVar) {}
};
......
......@@ -1835,7 +1835,7 @@ void CPlayerLevel::processEnterDoor()
gEffectController.setupEffect(new CDimDark(8));
auto evExit = new EventExitLevel(mpMap->getLevel(), true,
mustTeleportOnMap, mSpecialIdx);
mustTeleportOnMap, mPlayerIdx);
evExit->playSound = true;
gEventManager.add( evExit );
......@@ -1851,7 +1851,7 @@ void CPlayerLevel::processEnterDoor()
gEffectController.setupEffect(new CDimDark(8));
gMusicPlayer.stop();
auto evExit = new EventExitLevel(mpMap->getLevel(), true, false, mSpecialIdx);
auto evExit = new EventExitLevel(mpMap->getLevel(), true, false, mPlayerIdx);
evExit->playSound = true;
gEventManager.add( evExit );
......@@ -2748,12 +2748,13 @@ void CPlayerLevel::process()
gEffectController.setupEffect(new CDimDark(8));
auto evExit = new EventExitLevel(mpMap->getLevel(), true, false, mSpecialIdx);
auto evExit = new EventExitLevel(mpMap->getLevel(), true, false, mPlayerIdx);
evExit->playSound = true;
msgs.push_back( new CMessageBoxBitmapGalaxy(
msgs.push_back( new CMessageBoxBitmapGalaxy( mSprVar,
fuse_msg,
*gGraphics.getBitmapFromStr("KEENTHUMBSUP"),
*gGraphics.getBitmapFromStr(mSprVar, "KEENTHUMBSUP"),
LEFT,
false,
evExit) );
......
......@@ -172,7 +172,7 @@ void CPlayerWM::pumpEvent(const CEvent *evPtr)
// Events for the Player are processed here.
if( const EventPlayerEndLevel* ev = dynamic_cast<const EventPlayerEndLevel*>(evPtr) )
{
if(ev->who == mSpecialIdx)
if(ev->who == mPlayerIdx)
{
gEventManager.flush();
if(ev->sucess)
......@@ -236,7 +236,7 @@ void CPlayerWM::pumpEvent(const CEvent *evPtr)
else if( const EventPlayerRideFoot* ev = dynamic_cast<const EventPlayerRideFoot*>(evPtr) )
{
if(ev->who == mSpecialIdx)
if(ev->who == mPlayerIdx)
{
gEventManager.flush();
finishLevel(ev->levelObject);
......@@ -379,7 +379,7 @@ void CPlayerWM::processMoving()
else
{
// Tell the player he cannot climb yet
showMsgWithBmp(gBehaviorEngine.getString("KEEN_ROPE_REQUIRED"),
showMsgWithBmp(mSprVar, gBehaviorEngine.getString("KEEN_ROPE_REQUIRED"),
"KEENTALKING", RIGHT, false);
moveYDir(-(climbDir<<CSF)/2);
}
......@@ -529,7 +529,8 @@ void CPlayerWM::processMoving()
if( !m_cantswim )
{
gSound.playSound( SOUND_CANT_DO, SoundPlayMode::PLAY_PAUSEALL );
showMsgWithBmp(gBehaviorEngine.getString("CANT_SWIM_TEXT"),
showMsgWithBmp(mSprVar,
gBehaviorEngine.getString("CANT_SWIM_TEXT"),
105, LEFT, false);
m_cantswim = true;
......@@ -1063,7 +1064,6 @@ void CPlayerWM::startLevel(Uint16 object)
int level = object - 0xC000;