Skip to content

Commit

Permalink
globbing only adds not yet added inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
houmain committed Jul 28, 2024
1 parent 95053f3 commit 516dfa9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Since there are quite some terms, an explanation of what they represent in __spr
- __sheet__: a collection of _sprites_ which should be arranged on one or more _slices_, while obeying the defined constraints. Each _sprite_ is part of a single sheet (there is a default sheet _"spright"_).
- __slice__: a single layer of a _sheet_ where the _sprites_ are arranged.
- __sprite__: a rectangle on a _slice_ with additional metadata.
- __pivot point__: the coordinate of a point on a _sprite_ used for placing it in the game.
- __pivot point__: the coordinate of a point on a _sprite_ used for placing it in the game (a.k.a _anchor_).
- __input__: a filename or sequence referring to one or more input images.
- __source__: a single image file of an _input_ containing the pixel data of one or more _sprites_.
- __output__: a filename or sequence referring to one or more output images.
Expand Down Expand Up @@ -483,7 +483,7 @@ Arch Linux users can install an up to date build from the [AUR](https://aur.arch
Pre-built packages can be downloaded from the [latest release](https://github.com/houmain/spright/releases/latest) page.

Most conveniently but possibly not always the very latest version can be installed using a package manager:
```
```bash
# install using winget
winget install spright

Expand Down
5 changes: 3 additions & 2 deletions src/InputParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,13 @@ void InputParser::deduce_globbed_inputs(State& state) {
return sequences;
}();

const auto inputs_in_sheet_before = m_inputs.size();
for (const auto& sequence : sequences) {
if (has_map_suffix(sequence, state.map_suffixes))
continue;

// add only not yet encountered inputs
if (last_n_contain(m_inputs, m_inputs_in_current_glob,
// only add inputs not encountered before
if (last_n_contain(m_inputs, inputs_in_sheet_before,
[&](const Input& input) {
return input.source_filenames == sequence.sequence_filename();
}))
Expand Down

0 comments on commit 516dfa9

Please sign in to comment.