MCPcopy Create free account
hub / github.com/EasyRPG/Player / DrawTileImpl

Method DrawTileImpl

src/tilemap_layer.cpp:219–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219void TilemapLayer::DrawTileImpl(Bitmap& dst, Bitmap& tileset, Bitmap& tone_tileset, int x, int y, int row, int col, uint32_t tone_hash, ImageOpacity op, bool allow_fast_blit) {
220
221 auto rect = Rect{ col * TILE_SIZE, row * TILE_SIZE, TILE_SIZE, TILE_SIZE };
222
223 auto* src = &tileset;
224
225 // Create tone changed tile
226 if (tone != Tone()) {
227 if (chipset_tone_tiles.insert(tone_hash).second) {
228 tone_tileset.ToneBlit(col * TILE_SIZE, row * TILE_SIZE, tileset, rect, tone, Opacity::Opaque());
229 }
230 src = &tone_tileset;
231 }
232
233 bool use_fast_blit = fast_blit && allow_fast_blit;
234 if (op == ImageOpacity::Opaque || use_fast_blit) {
235 dst.BlitFast(x, y, *src, rect, 255);
236 } else {
237 dst.Blit(x, y, *src, rect, 255);
238 }
239}
240
241static uint32_t MakeFTileHash(int id) {
242 return static_cast<uint32_t>(id);

Callers

nothing calls this directly

Calls 4

ToneBlitMethod · 0.80
BlitFastMethod · 0.80
BlitMethod · 0.80
ToneClass · 0.70

Tested by

no test coverage detected