Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "global.hpp"
00022 #include "foreach.hpp"
00023 #include "variable.hpp"
00024
00025 #include "storyscreen/interface.hpp"
00026 #include "storyscreen/controller.hpp"
00027
00028 #include "display.hpp"
00029 #include "game_events.hpp"
00030 #include "gettext.hpp"
00031 #include "intro.hpp"
00032 #include "language.hpp"
00033 #include "log.hpp"
00034 #include "sound.hpp"
00035 #include "text.hpp"
00036
00037 static lg::log_domain log_engine("engine");
00038 #define LOG_NG LOG_STREAM(info, log_engine)
00039
00040
00041 #include "stub.hpp"
00042
00043 namespace {
00044
00045 int count_segments(const config::const_child_itors &story)
00046 {
00047 config::const_child_iterator itor = story.first;
00048 int count = 0;
00049 while(itor != story.second) {
00050 ++itor;
00051 ++count;
00052 }
00053 return count;
00054 }
00055 }
00056
00057 void show_story(display &disp, const std::string &scenario_name,
00058 const config::const_child_itors &story)
00059 {
00060 const int total_segments = count_segments(story);
00061 int segment_count = 0;
00062 config::const_child_iterator itor = story.first;
00063 storyscreen::START_POSITION startpos = storyscreen::START_BEGINNING;
00064 while (itor != story.second)
00065 {
00066 storyscreen::controller ctl(disp, vconfig(*itor, true),
00067 scenario_name, segment_count, total_segments);
00068 storyscreen::STORY_RESULT result = ctl.show(startpos);
00069
00070 switch(result) {
00071 case storyscreen::NEXT:
00072 if(itor != story.second) {
00073 ++itor;
00074 ++segment_count;
00075 startpos = storyscreen::START_BEGINNING;
00076 }
00077 break;
00078 case storyscreen::BACK:
00079 if(itor != story.first) {
00080 --itor;
00081 --segment_count;
00082 startpos = storyscreen::START_END;
00083 }
00084 break;
00085 case storyscreen::QUIT:
00086 return;
00087 }
00088 }
00089 return;
00090 }
00091
00092 void show_endscreen(display& , const t_string& , unsigned int )
00093 {
00094 STUB();
00095 LOG_NG << "show_endscreen() invoked...\n";
00096
00097 config story_cfg;
00098
00099
00100
00101 LOG_NG << "show_endscreen() completed...\n";
00102 }