MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / drawCharacterSprite

Function drawCharacterSprite

src/openrct2/drawing/Drawing.String.cpp:447–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445 }
446
447 static void drawCharacterSprite(RenderTarget& rt, int32_t codepoint, TextDrawInfo& info)
448 {
449 int32_t characterWidth = FontSpriteGetCodepointWidth(info.fontStyle, codepoint);
450 auto sprite = FontSpriteGetCodepointSprite(info.fontStyle, codepoint);
451
452 if (!info.textDrawFlags.has(TextDrawFlag::noDraw))
453 {
454 auto screenCoords = info.current;
455 if (info.textDrawFlags.has(TextDrawFlag::yOffsetEffect))
456 {
457 screenCoords.y += *info.yOffset++;
458 }
459
460 PaletteIndex palette[8]{};
461 palette[1] = info.palette.fill;
462 palette[2] = info.palette.sunnyOutline;
463 palette[3] = info.palette.shadowOutline;
464
465 PaletteMap paletteMap(palette);
466 GfxDrawGlyph(rt, sprite, screenCoords, paletteMap);
467 }
468
469 info.current.x += characterWidth;
470 }
471
472 static void drawStringRawSprite(RenderTarget& rt, std::string_view text, TextDrawInfo& info)
473 {

Callers 2

drawStringRawSpriteFunction · 0.85
processStringLiteralFunction · 0.85

Calls 4

GfxDrawGlyphFunction · 0.85
hasMethod · 0.65

Tested by

no test coverage detected