Skip to content

Commit

Permalink
Indicate free crystal tile IDs, improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Vankata453 committed Jul 7, 2023
1 parent 5de3d38 commit a8126da
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
6 changes: 5 additions & 1 deletion data/images/tiles.strf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@

;; next-id: 7195
;; free/skipped ids (please use before any other): 101
;; 2080-2084 are empty tiles, 5023-5092, 5268-5283, 7002 7005 7007 7008 7173
;; 2080-2084 are empty tiles, 4724, 4725, 4727-4735, 4737, 4738, 4740-4748,
;; 4749-4774, 4776, 4777, 4779-4787, 4789, 4790, 4792-4800, 4801-4821,
;; 4824-4831, 4833, 4834-4841, 4843, 4844-4851, 4853, 4854-4861, 4863, 4864-4871, 4873, 4874-4881, 4884-4891,
;; 4894-4905, 4909-4911, 4915-4917,
;; 5023-5092, 5268-5283, 7002 7005 7007 7008 7173
;; No group ids are currently skipped! Delete this line if any are and replace it with said ids...

(tilegroup
Expand Down
Binary file removed data/images/tiles/crystalcave/ground.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src/supertux/tile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class Tile final
/** Prevent the addition of this tile to tilegroups, place restrictions in editor. */
const bool m_deprecated;

/** Indicate if the tile is a clone of another tile. Hide from editor. */
/** Indicate if the tile is a clone of another tile. Hide from unassigned tilegroup. */
const bool m_is_clone;

private:
Expand Down
17 changes: 8 additions & 9 deletions src/supertux/tile_set_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ TileSetParser::parse_tile(const ReaderMapping& reader, int32_t min, int32_t max,
if (max && (id < static_cast<uint32_t>(min) || id > static_cast<uint32_t>(max))) return;
id += offset;

uint32_t clone_tile = 0;
reader.get("clone-tile", clone_tile);
if (clone_tile > 0)
{
m_tileset.add_tile(id, clone_tile);
return;
}

uint32_t attributes = 0;

bool value = false;
Expand Down Expand Up @@ -261,15 +269,6 @@ TileSetParser::parse_tile(const ReaderMapping& reader, int32_t min, int32_t max,
bool deprecated = false;
reader.get("deprecated", deprecated);

uint32_t clone_tile = 0;
reader.get("clone-tile", clone_tile);

if (clone_tile > 0)
{
m_tileset.add_tile(id, clone_tile);
return;
}

auto tile = std::make_unique<Tile>(surfaces, editor_surfaces,
attributes, data, fps,
deprecated, object_name, object_data);
Expand Down

0 comments on commit a8126da

Please sign in to comment.