Commit 82cc0b2b authored by gerstrong@gmail.com's avatar gerstrong@gmail.com

Cast adjustments

parent a0a6314a
......@@ -37,7 +37,9 @@ private:
Switch *mpTiltScreenSwitch = nullptr;
Switch *mpShowCursorSwitch = nullptr;
#ifdef VIRTUALPAD
Switch *mpVPadSwitch = nullptr;
#endif
NumberControl *mpFPSSelection = nullptr;
Switch *mpFrameSkip = nullptr;
ComboSelection *mpGameResSelection = nullptr;
......
......@@ -13,7 +13,7 @@
static int spriteOffset;
CGalaxySpriteObject::CGalaxySpriteObject(CMap *pmap, const Uint16 foeID,
Uint32 x, Uint32 y, const int sprVar) :
const int x, const int y, const int sprVar) :
CSpriteObject(pmap, x, y, sprVar),
mFoeID(foeID)
{
......@@ -269,7 +269,7 @@ bool CGalaxySpriteObject::getActionStatus(int16_t ActionNumber)
{ return (m_Action.getActionFormat(m_ActionBaseOffset + 30*ActionNumber)); }
int16_t CGalaxySpriteObject::getActionNumber()
{ return m_ActionNumber; }
{ return int16_t(m_ActionNumber); }
void CGalaxySpriteObject::setActionForce(const size_t ActionNumber)
......
......@@ -16,7 +16,9 @@
class CGalaxySpriteObject: public CSpriteObject
{
public:
CGalaxySpriteObject(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y, const int sprVar);
CGalaxySpriteObject(CMap *pmap, const Uint16 foeID,
const int x, const int y,
const int sprVar);
void setupGalaxyObjectOnMap(const size_t ActionBaseOffset = 0x0,
const size_t ActionNumber = 0x0 );
......
......@@ -21,10 +21,21 @@ public:
void setActionForce(const size_t ActionNumber);
protected:
void (CGalaxyActionSpriteObject::*mp_processState)();
std::map< size_t, GASOFctr > mActionMap;
std::map< size_t, GASOFctr > mActionMap;
template<class T>
void mapFunction(const size_t key, T func)
{
mActionMap[key] = static_cast<GASOFctr>(func);
}
};
}
#endif // CGALAXYACTIONSPRITEOBJECT_H
......@@ -16,7 +16,12 @@ namespace galaxy {
const int itemEffectTime = 50;
const int itemEffectTime_Animation = 14;
CItemEffect::CItemEffect(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y, Uint16 l_sprite, item_effect_type ieffect) :
CItemEffect::CItemEffect(CMap *pmap,
const Uint16 foeID,
const int x,
const int y,
Uint16 l_sprite,
item_effect_type ieffect) :
CGalaxySpriteObject(pmap, foeID, x, y, 0)
{
m_timer = 0;
......
......@@ -52,7 +52,8 @@ class CItemEffect : public CGalaxySpriteObject
public:
CItemEffect(CMap *pmap,
const Uint16 foeID,
Uint32 x, Uint32 y,
const int x,
const int y,
Uint16 l_sprite,
item_effect_type ieffect = FLOAT);
void process();
......
......@@ -53,10 +53,10 @@ m_timer(0)
mHealthPoints *= 4;
}
mActionMap[A_SLUG_MOVE] = static_cast<GASOFctr> (&CPoisonSlug::processCrawling);
mActionMap[A_SLUG_POOING] = static_cast<GASOFctr> (&CPoisonSlug::processPooing);
mActionMap[A_SLUG_STUNNED] = static_cast<GASOFctr> (&CStunnable::processGettingStunned);
mActionMap[A_SLUG_STUNNED_ALT] = static_cast<GASOFctr> (&CStunnable::processGettingStunned);
mapFunction(A_SLUG_MOVE, &CPoisonSlug::processCrawling);
mapFunction(A_SLUG_POOING, &CPoisonSlug::processPooing);
mapFunction(A_SLUG_STUNNED, &CPoisonSlug::processGettingStunned);
mapFunction(A_SLUG_STUNNED_ALT, &CPoisonSlug::processGettingStunned);
setupGalaxyObjectOnMap(0x2012, A_SLUG_MOVE);
......
......@@ -16,9 +16,12 @@ const int A_SLUGPOISON_NORMAL = 0;
//const int A_SLUGPOISON_FADE = 1;
const int POISON_TIME = 1;
CSlugSlime::CSlugSlime(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y, const int sprVar) :
CGalaxySpriteObject(pmap, foeID, x, y, sprVar),
m_timer(0)
CSlugSlime::CSlugSlime(CMap *pmap,
const Uint16 foeID,
const int x,
const int y,
const int sprVar) :
CGalaxySpriteObject(pmap, foeID, x, y, sprVar)
{
setupGalaxyObjectOnMap(0x20A8, A_SLUGPOISON_NORMAL);
}
......
......@@ -21,7 +21,8 @@ class CSlugSlime : public CGalaxySpriteObject
public:
/** Standard Constructor for the slug poo */
CSlugSlime(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y, const int sprVar);
CSlugSlime(CMap *pmap, const Uint16 foeID,
const int x, const int y, const int sprVar);
/** Main Process cycle */
void process() override;
......
......@@ -28,7 +28,7 @@ enum FLEEXACTIONS
constexpr int WALK_SPEED = 30;
constexpr int TRACK_SPEED = 120;
constexpr int TIME_LOOKING = 200;
//constexpr int TIME_LOOKING = 200;
constexpr int TIME_UNTIL_LOOK = 200;
constexpr int DISTANCE_UNTIL_TRACK = 8<<CSF;
......@@ -40,10 +40,11 @@ CFleex::CFleex(CMap* pmap, const Uint16 foeID, const Uint32 x, const Uint32 y) :
mKeenAlignment(LEFT),
mGoodTrackChance(false)
{
mActionMap[A_FLEEX_WALK] = (GASOFctr) &CFleex::processWalk;
mActionMap[A_FLEEX_TRACK] = (GASOFctr) &CFleex::processTrack;
mActionMap[A_FLEEX_LOOK] = (GASOFctr) &CFleex::processLook;
mActionMap[A_FLEEX_STUNNED] = (GASOFctr) &CStunnable::processGettingStunned;
mapFunction(A_FLEEX_WALK, &CFleex::processWalk);
mapFunction(A_FLEEX_TRACK, &CFleex::processTrack);
mapFunction(A_FLEEX_LOOK, &CFleex::processLook);
mapFunction(A_FLEEX_STUNNED, &CFleex::processGettingStunned);
setupGalaxyObjectOnMap(0x2C78, A_FLEEX_WALK);
......
......@@ -43,13 +43,13 @@ A_ORBATRIX_SLIDE = 5
};
constexpr int MAX_BOUNCE_BOOST = -150;
constexpr int FLY_SPEED = 10;
//constexpr int FLY_SPEED = 10;
constexpr int HOR_SPEED = 80;
//constexpr int VER_SPEED = 40;
constexpr int TIME_UNTIL_MOVE = 20;
constexpr int TIME_UNTIL_CURL = 20;
constexpr int TIME_UNTIL_SLIDE = 20;
//constexpr int TIME_UNTIL_SLIDE = 20;
constexpr int TIME_UNTIL_UNCURL = 200;
constexpr int TIME_UNTIL_FLOAT = 20;
......@@ -58,14 +58,14 @@ CGalaxyActionSpriteObject(pmap, foeID, x, y, sprVar),
mTimer(0),
mGivesKey(false)
{
mActionMap[A_ORBATRIX_FLOAT] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processFloat;
mActionMap[A_ORBATRIX_MOVE] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processMove;
mActionMap[A_ORBATRIX_CURL] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processCurl;
mActionMap[A_ORBATRIX_UNCURL] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processUncurl;
mActionMap[A_ORBATRIX_MOVE_ALT] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processMove;
mActionMap[A_ORBATRIX_BOUNCE] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processBounce;
mActionMap[A_ORBATRIX_LAND] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processLand;
mActionMap[A_ORBATRIX_SLIDE] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processSlide;
mapFunction(A_ORBATRIX_FLOAT, &COrbatrix::processFloat);
mapFunction(A_ORBATRIX_MOVE, &COrbatrix::processMove);
mapFunction(A_ORBATRIX_CURL, &COrbatrix::processCurl);
mapFunction(A_ORBATRIX_UNCURL, &COrbatrix::processUncurl);
mapFunction(A_ORBATRIX_MOVE_ALT, &COrbatrix::processMove);
mapFunction(A_ORBATRIX_BOUNCE, &COrbatrix::processBounce);
mapFunction(A_ORBATRIX_LAND, &COrbatrix::processLand);
mapFunction(A_ORBATRIX_SLIDE, &COrbatrix::processSlide);
setupGalaxyObjectOnMap(0x27E6, A_ORBATRIX_FLOAT);
......@@ -224,7 +224,9 @@ void COrbatrix::getTouchedBy(CSpriteObject& theObject)
{
stItemGalaxy &Item = player->m_Inventory.Item;
Item.m_gem.red++;
spawnObj(new CItemEffect(mpMap, 0, getXPosition(), getYPosition(), got_sprite_item_pics[2][2], FADEOUT));
spawnObj(new CItemEffect(mpMap, 0,
getXPosition(), getYPosition(),
got_sprite_item_pics[2][2], FADEOUT));
mIsDead = true;
exists = false;
}
......
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