Chameleon

Chameleon Commit Details

Date:2010-07-16 11:32:58 (8 years 11 months ago)
Author:Tamás Kosárszky
Commit:181
Parents: 180
Message:Initialize screen_params[] with proper default values and added checks for screen dimension values. Thanks for Conti and aschar.
Changes:
M/trunk/i386/boot2/gui.c

File differences

trunk/i386/boot2/gui.c
147147
148148
149149
150
150
151151
152152
153153
......
578578
579579
580580
581
581
582582
583583
584
584
585585
586586
587
588587
589588
590589
......
16981697
16991698
17001699
1701
1700
17021701
17031702
17041703
17051704
1706
1705
17071706
17081707
17091708
17101709
1711
17121710
17131711
17141712
static bool infoMenuNativeBoot = false;
static unsigned long screen_params[4] = {0, 0, 0, 0};// here we store the used screen resolution
static unsigned long screen_params[4] = {DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT, 32, 0};// here we store the used screen resolution
#ifdef EMBED_THEME
static int loadEmbeddedThemeImage(const char *image, unsigned char *image_data, unsigned int image_size)
#endif
}
// parse display size parameters
if (getIntForKey("screen_width", &val, &bootInfo->themeConfig)) {
if (getIntForKey("screen_width", &val, &bootInfo->themeConfig) && val > 0) {
screen_params[0] = val;
}
if (getIntForKey("screen_height", &val, &bootInfo->themeConfig)) {
if (getIntForKey("screen_height", &val, &bootInfo->themeConfig) && val > 0) {
screen_params[1] = val;
}
screen_params[2] = 32;
// Initalizing GUI strucutre.
bzero(&gui, sizeof(gui_t));
}
// parse screen size parameters
if (getIntForKey("boot_width", &pos, &bootInfo->themeConfig)) {
if (getIntForKey("boot_width", &pos, &bootInfo->themeConfig) && pos > 0) {
screen_params[0] = pos;
} else {
screen_params[0] = DEFAULT_SCREEN_WIDTH;
}
if (getIntForKey("boot_height", &pos, &bootInfo->themeConfig)) {
if (getIntForKey("boot_height", &pos, &bootInfo->themeConfig) && pos > 0) {
screen_params[1] = pos;
} else {
screen_params[1] = DEFAULT_SCREEN_HEIGHT;
}
screen_params[2] = 32;
gui.screen.width = screen_params[0];
gui.screen.height = screen_params[1];

Archive Download the corresponding diff file

Revision: 181