titlescreen.cpp File Reference

Shows the titlescreen, with main-menu and tip-of-the-day. More...

#include "global.hpp"
#include "config.hpp"
#include "construct_dialog.hpp"
#include "cursor.hpp"
#include "game_display.hpp"
#include "events.hpp"
#include "filesystem.hpp"
#include "game_config.hpp"
#include "hotkeys.hpp"
#include "key.hpp"
#include "gettext.hpp"
#include "log.hpp"
#include "marked-up_text.hpp"
#include "preferences_display.hpp"
#include "sdl_utils.hpp"
#include "show_dialog.hpp"
#include "titlescreen.hpp"
#include "util.hpp"
#include "video.hpp"
#include "serialization/parser.hpp"
#include "serialization/preprocessor.hpp"
#include <algorithm>
#include <vector>
#include "SDL_ttf.h"

Include dependency graph for titlescreen.cpp:

Go to the source code of this file.

Namespaces

namespace  gui

Defines

#define LOG_DP   LOG_STREAM(info, display)
 Log info-messages to stdout during the game, mainly for debugging.
#define ERR_DP   LOG_STREAM(err, display)
 Log error-messages to stdout during the game, mainly for debugging.
#define LOG_CONFIG   LOG_STREAM(info, config)
#define ERR_CONFIG   LOG_STREAM(err, config)

Functions

static bool fade_logo (game_display &screen, int xpos, int ypos)
 Fade-in the wesnoth-logo.
static void read_tips_of_day (config &tips_of_day)
 Read the file with the tips-of-the-day.
static void next_tip_of_day (config &tips_of_day, bool reverse=false)
 Go to the next tips-of-the-day.
static const configget_tip_of_day (config &tips_of_day)
 Return the text for one of the tips-of-the-day.
static void draw_tip_of_day (game_display &screen, config &tips_of_day, const gui::dialog_frame::style &style, gui::button *const previous_tip_button, gui::button *const next_tip_button, gui::button *const help_tip_button, const SDL_Rect *const main_dialog_area, surface_restorer &tip_of_day_restorer)
 Show one tip-of-the-day in a frame on the titlescreen.
static void draw_background (game_display &screen)
 Draw the map image background, revision number and fade the log the first time.
TITLE_RESULT gui::show_title (game_display &screen, config &tips_of_day, bool redraw_background)
 Show titlepage with logo and background, menu-buttons and tip-of-the-day.


Detailed Description

Shows the titlescreen, with main-menu and tip-of-the-day.

The menu consists of buttons, such als Start-Tutorial, Start-Campaign, Load-Game, etc. As decoration, the wesnoth-logo and a landmap in the background are shown.

Definition in file titlescreen.cpp.


Define Documentation

#define ERR_CONFIG   LOG_STREAM(err, config)

Definition at line 56 of file titlescreen.cpp.

#define ERR_DP   LOG_STREAM(err, display)

Log error-messages to stdout during the game, mainly for debugging.

Definition at line 54 of file titlescreen.cpp.

#define LOG_CONFIG   LOG_STREAM(info, config)

Definition at line 55 of file titlescreen.cpp.

#define LOG_DP   LOG_STREAM(info, display)

Log info-messages to stdout during the game, mainly for debugging.

Definition at line 52 of file titlescreen.cpp.


Function Documentation

static void draw_background ( game_display screen  )  [static]

static void draw_tip_of_day ( game_display screen,
config tips_of_day,
const gui::dialog_frame::style style,
gui::button *const   previous_tip_button,
gui::button *const   next_tip_button,
gui::button *const   help_tip_button,
const SDL_Rect *const   main_dialog_area,
surface_restorer tip_of_day_restorer 
) [static]

static bool fade_logo ( game_display screen,
int  xpos,
int  ypos 
) [static]

Fade-in the wesnoth-logo.

Animation-effect: scroll-in from right.
Used only once, after the game is started.

Parameters:
screen surface to operate on
xpos x-position of logo
ypos y-position of logo
Returns:
Result of running the routine
Return values:
true operation finished (successful or not)
false operation failed (because modeChanged), need to retry

Definition at line 72 of file titlescreen.cpp.

References display::delay(), ERR_DP, game_config::game_logo, image::get_image(), CVideo::getSurface(), LOG_DP, CVideo::modeChanged(), events::pump(), display::update_display(), update_rect(), and display::video().

Referenced by draw_background().

static const config* get_tip_of_day ( config tips_of_day  )  [static]

Return the text for one of the tips-of-the-day.

Definition at line 164 of file titlescreen.cpp.

References config::empty(), preferences::encountered_units(), config::get_children(), next_tip_of_day(), read_tips_of_day(), utils::split(), and tips.

Referenced by draw_tip_of_day().

static void next_tip_of_day ( config tips_of_day,
bool  reverse = false 
) [static]

Go to the next tips-of-the-day.

Definition at line 152 of file titlescreen.cpp.

References config::child_range(), and tips.

Referenced by get_tip_of_day(), and gui::show_title().

static void read_tips_of_day ( config tips_of_day  )  [static]

Read the file with the tips-of-the-day.

Definition at line 133 of file titlescreen.cpp.

References config::child_range(), config::clear(), ERR_CONFIG, LOG_CONFIG, preprocess_file(), read(), stream, and tips.

Referenced by get_tip_of_day().


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs