Commit de53f935 authored by gerstrong@gmail.com's avatar gerstrong@gmail.com

Version update and completed portrait loading for different players

parent f32898ca
...@@ -38,7 +38,7 @@ string(REGEX REPLACE "[\r\n]" "" CG_VERSION "${CG_VERSION}") ...@@ -38,7 +38,7 @@ string(REGEX REPLACE "[\r\n]" "" CG_VERSION "${CG_VERSION}")
# Since shell script get_version is not processed properly on windows, we have to define manually here. # Since shell script get_version is not processed properly on windows, we have to define manually here.
# TODO: Better system for defining the version # TODO: Better system for defining the version
IF(WIN32) IF(WIN32)
set(CG_VERSION "2.2.9") set(CG_VERSION "2.3.0")
endif() endif()
# Generate the README file with the correct version string # Generate the README file with the correct version string
......
...@@ -298,11 +298,10 @@ GsSprite &GsGraphics::getSpecialSpriteRef(const std::string &name) ...@@ -298,11 +298,10 @@ GsSprite &GsGraphics::getSpecialSpriteRef(const std::string &name)
GsFont &GsGraphics::getFont(Uint8 index) GsFont &GsGraphics::getFont(Uint8 index)
{ return Font.at(index); } { return Font.at(index); }
GsBitmap *GsGraphics::getBitmapFromStr(const int sprVar, GsBitmap *GsGraphics::getBitmapFromStr(const size_t sprVar,
const std::string &name) const const std::string &name) const
{ {
//const auto bmpVecIdx = sprVar; const size_t bmpVecIdx = sprVar;
const auto bmpVecIdx = 0;
auto it = mBitmapNameToIdx.find(name); auto it = mBitmapNameToIdx.find(name);
......
...@@ -77,7 +77,7 @@ public: ...@@ -77,7 +77,7 @@ public:
const int slot); const int slot);
GsBitmap &getMaskedBitmap(Uint16 slot); GsBitmap &getMaskedBitmap(Uint16 slot);
GsBitmap &getMiscGsBitmap(Uint16 slot); GsBitmap &getMiscGsBitmap(Uint16 slot);
GsBitmap *getBitmapFromStr(const int sprVar, GsBitmap *getBitmapFromStr(const size_t sprVar,
const std::string &name) const; const std::string &name) const;
GsSprite *getSprite(const int var, const std::string &name) const; GsSprite *getSprite(const int var, const std::string &name) const;
......
v2.3.0:
-------
- Improved loading of special sprites
- Bug fixes when more players are loaded
- Portrait bitmaps loading finally working
v2.2.9: v2.2.9:
------- -------
- Added a Macro for completly building without the virtual pad - Added a Macro for completly building without the virtual pad
- Cleanups by removing entire files - Cleanups by removing entire files
v2.2.8: v2.2.8:
------- -------
- Compilation fixes - Compilation fixes
......
...@@ -29,7 +29,7 @@ mp_AttachedObject(p_attacher) ...@@ -29,7 +29,7 @@ mp_AttachedObject(p_attacher)
mSpriteIdx = BLANKSPRITE; mSpriteIdx = BLANKSPRITE;
solid = false; solid = false;
const int camId = mp_AttachedObject->getSpriteVariantId(); const int camId = mp_AttachedObject->getSpriteVariantIdx();
mDontUseThisLead[camId] = false; mDontUseThisLead[camId] = false;
......
...@@ -350,7 +350,7 @@ class CSpriteObject ...@@ -350,7 +350,7 @@ class CSpriteObject
int getSpecialIdx() const int getSpecialIdx() const
{ return mPlayerIdx; } { return mPlayerIdx; }
int getSpriteVariantId() const int getSpriteVariantIdx() const
{ return mSprVar; } { return mSprVar; }
void setSpecialIdx(const int i) void setSpecialIdx(const int i)
......
...@@ -460,7 +460,7 @@ void CMapPlayGalaxy::operator>>(boost::property_tree::ptree &levelNode) ...@@ -460,7 +460,7 @@ void CMapPlayGalaxy::operator>>(boost::property_tree::ptree &levelNode)
unsigned int newXpos = it->getXPosition(); unsigned int newXpos = it->getXPosition();
spriteNode.put("<xmlattr>.id", it->mFoeID); spriteNode.put("<xmlattr>.id", it->mFoeID);
spriteNode.put("<xmlattr>.variant", it->getSpriteVariantId()); spriteNode.put("<xmlattr>.variant", it->getSpriteVariantIdx());
spriteNode.put("<xmlattr>.x", newXpos); spriteNode.put("<xmlattr>.x", newXpos);
spriteNode.put("<xmlattr>.y", newYpos); spriteNode.put("<xmlattr>.y", newYpos);
......
...@@ -438,7 +438,9 @@ void CPlayGameGalaxy::pumpEvent(const CEvent *evPtr) ...@@ -438,7 +438,9 @@ void CPlayGameGalaxy::pumpEvent(const CEvent *evPtr)
m_WorldMap.loadAndPlayMusic(); m_WorldMap.loadAndPlayMusic();
} }
showMsgWithBmp( ev->who, loading_text, "KEENTHUMBSUPLOADING", LEFT, true); const auto sprVar = mInventoryVec[ev->who].mSpriteVar;
showMsgWithBmp( sprVar, loading_text, "KEENTHUMBSUPLOADING", LEFT, true);
const EventExitLevel &evCopy = *ev; const EventExitLevel &evCopy = *ev;
......
...@@ -55,7 +55,10 @@ bool CWorldMap::init() ...@@ -55,7 +55,10 @@ bool CWorldMap::init()
if(!gSaveGameController.busy()) if(!gSaveGameController.busy())
{ {
showMsgWithBmp(0, loading_text, "KEENTHUMBSUPLOADING", LEFT, true); showMsgWithBmp(mInventoryVec[0].mSpriteVar,
loading_text,
"KEENTHUMBSUPLOADING",
LEFT, true);
} }
mMap.drawAll(); mMap.drawAll();
......
...@@ -62,7 +62,7 @@ void CBullet::getTouchedBy(CSpriteObject& theObject) ...@@ -62,7 +62,7 @@ void CBullet::getTouchedBy(CSpriteObject& theObject)
return; return;
} }
if( player->getSpriteVariantId() != getSpriteVariantId() ) if( player->getSpriteVariantIdx() != getSpriteVariantIdx() )
{ {
player->kill(false); player->kill(false);
} }
......
...@@ -228,7 +228,7 @@ void CPlatform::draw() ...@@ -228,7 +228,7 @@ void CPlatform::draw()
{ {
if(carriedObj) if(carriedObj)
{ {
GsSprite &playSprite = gGraphics.getSprite(carriedObj->getSpriteVariantId(),carriedObj->mSpriteIdx); GsSprite &playSprite = gGraphics.getSprite(carriedObj->getSpriteVariantIdx(),carriedObj->mSpriteIdx);
int distx = carriedObj->getXPosition()-getXPosition(); int distx = carriedObj->getXPosition()-getXPosition();
int disty = carriedObj->getYPosition()-getYPosition(); int disty = carriedObj->getYPosition()-getYPosition();
......
...@@ -149,7 +149,7 @@ void CPlatformHorizontal::draw() ...@@ -149,7 +149,7 @@ void CPlatformHorizontal::draw()
if(!player) if(!player)
continue; continue;
GsSprite &playSprite = gGraphics.getSprite(player->getSpriteVariantId(),player->mSpriteIdx); GsSprite &playSprite = gGraphics.getSprite(player->getSpriteVariantIdx(),player->mSpriteIdx);
int distx = player->getXPosition()-getXPosition(); int distx = player->getXPosition()-getXPosition();
int disty = player->getYPosition()-getYPosition(); int disty = player->getYPosition()-getYPosition();
......
...@@ -187,7 +187,7 @@ void CPlatformVertical::draw() ...@@ -187,7 +187,7 @@ void CPlatformVertical::draw()
if(!player) if(!player)
continue; continue;
GsSprite &playSprite = gGraphics.getSprite(player->getSpriteVariantId(), GsSprite &playSprite = gGraphics.getSprite(player->getSpriteVariantIdx(),
player->mSpriteIdx); player->mSpriteIdx);
int distx = player->getXPosition()-getXPosition(); int distx = player->getXPosition()-getXPosition();
int disty = player->getYPosition()-getYPosition(); int disty = player->getYPosition()-getYPosition();
......
...@@ -54,14 +54,14 @@ CMapLoaderGalaxy( ObjectPtr, inventoryVec) ...@@ -54,14 +54,14 @@ CMapLoaderGalaxy( ObjectPtr, inventoryVec)
// 31 seem to be the stoppers, those are not created because the platform // 31 seem to be the stoppers, those are not created because the platform
// get this from the object map directly // get this from the object map directly
const unsigned int PLATFORM_VERT_ALT = 27; //const unsigned int PLATFORM_VERT_ALT = 27;
const unsigned int PLATFORM_HORIZ_ALT = 28; //const unsigned int PLATFORM_HORIZ_ALT = 28;
const unsigned int PLATFORM_VERT = 29; //const unsigned int PLATFORM_VERT = 29;
const unsigned int PLATFORM_HORIZ = 30; //const unsigned int PLATFORM_HORIZ = 30;
// 31 does not count, because it's a blocker. // 31 does not count, because it's a blocker.
const unsigned int PLATFORM_DROP = 32; //const unsigned int PLATFORM_DROP = 32;
const unsigned int DIVE_SUIT = 35; //const unsigned int DIVE_SUIT = 35;
bool CMapLoaderGalaxyEp4::isKeenPlayer(const int foeID) bool CMapLoaderGalaxyEp4::isKeenPlayer(const int foeID)
......
...@@ -35,7 +35,7 @@ public: ...@@ -35,7 +35,7 @@ public:
void process(); void process();
private: private:
int bounceboost = 0; //int bounceboost = 0;
CPlayerLevel *mpInteractPlayer = nullptr; CPlayerLevel *mpInteractPlayer = nullptr;
}; };
......
...@@ -207,7 +207,7 @@ void CCouncilMember::getTouchedBy(CSpriteObject &theObject) ...@@ -207,7 +207,7 @@ void CCouncilMember::getTouchedBy(CSpriteObject &theObject)
std::vector<CMessageBoxGalaxy*> msgs; std::vector<CMessageBoxGalaxy*> msgs;
const int sprVar = player->getSpriteVariantId(); const int sprVar = player->getSpriteVariantIdx();
msgs.push_back( new CMessageBoxBitmapGalaxy(sprVar, elder_text[0], msgs.push_back( new CMessageBoxBitmapGalaxy(sprVar, elder_text[0],
gGraphics.getBitmapFromId(sprVar, 104), LEFT, false, nullptr) ); gGraphics.getBitmapFromId(sprVar, 104), LEFT, false, nullptr) );
......
...@@ -102,7 +102,7 @@ void CLindsey::getTouchedBy(CSpriteObject &theObject) ...@@ -102,7 +102,7 @@ void CLindsey::getTouchedBy(CSpriteObject &theObject)
#endif #endif
const int sprVar = player->getSpriteVariantId(); const int sprVar = player->getSpriteVariantIdx();
if(!customDlgs) if(!customDlgs)
......
...@@ -202,7 +202,7 @@ void CFuse::getTouchedBy(CSpriteObject &theObject) ...@@ -202,7 +202,7 @@ void CFuse::getTouchedBy(CSpriteObject &theObject)
std::vector<CMessageBoxGalaxy*> msgs; std::vector<CMessageBoxGalaxy*> msgs;
const int sprVar = thePlayer->getSpriteVariantId(); const int sprVar = thePlayer->getSpriteVariantIdx();
msgs.push_back( new CMessageBoxBitmapGalaxy(sprVar, msgs.push_back( new CMessageBoxBitmapGalaxy(sprVar,
msg, msg,
......
...@@ -83,7 +83,7 @@ void CGrabbiter::getTouchedBy(CSpriteObject& theObject) ...@@ -83,7 +83,7 @@ void CGrabbiter::getTouchedBy(CSpriteObject& theObject)
const int diffX = getXMidPos()-player->getXMidPos(); const int diffX = getXMidPos()-player->getXMidPos();
player->moveXDir(-diffX/4); player->moveXDir(-diffX/4);
const int sprVar = player->getSpriteVariantId(); const int sprVar = player->getSpriteVariantIdx();
if(player->m_Inventory.Item.m_special.sandwich > 0) if(player->m_Inventory.Item.m_special.sandwich > 0)
{ {
......
...@@ -187,7 +187,7 @@ void CRocket::getTouchedBy(CSpriteObject& theObject) ...@@ -187,7 +187,7 @@ void CRocket::getTouchedBy(CSpriteObject& theObject)
else else
{ {
// Tell the player he cannot climb yet // Tell the player he cannot climb yet
showMsgWithBmp(player->getSpriteVariantId(), showMsgWithBmp(player->getSpriteVariantIdx(),
gBehaviorEngine.getString("KEEN_KEYCARD_REQUIRED"), gBehaviorEngine.getString("KEEN_KEYCARD_REQUIRED"),
29, RIGHT, false); 29, RIGHT, false);
player->moveYDir((1<<CSF)/2); player->moveYDir((1<<CSF)/2);
......
...@@ -45,7 +45,7 @@ void CSpecialItem::getTouchedBy(CSpriteObject& theObject) ...@@ -45,7 +45,7 @@ void CSpecialItem::getTouchedBy(CSpriteObject& theObject)
exitEvent->playSound = true; exitEvent->playSound = true;
// Show got item message // Show got item message
showMsgWithBmp( player->getSpriteVariantId(), gBehaviorEngine.getString(answermap[mFoeID-0x63]), 30, LEFT, exitEvent ); showMsgWithBmp( player->getSpriteVariantIdx(), gBehaviorEngine.getString(answermap[mFoeID-0x63]), 30, LEFT, exitEvent );
player->m_Inventory.Item.m_gem.clear(); player->m_Inventory.Item.m_gem.clear();
} }
......
...@@ -58,13 +58,13 @@ void CAutoRay::process() ...@@ -58,13 +58,13 @@ void CAutoRay::process()
if (m_type==VERTICAL) if (m_type==VERTICAL)
{ {
NewRay = new CRay(mpMap, x+(4<<STC), y+(1<<CSF), CENTER, DOWN, getSpriteVariantId(), OBJ_AUTORAY_V, m_index, 124); NewRay = new CRay(mpMap, x+(4<<STC), y+(1<<CSF), CENTER, DOWN, getSpriteVariantIdx(), OBJ_AUTORAY_V, m_index, 124);
NewRay->mSpriteIdx = RAY_VERT_EP3; NewRay->mSpriteIdx = RAY_VERT_EP3;
NewRay->m_VertDir = DOWN; NewRay->m_VertDir = DOWN;
} }
else else
{ {
NewRay = new CRay(mpMap, x+(1<<CSF), y+(4<<STC), CENTER, DOWN, getSpriteVariantId(), OBJ_AUTORAY, m_index, 124); NewRay = new CRay(mpMap, x+(1<<CSF), y+(4<<STC), CENTER, DOWN, getSpriteVariantIdx(), OBJ_AUTORAY, m_index, 124);
NewRay->mSpriteIdx = ENEMYRAYEP3; NewRay->mSpriteIdx = ENEMYRAYEP3;
NewRay->m_HorDir = RIGHT; NewRay->m_HorDir = RIGHT;
} }
......
...@@ -125,9 +125,9 @@ void CGuardRobot::process() ...@@ -125,9 +125,9 @@ void CGuardRobot::process()
if (onscreen) if (onscreen)
playSound(SOUND_TANK_FIRE); playSound(SOUND_TANK_FIRE);
if (movedir==RIGHT) if (movedir==RIGHT)
newobject = new CRay(mpMap,getXRightPos()+(4<<STC), getYUpPos()+(5<<STC), RIGHT, CENTER, getSpriteVariantId()); newobject = new CRay(mpMap,getXRightPos()+(4<<STC), getYUpPos()+(5<<STC), RIGHT, CENTER, getSpriteVariantIdx());
else else
newobject = new CRay(mpMap,getXPosition(), getYUpPos()+(5<<STC), LEFT, CENTER, getSpriteVariantId()); newobject = new CRay(mpMap,getXPosition(), getYUpPos()+(5<<STC), LEFT, CENTER, getSpriteVariantIdx());
newobject->setOwner(OBJ_GUARDROBOT, m_index); newobject->setOwner(OBJ_GUARDROBOT, m_index);
newobject->mSpriteIdx = ENEMYRAYEP2; newobject->mSpriteIdx = ENEMYRAYEP2;
......
...@@ -356,7 +356,7 @@ void CManglingMachine::se_mortimer_spark() ...@@ -356,7 +356,7 @@ void CManglingMachine::se_mortimer_spark()
{ {
mpMap->setTile(mx, my, 169, true); mpMap->setTile(mx, my, 169, true);
// spawn a ZAP! or a ZOT! // spawn a ZAP! or a ZOT!
CRay *newobject = new CRay(mpMap, ((mx<<4)+4)<<STC, my<<4<<STC, CENTER, DOWN, getSpriteVariantId()); CRay *newobject = new CRay(mpMap, ((mx<<4)+4)<<STC, my<<4<<STC, CENTER, DOWN, getSpriteVariantIdx());
newobject->state = CRay::RAY_STATE_SETZAPZOT; newobject->state = CRay::RAY_STATE_SETZAPZOT;
newobject->inhibitfall = true; newobject->inhibitfall = true;
spawnObj(newobject); spawnObj(newobject);
...@@ -367,7 +367,7 @@ void CManglingMachine::se_mortimer_spark() ...@@ -367,7 +367,7 @@ void CManglingMachine::se_mortimer_spark()
{ {
mpMap->setTile(mx, my, 169, true); mpMap->setTile(mx, my, 169, true);
// spawn a ZAP! or a ZOT! // spawn a ZAP! or a ZOT!
CRay *newobject = new CRay(mpMap, ((mx<<4)+4)<<STC, my<<4<<STC, CENTER, DOWN, getSpriteVariantId()); CRay *newobject = new CRay(mpMap, ((mx<<4)+4)<<STC, my<<4<<STC, CENTER, DOWN, getSpriteVariantIdx());
newobject->state = CRay::RAY_STATE_SETZAPZOT; newobject->state = CRay::RAY_STATE_SETZAPZOT;
newobject->inhibitfall = true; newobject->inhibitfall = true;
spawnObj(newobject); spawnObj(newobject);
...@@ -431,7 +431,7 @@ void CManglingMachine::se_mortimer_heart(CVorticonSpriteObject *obj) ...@@ -431,7 +431,7 @@ void CManglingMachine::se_mortimer_heart(CVorticonSpriteObject *obj)
// delete the tile // delete the tile
mpMap->setTile(x,my,169); mpMap->setTile(x,my,169);
// spawn a ZAP! or a ZOT! // spawn a ZAP! or a ZOT!
CRay *newobject = new CRay(mpMap, ((x<<4)+4)<<STC, my<<4<<STC, CENTER, DOWN, getSpriteVariantId()); CRay *newobject = new CRay(mpMap, ((x<<4)+4)<<STC, my<<4<<STC, CENTER, DOWN, getSpriteVariantIdx());
newobject->state = CRay::RAY_STATE_SETZAPZOT; newobject->state = CRay::RAY_STATE_SETZAPZOT;
newobject->inhibitfall = true; newobject->inhibitfall = true;
spawnObj(newobject); spawnObj(newobject);
...@@ -533,7 +533,7 @@ void CManglingMachine::se_mortimer_zapsup() ...@@ -533,7 +533,7 @@ void CManglingMachine::se_mortimer_zapsup()
for(x=MORTIMER_MACHINE_XSTART;x<MORTIMER_MACHINE_XEND;x++) for(x=MORTIMER_MACHINE_XSTART;x<MORTIMER_MACHINE_XEND;x++)
{ {
// spawn a ZAP! or a ZOT! // spawn a ZAP! or a ZOT!
CRay *newobject = new CRay(mpMap, ((x<<4)+4)<<STC, (my+1)<<CSF, CENTER, DOWN, getSpriteVariantId()); CRay *newobject = new CRay(mpMap, ((x<<4)+4)<<STC, (my+1)<<CSF, CENTER, DOWN, getSpriteVariantIdx());
newobject->state = CRay::RAY_STATE_SETZAPZOT; newobject->state = CRay::RAY_STATE_SETZAPZOT;
newobject->inhibitfall = true; newobject->inhibitfall = true;
spawnObj(newobject); spawnObj(newobject);
...@@ -762,7 +762,7 @@ void CManglingMachine::se_mortimer_randomzaps() ...@@ -762,7 +762,7 @@ void CManglingMachine::se_mortimer_randomzaps()
y = rand()%((MORTIMER_MACHINE_YENDNOLEGS*16)-(MORTIMER_MACHINE_YSTART*16))+(MORTIMER_MACHINE_YSTART*16); y = rand()%((MORTIMER_MACHINE_YENDNOLEGS*16)-(MORTIMER_MACHINE_YSTART*16))+(MORTIMER_MACHINE_YSTART*16);
// spawn a ZAP! or a ZOT! // spawn a ZAP! or a ZOT!
CRay *newobject = new CRay(mpMap,x<<CSF, y<<CSF, RIGHT, CENTER, getSpriteVariantId() ); CRay *newobject = new CRay(mpMap,x<<CSF, y<<CSF, RIGHT, CENTER, getSpriteVariantIdx() );
newobject->state = CRay::RAY_STATE_SETZAPZOT; newobject->state = CRay::RAY_STATE_SETZAPZOT;
newobject->inhibitfall = true; newobject->inhibitfall = true;
spawnObj(newobject); spawnObj(newobject);
......
...@@ -52,7 +52,7 @@ mp_levels_completed(mpLevelCompleted) ...@@ -52,7 +52,7 @@ mp_levels_completed(mpLevelCompleted)
CPlayer::CPlayer(const CPlayer &player) : CPlayer::CPlayer(const CPlayer &player) :
CVorticonSpriteObject(player.mpMap, CVorticonSpriteObject(player.mpMap,
player.getXPosition(), player.getYPosition(), player.getXPosition(), player.getYPosition(),
OBJ_PLAYER, player.getSpriteVariantId() ), OBJ_PLAYER, player.getSpriteVariantIdx() ),
pjumpupspeed_decrease(player.pjumpupspeed_decrease), pjumpupspeed_decrease(player.pjumpupspeed_decrease),
mp_levels_completed(player.mp_levels_completed) mp_levels_completed(player.mp_levels_completed)
{ {
......
...@@ -771,7 +771,7 @@ void CPlayer::raygun() ...@@ -771,7 +771,7 @@ void CPlayer::raygun()
CRay *rayobject = new CRay(mpMap, xdir, ydir, CRay *rayobject = new CRay(mpMap, xdir, ydir,
static_cast<direction_t>(pDir.x), static_cast<direction_t>(pDir.x),
CENTER, CENTER,
getSpriteVariantId(), getSpriteVariantIdx(),
OBJ_PLAYER, m_index); OBJ_PLAYER, m_index);
rayobject->setSpeed(124); rayobject->setSpeed(124);
gEventManager.add(new EventSpawnObject(rayobject) ); gEventManager.add(new EventSpawnObject(rayobject) );
......
...@@ -171,7 +171,7 @@ void CRay::getTouchedBy(CVorticonSpriteObject &theObject) ...@@ -171,7 +171,7 @@ void CRay::getTouchedBy(CVorticonSpriteObject &theObject)
} }
else else
{ {
if(theObject.getSpriteVariantId() != getSpriteVariantId()) if(theObject.getSpriteVariantIdx() != getSpriteVariantIdx())
{ {
if (!gBehaviorEngine.mOptions[GameOption::ALLOWPKING].value) if (!gBehaviorEngine.mOptions[GameOption::ALLOWPKING].value)
{ {
......
...@@ -88,7 +88,7 @@ void CSpark::process() ...@@ -88,7 +88,7 @@ void CSpark::process()
my = my+3+blowy; my = my+3+blowy;
mpMap->setTile(mx, my, 505, true); mpMap->setTile(mx, my, 505, true);
// spawn a ZAP! or a ZOT! // spawn a ZAP! or a ZOT!
CRay *newobject = new CRay(mpMap, mx<<CSF, my<<CSF, CENTER, DOWN, getSpriteVariantId()); CRay *newobject = new CRay(mpMap, mx<<CSF, my<<CSF, CENTER, DOWN, getSpriteVariantIdx());
newobject->state = CRay::RAY_STATE_SETZAPZOT; newobject->state = CRay::RAY_STATE_SETZAPZOT;
newobject->setOwner(m_type, m_index); newobject->setOwner(m_type, m_index);
gEventManager.add( new EventSpawnObject(newobject) ); gEventManager.add( new EventSpawnObject(newobject) );
...@@ -133,7 +133,7 @@ void CSpark::process() ...@@ -133,7 +133,7 @@ void CSpark::process()
//my = my+y; //my = my+y;
mpMap->setTile(mx, my+y, 549, true); mpMap->setTile(mx, my+y, 549, true);
// spawn a ZAP! or a ZOT! // spawn a ZAP! or a ZOT!
CRay *newobject = new CRay(mpMap, mx<<CSF, (my+y)<<CSF, CENTER, DOWN, getSpriteVariantId()); CRay *newobject = new CRay(mpMap, mx<<CSF, (my+y)<<CSF, CENTER, DOWN, getSpriteVariantIdx());
newobject->setOwner(m_type ,m_index); newobject->setOwner(m_type ,m_index);
newobject->state = CRay::RAY_STATE_SETZAPZOT; newobject->state = CRay::RAY_STATE_SETZAPZOT;
playSound(SOUND_SHOT_HIT); playSound(SOUND_SHOT_HIT);
......
...@@ -161,9 +161,9 @@ void CTank::process() ...@@ -161,9 +161,9 @@ void CTank::process()
if (onscreen) if (onscreen)
playSound(SOUND_TANK_FIRE); playSound(SOUND_TANK_FIRE);
if (movedir==RIGHT) if (movedir==RIGHT)
newobject = new CRay(mpMap, getXMidPos(), getYUpPos()+height_top, RIGHT, CENTER, getSpriteVariantId()); newobject = new CRay(mpMap, getXMidPos(), getYUpPos()+height_top, RIGHT, CENTER, getSpriteVariantIdx());
else else
newobject = new CRay(mpMap, getXMidPos()-(1<<CSF), getYUpPos()+height_top, LEFT, CENTER, getSpriteVariantId()); newobject = new CRay(mpMap, getXMidPos()-(1<<CSF), getYUpPos()+height_top, LEFT, CENTER, getSpriteVariantIdx());
newobject->setOwner(OBJ_TANK, m_index); newobject->setOwner(OBJ_TANK, m_index);
newobject->setSpeed(108); newobject->setSpeed(108);
newobject->mSpriteIdx = ENEMYRAY; newobject->mSpriteIdx = ENEMYRAY;
......
...@@ -275,9 +275,9 @@ void CVorticonElite::process() ...@@ -275,9 +275,9 @@ void CVorticonElite::process()
CRay *newobject; CRay *newobject;
if (movedir==RIGHT) if (movedir==RIGHT)
newobject = new CRay(mpMap, getXRightPos()+1, getYPosition()+(9<<STC), RIGHT, CENTER, getSpriteVariantId()); newobject = new CRay(mpMap, getXRightPos()+1, getYPosition()+(9<<STC), RIGHT, CENTER, getSpriteVariantIdx());
else else
newobject = new CRay(mpMap, getXLeftPos()-1, getYPosition()+(9<<STC), LEFT, CENTER, getSpriteVariantId()); newobject = new CRay(mpMap, getXLeftPos()-1, getYPosition()+(9<<STC), LEFT, CENTER, getSpriteVariantIdx());
newobject->setOwner( m_type, m_index); newobject->setOwner( m_type, m_index);
newobject->mSpriteIdx = ENEMYRAYEP2; newobject->mSpriteIdx = ENEMYRAYEP2;
// don't shoot other vorticon elite // don't shoot other vorticon elite
......
...@@ -247,7 +247,7 @@ bool CPlayGameVorticon::saveXMLGameState() ...@@ -247,7 +247,7 @@ bool CPlayGameVorticon::saveXMLGameState()
auto &player = m_Player[i]; auto &player = m_Player[i];
ptree &playerNode = stateNode.add("Player", ""); ptree &playerNode = stateNode.add("Player", "");
playerNode.put("<xmlattr>.id", i); playerNode.put("<xmlattr>.id", i);
playerNode.put("<xmlattr>.variant", player.getSpriteVariantId()); playerNode.put("<xmlattr>.variant", player.getSpriteVariantIdx());
playerNode.put("x", player.getXPosition()); playerNode.put("x", player.getXPosition());
playerNode.put("y", player.getYPosition()); playerNode.put("y", player.getYPosition());
...@@ -267,7 +267,7 @@ bool CPlayGameVorticon::saveXMLGameState() ...@@ -267,7 +267,7 @@ bool CPlayGameVorticon::saveXMLGameState()
// save all the objects states // save all the objects states
auto &spriteObj = mSpriteObjectContainer[i]; auto &spriteObj = mSpriteObjectContainer[i];
ptree &spriteNode = stateNode.add("SpriteObj", ""); ptree &spriteNode = stateNode.add("SpriteObj", "");
spriteNode.put("<xmlattr>.variant", spriteObj->getSpriteVariantId()); spriteNode.put("<xmlattr>.variant", spriteObj->getSpriteVariantIdx());
spriteNode.put("type", spriteObj->m_type); spriteNode.put("type", spriteObj->m_type);
spriteNode.put("x", spriteObj->getXPosition()); spriteNode.put("x", spriteObj->getXPosition());
spriteNode.put("y", spriteObj->getYPosition()); spriteNode.put("y", spriteObj->getYPosition());
......
...@@ -139,7 +139,7 @@ void CPlayGameVorticon::goBacktoMap() ...@@ -139,7 +139,7 @@ void CPlayGameVorticon::goBacktoMap()
player->inventory.HasCardGreen = 0; player->inventory.HasCardGreen = 0;
player->inventory.HasCardRed = 0; player->inventory.HasCardRed = 0;
const int varId = player->getSpriteVariantId(); const int varId = player->getSpriteVariantIdx();
// Now, that the level is complete, sprite can be shown again, and now goto the world map! // Now, that the level is complete, sprite can be shown again, and now goto the world map!
int width = player->w>>(CSF-4); int width = player->w>>(CSF-4);
......
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