Add the option to have multiple title screens...
...and load one at random (patch #1061).
This commit is contained in:
parent
3fa0b367bf
commit
06b32747ae
3 changed files with 27 additions and 13 deletions
10
changelog
10
changelog
|
@ -6,13 +6,15 @@ Version 1.5.0+svn:
|
|||
* terrains:
|
||||
* Reorganisation of the terrain macros including more consistent image naming.
|
||||
The old macros are kept for now for compatibility.
|
||||
* miscellaneous and bug fixes:
|
||||
* Implemented the option to use the mouse selection clipboard in X11
|
||||
the new widget library also uses it.
|
||||
* Python AI:
|
||||
* Implemented a function which detects if a location is on the map border.
|
||||
* Implemented a function which gives the game's gold parameters.
|
||||
|
||||
* WML engine:
|
||||
* titlescreen is now randomly loaded
|
||||
* miscellaneous and bug fixes:
|
||||
* Implemented the option to use the mouse selection clipboard in X11
|
||||
the new widget library also uses it.
|
||||
|
||||
Version 1.5.0:
|
||||
* campaigns:
|
||||
* synchronize all campaign ids with their directory name
|
||||
|
|
|
@ -6,6 +6,9 @@ Version 1.5.0+svn:
|
|||
* Language and translations
|
||||
* updated translations: Chinese, French, Russian, Turkish.
|
||||
|
||||
* User interface
|
||||
* Titlescreen is now randomly loaded.
|
||||
|
||||
Version 1.5.0:
|
||||
* Graphics
|
||||
* Terrains can be rendered in front of units again.
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "serialization/parser.hpp"
|
||||
#include "serialization/preprocessor.hpp"
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#include "SDL_ttf.h"
|
||||
|
||||
|
@ -304,17 +305,25 @@ TITLE_RESULT show_title(game_display& screen, config& tips_of_day)
|
|||
int logo_x = game_config::title_logo_x * screen.w() / 1024,
|
||||
logo_y = game_config::title_logo_y * screen.h() / 768;
|
||||
|
||||
surface const title_surface(scale_surface(
|
||||
image::get_image(game_config::game_title),
|
||||
screen.w(), screen.h()));
|
||||
/*Select a random game_title*/
|
||||
std::vector<std::string> game_title_list =
|
||||
utils::split(game_config::game_title, ',', utils::STRIP_SPACES | utils::REMOVE_EMPTY);
|
||||
|
||||
|
||||
if (title_surface.null()) {
|
||||
ERR_DP << "Could not find title image\n";
|
||||
if(game_title_list.empty()) {
|
||||
ERR_CONFIG << "No title image defined\n";
|
||||
} else {
|
||||
screen.video().blit_surface(0, 0, title_surface);
|
||||
update_rect(screen_area());
|
||||
LOG_DP << "displayed title image\n";
|
||||
surface const title_surface(scale_surface(
|
||||
image::get_image(game_title_list[rand()%game_title_list.size()]),
|
||||
screen.w(), screen.h()));
|
||||
|
||||
|
||||
if (title_surface.null()) {
|
||||
ERR_DP << "Could not find title image\n";
|
||||
} else {
|
||||
screen.video().blit_surface(0, 0, title_surface);
|
||||
update_rect(screen_area());
|
||||
LOG_DP << "displayed title image\n";
|
||||
}
|
||||
}
|
||||
|
||||
fade_failed = !fade_logo(screen, logo_x, logo_y);
|
||||
|
|
Loading…
Add table
Reference in a new issue