From cc9a6628c418ba96a640544f878d05a0933d31c7 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Mon, 29 Jul 2013 21:44:59 +0200 Subject: [PATCH] weaponshop: use new spritemap --- spritemaps.c | 4 ++-- spritemaps.h | 2 +- weapon_shop.c | 10 ++-------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/spritemaps.c b/spritemaps.c index c4b275a..da97e0c 100644 --- a/spritemaps.c +++ b/spritemaps.c @@ -30,7 +30,7 @@ #include "sprites/ws_hbar6.c" #include "sprites/ws_hbar10.c" #include "sprites/ws_costcredit.c" -#include "sprites/ws_viewexit.c" +#include "sprites/weaponshop.c" #include "sprites/weapon_sprites.c" #define spritemap_entry(x, y) [ x ] = &(y .header) @@ -65,6 +65,6 @@ const struct palpic *spritemaps[] = { spritemap_entry(SI_WS_HBAR6, ws_hbar6), spritemap_entry(SI_WS_HBAR10, ws_hbar10), spritemap_entry(SI_WS_COSTCREDIT, ws_costcredit), - spritemap_entry(SI_WS_VIEWEXIT, ws_viewexit), + spritemap_entry(SI_WEAPONSHOP, weaponshop), spritemap_entry(SI_WEAPONS, weapon_sprites), }; diff --git a/spritemaps.h b/spritemaps.h index 168019e..efcdae2 100644 --- a/spritemaps.h +++ b/spritemaps.h @@ -32,7 +32,7 @@ enum __attribute__ ((__packed__)) sprite_index { SI_WS_HBAR6, SI_WS_HBAR10, SI_WS_COSTCREDIT, - SI_WS_VIEWEXIT, + SI_WEAPONSHOP, SI_WEAPONS, SI_MAX, SI_INVALID = SI_MAX, diff --git a/weapon_shop.c b/weapon_shop.c index 017facb..875c7f8 100644 --- a/weapon_shop.c +++ b/weapon_shop.c @@ -91,21 +91,15 @@ static void draw_ws_grid() { static void draw_ws_text_sprites() { blit_sprite(GRID_START_X+31*SCALE, GRID_START_Y+186*SCALE, &video, SCALE, spritemaps[SI_WS_COSTCREDIT], 0, 0); blit_sprite(GRID_START_X+150*SCALE, GRID_START_Y+186*SCALE, &video, SCALE, spritemaps[SI_WS_COSTCREDIT], 1, 0); - blit_sprite(GRID_START_X+3*SCALE, GRID_START_Y+121*SCALE, &video, SCALE, spritemaps[SI_WS_VIEWEXIT], 0, 0); - blit_sprite(GRID_START_X+259*SCALE, GRID_START_Y+121*SCALE, &video, SCALE, spritemaps[SI_WS_VIEWEXIT], 1, 0); } static void draw_ws_weapons() { unsigned img = 0; + const struct palpic* p = spritemaps[SI_WEAPONSHOP]; unsigned y,yy,x,xx; for(yy= 0, y = GRID_START_Y+5*SCALE; yy < 6; y+=23*SCALE, yy++) { for(xx = 0, x = GRID_START_X+3*SCALE; xx < 5; x+=64*SCALE, xx++) { - if(yy == 5 && (xx == 0 || xx == 4)) continue; - const struct palpic* p; - if(img == 8) img++; /* m16 with launcher not implemented */ - if(img > 19) p = spritemaps[SI_WEAPONS]; - else p = spritemaps[SI_WEAPONS]; - blit_sprite(x, y, &video, SCALE, p, img > 19 ? img - 20 : img , 0); + blit_sprite(x, y, &video, SCALE, p, img, 0); img++; } } -- 2.11.4.GIT