Add backgrounds

This commit is contained in:
simon.kagstrom 2009-11-26 18:33:42 +00:00
parent 35fcf68236
commit 3ff0e351f5
7 changed files with 11 additions and 6 deletions

View File

@ -68,7 +68,8 @@ const char *main_menu_messages[] = {
static void init(void) static void init(void)
{ {
TTF_Font *fnt; TTF_Font *fnt;
SDL_Surface *bg_left, *bg_right, *bg_middle; SDL_Surface *bg_left, *bg_right, *bg_middle,
*bg_submenu_left, *bg_submenu_right, *bg_submenu_middle;
screen = SDL_SetVideoMode(640, 480, 16, screen = SDL_SetVideoMode(640, 480, 16,
SDL_DOUBLEBUF); SDL_DOUBLEBUF);
@ -79,16 +80,20 @@ static void init(void)
fnt = read_and_alloc_font("font.ttf", 18); fnt = read_and_alloc_font("font.ttf", 18);
bg_left = IMG_Load("bg_left.png"); bg_left = IMG_Load("themes/default/bg_left.png");
bg_right = IMG_Load("bg_right.png"); bg_right = IMG_Load("themes/default/bg_right.png");
bg_middle = IMG_Load("bg_middle.png"); bg_middle = IMG_Load("themes/default/bg_middle.png");
panic_if( !bg_left || !bg_right || !bg_middle, bg_submenu_left = IMG_Load("themes/default/bg_submenu_left.png");
bg_submenu_right = IMG_Load("themes/default/bg_submenu_right.png");
bg_submenu_middle = IMG_Load("themes/default/bg_submenu_middle.png");
panic_if( !bg_left || !bg_right || !bg_middle ||
!bg_submenu_left || !bg_submenu_right || !bg_submenu_middle,
"bg loading failed\n"); "bg loading failed\n");
g_menu = new PrintMenu(new Font_TTF(fnt, 255, 255, 255)); g_menu = new PrintMenu(new Font_TTF(fnt, 255, 255, 255));
g_menu->setText(main_menu_messages); g_menu->setText(main_menu_messages);
g_menu->setSelectedBackground(bg_left, bg_middle, bg_right, g_menu->setSelectedBackground(bg_left, bg_middle, bg_right,
NULL, NULL, NULL); bg_submenu_left, bg_submenu_middle, bg_submenu_right);
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])

BIN
themes/default/bg_left.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

BIN
themes/default/bg_right.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B