projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- added geometry option which allows SuperTux to run at any resolution
[supertux.git]
/
src
/
title.cpp
diff --git
a/src/title.cpp
b/src/title.cpp
index
291431e
..
59df3d0
100644
(file)
--- a/
src/title.cpp
+++ b/
src/title.cpp
@@
-36,7
+36,6
@@
#include <ctype.h>
#endif
#include <ctype.h>
#endif
-#include "defines.h"
#include "app/globals.h"
#include "title.h"
#include "video/screen.h"
#include "app/globals.h"
#include "title.h"
#include "video/screen.h"
@@
-52,7
+51,7
@@
#include "gameloop.h"
#include "worldmap.h"
#include "leveleditor.h"
#include "gameloop.h"
#include "worldmap.h"
#include "leveleditor.h"
-#include "
scene
.h"
+#include "
player_status
.h"
#include "tile.h"
#include "sector.h"
#include "object/tilemap.h"
#include "tile.h"
#include "sector.h"
#include "object/tilemap.h"
@@
-61,6
+60,7
@@
#include "resources.h"
#include "app/gettext.h"
#include "misc.h"
#include "resources.h"
#include "app/gettext.h"
#include "misc.h"
+#include "textscroller.h"
static Surface* bkg_title;
static Surface* logo;
static Surface* bkg_title;
static Surface* logo;
@@
-84,9
+84,8
@@
static FrameRate frame_rate(100);
*/
void resume_demo()
{
*/
void resume_demo()
{
- // FIXME: shouldn't be needed if GameSession
- // didn't relay on global variables
- titlesession->get_current_sector()->activate();
+ player_status.reset();
+ titlesession->get_current_sector()->activate("main");
titlesession->set_current();
frame_rate.update();
titlesession->set_current();
frame_rate.update();
@@
-182,7
+181,7
@@
void check_levels_contrib_menu()
fadeout(256);
DrawingContext context;
context.draw_text(white_text, "Loading...",
fadeout(256);
DrawingContext context;
context.draw_text(white_text, "Loading...",
- Vector(
screen->w/2, screen->h
/2), CENTER_ALLIGN, LAYER_FOREGROUND1);
+ Vector(
SCREEN_WIDTH/2, SCREEN_HEIGHT
/2), CENTER_ALLIGN, LAYER_FOREGROUND1);
context.do_drawing();
// TODO: slots should be available for contrib maps
context.do_drawing();
// TODO: slots should be available for contrib maps
@@
-215,7
+214,7
@@
void check_levels_contrib_menu()
contrib_subset_menu->additem(MN_HL,"",0,0);
contrib_subset_menu->additem(MN_BACK, _("Back"), 0, 0);
contrib_subset_menu->additem(MN_HL,"",0,0);
contrib_subset_menu->additem(MN_BACK, _("Back"), 0, 0);
- titlesession->get_current_sector()->activate();
+ titlesession->get_current_sector()->activate(
"main"
);
titlesession->set_current();
}
}
titlesession->set_current();
}
}
@@
-246,22
+245,22
@@
void draw_demo(float elapsed_time)
world->play_music(LEVEL_MUSIC);
world->play_music(LEVEL_MUSIC);
- tux->key_event((SDLKey) keymap.right,
DOWN
);
+ tux->key_event((SDLKey) keymap.right,
true
);
if(random_timer.check()) {
random_timer.start(float(rand() % 3000 + 3000) / 1000.);
walking = !walking;
} else {
if(walking)
if(random_timer.check()) {
random_timer.start(float(rand() % 3000 + 3000) / 1000.);
walking = !walking;
} else {
if(walking)
- tux->key_event((SDLKey) keymap.jump,
UP
);
+ tux->key_event((SDLKey) keymap.jump,
false
);
else
else
- tux->key_event((SDLKey) keymap.jump,
DOWN
);
+ tux->key_event((SDLKey) keymap.jump,
true
);
}
// Wrap around at the end of the level back to the beginnig
if(world->solids->get_width() * 32 - 320 < tux->get_pos().x)
{
}
// Wrap around at the end of the level back to the beginnig
if(world->solids->get_width() * 32 - 320 < tux->get_pos().x)
{
-
tux->level_begin(
);
+
world->activate("main"
);
world->camera->reset(tux->get_pos());
}
world->camera->reset(tux->get_pos());
}
@@
-286,6
+285,7
@@
void title(void)
{
walking = true;
LevelEditor* leveleditor;
{
walking = true;
LevelEditor* leveleditor;
+ MusicRef credits_music;
Ticks::pause_init();
Ticks::pause_init();
@@
-297,7
+297,7
@@
void title(void)
logo = new Surface(datadir + "/images/title/logo.png", true);
img_choose_subset = new Surface(datadir + "/images/status/choose-level-subset.png", true);
logo = new Surface(datadir + "/images/title/logo.png", true);
img_choose_subset = new Surface(datadir + "/images/status/choose-level-subset.png", true);
- titlesession->get_current_sector()->activate();
+ titlesession->get_current_sector()->activate(
"main"
);
titlesession->set_current();
/* --- Main title loop: --- */
titlesession->set_current();
/* --- Main title loop: --- */
@@
-341,19
+341,18
@@
void title(void)
if (Menu::current() == main_menu)
if (Menu::current() == main_menu)
- context.draw_surface(logo, Vector(
screen->w
/2 - logo->w/2, 30),
+ context.draw_surface(logo, Vector(
SCREEN_WIDTH
/2 - logo->w/2, 30),
LAYER_FOREGROUND1+1);
context.draw_text(white_small_text, " SuperTux " PACKAGE_VERSION "\n",
LAYER_FOREGROUND1+1);
context.draw_text(white_small_text, " SuperTux " PACKAGE_VERSION "\n",
- Vector(0,
screen->h - 7
0), LEFT_ALLIGN, LAYER_FOREGROUND1);
+ Vector(0,
SCREEN_HEIGHT - 5
0), LEFT_ALLIGN, LAYER_FOREGROUND1);
context.draw_text(white_small_text,
_(
"Copyright (c) 2003 SuperTux Devel Team\n"
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\n"
-"are welcome to redistribute it under certain conditions; see the file COPYING\n"
-"for details.\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 - 70 + white_small_text->get_height()
),
+ Vector(0,
SCREEN_HEIGHT - 50 + white_small_text->get_height() + 5
),
LEFT_ALLIGN, LAYER_FOREGROUND1);
/* Don't draw menu, if quit is true */
LEFT_ALLIGN, LAYER_FOREGROUND1);
/* Don't draw menu, if quit is true */
@@
-385,10
+384,10
@@
void title(void)
break;
case MNID_CREDITS:
fadeout(500);
break;
case MNID_CREDITS:
fadeout(500);
- titlesession->get_current_sector()->play_music(CREDITS_MUSIC);
- display_text_file("credits.txt", SCROLL_SPEED_CREDITS, white_big_text , white_text, white_small_text, blue_text );
+ credits_music = SoundManager::get()->load_music(datadir + "/music/credits.ogg");
+ SoundManager::get()->play_music(credits_music);
+ display_text_file("credits.txt");
fadeout(500);
fadeout(500);
- //titlesession->get_current_sector()->play_music(LEVEL_MUSIC); //not needed
Menu::set_current(main_menu);
break;
case MNID_QUITMAINMENU:
Menu::set_current(main_menu);
break;
case MNID_QUITMAINMENU: