| 51 | } |
| 52 | |
| 53 | bool TileMapAtlas::initWithTileFile(std::string_view tile, std::string_view mapFile, int tileWidth, int tileHeight) |
| 54 | { |
| 55 | this->loadTGAfile(mapFile); |
| 56 | this->calculateItemsToRender(); |
| 57 | |
| 58 | if (AtlasNode::initWithTileFile(tile, tileWidth, tileHeight, _itemsToRender)) |
| 59 | { |
| 60 | this->updateAtlasValues(); |
| 61 | this->setContentSize(Vec2((float)(_TGAInfo->width * _itemWidth), (float)(_TGAInfo->height * _itemHeight))); |
| 62 | return true; |
| 63 | } |
| 64 | return false; |
| 65 | } |
| 66 | |
| 67 | TileMapAtlas::TileMapAtlas() : _itemsToRender(0), _TGAInfo(nullptr) {} |
| 68 |
no test coverage detected