commit fbaef497338f04a64767c7c887723f263583b7ba parent 34011ceda6873d399a17e63a4f656612325f2ce9 Author: dsp56300 <dsp56300@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:55:11 +0200 remove duplicate half roms to be able to load them even if there are too many, but identical ones Diffstat:
M | source/xtLib/xtRomLoader.cpp | | | 16 | ++++++++++++++++ |
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/source/xtLib/xtRomLoader.cpp b/source/xtLib/xtRomLoader.cpp @@ -47,6 +47,22 @@ namespace xt ++i; } + if(filesHalf.size() > 2) + { + // remove possible duplicates + for(size_t i=0; i<filesHalf.size(); ++i) + { + for(size_t j=i+1; j<filesHalf.size(); ++j) + { + if(filesHalf[i].data == filesHalf[j].data) + { + filesHalf.erase(filesHalf.begin() + static_cast<ptrdiff_t>(j)); + --j; + } + } + } + } + if(filesHalf.size() == 2) { File& a = filesHalf.front();