diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-02-08 22:48:53 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-02-08 22:48:53 +0000 |
commit | f24bd466f28d08098244843172d743864c3f1723 (patch) | |
tree | 0ba74dfeb24fb7f72c2334fd5c9c8db1393c725a /apps/plugins/cube.c | |
parent | aa3ab739ab9af715d72d77af830747bc4d51d263 (diff) | |
download | rockbox-f24bd466f28d08098244843172d743864c3f1723.tar.gz rockbox-f24bd466f28d08098244843172d743864c3f1723.zip |
adjusting to screen size
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5859 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/cube.c')
-rw-r--r-- | apps/plugins/cube.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index e17dcb752a..0beee59777 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c | |||
@@ -75,8 +75,8 @@ static long matrice[3][3]; | |||
75 | 75 | ||
76 | static int nb_points = 8; | 76 | static int nb_points = 8; |
77 | 77 | ||
78 | static int x_off = 56; | 78 | static int x_off = LCD_WIDTH/2; |
79 | static int y_off = 31; | 79 | static int y_off = LCD_HEIGHT/2; |
80 | static int z_off = 600; | 80 | static int z_off = 600; |
81 | 81 | ||
82 | /* Precalculated sine and cosine * 10000 (four digit fixed point math) */ | 82 | /* Precalculated sine and cosine * 10000 (four digit fixed point math) */ |
@@ -224,17 +224,23 @@ static void cube_viewport(void) | |||
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | #if LCD_HEIGHT > 100 | ||
228 | #define DIST 80 | ||
229 | #else | ||
230 | #define DIST 40 | ||
231 | #endif | ||
232 | |||
227 | static void cube_init(void) | 233 | static void cube_init(void) |
228 | { | 234 | { |
229 | /* Original 3D-position of cube's corners */ | 235 | /* Original 3D-position of cube's corners */ |
230 | sommet[0].x = -40; sommet[0].y = -40; sommet[0].z = -40; | 236 | sommet[0].x = -DIST; sommet[0].y = -DIST; sommet[0].z = -DIST; |
231 | sommet[1].x = 40; sommet[1].y = -40; sommet[1].z = -40; | 237 | sommet[1].x = DIST; sommet[1].y = -DIST; sommet[1].z = -DIST; |
232 | sommet[2].x = 40; sommet[2].y = 40; sommet[2].z = -40; | 238 | sommet[2].x = DIST; sommet[2].y = DIST; sommet[2].z = -DIST; |
233 | sommet[3].x = -40; sommet[3].y = 40; sommet[3].z = -40; | 239 | sommet[3].x = -DIST; sommet[3].y = DIST; sommet[3].z = -DIST; |
234 | sommet[4].x = 40; sommet[4].y = -40; sommet[4].z = 40; | 240 | sommet[4].x = DIST; sommet[4].y = -DIST; sommet[4].z = DIST; |
235 | sommet[5].x = -40; sommet[5].y = -40; sommet[5].z = 40; | 241 | sommet[5].x = -DIST; sommet[5].y = -DIST; sommet[5].z = DIST; |
236 | sommet[6].x = -40; sommet[6].y = 40; sommet[6].z = 40; | 242 | sommet[6].x = -DIST; sommet[6].y = DIST; sommet[6].z = DIST; |
237 | sommet[7].x = 40; sommet[7].y = 40; sommet[7].z = 40; | 243 | sommet[7].x = DIST; sommet[7].y = DIST; sommet[7].z = DIST; |
238 | } | 244 | } |
239 | 245 | ||
240 | static void line(int a, int b) | 246 | static void line(int a, int b) |