- Menu::set_current(main_menu);
- DrawingContext& context = *titlesession->context;
- while (Menu::current())
- {
- // Calculate the movement-factor
- Uint32 ticks = SDL_GetTicks();
- float elapsed_time = float(ticks - lastticks) / 1000.;
- global_time += elapsed_time;
- lastticks = ticks;
- // 40fps is minimum
- if(elapsed_time > .04)
- elapsed_time = .04;
-
- /* Lower the speed so that Tux doesn't jump too hectically throught
- the demo. */
- elapsed_time /= 2;
-
- SDL_Event event;
- while (SDL_PollEvent(&event))
- {
- if (Menu::current())
- {
- Menu::current()->event(event);
- }
- // FIXME: QUIT signal should be handled more generic, not locally
- if (event.type == SDL_QUIT)
- Menu::set_current(0);
- }
-
- /* Draw the background: */
- draw_demo(elapsed_time);
-
-
- if (Menu::current() == main_menu)
- context.draw_surface(logo, Vector(screen->w/2 - logo->w/2, 30),
- LAYER_FOREGROUND1+1);
-
- context.draw_text(white_small_text, " SuperTux " PACKAGE_VERSION "\n",
- Vector(0, screen->h - 50), LEFT_ALLIGN, LAYER_FOREGROUND1);
- context.draw_text(white_small_text,
- _(
-"Copyright (c) 2003 SuperTux Devel Team\n"
-"This game comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to\n"
-"redistribute it under certain conditions; see the file COPYING for details.\n"
- ),
- Vector(0, screen->h - 50 + white_small_text->get_height() + 5),
- LEFT_ALLIGN, LAYER_FOREGROUND1);
-
- /* Don't draw menu, if quit is true */
- Menu* menu = Menu::current();
- if(menu)
- {
- menu->draw(context);
- menu->action();