Optimize parameter passing to avoid unnecessary copying

This commit is contained in:
Pugemon
2024-06-07 04:00:38 +03:00
parent 46ca1bb04a
commit f25a425cb9
123 changed files with 578 additions and 522 deletions
+12 -12
View File
@@ -38,26 +38,26 @@ public:
Assets(const Assets&) = delete;
~Assets();
Texture* getTexture(std::string name) const;
void store(std::unique_ptr<Texture> texture, std::string name);
Texture* getTexture(const std::string& name) const;
void store(std::unique_ptr<Texture> texture, const std::string& name);
Shader* getShader(std::string name) const;
void store(std::unique_ptr<Shader> shader, std::string name);
Shader* getShader(const std::string& name) const;
void store(std::unique_ptr<Shader> shader, const std::string& name);
Font* getFont(std::string name) const;
void store(std::unique_ptr<Font> font, std::string name);
Font* getFont(const std::string& name) const;
void store(std::unique_ptr<Font> font, const std::string& name);
Atlas* getAtlas(std::string name) const;
void store(std::unique_ptr<Atlas> atlas, std::string name);
Atlas* getAtlas(const std::string& name) const;
void store(std::unique_ptr<Atlas> atlas, const std::string& name);
audio::Sound* getSound(std::string name) const;
void store(std::unique_ptr<audio::Sound> sound, std::string name);
audio::Sound* getSound(const std::string& name) const;
void store(std::unique_ptr<audio::Sound> sound, const std::string& name);
const std::vector<TextureAnimation>& getAnimations();
void store(const TextureAnimation& animation);
UiDocument* getLayout(std::string name) const;
void store(std::unique_ptr<UiDocument> layout, std::string name);
UiDocument* getLayout(const std::string& name) const;
void store(std::unique_ptr<UiDocument> layout, const std::string& name);
};
#endif // ASSETS_ASSETS_HPP_