This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10561 - Fullscreen brickmania
Attached to Project:
Rockbox
Opened by Clément Pit--Claudel (CFP) - Monday, 24 August 2009, 10:37 GMT+2
Last edited by Karl Kurbjun (kkurbjun) - Friday, 18 December 2009, 05:12 GMT+2
Opened by Clément Pit--Claudel (CFP) - Monday, 24 August 2009, 10:37 GMT+2
Last edited by Karl Kurbjun (kkurbjun) - Friday, 18 December 2009, 05:12 GMT+2
|
DetailsThis patch makes brickmania fullscreen on all targets.
To ensure that it the game isn't easier on DAPs with bigger screens, it recalculates the game and pad speed. Please, do test it :) I've tried it on all color targets (in sim), but there may still be a few modifications to do. CFP. |
This task depends upon
Closed by Karl Kurbjun (kkurbjun)
Friday, 18 December 2009, 05:12 GMT+2
Reason for closing: Accepted
Additional comments about closing: Thanks.
Friday, 18 December 2009, 05:12 GMT+2
Reason for closing: Accepted
Additional comments about closing: Thanks.
But it's highly discouraged to use float, because the targets don't have hardware units to do floating point calculation, so it's horribly slow. explanation: (http://www.rockbox.org/tracker/task/10193#comment31618)
Apart from that the patch works fine on my Sansa E200.
CFP.
I'm not sure I got your last comment: I think the patch work an all color targets. I haven't however, tested on other targets. Did you mean there was targets where the calculation wasn't right?
Thanks,
CFP.
As an enhancement across all targets I think it would make sense to have PAD_MOTION dependent on the the overall screen height regardless of whether the screen is portrait or landscape.
With a screen height of 176 PAD_MOTION should calculate out to 8. As the screen height increases or decreases the PAD_MOTION should scale with the screen height.
So, for example the PAD_MOTION calculation could be 8*SCREEN_HEIGHT/176. This would make is so that the ball speed would scale across all screen sizes. HEIGHT_DELTA could then be eliminated, CYCLE_TIME should probably stay at 50, but if needed it could scale similar to PAD_MOTION.
This would eliminate the need for the screen height checks below:
/* Calculates the delta between a 4/3 ratio and the actual ratio */
#if LCD_WIDTH<=LCD_HEIGHT
#define HEIGHT_DELTA (LCD_WIDTH * 3) / (LCD_HEIGHT * 4)
#else
#define HEIGHT_DELTA 1
#endif
Then the defines might look something like this instead:
#define CYCLETIME 50
#define PAD_MOTION (8*SCREEN_HEIGHT/176)
#define GAMESCREEN_HEIGHT LCD_HEIGHT
If the cycle time needs to be scaled that could be changed too, but I think just changing the ball speed should be adequate.
In fact, CYCLETIME affects both the ball speed and the pad speed: it affects the overall speed of the game. This is why I change it. Then, I apply a corresponding change to how much the pad moves per cycle (that's PAD_MOTION, in pixels), so that so that in the end the pad speed remains the same.
I've tried a few solution to implement what you suggested: I've attached a spreadsheet to demonstrate a few formulas. In fact, the best solution (IMO) is to just use the same calculation as I already did, however without taking into consideration the fact that LCD_WIDTH would be less than LCD_HEIGHT. It gives pretty good results I think.
Scaling the game speed in regards to the H300's size is another good solution, which in fact addresses the problem that currently (in SVN) brickmania isn't faster on larger screens.
To conclude, there are two good solutions:
1. Do not address the "speed should be proportional to the screen size problem". See patch v3-0.
2. Do address the aforementioned problem. See patch v3-1
I'd rather go for not addressing the speed issue, but there is no real reason for this :).
CFP
All that I think is left is to change the GAMESCREEN_HEIGHT to be equal to FIXED3(LCD_HEIGHT), but see what you think of the speed and play of the game with that change - if you think it is reasonable I will commit the change. If you think there is anything else that needs to be modified let me know.