diff --git a/Aquaria/AnimationEditor.cpp b/Aquaria/AnimationEditor.cpp index 5f8af58..c3c8942 100644 --- a/Aquaria/AnimationEditor.cpp +++ b/Aquaria/AnimationEditor.cpp @@ -508,11 +508,10 @@ void AnimationEditor::undo() { if (undoEntry < undoHistory.size()) { - std::list::iterator it = undoHistory.begin(); - std::advance(it, undoEntry); - editSprite->animations = it->animations; - if(undoEntry) + editSprite->animations = undoHistory[undoEntry].animations; + if(undoEntry > 0) { undoEntry--; + } } } } @@ -526,9 +525,7 @@ void AnimationEditor::redo() undoEntry++; if (undoEntry < undoHistory.size()) { - std::list::iterator it = undoHistory.begin(); - std::advance(it, undoEntry); - editSprite->animations = it->animations; + editSprite->animations = undoHistory[undoEntry].animations; } else { diff --git a/Aquaria/AnimationEditor.h b/Aquaria/AnimationEditor.h index 3fa64f5..a10834b 100644 --- a/Aquaria/AnimationEditor.h +++ b/Aquaria/AnimationEditor.h @@ -3,7 +3,7 @@ #include "../BBGE/SkeletalSprite.h" #include "StateManager.h" -#include +#include class DebugFont; class BitmapText; @@ -92,7 +92,7 @@ public: void moveNextWidgets(float dt); - std::list undoHistory; + std::deque undoHistory; size_t undoEntry; diff --git a/Aquaria/Continuity.cpp b/Aquaria/Continuity.cpp index 53f82ca..9791dd0 100644 --- a/Aquaria/Continuity.cpp +++ b/Aquaria/Continuity.cpp @@ -43,11 +43,6 @@ const float webTime = 8; const float petPowerTime = 30; const float lightTime = 60; -Profile::Profile() -{ - name = "save"; -} - Continuity::Continuity() { toggleMoveMode = false; @@ -2627,7 +2622,7 @@ void Continuity::saveFile(int slot, Vector position, unsigned char *scrShotData, std::string Continuity::getSaveFileName(int slot, const std::string &pfix) { std::ostringstream os; - os << dsq->getSaveDirectory() << "/" << dsq->currentProfile.name << "-" << numToZeroString(slot, 4) << "." << pfix; + os << dsq->getSaveDirectory() << "/save-" << numToZeroString(slot, 4) << "." << pfix; return os.str(); } diff --git a/Aquaria/DSQ.h b/Aquaria/DSQ.h index fb10fb6..44e169e 100644 --- a/Aquaria/DSQ.h +++ b/Aquaria/DSQ.h @@ -115,13 +115,6 @@ public: void load(); }; -class Profile -{ -public: - Profile(); - std::string name; -}; - enum SaveSlotMode { SSM_NONE = -1, @@ -265,8 +258,6 @@ public: typedef std::vector StringList; StringList profiles; - Profile currentProfile; - AquariaScreenTransition *screenTransition; Precacher precacher; diff --git a/Aquaria/Game.cpp b/Aquaria/Game.cpp index 6271c78..89ab07c 100644 --- a/Aquaria/Game.cpp +++ b/Aquaria/Game.cpp @@ -2109,7 +2109,6 @@ bool Game::saveScene(std::string scene) std::ostringstream os2; os2 << gradBtm.x << " " << gradBtm.y << " " << gradBtm.z; level->SetAttribute("gradBtm", os2.str().c_str()); - } if (!saveMusic.empty()) @@ -2627,7 +2626,6 @@ void Game::applyState() firstSchoolFish = true; invincibleOnNested = true; - controlHintNotes.clear(); worldMapIndex = -1; @@ -3943,7 +3941,6 @@ bool Game::collideCircleVsLineAngle(RenderObject *r, float angle, float startLen return collision; } - Bone *Game::collideSkeletalVsCircle(Entity *skeletal, Vector pos, float radius) { float smallestDist = HUGE_VALF; diff --git a/Aquaria/Game.h b/Aquaria/Game.h index faccc4f..645deb0 100644 --- a/Aquaria/Game.h +++ b/Aquaria/Game.h @@ -131,9 +131,6 @@ public: int idx; }; -typedef std::vector QuadList; -typedef std::vector QuadArray; - typedef std::vector ElementUpdateList; struct EntitySaveData diff --git a/Aquaria/SceneEditor.cpp b/Aquaria/SceneEditor.cpp index da7ffe5..81a09a1 100644 --- a/Aquaria/SceneEditor.cpp +++ b/Aquaria/SceneEditor.cpp @@ -96,7 +96,6 @@ std::string getMapTemplateFilename() return ""; } - SceneEditor::SceneEditor() : ActionMapper(), on(false) { autoSaveFile = 0; @@ -2415,18 +2414,17 @@ void SceneEditor::prevElement() void SceneEditor::doPrevElement() { size_t oldCur = curElement; + size_t maxn = dsq->game->elementTemplates.size(); - if(dsq->game->elementTemplates.size() == 0) { - return; - } - - if(curElement > 0) { + if(curElement) curElement--; - } - if (curElement >= game->elementTemplates.size()) - curElement = dsq->game->elementTemplates.size()-1; + else if(maxn) + curElement = maxn-1; - if (dsq->game->elementTemplates[curElement].idx < 1024) + if (maxn && curElement >= maxn) + curElement = maxn-1; + + if (maxn && dsq->game->elementTemplates[curElement].idx < 1024) { placer->setTexture(dsq->game->elementTemplates[curElement].gfx); } diff --git a/BBGE/ParticleManager.cpp b/BBGE/ParticleManager.cpp index c3875ee..3077ea1 100644 --- a/BBGE/ParticleManager.cpp +++ b/BBGE/ParticleManager.cpp @@ -205,15 +205,6 @@ void ParticleManager::nextFree(size_t jump) free -= size; } -void ParticleManager::prevFree(size_t jump) -{ - if(free < jump) { - free = free + size - jump; - } else { - free -= jump; - } -} - void ParticleManager::setFree(size_t free) { if (free != -1) @@ -222,8 +213,8 @@ void ParticleManager::setFree(size_t free) } } -const int spread = 8; -const int spreadCheck = 128; +static const size_t spread = 8; +static const size_t spreadCheck = 128; // travel the list until you find an empty or give up Particle *ParticleManager::stomp() diff --git a/BBGE/Particles.h b/BBGE/Particles.h index 3d74290..edf445e 100644 --- a/BBGE/Particles.h +++ b/BBGE/Particles.h @@ -234,7 +234,6 @@ protected: Particle* stomp(); void nextFree(size_t f=1); - void prevFree(size_t f=1); size_t oldFree; diff --git a/BBGE/SkeletalSprite.h b/BBGE/SkeletalSprite.h index 241028a..8efca01 100644 --- a/BBGE/SkeletalSprite.h +++ b/BBGE/SkeletalSprite.h @@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Quad.h" #include "SimpleIStringStream.h" +#include // for 2d system only enum AnimationCommand @@ -61,9 +62,7 @@ public: std::string gfx; std::string name; size_t boneIdx; - int pidx; - bool rbp; - + int pidx, rbp; std::string prt; std::vector changeStrip; diff --git a/BBGE/Texture.cpp b/BBGE/Texture.cpp index 4d8d738..d3b2d2c 100644 --- a/BBGE/Texture.cpp +++ b/BBGE/Texture.cpp @@ -419,7 +419,7 @@ ImageTGA *Texture::TGAloadMem(void *mem, int size) ByteBuffer bb(mem, size, ByteBuffer::REUSE); ImageTGA *pImageData = NULL; // This stores our important image data - unsigned short width = 0, height = 0;// The dimensions of the image + uint16_t width = 0, height = 0; // The dimensions of the image byte length = 0; // The length in bytes to the pixels byte imageType = 0; // The image type (RLE, RGB, Alpha...) byte bits = 0; // The bits per pixel for the image (16, 24, 32)