- pngdump tool overlay multiple images (combine spritesheets)
[gba_blender] / src / main.c
index af2f6d3..2110b9a 100644 (file)
@@ -35,10 +35,17 @@ enum {
        SIDX_ICONS_BASE
 };
 
+#define SNAM_START     512
 enum {
-       SNAM_DEL0       = 512,
-       SNAM_DEL1       = SNAM_DEL0 + 8,
-       SNAM_DEL2       = SNAM_DEL1 + 8
+       SNAM_DEL0               = SNAM_START,
+       SNAM_DEL1               = SNAM_DEL0 + 8,
+       SNAM_DEL2               = SNAM_DEL1 + 8,
+       SNAM_ICON_ZOOM  = SNAM_START + 24,
+       SNAM_ICON_PAN   = SNAM_ICON_ZOOM + 4,
+       SNAM_ICON_ORBIT = SNAM_START + 32 * 4 + 24,     /* for tiles down, 24 across */
+       SNAM_ICON_X             = SNAM_START + 32 * 8 + 26,
+       SNAM_ICON_Y             = SNAM_ICON_X + 2,
+       SNAM_ICON_Z             = SNAM_ICON_Y + 2
 };
 
 #define MENU_HEIGHT            17
@@ -117,6 +124,12 @@ int main(void)
        dma_copy16(3, fbptr[1], bgimg_pixels, 240 * 160 / 2, 0);
 
        init_sprites();
+       REG_BLDCNT = BLDCNT_ALPHA | BLDCNT_B_BG2;
+       REG_BLDALPHA = 0x040c;
+
+       set_sprite(oam, SIDX_ICONS_BASE, SNAM_ICON_ZOOM, 213, 57, 4, SPR_SZ32);
+       set_sprite(oam, SIDX_ICONS_BASE + 1, SNAM_ICON_PAN, 213, 81, 4, SPR_SZ32);
+       set_sprite(oam, SIDX_ICONS_BASE + 2, SNAM_ICON_ORBIT, 213, 103, 4, SPR_SZ32);
 
        xgl_init();
        xgl_viewport(0, 0, 240, VP_HEIGHT);
@@ -231,7 +244,8 @@ static void show_msgbox(int en)
 
        if(en) {
                for(i=0; i<3; i++) {
-                       set_sprite(oam, SIDX_DEL0 + i, SNAM_DEL0 + i * 8, 42 + i * 64, 42, 0, SPR_SZ64);
+                       set_sprite(oam, SIDX_DEL0 + i, SNAM_DEL0 + i * 8, 42 + i * 64, 50, 0,
+                                       SPR_SZ64 | SPR_BLEND);
                }
        } else {
                for(i=0; i<3; i++) {