summaryrefslogtreecommitdiff
path: root/apps/plugins/sliding_puzzle.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/sliding_puzzle.c')
-rw-r--r--apps/plugins/sliding_puzzle.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c
index bb497deb8e..ce2ae810d5 100644
--- a/apps/plugins/sliding_puzzle.c
+++ b/apps/plugins/sliding_puzzle.c
@@ -95,16 +95,17 @@ PLUGIN_HEADER
95 95
96#endif 96#endif
97 97
98
99#include "sliding_puzzle.h"
100#define IMAGE_WIDTH BMPWIDTH_sliding_puzzle
101#define IMAGE_HEIGHT BMPHEIGHT_sliding_puzzle
102#define IMAGE_SIZE IMAGE_WIDTH
103
98static struct plugin_api* rb; 104static struct plugin_api* rb;
99#if LCD_DEPTH==1 105#if LCD_DEPTH==1
100/* for recorder, use rectangular image, 5x4 puzzle */ 106/* for Archos, use rectangular image, 5x4 puzzle */
101#define SPOTS_X 5 107#define SPOTS_X 5
102#define SPOTS_Y 4 108#define SPOTS_Y 4
103#define SPOTS_WIDTH 16
104#define SPOTS_HEIGHT 16
105#define IMAGE_WIDTH 80
106#define IMAGE_HEIGHT 64
107#define IMAGE_SIZE 80
108#else 109#else
109/* for other targets, use a square image, 4x4 puzzle 110/* for other targets, use a square image, 4x4 puzzle
110 Puzzle image dimension is min(lcd_height,lcd_width) 111 Puzzle image dimension is min(lcd_height,lcd_width)
@@ -113,15 +114,12 @@ static struct plugin_api* rb;
113 and SPOTS_Y, otherwise lcd_bitmap_part stride won't be correct */ 114 and SPOTS_Y, otherwise lcd_bitmap_part stride won't be correct */
114#define SPOTS_X 4 115#define SPOTS_X 4
115#define SPOTS_Y 4 116#define SPOTS_Y 4
116#define IMAGE_SIZE ( (LCD_WIDTH<LCD_HEIGHT)?LCD_WIDTH:LCD_HEIGHT )
117#define IMAGE_WIDTH IMAGE_SIZE
118#define IMAGE_HEIGHT IMAGE_SIZE
119#define SPOTS_WIDTH (IMAGE_WIDTH/SPOTS_X)
120#define SPOTS_HEIGHT (IMAGE_HEIGHT/SPOTS_Y)
121#endif 117#endif
122 118
123#define NUM_SPOTS (SPOTS_X*SPOTS_Y) 119#define SPOTS_WIDTH (IMAGE_WIDTH / SPOTS_X)
124#define HOLE_ID (NUM_SPOTS) 120#define SPOTS_HEIGHT (IMAGE_HEIGHT / SPOTS_Y)
121#define NUM_SPOTS (SPOTS_X*SPOTS_Y)
122#define HOLE_ID (NUM_SPOTS)
125#define INITIAL_HOLE (HOLE_ID-1) 123#define INITIAL_HOLE (HOLE_ID-1)
126 124
127enum picmodes 125enum picmodes