* Draw a sprite, not in a viewport * @param img Image number to draw * @param pal Palette to use. * @param x Left coordinate of image in pixels * @param y Top coordinate of image in pixels * @param sub If available, draw only specified part of the sprite * @param zoom Zoom level of sprite */
| 1032 | * @param zoom Zoom level of sprite |
| 1033 | */ |
| 1034 | void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, ZoomLevel zoom) |
| 1035 | { |
| 1036 | SpriteID real_sprite = GB(img, 0, SPRITE_WIDTH); |
| 1037 | if (HasBit(img, PALETTE_MODIFIER_TRANSPARENT)) { |
| 1038 | pal = GB(pal, 0, PALETTE_WIDTH); |
| 1039 | _colour_remap_ptr = GetNonSprite(pal, SpriteType::Recolour) + 1; |
| 1040 | GfxMainBlitter(GetSprite(real_sprite, SpriteType::Normal), x, y, pal == PALETTE_TO_TRANSPARENT ? BlitterMode::Transparent : BlitterMode::TransparentRemap, sub, real_sprite, zoom); |
| 1041 | } else if (pal != PAL_NONE) { |
| 1042 | if (HasBit(pal, PALETTE_TEXT_RECOLOUR)) { |
| 1043 | SetColourRemap((TextColour)GB(pal, 0, PALETTE_WIDTH)); |
| 1044 | } else { |
| 1045 | _colour_remap_ptr = GetNonSprite(GB(pal, 0, PALETTE_WIDTH), SpriteType::Recolour) + 1; |
| 1046 | } |
| 1047 | GfxMainBlitter(GetSprite(real_sprite, SpriteType::Normal), x, y, GetBlitterMode(pal), sub, real_sprite, zoom); |
| 1048 | } else { |
| 1049 | GfxMainBlitter(GetSprite(real_sprite, SpriteType::Normal), x, y, BlitterMode::Normal, sub, real_sprite, zoom); |
| 1050 | } |
| 1051 | } |
| 1052 | |
| 1053 | /** |
| 1054 | * The code for setting up the blitter mode and sprite information before finally drawing the sprite. |
no test coverage detected