Author: mordante
Date: Wed Apr 30 18:59:27 2008
New Revision: 26262
URL: http://svn.gna.org/viewcvs/wesnoth?rev=26262&view=rev
Log:
Add the option to have multiple title screens and load one at random
(patch #1061).
Modified:
trunk/changelog
trunk/players_changelog
trunk/src/titlescreen.cpp
Modified: trunk/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=26262&r1=26261&r2=26262&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Wed Apr 30 18:59:27 2008
@@ -6,13 +6,15 @@
* terrains:
* Reorganisation of the terrain macros including more consistent image
naming.
The old macros are kept for now for compatibility.
+ * 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.
- * 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.
-
+
Version 1.5.0:
* campaigns:
* synchronize all campaign ids with their directory name
Modified: trunk/players_changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/players_changelog?rev=26262&r1=26261&r2=26262&view=diff
==============================================================================
--- trunk/players_changelog (original)
+++ trunk/players_changelog Wed Apr 30 18:59:27 2008
@@ -6,6 +6,9 @@
* 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.
Modified: trunk/src/titlescreen.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/titlescreen.cpp?rev=26262&r1=26261&r2=26262&view=diff
==============================================================================
--- trunk/src/titlescreen.cpp (original)
+++ trunk/src/titlescreen.cpp Wed Apr 30 18:59:27 2008
@@ -41,6 +41,7 @@
#include "serialization/parser.hpp"
#include "serialization/preprocessor.hpp"
#include <algorithm>
+#include <vector>
#include "SDL_ttf.h"
@@ -304,17 +305,25 @@
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(game_title_list.empty()) {
+ ERR_CONFIG << "No title image defined\n";
+ } else {
+ 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";
+
+ 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);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits