diff --git a/Marker.cpp b/Marker.cpp index 658c45a..4a4cf7a 100644 --- a/Marker.cpp +++ b/Marker.cpp @@ -15,6 +15,13 @@ Marker::Marker() { } Marker::Marker(std::filesystem::path folder) { + if (validMarkerFolder(folder)) { + initFromFolder(folder); + return; + } + std::stringstream err; + err << "Invalid marker folder : " << folder.string(); + throw std::runtime_error(err.str()); } std::optional> Marker::getSprite(MarkerEndingState state, float seconds) { diff --git a/main.cpp b/main.cpp index 453023e..c91f1d0 100644 --- a/main.cpp +++ b/main.cpp @@ -9,6 +9,7 @@ int main(int argc, char** argv) { + // TODO : BPM & offset settings dans le menu Porperties // TODO : Highlight des notes qui s'entrechoquent // TODO : Undo / Redo // TODO : Debug Log @@ -55,14 +56,14 @@ int main(int argc, char** argv) { // Loading markers preview - std::map markerPreviews; + std::map markerPreviews; for (const auto& folder : std::filesystem::directory_iterator("assets/textures/markers")) { if (folder.is_directory()) { try { sf::Texture markerPreview; markerPreview.loadFromFile((folder/"ma15.png").string()); markerPreview.setSmooth(true); - markerPreviews.insert({folder.path().filename().string(),markerPreview}); + markerPreviews.insert({folder,markerPreview}); } catch (const std::exception& e) { // ajouter e au log }