void actor_draw_shadow(Actor * self) { int f = self->walk_tick >> 2; if (f > 4) { f = 8 - f; } int d = round(self->angle * 8 / (2 * pi) - 2); d &= 7; LandImage * im = self->kind->shadows[d + f * 8]; int w = land_image_width(im); int h = land_image_height(im); land_image_draw_scaled(im, self->x - w / 2, self->y - h / 4 - h / 8, 1, 0.5); if (self->projectile) { land_image_draw(item_types[self->kind->projectile] ->shadows[d] , self->px, self->py - 16); } }
void overview_render(Overview * self) { land_clear(1, 1, 1, 1); float zoom = game->viewport->zoom * pow(2, self->zoom / 10.0); land_reset_transform(); land_translate(self->zoomx, self->zoomy); land_scale(zoom, zoom); #line 115 float w = 960; for (int i = 1; i < 50; i += 1) { int x, z; game_level_number_to_xz(i, & x, & z); float sx, sy; project(game->viewport, (x - 3) * 128, 0, (z - 3) * 128, & sx, & sy); #line 122 int j = i; if (i == game->swap_level) { j = self->selected; } #line 125 else if (i == self->selected) { if (game->swap_level) { j = game->swap_level; sx = self->mx; sy = self->my; } } #line 131 if (self->screenshot [j]) { float iw = land_image_width(self->screenshot [j]); #line 134 land_image_draw_scaled(self->screenshot [j], sx, sy, w / 9 / iw, w / 9 / iw); } if (i == self->selected) { land_premul(1, 0, 0, 0.5); #line 139 float s = w / 18; sy += 5 /* the floor is not centered, so add a slight offset */; #line 142 float xy [8] = {sx, sy - s / 2, sx + s, sy, sx, sy + s / 2, sx - s, sy}; land_filled_polygon(4, xy); } } }