1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-02-18 02:34:57 +00:00

eliminate some unused code

This commit is contained in:
fgenesis 2023-05-09 05:21:47 +02:00
parent aa067be1f7
commit eec6027ccc
7 changed files with 0 additions and 163 deletions

View file

@ -2514,66 +2514,6 @@ void Avatar::formAbility()
seedName = "SeedUberVine";
dsq->game->fireShot(seedName, this, 0, pos, getAim());
/*
Vector pos = getAim();
if (!pos.isZero())
pos.setLength2D(64);
pos += position;
//dsq->spawnParticleEffect("Fertilizer", pos);
Entity *e = 0;
std::string seedName;
if (chargeLevelAttained == 0)
seedName = "SeedFlower";
else if (chargeLevelAttained == 2)
seedName = "SeedUberVine";
e = dsq->game->createEntity(seedName, 0, pos, 0, false, "");
Vector add = pos - position;
add.setLength2D(800);
e->vel += add;
*/
/*
if (chargeLevelAttained == 0)
{
}
else if (chargeLevelAttained == 1)
{
e->setState(STATE_CHARGE1);
}
else if (chargeLevelAttained == 2)
{
e->setState(STATE_CHARGE2);
}
e->update(0);
*/
// idle = charge 0
// attack = charge1
// something = charge2
/*
FOR_ENTITIES (i)
{
Entity *e = *i;
if (e && e->getEntityType() == ET_ENEMY && e->isDamageTarget(DT_AVATAR_NATURE))
{
if ((e->position - pos).isLength2DIn(128))
{
DamageData d;
d.damageType = DT_AVATAR_NATURE;
d.damage = 1;
d.attacker = this;
e->damage(d);
}
}
}
*/
}
break;
case FORM_BEAST:
@ -2957,9 +2897,7 @@ void Avatar::formAbilityUpdate(float dt)
if (state.abilityDelay == 0)
{
state.abilityDelay = bubbleRate;
//state.abilityDelay -= bubbleRate;
// spawn bubble
//Entity *bubble = dsq->game->createEntity("FishFormBubble", 0, position, 0, false, "");
Vector dir = getAim();
dir.normalize2D();

View file

@ -2445,36 +2445,6 @@ void Entity::fillGrid()
}
}
/*
void Entity::assignUniqueID(bool temporary)
{
const int inc = temporary ? -1 : 1;
int id = inc;
while (1)
{
bool isFree = true;
FOR_ENTITIES(i)
{
Entity *e = *i;
if (e != this)
{
if (e->getID() == id)
{
isFree = false;
break;
}
}
}
if (isFree)
{
break;
}
id += inc;
}
entityID = id;
}
*/
// caller must make sure that the ID is unused
void Entity::setID(int id)
{

View file

@ -241,7 +241,6 @@ public:
InterpolatedVector maxSpeedLerp;
Hair *hair;
void assignUniqueID(bool temporary);
int entityID;
int getMaxSpeed();
std::string deathSound;

View file

@ -760,20 +760,6 @@ bool Game::removeEntity(Entity *selected)
{
selected->setState(Entity::STATE_DEAD);
selected->safeKill();
XMLElement *e = this->saveFile->FirstChildElement("Enemy");
while (e)
{
int x = atoi(e->Attribute("x"));
int y = atoi(e->Attribute("y"));
if (int(selected->startPos.x) == x && int(selected->startPos.y) == y)
{
this->saveFile->DeleteChild(e);
//delete e;
return true;
}
e = e->NextSiblingElement("Enemy");
}
for (size_t i = 0; i < entitySaveData.size(); i++)
{

View file

@ -92,7 +92,6 @@ public:
std::vector <TileVector> grid;
int w,h;
float tu1, tu2, tv1, tv2;
void setGrid(Vector position);
bool cull;
float alpha;
size_t idx;
@ -240,7 +239,6 @@ public:
Vector getWallNormal(Vector pos, int sampleArea = 5, int obs = -1);
void updateMiniMapHintPosition();
EntitySaveData *getEntitySaveDataForEntity(Entity *e);
Entity *createEntityOnMap(const EntitySaveData& sav); // when loading from save (saved to map). Caller must postInit().
Entity *createEntityOnMap(const char *type, Vector pos); // when spawning in the editor (saved to map). Caller must postInit().
@ -360,7 +358,6 @@ public:
std::string getNoteName(int n, const std::string &pre="");
void selectEntityFromGroups();
InterpolatedVector cameraInterp;
float getWaterLevel();

View file

@ -1022,39 +1022,6 @@ void SceneEditor::deleteSelected()
}
}
void SceneEditor::updateSaveFileEnemyPosition(Entity *ent)
{
XMLElement *exml = dsq->game->saveFile->FirstChildElement("Enemy");
while (exml)
{
int x = atoi(exml->Attribute("x"));
int y = atoi(exml->Attribute("y"));
if (ent->startPos.x == x && ent->startPos.y == y)
{
ent->startPos = Vector(int(ent->position.x), int(ent->position.y));
exml->SetAttribute("x", int(ent->startPos.x));
exml->SetAttribute("y", int(ent->startPos.y));
return;
}
exml = exml->NextSiblingElement("Enemy");
}
exml = dsq->game->saveFile->FirstChildElement("Entity");
while (exml)
{
int x = atoi(exml->Attribute("x"));
int y = atoi(exml->Attribute("y"));
if (ent->startPos.x == x && ent->startPos.y == y)
{
ent->startPos = Vector(int(ent->position.x), int(ent->position.y));
exml->SetAttribute("x", int(ent->startPos.x));
exml->SetAttribute("y", int(ent->startPos.y));
return;
}
exml = exml->NextSiblingElement("Entity");
}
}
void SceneEditor::checkForRebuild()
{
if (editType == ET_ELEMENTS && state != ES_SELECTING && !selectedElements.empty())
@ -1454,20 +1421,6 @@ void SceneEditor::mouseButtonRight()
}
}
void SceneEditor::startMoveEntity()
{
movingEntity = dsq->game->getEntityAtCursor();
}
void SceneEditor::endMoveEntity()
{
if (movingEntity)
{
updateSaveFileEnemyPosition(movingEntity);
movingEntity = 0;
}
}
void SceneEditor::up()
{
if (editType == ET_ELEMENTS && state == ES_SELECTING)
@ -2578,8 +2531,6 @@ void SceneEditor::toggle(bool on)
for (int i = 0; i < 9; i++)
dsq->getRenderObjectLayer(LR_ELEMENTS1+i)->visible = true;
if (movingEntity)
endMoveEntity();
movingEntity = 0;
dsq->getRenderObjectLayer(LR_BLACKGROUND)->update = false;

View file

@ -109,10 +109,6 @@ public:
void regenLevel();
void updateSaveFileEnemyPosition(Entity *ent);
void startMoveEntity();
void endMoveEntity();
void down();
void up();