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