mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-08 16:05:12 +00:00
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.
This commit is contained in:
parent
8d76314519
commit
aa6b0a82b7
@ -389,6 +389,11 @@ game_controller::game_controller(int argc, char** argv) :
|
||||
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;
|
||||
|
@ -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,12 +28,15 @@
|
||||
#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)
|
||||
{
|
||||
foreach (const config &child, cfg.child_range("deprecated_message"))
|
||||
@ -48,7 +50,7 @@ static void scan_deprecation_messages(const config &cfg)
|
||||
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 @@ static bool show_intro_part_helper(display &disp, const vconfig& part,
|
||||
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 @@ void the_end(display &disp, std::string text, unsigned int duration)
|
||||
}
|
||||
}
|
||||
|
||||
#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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,4 +52,10 @@ void show_intro(display &disp, const vconfig& data, const config& level);
|
||||
*/
|
||||
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 */
|
||||
|
@ -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 @@ void controller::clear_pages()
|
||||
}
|
||||
|
||||
} // end namespace storyscreen
|
||||
|
||||
#endif /* SHADOWM_STORYSCREEN */
|
||||
|
@ -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 @@ public:
|
||||
} // end namespace storyscreen
|
||||
|
||||
#endif /* ! STORYSCREEN_CONTROLLER_HPP_INCLUDED */
|
||||
#endif /* SHADOWM_STORYSCREEN */
|
||||
|
@ -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 @@ void show_endscreen(display& disp, const t_string& text, unsigned int duration)
|
||||
|
||||
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 */
|
||||
|
@ -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_storyscreen(display& disp, const vconfig& story_cfg, const std::string
|
||||
void show_endscreen(display& disp, const t_string& text, unsigned int duration);
|
||||
|
||||
#endif /* ! STORYSCREEN_HPP_INCLUDED */
|
||||
|
||||
#endif /* SHADOWM_STORYSCREEN */
|
||||
|
@ -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 @@ page::page()
|
||||
|
||||
} // end namespace storyscreen
|
||||
|
||||
#endif /* SHADOWM_STORYSCREEN */
|
||||
|
@ -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 @@ private:
|
||||
|
||||
|
||||
#endif /* ! STORYSCREEN_PAGE_HPP_INCLUDED */
|
||||
#endif /* ! SHADOWM_STORYSCREEN */
|
||||
|
Loading…
x
Reference in New Issue
Block a user