The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
interface.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 2016 by Ignacio R. Morelle <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /**
16  * @file
17  * Storyscreen controller (wrapper interface).
18  */
19 
20 #include "global.hpp"
21 #include "variable.hpp"
22 
25 
26 #include "gettext.hpp"
27 #include "intro.hpp"
28 #include "language.hpp"
29 #include "log.hpp"
30 #include "sound.hpp"
31 #include "text.hpp"
32 #include "video.hpp"
33 
34 static lg::log_domain log_engine("engine");
35 #define LOG_NG LOG_STREAM(info, log_engine)
36 
37 void show_story(CVideo& video, const std::string &scenario_name,
38  const config::const_child_itors &story)
39 {
40  events::event_context story_context;
41 
42  int segment_count = 0;
43  config::const_child_iterator itor = story.first;
45  while (itor != story.second)
46  {
47  storyscreen::controller ctl(video, vconfig(*itor, true),
48  scenario_name, segment_count);
49  storyscreen::STORY_RESULT result = ctl.show(startpos);
50 
51  switch(result) {
52  case storyscreen::NEXT:
53  if(itor != story.second) {
54  ++itor;
55  ++segment_count;
57  }
58  break;
59  case storyscreen::BACK:
60  if(itor != story.first) {
61  --itor;
62  --segment_count;
63  startpos = storyscreen::START_END;
64  }
65  break;
66  case storyscreen::QUIT:
68  return;
69  }
70  }
72  return;
73 }
-file gamestatus.hpp
static lg::log_domain log_engine("engine")
Definition: video.hpp:58
-file util.hpp
std::pair< const_child_iterator, const_child_iterator > const_child_itors
Definition: config.hpp:214
GLuint64EXT * result
Definition: glew.h:10727
void show_story(CVideo &video, const std::string &scenario_name, const config::const_child_itors &story)
Shows an introduction sequence using story WML.
Definition: interface.cpp:37
std::map< std::string, tfilter >::iterator itor
Definition: filter.cpp:199
Storyscreen controller (wrapper interface).
void trigger_full_redraw()
Definition: video.cpp:88
A variable-expanding proxy for the config class.
Definition: variable.hpp:36
Standard logging facilities (interface).
Storyscreen controller (interface).
GLsizei const GLcharARB ** string
Definition: glew.h:4503
STORY_RESULT show(START_POSITION startpos=START_BEGINNING)
Display all story screen parts in a first..last sequence.
Definition: controller.cpp:144