diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-03-05 18:53:06 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-03-05 18:53:06 -0500 |
commit | 937875c4e1432b418f0f5051759e02c8d4c9ffa4 (patch) | |
tree | bfb08ae9f8e4619dc213e20739b4fbce682ae0d0 /src/game.cpp | |
parent | cd72ba5481705072b893d728e2f80931b5cca580 (diff) | |
download | tanetane-937875c4e1432b418f0f5051759e02c8d4c9ffa4.tar.gz tanetane-937875c4e1432b418f0f5051759e02c8d4c9ffa4.tar.bz2 tanetane-937875c4e1432b418f0f5051759e02c8d4c9ffa4.zip |
Added the mask sprite layer
This layer is below the normal sprite layer. Sprites on it are only rendered within the area of a zone that is defined per-map.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp index 5b5c506..7e3c88f 100644 --- a/src/game.cpp +++ b/src/game.cpp | |||
@@ -56,7 +56,7 @@ void Game::loadMap(std::string filename) { | |||
56 | if (spritesByAlias_.count(p.name)) continue; | 56 | if (spritesByAlias_.count(p.name)) continue; |
57 | 57 | ||
58 | int spriteId = emplaceSprite(p.name); | 58 | int spriteId = emplaceSprite(p.name); |
59 | getSystem<TransformSystem>().initSprite(spriteId, p.pos); | 59 | getSystem<TransformSystem>().initSprite(spriteId, p.pos, p.masked ? SpriteLayer::Mask : SpriteLayer::Normal); |
60 | getSystem<TransformSystem>().setUpCollision(spriteId, p.collisionOffset, p.collisionSize, true); | 60 | getSystem<TransformSystem>().setUpCollision(spriteId, p.collisionOffset, p.collisionSize, true); |
61 | if (!p.animationFilename.empty()) { | 61 | if (!p.animationFilename.empty()) { |
62 | getSystem<AnimationSystem>().initSprite(spriteId, p.animationFilename); | 62 | getSystem<AnimationSystem>().initSprite(spriteId, p.animationFilename); |