Skip to content

Commit

Permalink
ADD getCdbTile
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed Nov 6, 2024
1 parent b4bde05 commit 76ae4fd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/dn/heaps/slib/SpriteLib.hx
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,22 @@ class SpriteLib {
return fd.tile;
}

#if castle
public function getCdbTile(tileInf:cdb.Types.TilePos) {
if( tileInf==null )
return h2d.Tile.fromColor(0xff0000, 4,4, 0);

final size = tileInf.size;
return tile.sub(
tileInf.x*size,
tileInf.y*size,
(tileInf.width==null ? 1 : tileInf.width)*size,
(tileInf.height==null ? 1 : tileInf.height)*size
);
}
#end


#end // End of #if !macro


Expand Down

0 comments on commit 76ae4fd

Please sign in to comment.