// -------------------------------------------------- void BoxViewer::drawPokemonScale(pkm_s* pkm, int16_t x, int16_t y, float scale) // -------------------------------------------------- { if (pkm->speciesID == 0) return; sf2d_texture* pkmIcons = PHBanku::texture->pkmIcons; if (pkm->isShiny) pkmIcons = PHBanku::texture->pkmShinyIcons; // Draw the shadow { sf2d_draw_texture_part_scale_blend(pkmIcons, x + 2 * scale, y + 2 * scale, (pkm->speciesID % 25) * 40, (pkm->speciesID / 25) * 30, 40, 30, scale, scale, RGBA8(0x00,0x00,0x00,0x55)); } if (pkm->isEggy) { // Draw the egg+Pokémon icon sf2d_draw_texture_part_scale(pkmIcons, x, y, (pkm->speciesID % 25) * 40, (pkm->speciesID / 25) * 30, 40, 30, scale, scale); sf2d_draw_texture_part(pkmIcons, x, y + 30 * (scale - 0.5f), (EGG_ID % 25) * 40, (EGG_ID / 25) * 30, 40, 30); } else { // Draw the Pokémon icon sf2d_draw_texture_part_scale(pkmIcons, x, y, (pkm->speciesID % 25) * 40, (pkm->speciesID / 25) * 30, 40, 30, scale, scale); // Draw the item if (pkm->itemID > 0) { // TODO: Draw item sf2d_draw_texture_part(PHBanku::texture->itemIcons, x + 5, y + 30 * (scale - 0.5f), (pkm->itemID % 34) * 30, (pkm->itemID / 34) * 30, 30, 30); } } }
void renderb(s32 xp, s32 yp, u32 xTile, u32 yTile, u8 bits, u32 color) { xp -= offsetX; yp -= offsetY; int scaleX = 2, scaleY = 2; if ((bits & 1) > 0) { scaleX = -2; xp += 8; } if ((bits & 2) > 0) { scaleY = -2; yp += 8; } sf2d_draw_texture_part_scale_blend(icons, xp << 1, yp << 1, xTile, yTile, 8, 8, scaleX, scaleY, color); }
void render16s(s32 xp, s32 yp, u32 tile, u8 bits, u32 color) { xp -= offsetX; yp -= offsetY; int xTile = tile & 255; int yTile = tile >> 8; int scaleX = 2, scaleY = 2; if ((bits & 1) > 0) { scaleX = -2; xp += 16; } if ((bits & 2) > 0) { scaleY = -2; yp += 16; } sf2d_draw_texture_part_scale_blend(icons, xp << 1, yp << 1, xTile, yTile, 16, 16, scaleX, scaleY, color); }