Commit 6af19879 authored by gerstrong's avatar gerstrong

Small fixes for Windows

parent 4e8b1d8d
This diff is collapsed.
......@@ -268,7 +268,7 @@
"engine/CEvent.h"
"CVec.h"
1359807654 c:\users\admin\desktop\commander-genius\src\engine\cevent.h
1360001318 c:\users\admin\desktop\commander-genius\src\engine\cevent.h
<cstdint>
<string>
<list>
......@@ -780,7 +780,7 @@
1355227553 c:\users\admin\desktop\commander-genius\src\engine\spritedefines.h
1359807654 source:c:\users\admin\desktop\commander-genius\src\common\cmap.cpp
1360002723 source:c:\users\admin\desktop\commander-genius\src\common\cmap.cpp
"CMap.h"
"common/CBehaviorEngine.h"
"FindFile.h"
......@@ -1452,7 +1452,7 @@
"sdl/input/CInput.h"
"arguments.h"
1359808460 c:\users\admin\desktop\commander-genius\src\fileio\cpatcher.h
1360002975 c:\users\admin\desktop\commander-genius\src\fileio\cpatcher.h
<list>
<string>
"CExeFile.h"
......@@ -2380,7 +2380,7 @@
"common/Menu/CMenuController.h"
"graphics/effects/CEffects.h"
1359807654 source:c:\users\admin\desktop\commander-genius\src\engine\galaxy\cplaygamegalaxy.cpp
1360001492 source:c:\users\admin\desktop\commander-genius\src\engine\galaxy\cplaygamegalaxy.cpp
"CPlayGameGalaxy.h"
"common/CMapLoaderGalaxy.h"
"graphics/CGfxEngine.h"
......@@ -3051,7 +3051,7 @@
"../../fileio.h"
"../../CLogFile.h"
1359808721 source:c:\users\admin\desktop\commander-genius\src\fileio\cpatcher.cpp
1360002865 source:c:\users\admin\desktop\commander-genius\src\fileio\cpatcher.cpp
"CPatcher.h"
<string.h>
<fstream>
......@@ -4260,7 +4260,7 @@
1359807654 c:\users\admin\desktop\commander-genius\src\engine\galaxy\ep5\ai\csecuritydoor.h
"engine/galaxy/common/CGalaxySpriteObject.h"
1359807654 source:c:\users\admin\desktop\commander-genius\src\engine\galaxy\common\ai\cplayerwm.cpp
1360000635 source:c:\users\admin\desktop\commander-genius\src\engine\galaxy\common\ai\cplayerwm.cpp
"CPlayerWM.h"
"engine/galaxy/common/ai/CFlag.h"
"common/CBehaviorEngine.h"
......@@ -4268,7 +4268,7 @@
"sdl/sound/CSound.h"
"CVec.h"
1359807654 c:\users\admin\desktop\commander-genius\src\engine\galaxy\common\ai\cplayerwm.h
1360000635 c:\users\admin\desktop\commander-genius\src\engine\galaxy\common\ai\cplayerwm.h
"CPlayerBase.h"
1359807654 source:c:\users\admin\desktop\commander-genius\src\engine\galaxy\common\ai\cspriteitem.cpp
......@@ -4869,7 +4869,7 @@
"common/CAudioResources.h"
"fileio/CExeFile.h"
1359807654 source:c:\users\admin\desktop\commander-genius\src\engine\galaxy\res\cegagraphicsgalaxy.cpp
1360002723 source:c:\users\admin\desktop\commander-genius\src\engine\galaxy\res\cegagraphicsgalaxy.cpp
"CEGAGraphicsGalaxy.h"
"graphics/CGfxEngine.h"
"fileio/ResourceMgmt.h"
......
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="Debug" />
<ActiveTarget name="Release" />
<File name="..\..\src\fileio\CExeFile.cpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="7582" topLine="344" />
</Cursor>
</File>
<File name="..\..\src\fileio\CPatcherUtils.cpp" open="1" top="0" tabpos="18" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2705" topLine="109" />
</Cursor>
</File>
<File name="..\..\src\engine\galaxy\ep4\ai\CDiveSuit.cpp" open="1" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1066" topLine="20" />
</Cursor>
</File>
<File name="..\..\src\engine\CEventContainer.h" open="1" top="0" tabpos="15" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="961" topLine="20" />
</Cursor>
</File>
<File name="..\..\src\engine\galaxy\ep4\ai\CCouncilMember.cpp" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="5774" topLine="189" />
</Cursor>
</File>
<File name="..\..\src\engine\galaxy\common\ai\CPlayerWM.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1033" topLine="35" />
</Cursor>
</File>
<File name="..\..\src\engine\galaxy\ep4\ai\CFoot.cpp" open="1" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="740" topLine="0" />
</Cursor>
</File>
<File name="..\..\src\Debug.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="4300" topLine="152" />
</Cursor>
</File>
<File name="..\..\src\engine\galaxy\common\ai\CFlag.cpp" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1903" topLine="79" />
</Cursor>
</File>
<File name="..\..\src\fileio\CPatcher.cpp" open="1" top="1" tabpos="19" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="5921" topLine="211" />
</Cursor>
</File>
<File name="..\..\src\engine\vorticon\CAudioVorticon.cpp" open="1" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2833" topLine="87" />
</Cursor>
</File>
<File name="..\..\src\engine\galaxy\res\CEGAGraphicsGalaxy.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="10960" topLine="367" />
</Cursor>
</File>
<File name="..\..\src\fileio\compression\CHuffman.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1413" topLine="30" />
</Cursor>
</File>
<File name="..\..\src\engine\CEvent.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="928" topLine="35" />
</Cursor>
</File>
<File name="..\..\src\common\CMap.cpp" open="1" top="0" tabpos="16" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="4703" topLine="212" />
</Cursor>
</File>
<File name="..\..\src\engine\galaxy\common\ai\CPlayerBase.cpp" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="12423" topLine="461" />
</Cursor>
</File>
<File name="..\..\src\engine\galaxy\CPlayGameGalaxy.cpp" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="9045" topLine="320" />
</Cursor>
</File>
<File name="..\..\src\engine\galaxy\common\ai\CPlayerLevel.cpp" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="32386" topLine="1370" />
</Cursor>
</File>
<File name="..\..\src\fileio\CPatcher.h" open="1" top="0" tabpos="20" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="878" topLine="27" />
</Cursor>
</File>
<File name="..\..\src\engine\galaxy\common\ai\CPlayerWM.cpp" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3055" topLine="121" />
</Cursor>
</File>
</CodeBlocks_layout_file>
......@@ -36,14 +36,14 @@ m_Background(false)
////////////////////////////
void CMap::setLevel( const Uint16 level )
{
m_Level = level;
{
m_Level = level;
}
Uint16 CMap::getLevel()
{
return m_Level;
return m_Level;
}
void CMap::setLevelName( const std::string& name )
......@@ -53,7 +53,7 @@ void CMap::setLevelName( const std::string& name )
std::string CMap::getLevelName()
{
return m_LevelName;
return m_LevelName;
}
......@@ -97,8 +97,8 @@ Uint16 CMap::at(Uint16 x, Uint16 y, Uint16 t)
//////////////////////////
// returns the object/sprite/level which is set at the given coordinates
Uint16 CMap::getObjectat(Uint16 x, Uint16 y)
{
return at(x,y,2);
{
return at(x,y,2);
}
/**
......@@ -127,13 +127,13 @@ void CMap::collectBlockersCoordiantes()
scrollBlockY.push_back(1<<CSF);
scrollBlockX.push_back(1<<CSF);
int ep = g_pBehaviorEngine->getEpisode();
if(g_pBehaviorEngine->getEngine() == ENGINE_GALAXY)
{
const word* map_ptr = m_Plane[2].getMapDataPtr();
for(int y=0 ; y<(int)m_height ; y++)
{
for(int x=0 ; x<(int)m_width ; x++)
......@@ -148,17 +148,18 @@ void CMap::collectBlockersCoordiantes()
map_ptr++;
}
}
}
scrollBlockY.push_back((m_height-1)<<(CSF));
scrollBlockX.push_back((m_width-1)<<(CSF));
}
void CMap::fetchNearestVertBlockers(const int x, int &leftCoord, int &rightCoord)
{
int blockXleft, blockXright;
int blockXleft = 0;
int blockXright = 0;
std::vector<int>::iterator left = scrollBlockX.begin();
std::vector<int>::iterator right = left;
right++;
......@@ -168,20 +169,20 @@ void CMap::fetchNearestVertBlockers(const int x, int &leftCoord, int &rightCoord
{
blockXleft = *left;
blockXright = *right;
if( x > blockXleft && x < blockXright )
{
leftCoord = blockXleft;
rightCoord = blockXright;
return;
}
left++;
right++;
}
leftCoord = blockXleft;
rightCoord = blockXright;
rightCoord = blockXright;
}
void CMap::fetchNearestHorBlockers(const int y, int &upCoord, int &downCoord)
......@@ -193,19 +194,19 @@ void CMap::fetchNearestHorBlockers(const int y, int &upCoord, int &downCoord)
blockYup = *up;
blockYdown = *down;
for( ; down != scrollBlockY.end() ; )
{
blockYup = *up;
blockYdown = *down;
if( y > blockYup && y < blockYdown )
{
upCoord = blockYup;
downCoord = blockYdown;
return;
}
up++;
down++;
}
......@@ -217,11 +218,12 @@ void CMap::fetchNearestHorBlockers(const int y, int &upCoord, int &downCoord)
bool CMap::findVerticalScrollBlocker(const int x)
{
int blockXleft, blockXright;
{
int blockXleft = 0;
int blockXright = 0;
fetchNearestVertBlockers(x, blockXleft, blockXright);
if(x-(1<<CSF) < blockXleft)
return true;
return false;
......@@ -229,10 +231,10 @@ bool CMap::findVerticalScrollBlocker(const int x)
bool CMap::findHorizontalScrollBlocker(const int y)
{
{
int blockYup, blockYdown;
fetchNearestHorBlockers(y, blockYup, blockYdown);
if(y-(1<<CSF) < blockYup)
return true;
return false;
......@@ -246,11 +248,11 @@ bool CMap::findHorizontalScrollBlocker(const int y)
bool CMap::findObject(unsigned int obj, int *xout, int *yout)
{
unsigned int x,y;
for(y=2;y<m_height-2;y++)
{
for(x=2;x<m_width-2;x++)
{
{
if (m_Plane[2].getMapDataAt(x,y)==obj)
{
*xout = x;
......@@ -348,19 +350,19 @@ bool CMap::gotoPos(int x, int y)
bool retval = false;
dx = x - m_scrollx;
dy = y - m_scrolly;
if( dx > 0 )
for( int scrollx=0 ; scrollx<dx ; scrollx++) scrollRight(true);
else retval = true;
if( dx < 0 )
for( int scrollx=0 ; scrollx<-dx ; scrollx++) scrollLeft(true);
else retval = true;
if( dy > 0 )
for( int scrolly=0 ; scrolly<dy ; scrolly++) scrollDown(true);
else retval = true;
if( dy < 0 )
for( int scrolly=0 ; scrolly<-dy ; scrolly++) scrollUp(true);
else retval = true;
......@@ -372,11 +374,11 @@ bool CMap::gotoPos(int x, int y)
bool CMap::scrollRight(const bool force)
{
const int res_width = g_pVideoDriver->getGameResolution().w;
if( !force && findVerticalScrollBlocker((m_scrollx+res_width)<<STC) )
return false;
if(m_scrollx < ((m_width-2)<<4) - g_pVideoDriver->getGameResolution().w)
{
m_scrollx++;
......@@ -401,7 +403,7 @@ bool CMap::scrollLeft(const bool force)
{
if( !force && findVerticalScrollBlocker((m_scrollx-2)<<STC) )
return false;
if( m_scrollx > 32 )
{
m_scrollx--;
......@@ -581,7 +583,7 @@ void CMap::drawHstripe(unsigned int y, unsigned int mpy)
if(mpy >= m_height) return;
SDL_Surface *ScrollSurface = g_pVideoDriver->getScrollSurface();
Uint32 num_v_tiles= ScrollSurface->w/16;
if( num_v_tiles+m_mapx >= m_width )
num_v_tiles = m_width-m_mapx;
......@@ -646,7 +648,7 @@ void CMap::drawVstripe(unsigned int x, unsigned int mpx)
* \TODO: I think this function should be splat up into vorticon and galaxy engine function somehow.
*/
void CMap::_drawForegroundTiles()
{
{
// TODO: This event pushing here is to much information that is pushed to the event list. Please reduce this!
SDL_Surface *surface = g_pVideoDriver->getBlitSurface();
const Uint16 num_h_tiles = surface->h;
......@@ -669,13 +671,13 @@ void CMap::_drawForegroundTiles()
if(!m_Background) // Keen Vorticon in general do not have real background. It's just one plane
{
if(TileProperties[fg].behaviour == -2) // case when has a masked graphic.
if(TileProperties[fg].behaviour == -2) // case when has a masked graphic.
//NOTE: It is fg+1 because the masked tile comes directly on the tileplane in the Keen vorticon games.
m_Tilemaps[1].drawTile(surface, loc_x, loc_y, fg+1 );
else if (TileProperties[fg].behaviour == -1) // case when tile is just foreground
m_Tilemaps[1].drawTile(surface, loc_x, loc_y, fg );
}
else if(fg != 0)
else if(fg != 0)
{
if(TileProperties[fg].behaviour < 0)
m_Tilemaps[1].drawTile(surface, loc_x, loc_y, fg );
......@@ -716,9 +718,9 @@ void CMap::animateAllTiles()
SDL_Surface *ScrollSurface = g_pVideoDriver->getScrollSurface();
// Let the animation timer tick!!
mAnimtileTimer += 1.0f;
mAnimtileTimer += 1.0f;
const Uint8 animtileTimerInt = static_cast<Uint8>(mAnimtileTimer);
if( mAnimtileTimer > 256.0f )
mAnimtileTimer = 0.0f;
......
......@@ -49,7 +49,7 @@ struct EventExitLevel : CEvent {
const uint16_t levelObject;
const bool sucess;
const bool teleport;
EventExitLevel(const uint16_t l, const bool s, const bool t=false) :
EventExitLevel(const uint16_t l, const bool s, const bool t=false) :
levelObject(l), sucess(s), teleport(t){}
};
......@@ -65,7 +65,7 @@ struct EventRestartLevel : CEvent {};
struct EventPlayerEndLevel : CEvent {
const uint16_t levelObject;
const bool sucess;
EventPlayerEndLevel(const EventExitLevel ev) :
EventPlayerEndLevel(const EventExitLevel &ev) :
levelObject(ev.levelObject), sucess(ev.sucess) {}
};
......
......@@ -222,7 +222,7 @@ void CPlayGameGalaxy::process()
m_Inventory.Item.triggerAllItemsCheat();
m_Cheatmode.items = true;
m_Cheatmode.god = true;
m_Cheatmode.jump = true;
m_Cheatmode.jump = true;
eventContainer.add( new EventSendDialog("Super Cheat!") );
}
}
......@@ -236,29 +236,29 @@ void CPlayGameGalaxy::process()
if( EventSendBitmapDialogMsg *ev = eventContainer.occurredEvent<EventSendBitmapDialogMsg>() )
{
std::unique_ptr<CMessageBoxBitmapGalaxy> pMsgBox( new CMessageBoxBitmapGalaxy( ev->Msg, ev->BitmapRef, ev->Direction ) );
pMsgBox->init();
pMsgBox->init();
// Create the special merge effect (Fadeout) if requested
if( g_pGfxEngine->runningEffect() )
{
CColorMerge *pColorMerge = dynamic_cast<CColorMerge*>(g_pGfxEngine->Effect());
if( pColorMerge != NULL )
{
{
SDL_Surface *fxSfc = pColorMerge->getSfc().get();
SDL_Rect cutRect = pMsgBox->getRect();
SDL_Surface *msgSfc = pMsgBox->getSfc();
SDL_BlitSurface(msgSfc, NULL, fxSfc, &cutRect);
SDL_Surface *msgSfc = pMsgBox->getSfc();
SDL_BlitSurface(msgSfc, NULL, fxSfc, &cutRect);
}
CDimDark *pDimDark = dynamic_cast<CDimDark*>(g_pGfxEngine->Effect());
if( pDimDark != NULL )
{
{
SDL_Surface *fxSfc = pDimDark->getSfc().get();
SDL_Surface *darkSfc = pDimDark->getDarkSfc().get();
SDL_Rect cutRect = pMsgBox->getRect();
SDL_Surface *msgSfc = pMsgBox->getSfc();
SDL_BlitSurface(msgSfc, NULL, fxSfc, &cutRect);
SDL_BlitSurface(msgSfc, NULL, darkSfc, &cutRect);
SDL_Surface *msgSfc = pMsgBox->getSfc();
SDL_BlitSurface(msgSfc, NULL, fxSfc, &cutRect);
SDL_BlitSurface(msgSfc, NULL, darkSfc, &cutRect);
}
}
......@@ -289,14 +289,14 @@ void CPlayGameGalaxy::process()
g_pMusicPlayer->stop();
std::unique_ptr<CMessageBoxSelection> pMsgBox( new CMessageBoxSelection( ev->Message, ev->Options ) );
pMsgBox->init();
mMessageBoxes.push_back( move(pMsgBox) );
eventContainer.pop_Event();
}
if(mMessageBoxes.empty())
{
{
if( EventEnterLevel *ev = eventContainer.occurredEvent<EventEnterLevel>() )
{
if(ev->data >= 0xC000) // Start a new level!
......@@ -326,18 +326,18 @@ void CPlayGameGalaxy::process()
m_WorldMap.setActive(true);
m_LevelName = m_WorldMap.getLevelName();
m_WorldMap.loadAndPlayMusic();
const bool tel = ev->teleport;
// Should only happen in Keen 5. This should trigger on map teleportation
eventContainer.pop_Event();
eventContainer.add( new EventPlayerEndLevel(*ev) );
if(tel)
{
const EventExitLevel &evCopy = *ev;
eventContainer.add( new EventPlayerEndLevel(evCopy) );
// Should only happen in Keen 5. This should trigger on map teleportation
if(evCopy.teleport)
{
eventContainer.add( new EventPlayerTeleportFromLevel() );
}
}
eventContainer.pop_Event();
}
else if( EventExitLevelWithFoot *ev = eventContainer.occurredEvent<EventExitLevelWithFoot>() )
{
......
......@@ -41,13 +41,13 @@ waveTimer(0),
swimming(false)
{
m_ActionBaseOffset = actionoffset;
CGalaxySpriteObject::setActionForce(0);
setActionSprite();
walkBaseFrame = sprite;
wavingBaseFrame = walkBaseFrame + 22;
swimBaseFrame = walkBaseFrame + 24;
swimBaseFrame = walkBaseFrame + 24;
m_basesprite = walkBaseFrame;
performCollisions();
......@@ -132,23 +132,23 @@ void CPlayerWM::process()
if(ev->sucess)
{
finishLevel(ev->levelObject);
if(g_pBehaviorEngine->getEpisode() == 5)
{
// enough fuses broken, in fact of all the fuses levels, except the secret one.
// then open the elevator door for the last level!
// then open the elevator door for the last level!
// NOTE: I'm not sure, if there is a better way to do it. if you know one, go ahead and improve this!
if(m_Inventory.Item.fuses_levels_completed >= 4)
{
// Must happen only once!
m_Inventory.Item.fuses_levels_completed = 0;
int x = (0x1A)<<CSF; // upper left corner of that elevator
int y = (0x37)<<CSF; // on the map
// I only will change the closed elevator tiles!
const int tileID = mp_Map->getPlaneDataAt(1, x, y);
// I only will change the closed elevator tiles!
if(tileID == 0x072C)
{
......@@ -156,9 +156,9 @@ void CPlayerWM::process()
const int t_ur = mp_Map->getPlaneDataAt(1, x+(1<<CSF), y) + 10;
const int t_ll = mp_Map->getPlaneDataAt(1, x, y+(1<<CSF)) + 10;
const int t_lr = mp_Map->getPlaneDataAt(1, x+(1<<CSF), y+(1<<CSF)) + 10;
x >>= CSF; y >>= CSF;
mp_Map->setTile(x, y, t_ul, true);
mp_Map->setTile(x+1, y, t_ur, true);
mp_Map->setTile(x, y+1, t_ll, true);
......@@ -189,18 +189,18 @@ void CPlayerWM::process()
{
// Find the spot of the teleportation destination
// TODO: This part is only meant for Episode 5. We should catch exception
// Whenever another episode tries to trigger this call.
// Whenever another episode tries to trigger this call.
int x,y;
mp_Map->findTile( 0x1A, &x, &y, 2);
const int newX = x<<CSF;
const int newX = x<<CSF;
const int newY = y<<CSF;
m_Pos.x = newX;
m_Pos.y = newY;
m_camera.setPosition(m_Pos);
EventContainer.pop_Event();
}
......@@ -224,10 +224,10 @@ void CPlayerWM::processWaving()
waveTimer = 0;
return;
}
m_animation_time = 10;
sprite = m_basesprite;
sprite += m_animation%2;
sprite += m_animation%2;
}
......@@ -326,7 +326,7 @@ void CPlayerWM::processMoving()
{
performWalkingAnimation(walking);
m_cantswim = false;
waveTimer++;
if( waveTimer >= TIME_TO_WAVE)
{
......@@ -434,19 +434,19 @@ void CPlayerWM::verifyTeleportation()
else // ... make him move until teleporter hides him.
{
//const int ep = g_pBehaviorEngine->getEpisode();
mProcessPtr = &CPlayerWM::processEnteringTeleporter;
Uint16 newTile = mp_Map->getPlaneDataAt( 1, x, y );
// TODO: Check if the animated tile also must be the same formula for Episode 5
// TODO: Check if the animated tile also must be the same formula for Episode 5
newTile -= 18; // One row up
newTile += 2; // Two columns to the right!
m_teleportanibasetile = newTile;
mp_Map->setTile(x>>CSF, y>>CSF, newTile, true);
solid = false;
}
}
......@@ -515,7 +515,7 @@ void CPlayerWM::processClosingElevator()
mp_Map->setTile(x-1, y, tile2-2, true);
mp_Map->setTile(x-1, y-1, tile3-2, true);
mp_Map->setTile(x, y-1, tile4-2, true);
playSound(SOUND_ELEVATOR_OPEN);
elevator_frames--;
......@@ -601,7 +601,7 @@ void CPlayerWM::processOpeningElevator()
mp_Map->setTile(x-1, y, tile2+2, true);
mp_Map->setTile(x-1, y-1, tile3+2, true);
mp_Map->setTile(x, y-1, tile4+2, true);
playSound(SOUND_ELEVATOR_OPEN);
elevator_frames--;
......@@ -657,7 +657,7 @@ void CPlayerWM::processLeavingElevator()
// Teleporter
void CPlayerWM::processEnteringTeleporter()
{
{
// Move him to the target
VectorD2<int> pos(getXPosition(), getYPosition());
VectorD2<int> vec = target-pos;
......@@ -674,14 +674,14 @@ void CPlayerWM::processEnteringTeleporter()
vec_norm.y = vec.y/dist_y;
yDirection = vec_norm.y;
if( dist_x < SLOW_TELEPORT_WALK_SPEED &&
dist_y < SLOW_TELEPORT_WALK_SPEED)
{
moveDir(vec);
// If done make him invisible and transport him through the level. !solid
//target -> change it when the touched tile is known
......@@ -693,20 +693,20 @@ void CPlayerWM::processEnteringTeleporter()
const Uint32 filter = object & 0xFFFF;
const Uint32 newPosX = (filter & 0xFF00) >> 8;
const Uint32 newPosY = (filter & 0x00FF);
Uint16 newTile = mp_Map->getPlaneDataAt( 1, x, y );
// TODO: Check if the animated tile also must be the same formula for Episode 5
// TODO: Check if the animated tile also must be the same formula for Episode 5
newTile = m_teleportanibasetile;
newTile += 18; // One row up
newTile -= 2; // set right tile for the teleporter coord
mp_Map->setTile(x>>CSF, y>>CSF, newTile, true);
mp_Map->setTile(x>>CSF, y>>CSF, newTile, true);
// Set new target
target.x = (newPosX<<CSF);