Index: apps/plugins/brickmania.c =================================================================== --- apps/plugins/brickmania.c (révision 22500) +++ apps/plugins/brickmania.c (copie de travail) @@ -248,20 +248,20 @@ #include "pluginbitmaps/brickmania_break.h" #endif -/* The time (in ms) for one iteration through the game loop - decrease this - to speed up the game - note that current_tick is (currently) only accurate - to 10ms. +#define TOPMARGIN (BRICK_HEIGHT * 2) + +/* The time (in ms) for one iteration through the game loop is 50 ms. Decrease + this value to speed up the game - note that current_tick is (currently) only + accurate to 10ms. + + The speed of the game is adapted to correct the screen ratio (ie., the ball + goes quicker if the screen has a bigger height). */ -#define CYCLETIME 50 -#define TOPMARGIN (BRICK_HEIGHT * 2) +#define CYCLETIME (50 * (176) / (LCD_HEIGHT)) +#define PAD_MOTION (8 * (176 * 220) / (LCD_WIDTH * LCD_HEIGHT)) -#if LCD_WIDTH<=LCD_HEIGHT -/* Maintain a 4/3 ratio (Width/Height) */ -#define GAMESCREEN_HEIGHT (LCD_WIDTH * 3 / 4) -#else #define GAMESCREEN_HEIGHT LCD_HEIGHT -#endif #define STRINGPOS_FINISH (GAMESCREEN_HEIGHT - (GAMESCREEN_HEIGHT / 6)) #define STRINGPOS_CONGRATS (STRINGPOS_FINISH - 20) @@ -271,7 +271,6 @@ /*calculate paddle y-position */ #define PAD_POS_Y (GAMESCREEN_HEIGHT - PAD_HEIGHT - 1) - int levels_num = 29; static unsigned char levels[29][8][10] = { @@ -975,11 +974,6 @@ rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_clear_display(); rb->lcd_set_background(LCD_BLACK); -#if LCD_HEIGHT > GAMESCREEN_HEIGHT - rb->lcd_set_foreground(rb->global_settings->bg_color); - rb->lcd_fillrect(0, GAMESCREEN_HEIGHT, LCD_WIDTH, - LCD_HEIGHT - GAMESCREEN_HEIGHT); -#endif rb->lcd_set_foreground(LCD_WHITE); #else rb->lcd_clear_display(); @@ -1585,7 +1579,7 @@ continue; if ((button_right && flip_sides==false) || (button_left && flip_sides==true)) { - if (pad_pos_x+8+pad_width > LCD_WIDTH) { + if (pad_pos_x+PAD_MOTION+pad_width > LCD_WIDTH) { for(k=0;k