From 6d768de2a8abc6dba90bffd4c8b54a188a613ee5 Mon Sep 17 00:00:00 2001 From: Mihai Dumitrescu Date: Thu, 18 Dec 2025 20:15:43 +0200 Subject: [PATCH 1/2] Add resource manager Signed-off-by: Mihai Dumitrescu --- src/ResourceManager.cpp | 12 ++++++++++++ src/ResourceManager.h | 20 ++++++++++++++++++++ src/Rpg/map/entities/Entity.cpp | 10 ++++------ src/Rpg/map/entities/Entity.h | 3 ++- src/Rpg/map/zones/Zone.cpp | 9 +++------ src/Rpg/map/zones/Zone.h | 2 +- src/Rpg/map/zones/ZoneManager.cpp | 4 ++-- src/Rpg/map/zones/ZoneManager.h | 2 -- src/Rpg/menues/AnalyzeMenu.cpp | 8 ++++---- src/Rpg/menues/ShopMenu.cpp | 4 ++-- 10 files changed, 50 insertions(+), 24 deletions(-) create mode 100644 src/ResourceManager.cpp create mode 100644 src/ResourceManager.h diff --git a/src/ResourceManager.cpp b/src/ResourceManager.cpp new file mode 100644 index 0000000..c71e6f3 --- /dev/null +++ b/src/ResourceManager.cpp @@ -0,0 +1,12 @@ +#include "ResourceManager.h" + +sf::Texture& ResourceManager::getTexture(const std::string& filepath) { + auto& textures = getInstance().mTextures; + if (textures.find(filepath) != textures.end()) + return textures.at(filepath); + + sf::Texture& texture = textures[filepath]; + if (!texture.loadFromFile(filepath)) + std::cerr << "Failed to load texture: " << filepath << std::endl; + return texture; +} diff --git a/src/ResourceManager.h b/src/ResourceManager.h new file mode 100644 index 0000000..97621a4 --- /dev/null +++ b/src/ResourceManager.h @@ -0,0 +1,20 @@ +#pragma once +#include +#include +#include +#include + +class ResourceManager { +public: + static ResourceManager& getInstance() { + static ResourceManager instance; + return instance; + } + + sf::Texture& getTexture(const std::string& filepath); + +private: + std::map mTextures; + ResourceManager() {}; +}; + diff --git a/src/Rpg/map/entities/Entity.cpp b/src/Rpg/map/entities/Entity.cpp index 7b8b9ec..ca63218 100644 --- a/src/Rpg/map/entities/Entity.cpp +++ b/src/Rpg/map/entities/Entity.cpp @@ -5,14 +5,12 @@ Entity::Entity(const sf::Vector2f& position, const std::string filename, const sf::Vector2f& collPosition, const sf::Vector2f& collSize, int canInteract, const sf::Vector2f& interactPos, const sf::Vector2f& interactSize) : mCanInteract(canInteract) { - mTexture = new sf::Texture; // If filename is empty than the entity is not drawable => dont load texture from file - if(filename != "") - if (!mTexture->loadFromFile(filename)) { - std::cerr << "Couldn't load texture for an entity!" << std::endl; - } + if(filename != "") { + sf::Texture& texture = ResourceManager::getInstance().getTexture(filename); + mSprite.setTexture(texture); + } mSprite.setPosition(position); - mSprite.setTexture(*mTexture); mCollisionZone.setSize(collSize); mCollisionZone.setPosition(collPosition); diff --git a/src/Rpg/map/entities/Entity.h b/src/Rpg/map/entities/Entity.h index 97b13e4..7108358 100644 --- a/src/Rpg/map/entities/Entity.h +++ b/src/Rpg/map/entities/Entity.h @@ -1,5 +1,6 @@ #pragma once #include +#include "../../../ResourceManager.h" #include "DrawableEntity.h" class Entity : public DrawableEntity { @@ -21,7 +22,7 @@ class Entity : public DrawableEntity { protected: sf::Sprite mSprite; - sf::Texture *mTexture; + sf::RectangleShape mCollisionZone; sf::RectangleShape mInteractableZone; int mCanInteract; diff --git a/src/Rpg/map/zones/Zone.cpp b/src/Rpg/map/zones/Zone.cpp index bd16475..1c6e26d 100644 --- a/src/Rpg/map/zones/Zone.cpp +++ b/src/Rpg/map/zones/Zone.cpp @@ -41,12 +41,9 @@ void Zone::loadFromJson(const std::string& jsonPath, GameContext& gameContext) { if (backgroundPath.find("..") != std::string::npos) backgroundPath = "assets" + backgroundPath.substr(2); - if (mBackgroundTexture.loadFromFile(backgroundPath)) { - mBackgroundSprite.setTexture(mBackgroundTexture); - mBackgroundSprite.setPosition(mCoords.x * 1024.f, mCoords.y * 1024.f); - } else { - std::cerr << "Failed to load zone background: " << backgroundPath << std::endl; - } + sf::Texture& texture = ResourceManager::getInstance().getTexture(backgroundPath); + mBackgroundSprite.setTexture(texture); + mBackgroundSprite.setPosition(mCoords.x * 1024.f, mCoords.y * 1024.f); } else if (type == "objectgroup") { for (const auto& object: layer["objects"]) { std::string entityType = object.value("type", ""); diff --git a/src/Rpg/map/zones/Zone.h b/src/Rpg/map/zones/Zone.h index feebe0b..1404f46 100644 --- a/src/Rpg/map/zones/Zone.h +++ b/src/Rpg/map/zones/Zone.h @@ -7,6 +7,7 @@ #include #include "../entities/Entity.h" #include "../entities/EntityFactory.h" +#include "../../../ResourceManager.h" class Zone { public: @@ -24,7 +25,6 @@ class Zone { void loadFromJson(const std::string& jsonPath, GameContext& gameContext); sf::Vector2i mCoords; - sf::Texture mBackgroundTexture; sf::Sprite mBackgroundSprite; std::vector> mEntities; diff --git a/src/Rpg/map/zones/ZoneManager.cpp b/src/Rpg/map/zones/ZoneManager.cpp index b39511f..42248ae 100644 --- a/src/Rpg/map/zones/ZoneManager.cpp +++ b/src/Rpg/map/zones/ZoneManager.cpp @@ -5,11 +5,11 @@ const int CHUNK_SIZE = 1024; ZoneManager::ZoneManager(GameContext& gameContext, int viewRange) - : mGameContext(gameContext), mViewRange(viewRange), mCurrentZoneCoords(0, 0), mIsInsideAStructure(gameContext.isInsideStructure) { + : mGameContext(gameContext), mViewRange(viewRange), mCurrentZoneCoords(0, 0) { } void ZoneManager::update(const sf::Vector2f& playerWorldPos) { - if (mIsInsideAStructure) + if (mGameContext.isInsideStructure) return; int zoneX = static_cast(playerWorldPos.x / (CHUNK_SIZE)); diff --git a/src/Rpg/map/zones/ZoneManager.h b/src/Rpg/map/zones/ZoneManager.h index abfcc12..66119e8 100644 --- a/src/Rpg/map/zones/ZoneManager.h +++ b/src/Rpg/map/zones/ZoneManager.h @@ -31,7 +31,5 @@ class ZoneManager { std::map, std::unique_ptr> mZones; sf::Vector2i mCurrentZoneCoords; int mViewRange; - - bool mIsInsideAStructure; }; diff --git a/src/Rpg/menues/AnalyzeMenu.cpp b/src/Rpg/menues/AnalyzeMenu.cpp index 569bc65..c5c2f53 100755 --- a/src/Rpg/menues/AnalyzeMenu.cpp +++ b/src/Rpg/menues/AnalyzeMenu.cpp @@ -18,15 +18,15 @@ AnalyzeMenu::AnalyzeMenu(sf::RenderWindow& window, Inventory& inventory, TimeSys if (!mFont.loadFromFile("assets/fonts/gameFont.ttf")) std::cerr << "Failed to load font for AnalyzeMenu!" << std::endl; - mMenuShape.setSize(sf::Vector2f(window.getSize().x / 2.0f, window.getSize().y / 2.0f)); + mMenuShape.setSize(sf::Vector2f(window.getSize().x / 2.f, window.getSize().y / 2.f)); mMenuShape.setFillColor(sf::Color(50, 50, 50, 255)); mMenuShape.setPosition((window.getSize().x - mMenuShape.getSize().x) / 2.f, (window.getSize().y - mMenuShape.getSize().y) / 2.f); - mHoveredZoneShape.setSize(sf::Vector2f(window.getSize().x * 3.0f / 4.0f, 40)); + mHoveredZoneShape.setSize(sf::Vector2f(window.getSize().x / 2.f, 40)); mHoveredZoneShape.setFillColor(sf::Color(10, 10, 10, 100)); - mHoveredZoneShape.setPosition(sf::Vector2f((window.getSize().x - mMenuShape.getSize().x) / 2.0f, - (window.getSize().y - mMenuShape.getSize().y) / 2.0f)); + mHoveredZoneShape.setPosition(sf::Vector2f((window.getSize().x - mMenuShape.getSize().x) / 2.f, + (window.getSize().y - mMenuShape.getSize().y) / 2.f)); mMenuText.setFont(mFont); mMenuText.setCharacterSize(20); diff --git a/src/Rpg/menues/ShopMenu.cpp b/src/Rpg/menues/ShopMenu.cpp index a83e45d..8d4db9a 100755 --- a/src/Rpg/menues/ShopMenu.cpp +++ b/src/Rpg/menues/ShopMenu.cpp @@ -12,12 +12,12 @@ ShopMenu::ShopMenu(sf::RenderWindow& window, Inventory& inventory, TimeSystem& t mItem3Button(sf::Vector2f(0.0f, 0.0f), sf::Vector2f(110.f, 150.f), "3"), mCrystals(crystals), mNumItems(numItems) { - mMenuShape.setSize(sf::Vector2f(window.getSize().x / 2.0f, window.getSize().y / 2.f)); + mMenuShape.setSize(sf::Vector2f(window.getSize().x / 2.f, window.getSize().y / 2.f)); mMenuShape.setFillColor(sf::Color(50, 50, 50, 255)); mMenuShape.setPosition((window.getSize().x - mMenuShape.getSize().x) / 2.f, (window.getSize().y - mMenuShape.getSize().y) / 2.f); - mHoveredZoneShape.setSize(sf::Vector2f(window.getSize().x * 3.0f / 4.0f, 40)); + mHoveredZoneShape.setSize(sf::Vector2f(window.getSize().x / 2.f, 40)); mHoveredZoneShape.setFillColor(sf::Color(10, 10, 10, 100)); mHoveredZoneShape.setPosition(mMenuShape.getPosition()); From 7f52d4d9c502fe24066f94a8b099b8f2de9e3f06 Mon Sep 17 00:00:00 2001 From: Mihai Dumitrescu Date: Thu, 18 Dec 2025 20:22:33 +0200 Subject: [PATCH 2/2] Save structure index Signed-off-by: Mihai Dumitrescu --- src/Rpg/gamengine/RPGEngine.cpp | 29 +++++++++++++++----------- src/Rpg/gamengine/RPGEngine.h | 1 + src/Rpg/map/buildings/MCHouse.cpp | 6 ++++-- src/Rpg/map/buildings/MCHouse.h | 3 ++- src/Rpg/map/entities/EntityFactory.cpp | 3 ++- src/Rpg/map/entities/EntityFactory.h | 1 + src/Rpg/saveSystem/SaveSystem.cpp | 20 +++++++++++------- src/Rpg/saveSystem/SaveSystem.h | 8 +++---- 8 files changed, 43 insertions(+), 28 deletions(-) diff --git a/src/Rpg/gamengine/RPGEngine.cpp b/src/Rpg/gamengine/RPGEngine.cpp index 3bed06b..8ae5742 100755 --- a/src/Rpg/gamengine/RPGEngine.cpp +++ b/src/Rpg/gamengine/RPGEngine.cpp @@ -74,6 +74,7 @@ RPGEngine::RPGEngine(sf::RenderWindow& window, GameManager* gameManager) mShowAnalyzeMenu(false), mShowInteract(false), mIsInsideAStructure(false), + mStructureIndex(-1), mCrystals(100), mStorageCapacity(500), mCurrentLevel(1), @@ -83,7 +84,8 @@ RPGEngine::RPGEngine(sf::RenderWindow& window, GameManager* gameManager) mIsInitialized(false), mTransitionSystem(sf::Vector2f(window.getSize().x, window.getSize().y)), mChestMenu(window, mInventory, mChestInventory, sf::Vector2f(70.f, 70.f)), - mGameContext{ mCharacter, mIsInsideAStructure, mCameraFixedPosition, mShowChestMenu, mTimeSystem, mTransitionSystem, gameManager, + mGameContext{ mCharacter, mIsInsideAStructure, mStructureIndex, mCameraFixedPosition, + mShowChestMenu, mTimeSystem, mTransitionSystem, gameManager, [this](const std::string& name) { const Waypoint* waypoint = mWaypointManager.getWaypoint(name); @@ -99,7 +101,7 @@ RPGEngine::RPGEngine(sf::RenderWindow& window, GameManager* gameManager) } } }, mWaypointManager}, - mZoneManager(mGameContext, 2), + mZoneManager(mGameContext, 1), mStartTowerDefenseMenu(window, mAvailableTowers, this, gameManager, mCurrentLevel, mCrystals), mBankMenu(window, mCrystals, mStorageCapacity, mTimeSystem), mShopMenu(window, mInventory, mTimeSystem, 5, mCrystals), @@ -664,8 +666,7 @@ void RPGEngine::render() { mTransitionSystem.render(mWindow); - if (!mShowBankMenu && !mShowMenu && !mShowStartMenu && !mShowShopMenu && !mShowAnalyzeMenu && !mShowChestMenu) - renderDateTime(mWindow, mFont, currentDate, currentTime); + renderDateTime(mWindow, mFont, currentDate, currentTime); mWindow.display(); } @@ -880,8 +881,8 @@ void RPGEngine::saveGame() { chestItemId, chestItemQuantity, droppedItemId, droppedItemXPos, droppedItemYPos, droppedItemQuantity, extracting, inSlot, completed, timerActive, startYear1, startDay1, startHour1, startMinute1, - slotItemId, mIsInsideAStructure, mCameraFixedPosition, chapter, - flagKeys, flagValues); + slotItemId, mIsInsideAStructure, mStructureIndex, mCameraFixedPosition, + chapter, flagKeys, flagValues); } void RPGEngine::loadGame() { @@ -892,7 +893,7 @@ void RPGEngine::loadGame() { int crystals, year, day, hour, minute, bankBalance, penalty, interest, amountToRepay, daysToRepayment, startYear, startDay, startHour, startMinute, hasBorrowActive, extracting, inSlot, completed, timerActive, startYear1, - startDay1, startHour1, startMinute1, slotItemId, insideStructure, chapter; + startDay1, startHour1, startMinute1, slotItemId, insideStructure, structureIndex, chapter; std::vector droppedItemId; std::vector droppedItemXPos; std::vector droppedItemYPos; @@ -912,21 +913,25 @@ void RPGEngine::loadGame() { chestItemId, chestItemQuantity, droppedItemId, droppedItemXPos, droppedItemYPos, droppedItemQuantity, extracting, inSlot, completed, timerActive, startYear1, startDay1, startHour1, - startMinute1, slotItemId, insideStructure, + startMinute1, slotItemId, insideStructure, structureIndex, mCameraFixedPosition, chapter, flagKeys, flagValues)) { mInventory.clear(); mChestInventory.clear(); mDroppedItems.clear(); - mCharacter.setPosition(playerPosition); mCharacter.setAnimation(playerAnimation); mIsInsideAStructure = insideStructure; - if (mIsInsideAStructure == true) - mGameContext.changeMap("assets/maps/interiors/house_interior.json"); - else + mStructureIndex = structureIndex; + if (mIsInsideAStructure == true) { + if (mStructureIndex == 0) + mGameContext.changeMap("MCHouse_Interior"); + mCharacter.setPosition(playerPosition); + } else { mGameContext.changeMap("open_world"); + mStructureIndex = -1; + } mNPCManager.loadNPCStates(npcPositions, npcWaypoints); mCrystals = crystals; diff --git a/src/Rpg/gamengine/RPGEngine.h b/src/Rpg/gamengine/RPGEngine.h index 97a35ce..c896c3b 100644 --- a/src/Rpg/gamengine/RPGEngine.h +++ b/src/Rpg/gamengine/RPGEngine.h @@ -145,6 +145,7 @@ class RPGEngine { std::vector mChoiceTexts; bool mIsInsideAStructure; + int mStructureIndex; sf::Vector2f mCameraFixedPosition; sf::View mFixedCamera; diff --git a/src/Rpg/map/buildings/MCHouse.cpp b/src/Rpg/map/buildings/MCHouse.cpp index ad68088..e185489 100644 --- a/src/Rpg/map/buildings/MCHouse.cpp +++ b/src/Rpg/map/buildings/MCHouse.cpp @@ -4,9 +4,10 @@ MCHouse::MCHouse(const sf::Vector2f& position, const std::string filename, const sf::Vector2f& collPosition, const sf::Vector2f& collSize, int canInteract, const sf::Vector2f& interactPos, const sf::Vector2f& interactSize, MainCharacter& mainCharacter, bool& isInsideAStructure, - sf::Vector2f& cameraFixedPosition, std::function changeMap) + sf::Vector2f& cameraFixedPosition, std::function changeMap, + int& structureIndex) : Entity(position, filename, collPosition, collSize, canInteract, interactPos, interactSize), mMainCharacter(mainCharacter), - mIsInsideAStructure(isInsideAStructure), mCameraFixedPosition(cameraFixedPosition), mChangeMap(changeMap) { + mIsInsideAStructure(isInsideAStructure), mCameraFixedPosition(cameraFixedPosition), mChangeMap(changeMap), mStructureIndex(structureIndex) { } @@ -14,6 +15,7 @@ void MCHouse::interact() { mMainCharacter.setAnimation(3); mIsInsideAStructure = true; + mStructureIndex = 0; mChangeMap("MCHouse_Interior"); } diff --git a/src/Rpg/map/buildings/MCHouse.h b/src/Rpg/map/buildings/MCHouse.h index 7c4eabb..c0eae2e 100644 --- a/src/Rpg/map/buildings/MCHouse.h +++ b/src/Rpg/map/buildings/MCHouse.h @@ -9,7 +9,7 @@ class MCHouse : public Entity { const sf::Vector2f& collPosition, const sf::Vector2f& collSize, int canInteract, const sf::Vector2f& interactPos, const sf::Vector2f& interactSize, MainCharacter& mainCharacter, bool& isInsideAStructure, sf::Vector2f& cameraFixedPosition, - std::function changeMap); + std::function changeMap, int& structureIndex); void interact() override; private: @@ -18,5 +18,6 @@ class MCHouse : public Entity { sf::Vector2f& mCameraFixedPosition; std::function mChangeMap; + int& mStructureIndex; }; diff --git a/src/Rpg/map/entities/EntityFactory.cpp b/src/Rpg/map/entities/EntityFactory.cpp index e80de2b..4ecbe08 100644 --- a/src/Rpg/map/entities/EntityFactory.cpp +++ b/src/Rpg/map/entities/EntityFactory.cpp @@ -24,7 +24,8 @@ std::unique_ptr EntityFactory::createEntity(const std::string& type, con gameContext.mainCharacter, gameContext.isInsideStructure, gameContext.cameraFixedPosition, - gameContext.changeMap + gameContext.changeMap, + gameContext.structureIndex ); } else if (type == "MCHouseInt") { sf::Vector2f interactSize = sf::Vector2f(43.f, 15.f); diff --git a/src/Rpg/map/entities/EntityFactory.h b/src/Rpg/map/entities/EntityFactory.h index a352ddd..cdbc85a 100644 --- a/src/Rpg/map/entities/EntityFactory.h +++ b/src/Rpg/map/entities/EntityFactory.h @@ -13,6 +13,7 @@ class GameManager; struct GameContext { MainCharacter& mainCharacter; bool& isInsideStructure; + int &structureIndex; sf::Vector2f& cameraFixedPosition; bool& showChestMenu; TimeSystem& timeSystem; diff --git a/src/Rpg/saveSystem/SaveSystem.cpp b/src/Rpg/saveSystem/SaveSystem.cpp index 38cca6a..f37ddc4 100644 --- a/src/Rpg/saveSystem/SaveSystem.cpp +++ b/src/Rpg/saveSystem/SaveSystem.cpp @@ -19,8 +19,8 @@ void SaveSystem::save(const sf::Vector2f& playerPosition, const int& playerAnima const std::vector& droppedItemYPos, const std::vector& droppedItemQuantity, const int& extracting, const int& inSlot, const int& completed, const int& timerActive, const int& startYear1, const int& startDay1, const int& startHour1, const int& startMinute1, - const int& slotItemId, const int& insideStructure, const sf::Vector2f& fixedCameraPos, - const int& chapter, const std::vector& flagKeys, + const int& slotItemId, const int& insideStructure, const int& structureIndex, + const sf::Vector2f& fixedCameraPos, const int& chapter, const std::vector& flagKeys, const std::vector& flagValues) { std::ofstream outFile(mSaveFilePath); @@ -62,7 +62,7 @@ void SaveSystem::save(const sf::Vector2f& playerPosition, const int& playerAnima // std::cout << droppedItemId[i] << " " << droppedItemXPos[i] << " " << droppedItemYPos[i] << " " << droppedItemQuantity[i] << std::endl; } - outFile << insideStructure << " " << fixedCameraPos.x << " " << fixedCameraPos.y + outFile << insideStructure << " " << structureIndex << " " << fixedCameraPos.x << " " << fixedCameraPos.y << " " << chapter << std::endl; outFile << flagValues.size() << std::endl; @@ -84,8 +84,8 @@ bool SaveSystem::load(sf::Vector2f& playerPosition, int& playerAnimation, std::vector& droppedItemYPos, std::vector& droppedItemQuantity, int& extracting, int& inSlot, int& completed, int& timerActive, int& startYear1, int& startDay1, int& startHour1, int& startMinute1, int& slotItemId, - int& insideStructure, sf::Vector2f& fixedCameraPos, int& chapter, - std::vector& flagKeys, std::vector& flagValues) { + int& insideStructure, int& structureIndex, sf::Vector2f& fixedCameraPos, + int& chapter, std::vector& flagKeys, std::vector& flagValues) { std::ifstream inFile(mSaveFilePath); if (!inFile) { @@ -255,6 +255,10 @@ bool SaveSystem::load(sf::Vector2f& playerPosition, int& playerAnimation, std::cerr << "Error reading inside structure from save file." << std::endl; return false; } + if (!(inFile >> structureIndex)) { + std::cerr << "Error reading structure index from save file." << std::endl; + return false; + } if (!(inFile >> fixedCameraPos.x)) { std::cerr << "Error reading fixed camera pos X from save file." << std::endl; return false; @@ -297,7 +301,7 @@ bool SaveSystem::loadPartial(std::string saveFile, int& crystals, int& year, int int bankBalance, penalty, interest, amountToRepay, daysToRepayment, startYear, startDay, startHour, startMinute, hasBorrowActive, extracting, inSlot, completed, timerActive, startYear1, startDay1, startHour1, - startMinute1, slotItemId, insideStructure, chapter; + startMinute1, slotItemId, insideStructure, structureIndex, chapter; std::vector droppedItemId; std::vector droppedItemXPos; std::vector droppedItemYPos; @@ -321,8 +325,8 @@ bool SaveSystem::loadPartial(std::string saveFile, int& crystals, int& year, int droppedItemId, droppedItemXPos, droppedItemYPos, droppedItemQuantity, extracting, inSlot, completed, timerActive, startYear1, startDay1, startHour1, startMinute1, slotItemId, - insideStructure, cameraFixedPosition, chapter, flagKeys, - flagValues); + insideStructure, structureIndex, cameraFixedPosition, chapter, + flagKeys, flagValues); mSaveFilePath = tmp; return success; diff --git a/src/Rpg/saveSystem/SaveSystem.h b/src/Rpg/saveSystem/SaveSystem.h index 079dccc..315b80d 100644 --- a/src/Rpg/saveSystem/SaveSystem.h +++ b/src/Rpg/saveSystem/SaveSystem.h @@ -21,8 +21,8 @@ class SaveSystem { const std::vector& droppedItemYPos, const std::vector& droppedItemQuantity, const int& extracting, const int& inSlot, const int& completed, const int& timerActive, const int& startYear1, const int& startDay1, const int& startHour1, const int& startMinute1, - const int& slotItemid, const int& insideStructure, const sf::Vector2f& fixedCameraPos, - const int& chapter, const std::vector& flagKeys, + const int& slotItemid, const int& insideStructure, const int& structureIndex, + const sf::Vector2f& fixedCameraPos, const int& chapter, const std::vector& flagKeys, const std::vector& flagValues); bool load(sf::Vector2f& playerPosition, int& playerAnimation, @@ -36,8 +36,8 @@ class SaveSystem { std::vector& droppedItemYPos, std::vector& droppedItemQuantity, int& extracting, int& inSlot, int& completed, int& timerActive, int& startYear1, int& startDay1, int& startHour1, int& startMinute1, int& slotItemId, - int& insideStructure, sf::Vector2f& fixedCameraPos, int& chapter, - std::vector& flagKeys, std::vector& flagValues); + int& insideStructure, int& structureIndex, sf::Vector2f& fixedCameraPos, + int& chapter, std::vector& flagKeys, std::vector& flagValues); // Method used for the extraction of some fields for MainMenu bool loadPartial(std::string saveFile, int& crystals, int& year, int &day, int& hour, int& minute);