MCPcopy Create free account
hub / github.com/axmolengine/axmol / calculateItemsToRender

Method calculateItemsToRender

core/2d/TileMapAtlas.cpp:86–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void TileMapAtlas::calculateItemsToRender()
87{
88 AXASSERT(_TGAInfo != nullptr, "tgaInfo must be non-nil");
89
90 _itemsToRender = 0;
91 for (int x = 0; x < _TGAInfo->width; x++)
92 {
93 for (int y = 0; y < _TGAInfo->height; y++)
94 {
95 Color3B* ptr = (Color3B*)_TGAInfo->imageData;
96 Color3B value = ptr[x + y * _TGAInfo->width];
97 if (value.r)
98 {
99 ++_itemsToRender;
100 }
101 }
102 }
103}
104
105void TileMapAtlas::loadTGAfile(std::string_view file)
106{

Callers 1

initWithTileFileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected