Author: shadowmaster
Date: Tue Mar 31 18:51:39 2009
New Revision: 34341
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34341&view=rev
Log:
* Enabled compilation of the experimental storyscreen code by default.
* It is disabled at runtime unless the (purposefully undocumented)
switch --shadowm-storyscreen is passed to the game's command line.
* Doxygen.
Modified:
trunk/src/game.cpp
trunk/src/intro.cpp
trunk/src/intro.hpp
trunk/src/storyscreen/controller.cpp
trunk/src/storyscreen/controller.hpp
trunk/src/storyscreen/interface.cpp
trunk/src/storyscreen/interface.hpp
trunk/src/storyscreen/page.cpp
trunk/src/storyscreen/page.hpp
Modified: trunk/src/game.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game.cpp?rev=34341&r1=34340&r2=34341&view=diff
==============================================================================
--- trunk/src/game.cpp (original)
+++ trunk/src/game.cpp Tue Mar 31 18:51:39 2009
@@ -389,6 +389,11 @@
no_sound = true;
} else if(val == "--nomusic") {
no_music = true;
+ } else if(val == "--shadowm-storyscreen") {
+ // This is a hidden option to help testing
+ // the work-in-progress new storyscreen code.
+ // Don't document.
+ set_new_storyscreen(true);
} else if(val == "--new-widgets") {
// This is a hidden option to enable the new widget
toolkit.
gui2::new_widgets = true;
Modified: trunk/src/intro.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/intro.cpp?rev=34341&r1=34340&r2=34341&view=diff
==============================================================================
--- trunk/src/intro.cpp (original)
+++ trunk/src/intro.cpp Tue Mar 31 18:51:39 2009
@@ -17,7 +17,6 @@
* Introduction sequence at start of a scenario, End-screen after end of
* campaign.
*/
-#ifndef SHADOWM_STORYSCREEN
#include "global.hpp"
#include "foreach.hpp"
@@ -29,11 +28,14 @@
#include "log.hpp"
#include "marked-up_text.hpp"
#include "sound.hpp"
+#include "storyscreen/interface.hpp"
#include "game_events.hpp"
#include "language.hpp"
#define ERR_NG LOG_STREAM(err , engine)
#define LOG_NG LOG_STREAM(info, engine)
+
+static bool use_shadowm_storyscreen = false;
static void scan_deprecation_messages(const config &cfg)
{
@@ -48,7 +50,7 @@
static bool show_intro_part(display &disp, const vconfig& part,
const std::string& scenario);
-void show_intro(display &disp, const vconfig& data, const config& level)
+void show_intro_old(display &disp, const vconfig& data, const config& level)
{
LOG_NG << "showing intro sequence...\n";
scan_deprecation_messages(data.get_parsed_config());
@@ -456,7 +458,7 @@
return true;
}
-void the_end(display &disp, std::string text, unsigned int duration)
+void the_end_old(display &disp, std::string text, unsigned int duration)
{
//
// Some sane defaults.
@@ -509,4 +511,30 @@
}
}
-#endif /* ! SHADOWM_STORYSCREEN */
+void set_new_storyscreen(bool enabled)
+{
+ use_shadowm_storyscreen = enabled;
+ LOG_NG << "enabled experimental storyscreen code\n";
+}
+
+void show_intro(display &disp, const vconfig& data, const config& level)
+{
+ if(use_shadowm_storyscreen) {
+ const std::string scenario_name = level["name"];
+ show_storyscreen(disp,data,scenario_name);
+ }
+ else {
+ show_intro_old(disp,data,level);
+ }
+}
+
+void the_end(display &disp, std::string text, unsigned int duration)
+{
+ if(use_shadowm_storyscreen) {
+ show_endscreen(disp, t_string(text) /* dumb! */, duration);
+ }
+ else {
+ the_end_old(disp,text,duration);
+ }
+}
+
Modified: trunk/src/intro.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/intro.hpp?rev=34341&r1=34340&r2=34341&view=diff
==============================================================================
--- trunk/src/intro.hpp (original)
+++ trunk/src/intro.hpp Tue Mar 31 18:51:39 2009
@@ -52,4 +52,10 @@
*/
void the_end(display &disp, std::string text, unsigned int duration);
+/**
+ * Enables/disables the new (work in progress) story screen
+ * code.
+ */
+void set_new_storyscreen(bool enabled);
+
#endif /* ! INTRO_HPP_INCLUDED */
Modified: trunk/src/storyscreen/controller.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/storyscreen/controller.cpp?rev=34341&r1=34340&r2=34341&view=diff
==============================================================================
--- trunk/src/storyscreen/controller.cpp (original)
+++ trunk/src/storyscreen/controller.cpp Tue Mar 31 18:51:39 2009
@@ -13,14 +13,12 @@
See the COPYING file for more details.
*/
-// FIXME: textscreen.[ch]pp ??
/**
- * @file storyscreen_controller.cpp
- * This code is work in progress, and shouldn't be enabled for production
- * builds. It is supposed to completely replace the old story screens code
+ * @file storyscreen/controller.cpp
+ * This code is work in progress, and the interfaces may change.
+ * It is supposed to completely replace the old story screens code
* at intro.cpp, introducing new WML conventions while at it.
*/
-#ifdef SHADOWM_STORYSCREEN
#include "global.hpp"
#include "SDL.h"
@@ -98,5 +96,3 @@
}
} // end namespace storyscreen
-
-#endif /* SHADOWM_STORYSCREEN */
Modified: trunk/src/storyscreen/controller.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/storyscreen/controller.hpp?rev=34341&r1=34340&r2=34341&view=diff
==============================================================================
--- trunk/src/storyscreen/controller.hpp (original)
+++ trunk/src/storyscreen/controller.hpp Tue Mar 31 18:51:39 2009
@@ -13,14 +13,12 @@
See the COPYING file for more details.
*/
-// FIXME: textscreen.[ch]pp ??
/**
- * @file storyscreen_controller.hpp
- * This code is work in progress, and shouldn't be enabled for production
- * builds. It is supposed to completely replace the old story screens code
+ * @file storyscreen/controller.hpp
+ * This code is work in progress, and the interfaces may change.
+ * It is supposed to completely replace the old story screens code
* at intro.cpp, introducing new WML conventions while at it.
*/
-#ifdef SHADOWM_STORYSCREEN
#ifndef STORYSCREEN_CONTROLLER_HPP_INCLUDED
#define STORYSCREEN_CONTROLLER_HPP_INCLUDED
@@ -78,4 +76,3 @@
} // end namespace storyscreen
#endif /* ! STORYSCREEN_CONTROLLER_HPP_INCLUDED */
-#endif /* SHADOWM_STORYSCREEN */
Modified: trunk/src/storyscreen/interface.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/storyscreen/interface.cpp?rev=34341&r1=34340&r2=34341&view=diff
==============================================================================
--- trunk/src/storyscreen/interface.cpp (original)
+++ trunk/src/storyscreen/interface.cpp Tue Mar 31 18:51:39 2009
@@ -14,12 +14,11 @@
*/
/**
- * @file storyscreen.cpp
- * This code is work in progress, and shouldn't be enabled for production
- * builds. It is supposed to completely replace the old story screens code
+ * @file storyscreen/interface.cpp
+ * This code is work in progress, and the interfaces may change.
+ * It is supposed to completely replace the old story screens code
* at intro.cpp, introducing new WML conventions while at it.
*/
-#ifdef SHADOWM_STORYSCREEN
#include "global.hpp"
#include "foreach.hpp"
@@ -76,17 +75,3 @@
LOG_NG << "show_endscreen() completed...\n";
}
-
-// Trivial drop-in compatibility with intro.cpp
-void show_intro(display &disp, const vconfig& data, const config& level)
-{
- const std::string scenario_name = level["name"];
- show_storyscreen(disp,data,scenario_name);
-}
-
-void the_end(display &disp, std::string text, unsigned int duration)
-{
- show_endscreen(disp, t_string(text) /* dumb! */, duration);
-}
-
-#endif /* SHADOWM_STORYSCREEN */
Modified: trunk/src/storyscreen/interface.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/storyscreen/interface.hpp?rev=34341&r1=34340&r2=34341&view=diff
==============================================================================
--- trunk/src/storyscreen/interface.hpp (original)
+++ trunk/src/storyscreen/interface.hpp Tue Mar 31 18:51:39 2009
@@ -13,14 +13,12 @@
See the COPYING file for more details.
*/
-// FIXME: textscreen.[ch]pp ??
/**
- * @file storyscreen.hpp
- * This code is work in progress, and shouldn't be enabled for production
- * builds. It is supposed to completely replace the old story screens code
+ * @file storyscreen/interface.hpp
+ * This code is work in progress, and the interfaces may change.
+ * It is supposed to completely replace the old story screens code
* at intro.cpp, introducing new WML conventions while at it.
*/
-#ifdef SHADOWM_STORYSCREEN
#ifndef STORYSCREEN_HPP_INCLUDED
#define STORYSCREEN_HPP_INCLUDED
@@ -61,5 +59,3 @@
void show_endscreen(display& disp, const t_string& text, unsigned int
duration);
#endif /* ! STORYSCREEN_HPP_INCLUDED */
-
-#endif /* SHADOWM_STORYSCREEN */
Modified: trunk/src/storyscreen/page.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/storyscreen/page.cpp?rev=34341&r1=34340&r2=34341&view=diff
==============================================================================
--- trunk/src/storyscreen/page.cpp (original)
+++ trunk/src/storyscreen/page.cpp Tue Mar 31 18:51:39 2009
@@ -12,7 +12,13 @@
See the COPYING file for more details.
*/
-#ifdef SHADOWM_STORYSCREEN
+/**
+ * @file storyscreen/page.cpp
+ * This code is work in progress, and the interfaces may change.
+ * It is supposed to completely replace the old story screens code
+ * at intro.cpp, introducing new WML conventions while at it.
+ */
+
#include "global.hpp"
#include "asserts.hpp"
#include "log.hpp"
@@ -139,4 +145,3 @@
} // end namespace storyscreen
-#endif /* SHADOWM_STORYSCREEN */
Modified: trunk/src/storyscreen/page.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/storyscreen/page.hpp?rev=34341&r1=34340&r2=34341&view=diff
==============================================================================
--- trunk/src/storyscreen/page.hpp (original)
+++ trunk/src/storyscreen/page.hpp Tue Mar 31 18:51:39 2009
@@ -12,7 +12,13 @@
See the COPYING file for more details.
*/
-#ifdef SHADOWM_STORYSCREEN
+/**
+ * @file storyscreen/page.hpp
+ * This code is work in progress, and the interfaces may change.
+ * It is supposed to completely replace the old story screens code
+ * at intro.cpp, introducing new WML conventions while at it.
+ */
+
#ifndef STORYSCREEN_PAGE_HPP_INCLUDED
#define STORYSCREEN_PAGE_HPP_INCLUDED
@@ -100,4 +106,3 @@
#endif /* ! STORYSCREEN_PAGE_HPP_INCLUDED */
-#endif /* ! SHADOWM_STORYSCREEN */
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits