.................

This commit is contained in:
2025-11-11 22:19:18 -05:00
parent 7e1b8c8b04
commit d7c481a20b
8 changed files with 32 additions and 4 deletions
+6 -1
View File
@@ -29,6 +29,11 @@ namespace anm2ed::anm2
audio = Audio(this->path.c_str());
}
Sound::Sound(const std::filesystem::path& directory, const std::filesystem::path& path)
: Sound(directory.string(), path.string())
{
}
Sound::Sound(XMLElement* element, int& id)
{
if (!element) return;
@@ -63,4 +68,4 @@ namespace anm2ed::anm2
bool Sound::is_valid() { return audio.is_valid(); }
void Sound::play() { audio.play(); }
}
}
+2 -1
View File
@@ -23,6 +23,7 @@ namespace anm2ed::anm2
Sound& operator=(const Sound&);
Sound(tinyxml2::XMLElement*, int&);
Sound(const std::string&, const std::string&);
Sound(const std::filesystem::path&, const std::filesystem::path&);
tinyxml2::XMLElement* to_element(tinyxml2::XMLDocument&, int);
std::string to_string(int);
void serialize(tinyxml2::XMLDocument&, tinyxml2::XMLElement*, int);
@@ -30,4 +31,4 @@ namespace anm2ed::anm2
bool is_valid();
void play();
};
}
}
+6 -1
View File
@@ -29,6 +29,11 @@ namespace anm2ed::anm2
texture = Texture(this->path);
}
Spritesheet::Spritesheet(const std::filesystem::path& directory, const std::filesystem::path& path)
: Spritesheet(directory.string(), path.string())
{
}
XMLElement* Spritesheet::to_element(XMLDocument& document, int id)
{
auto element = document.NewElement("Spritesheet");
@@ -60,4 +65,4 @@ namespace anm2ed::anm2
bool Spritesheet::is_valid() { return texture.is_valid(); }
}
}
+2 -1
View File
@@ -20,6 +20,7 @@ namespace anm2ed::anm2
Spritesheet() = default;
Spritesheet(tinyxml2::XMLElement*, int&);
Spritesheet(const std::string&, const std::string& = {});
Spritesheet(const std::filesystem::path&, const std::filesystem::path& = {});
tinyxml2::XMLElement* to_element(tinyxml2::XMLDocument&, int);
std::string to_string(int id);
bool save(const std::string&, const std::string& = {});
@@ -27,4 +28,4 @@ namespace anm2ed::anm2
void reload(const std::string&);
bool is_valid();
};
}
}