| 225 | } |
| 226 | |
| 227 | void TileMapAtlas::updateAtlasValues() |
| 228 | { |
| 229 | AXASSERT(_TGAInfo != nullptr, "tgaInfo must be non-nil"); |
| 230 | |
| 231 | int total = 0; |
| 232 | |
| 233 | for (int x = 0; x < _TGAInfo->width; x++) |
| 234 | { |
| 235 | for (int y = 0; y < _TGAInfo->height; y++) |
| 236 | { |
| 237 | if (total < _itemsToRender) |
| 238 | { |
| 239 | Color3B* ptr = (Color3B*)_TGAInfo->imageData; |
| 240 | Color3B value = ptr[x + y * _TGAInfo->width]; |
| 241 | |
| 242 | if (value.r != 0) |
| 243 | { |
| 244 | this->updateAtlasValueAt(Vec2(x, y), value, total); |
| 245 | |
| 246 | std::string key = StringUtils::toString(x) + "," + StringUtils::toString(y); |
| 247 | _posToAtlasIndex[key] = total; |
| 248 | |
| 249 | total++; |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | } |
no test coverage detected