diff --git a/CHANGELOG.md b/CHANGELOG.md index b08b97f..37b5e7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [Version 3.3.1] - 2024-06-06 + +### Added + +- Added max-sprites definition. +- Added Cocos2d-x template. + +### Changed + +- Abort globbing when pattern is too coarse. + +### Fixed + +- Ensure the lowest index duplicate sprite is the one that is kept. +- globbing does not always search subdirectories. + ## [Version 3.3.0] - 2023-05-28 ### Added @@ -228,6 +244,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fixed -- commandline arguments. - Fixed sample cpp.template. +[version 3.3.1]: https://github.com/houmain/spright/compare/3.3.0...3.3.1 [version 3.3.0]: https://github.com/houmain/spright/compare/3.2.0...3.3.0 [version 3.2.0]: https://github.com/houmain/spright/compare/3.1.0...3.2.0 [version 3.1.0]: https://github.com/houmain/spright/compare/3.0.0...3.1.0 diff --git a/README.md b/README.md index 4c993bb..90b394c 100644 --- a/README.md +++ b/README.md @@ -242,13 +242,14 @@ The following table contains a list of all definitions, with the item each affec | **input** | - | path | Adds a new input file at _path_. It can define a single file or an un-/bounded sequence of files (e.g. `"frames{0-}.png", "frames{0001-0013}.png"`). | | path | input | path | A _path_ which should be prepended to the input's path. | | colorkey | input | [color] | Specifies that the input has a color, which should be considered transparent (in hex notation e.g. `FF00FF`). | -| grid | input | x, y | Specifies that the input contains multiple sprites, arranged in a grid of a certain cell size. In this mode the _rect_ of each _sprite_ is deduced from the grid. Each _sprite_ automatically advances the current cell horizontally. | +| grid | input | x, [y] | Specifies that the input contains multiple sprites, arranged in a grid of a certain cell size. In this mode the _rect_ of each _sprite_ is deduced from the grid. Each _sprite_ automatically advances the current cell horizontally. | | grid-cells | input | x, y | As _grid_, but specifies the number of cells instead of their size. When the cells are squares, one dimension is allowed to be _0_, so it is automatically deduced. | | grid-offset | input | x, [y],
[r-x], [b-y] | Offsets the grid from the top-left corner by a number of pixels. Optionally the grid's offset from the bottom-right corner can also be specified, which is used when deducing the cell-size using _grid-cells_. | | grid-spacing | input | x, [y] | Sets a spacing between the grid cells. | -| row | input | row | Sets a sprite's vertical offset within a grid (starting with 0). | -| skip | input | [count] | Skips one or more horizontal grid cells or indices in file sequences (a non-numeric parameter is treated as 1, to allow simple substitutions of _sprite_). | +| row | input | row | Sets a sprite's row within a grid (starting with 0). | +| skip | input | [count] | Skips one or more horizontal grid cells or indices in file sequences (a non-numeric parameter is treated as 1, to allow simple substitution of _sprite "id"_). | | atlas | input | [pixels] | Specifies that the input contains multiple unaligned sprites, separated by more than a specific number of transparent pixel rows. | +| max-sprites | input | count | Limits the number of sprites to prevent editors from becoming unresponsive on invalid input (default is 1000). | | **sprite** | - | [id] | Adds a new sprite to an input and optionally sets its id. | | id | sprite | id | Sets the sprite's id (defaults to `"sprite_{{index}}"`). See list of available [variables](#variables). | | span | sprite | columns, rows | Sets the number of grid cells a sprite spans. | diff --git a/src/Definition.cpp b/src/Definition.cpp index a7f0711..43a515d 100644 --- a/src/Definition.cpp +++ b/src/Definition.cpp @@ -451,7 +451,7 @@ void apply_definition(Definition definition, break; } case Definition::grid: - state.grid = check_size(false); + state.grid = check_size(true); check(state.grid.x > 0 && state.grid.y > 0, "invalid grid"); break;