Index: apps/plugins/brickmania.c =================================================================== --- apps/plugins/brickmania.c (révision 22500) +++ apps/plugins/brickmania.c (copie de travail) @@ -248,21 +248,29 @@ #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 CYCLETIME 50 - #define TOPMARGIN (BRICK_HEIGHT * 2) +/* Calculates the delta between a 4/3 ration and the actual ratio */ #if LCD_WIDTH<=LCD_HEIGHT -/* Maintain a 4/3 ratio (Width/Height) */ -#define GAMESCREEN_HEIGHT (LCD_WIDTH * 3 / 4) +#define HEIGHT_DELTA (LCD_WIDTH * 3) / (LCD_HEIGHT * 4) #else -#define GAMESCREEN_HEIGHT LCD_HEIGHT +#define HEIGHT_DELTA 1 #endif +/* 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 ration (ie., the ball + goes quicker if the screen has a bigger height. + In fact, we try to speed up the game without speeding up the pad to + compensate for the higher screen. +*/ +#define CYCLETIME (50 * HEIGHT_DELTA) +#define PAD_MOTION (8 * HEIGHT_DELTA) + +#define GAMESCREEN_HEIGHT LCD_HEIGHT + #define STRINGPOS_FINISH (GAMESCREEN_HEIGHT - (GAMESCREEN_HEIGHT / 6)) #define STRINGPOS_CONGRATS (STRINGPOS_FINISH - 20) #define STRINGPOS_NAVI (STRINGPOS_FINISH - 10) @@ -271,7 +279,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 +982,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 +1587,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