From 1168eaf1d974765396bd9faf3effb6c6072b488d Mon Sep 17 00:00:00 2001 From: fgenesis Date: Fri, 12 Apr 2013 09:17:45 +0200 Subject: [PATCH] Remove some dead code + fix clang warning. --- Aquaria/Avatar.cpp | 16 ------- Aquaria/Avatar.h | 1 - Aquaria/Continuity.cpp | 35 ---------------- Aquaria/DSQ.h | 28 ------------- Aquaria/Game.cpp | 83 ------------------------------------- Aquaria/Game.h | 9 ---- Aquaria/ScriptInterface.cpp | 13 +----- 7 files changed, 1 insertion(+), 184 deletions(-) diff --git a/Aquaria/Avatar.cpp b/Aquaria/Avatar.cpp index 0c9aa0a..e07cd37 100644 --- a/Aquaria/Avatar.cpp +++ b/Aquaria/Avatar.cpp @@ -2431,22 +2431,6 @@ bool Avatar::fireAtNearestValidEntity(const std::string &shot) return firedShot; } -void Avatar::spawnSeed() -{ - // max spore children/seeds = 50 - if (dsq->game->getNumberOfEntitiesNamed("SporeChild") < 4) - { - if (!dsq->game->isObstructed(TileVector(position))) - { - dsq->game->createEntity("SporeChild", 0, position, 0, 0, ""); - } - } - else - { - // visual effect and/or sound effect - } -} - Vector Avatar::getFacing() { if (vel.isLength2DIn(2) && rotation.z == 0) diff --git a/Aquaria/Avatar.h b/Aquaria/Avatar.h index 675aedb..0b8a196 100644 --- a/Aquaria/Avatar.h +++ b/Aquaria/Avatar.h @@ -358,7 +358,6 @@ protected: float fallGravityTimer; Vector fallGravity; int lastOutOfWaterMaxSpeed; - void spawnSeed(); int shieldPoints; diff --git a/Aquaria/Continuity.cpp b/Aquaria/Continuity.cpp index 8d4190c..7e712a3 100644 --- a/Aquaria/Continuity.cpp +++ b/Aquaria/Continuity.cpp @@ -2997,40 +2997,6 @@ int Continuity::getPathFlag(Path *p) return entityFlags[os2.str()]; } -SporeChildData *Continuity::getSporeChildDataForEntity(Entity *e) -{ - SporeChildData *scd=0; - for (int i = 0; i < sporeChildData.size(); i++) - { - if (sporeChildData[i].entity == e) - { - scd = &sporeChildData[i]; - break; - } - } - return scd; -} - -void Continuity::registerSporeChildData(Entity *e) -{ - if (!dsq->game->creatingSporeChildren) - { - SporeChildData *scd=0; - if (!(scd = getSporeChildDataForEntity(e))) - { - SporeChildData d; - sporeChildData.push_back(d); - scd = &sporeChildData[sporeChildData.size()-1]; - } - if (scd) - { - scd->state = e->getState(); - scd->health = e->health; - scd->entity = e; - } - } -} - class GemGet : public Quad { public: @@ -3285,7 +3251,6 @@ void Continuity::reset() loadPetData(); formUpgrades.clear(); - sporeChildData.clear(); auraType = AURA_NONE; for (int i = 0; i < MAX_FLAGS; i++) diff --git a/Aquaria/DSQ.h b/Aquaria/DSQ.h index 57b7df0..1b496bc 100644 --- a/Aquaria/DSQ.h +++ b/Aquaria/DSQ.h @@ -826,28 +826,6 @@ public: void load(); }; -enum CMStat -{ - CM_ID =0, - CM_EGO, - CM_SEGO -}; - -class WordColoring -{ -public: - std::string word; - Vector color; -}; - -struct SporeChildData -{ - SporeChildData() : state(0), entity(0), health(0) {} - int state; - int health; - Entity *entity; -}; - const int FLAG_LI = 1000, FLAG_LICOMBAT = 1001; const int FLAG_COOKS = 21; @@ -1065,12 +1043,6 @@ public: AuraType auraType; float auraTimer; - SporeChildData *getSporeChildDataForEntity(Entity *e); - void registerSporeChildData(Entity *e); - - std::vector sporeChildData; - - EatData *getEatData(const std::string &name); void loadEatBank(); diff --git a/Aquaria/Game.cpp b/Aquaria/Game.cpp index 5583d05..b05b816 100644 --- a/Aquaria/Game.cpp +++ b/Aquaria/Game.cpp @@ -1867,18 +1867,6 @@ void Game::transitionToScene(std::string scene) core->enqueueJumpState("Game", false); } -void Game::transitionToSceneUnder(std::string scene) -{ - if (avatar) - { - avatar->onWarp(); - } - sceneToLoad = scene; - stringToLower(sceneToLoad); - core->pushState("Game"); -} - - ElementTemplate *Game::getElementTemplateByIdx(int idx) { for (int i = 0; i < elementTemplates.size(); i++) @@ -2706,34 +2694,6 @@ EntitySaveData *Game::getEntitySaveDataForEntity(Entity *e, Vector pos) return 0; } -void Game::spawnSporeChildren() -{ - creatingSporeChildren = true; - SporeChildData *scd; - int sz = dsq->continuity.sporeChildData.size(); - for (int i=0; i < sz; i++) - { - scd = &dsq->continuity.sporeChildData[i]; - scd->entity = 0; - } - int c = 0; - for (int i=0; i < sz; i++) - { - scd = &dsq->continuity.sporeChildData[i]; - Entity *e = dsq->game->createEntity("SporeChild", 0, avatar->position+Vector(0,2+c*2), 0, 0, ""); - if (e) - { - e->setState(scd->state); - if (scd->health < 1) - scd->health = 1; - e->health = scd->health; - scd->entity = e; - } - c++; - } - creatingSporeChildren = false; -} - void Game::setTimerTextAlpha(float a, float t) { timerText->alpha.interpolateTo(a, t); @@ -5767,46 +5727,6 @@ void Game::updateParticlePause() } } -void Game::warpKey1() -{ - if (core->getCtrlState()) - { - dsq->game->avatar->heal(1000); - dsq->game->avatar->fhTo(true); - warpToSceneNode("OPENWATER02", "WARPKEY"); - } -} - -void Game::warpKey2() -{ - if (core->getCtrlState()) - { - dsq->game->avatar->heal(1000); - dsq->game->avatar->fhTo(true); - warpToSceneNode("VEIL01", "WARPKEY"); - } -} - -void Game::warpKey3() -{ - if (core->getCtrlState()) - { - dsq->game->avatar->heal(1000); - dsq->game->avatar->fhTo(true); - warpToSceneNode("FOREST03", "WARPKEY"); - } -} - -void Game::warpKey4() -{ - if (core->getCtrlState()) - { - dsq->game->avatar->heal(1000); - dsq->game->avatar->fhTo(true); - warpToSceneNode("ABYSS01", "WARPKEY"); - } -} - int game_collideParticle(Vector pos) { bool aboveWaterLine = (pos.y <= dsq->game->waterLevel.x+20); @@ -6760,9 +6680,6 @@ void Game::applyState() toNode = ""; - - spawnSporeChildren(); - createInGameMenu(); hideInGameMenu(false); diff --git a/Aquaria/Game.h b/Aquaria/Game.h index d2030d3..33a5bc6 100644 --- a/Aquaria/Game.h +++ b/Aquaria/Game.h @@ -125,7 +125,6 @@ typedef std::vector EntityGroups; enum EditTypes { - ET_NONE =-1, ET_ELEMENTS =0, ET_ENTITIES =1, ET_PATHS =2, @@ -648,7 +647,6 @@ public: void updatePreviewRecipe(); void transitionToScene(std::string scene); - void transitionToSceneUnder(std::string scene); bool loadScene(std::string scene); void clearGrid(int v = 0); @@ -882,9 +880,6 @@ public: int worldMapIndex; - void spawnSporeChildren(); - - bool creatingSporeChildren; bool loadingScene; WaterSurfaceRender *waterSurfaceRender; @@ -1048,10 +1043,6 @@ protected: void warpPrep(); - void warpKey1(); - void warpKey2(); - void warpKey3(); - void warpKey4(); bool shuttingDownGameState; void onOptionsMenu(); bool optionsMenu, foodMenu, petMenu, treasureMenu, keyConfigMenu; diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index 879d9cc..fb7e210 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -5240,16 +5240,6 @@ luaFunc(warpNaijaToSceneNode) luaReturnNil(); } -luaFunc(registerSporeChildData) -{ - Entity *e = entity(L); - if (e) - { - dsq->continuity.registerSporeChildData(e); - } - luaReturnNil(); -} - luaFunc(entity_setDamageTarget) { Entity *e = entity(L); @@ -6460,7 +6450,7 @@ luaFunc(entity_getNearestEntity) Entity *e = *i; if (e != me && e != ignore && e->isPresent() && e->isNormalLayer()) { - if (type == ET_NONE || e->getEntityType() == type) + if (type == ET_NOTYPE || e->getEntityType() == type) { if (damageTarget == DT_NONE || e->isDamageTarget((DamageType)damageTarget)) { @@ -7773,7 +7763,6 @@ static const struct { luaRegister(entity_sound), luaRegister(entity_playSfx), - luaRegister(registerSporeChildData), luaRegister(registerSporeDrop), luaRegister(getIngredientGfx),