pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r2637 - in branches/pingus_sdl/src: . display gui


From: grumbel at BerliOS
Subject: [Pingus-CVS] r2637 - in branches/pingus_sdl/src: . display gui
Date: Sat, 13 Jan 2007 12:37:49 +0100

Author: grumbel
Date: 2007-01-13 12:37:45 +0100 (Sat, 13 Jan 2007)
New Revision: 2637

Added:
   branches/pingus_sdl/src/dummy_screen.hxx
Modified:
   branches/pingus_sdl/src/SConscript
   branches/pingus_sdl/src/display/drawing_context.cxx
   branches/pingus_sdl/src/display/drawing_context.hxx
   branches/pingus_sdl/src/display/drawing_request.hxx
   branches/pingus_sdl/src/gui/display.cxx
   branches/pingus_sdl/src/gui/display.hxx
   branches/pingus_sdl/src/gui/screen_manager.cxx
   branches/pingus_sdl/src/gui/screen_manager.hxx
   branches/pingus_sdl/src/pingus_main.cxx
   branches/pingus_sdl/src/pingus_main.hxx
   branches/pingus_sdl/src/story_screen.cxx
Log:
- some more SDL stuff, game now opens a empty window

Modified: branches/pingus_sdl/src/SConscript
===================================================================
--- branches/pingus_sdl/src/SConscript  2007-01-13 10:36:59 UTC (rev 2636)
+++ branches/pingus_sdl/src/SConscript  2007-01-13 11:37:45 UTC (rev 2637)
@@ -116,7 +116,7 @@
 # 'demo_recorder.cxx', 
 # 'demo_session.cxx', 
 # 'direction.cxx', 
-# 'display/drawing_context.cxx', 
+'display/drawing_context.cxx', 
 # 'display/scene_context.cxx', 
 
 # # 'editor/context_menu.cxx',
@@ -241,7 +241,7 @@
 # 'timer.cxx', 
 'tinygettext/tinygettext.cxx', 
 # 'true_server.cxx', 
-# 'vector.cxx', 
+'vector.cxx', 
 # 'world.cxx', 
 # 'worldmap/dot.cxx', 
 # 'worldmap/dot_factory.cxx', 

Modified: branches/pingus_sdl/src/display/drawing_context.cxx
===================================================================
--- branches/pingus_sdl/src/display/drawing_context.cxx 2007-01-13 10:36:59 UTC 
(rev 2636)
+++ branches/pingus_sdl/src/display/drawing_context.cxx 2007-01-13 11:37:45 UTC 
(rev 2637)
@@ -19,10 +19,6 @@
 
 #include <assert.h>
 #include <iostream>
-#include <ClanLib/Display/display.h>
-#include <ClanLib/Display/sprite.h>
-#include <ClanLib/Display/font.h>
-#include <ClanLib/Display/graphic_context.h>
 #include <iostream>
 #include "drawing_context.hxx"
 
@@ -35,6 +31,7 @@
   }
 };
 
+#if 0
 class FillScreenDrawingRequest : public DrawingRequest
 {
 private:
@@ -93,13 +90,13 @@
 class LineDrawingRequest : public DrawingRequest
 {
 private:
-  CL_Pointf pos1;
-  CL_Pointf pos2;
+  Vector pos1;
+  Vector pos2;
   CL_Color  color;
 
 public:
-  LineDrawingRequest(const CL_Pointf& pos1_, 
-                     const CL_Pointf& pos2_, 
+  LineDrawingRequest(const Vector& pos1_, 
+                     const Vector& pos2_, 
                      const CL_Color&  color_,
                      float z)
     : DrawingRequest(CL_Vector(0, 0, z)),
@@ -171,6 +168,7 @@
   }
 };
 
+#endif 
 class DrawingContextDrawingRequest : public DrawingRequest
 {
 private:
@@ -178,7 +176,7 @@
   
 public:
   DrawingContextDrawingRequest(DrawingContext* dc_, float z)
-    : DrawingRequest(CL_Vector(0,0,z)),
+    : DrawingRequest(Vector3(0,0,z)),
       dc(dc_)
   {}
   
@@ -187,14 +185,14 @@
     delete dc;
   }
 
-  void draw(CL_GraphicContext* gc) {
-    dc->render(gc);
+  void draw(SDL_Surface* screen) {
+    dc->render(screen);
   }
 };
 
 DrawingContext::DrawingContext()
 {
-  translate_stack.push_back(CL_Pointf(0, 0));
+  translate_stack.push_back(Vector(0, 0));
 }
 
 DrawingContext::~DrawingContext()
@@ -204,7 +202,7 @@
 }
 
 void
-DrawingContext::render(CL_GraphicContext* gc)
+DrawingContext::render(SDL_Surface* screen)
 {
   std::stable_sort(drawingrequests.begin(), drawingrequests.end(), 
DrawingRequestsSorter());
   
@@ -218,7 +216,7 @@
   for(DrawingRequests::iterator i = drawingrequests.begin(); i != 
drawingrequests.end(); ++i)
     {
       //std::cout << this << ": " << (*i)->get_z_pos() << std::endl;
-      (*i)->draw(gc);
+      (*i)->draw(screen);
     }
 }
 
@@ -244,6 +242,7 @@
   draw(new DrawingContextDrawingRequest(dc, z));
 }
 
+#if 0
 void
 DrawingContext::draw(const CL_Surface&  surface, const Vector& pos)
 {
@@ -255,7 +254,7 @@
 void
 DrawingContext::draw(const CL_Sprite& sprite, const Vector& pos)
 {
-       draw(sprite, pos.x, pos.y, pos.z);
+  draw(sprite, pos.x, pos.y, pos.z);
 }
 
 void
@@ -277,7 +276,7 @@
 DrawingContext::draw_line (float x1, float y1, float x2, float y2, 
                            const CL_Color& color, float z)
 {
-  draw(new LineDrawingRequest(CL_Pointf(x1, y1), CL_Pointf(x2, y2), color, z));
+  draw(new LineDrawingRequest(Vector(x1, y1), Vector(x2, y2), color, z));
 }
 
 void
@@ -364,7 +363,7 @@
 DrawingContext::reset_modelview()
 {
   translate_stack.clear();
-  translate_stack.push_back(CL_Pointf(0, 0));
+  translate_stack.push_back(Vector(0, 0));
 }
 
 CL_Rect
@@ -390,35 +389,42 @@
 void
 DrawingContext::print_left (const CL_Font& font_, float x_pos, float y_pos, 
const std::string& str, float z)
 {
+#if 0
   draw(new FontDrawingRequest(font_, 
                               origin_top_left,
                               CL_Vector(x_pos + translate_stack.back().x,
                                         y_pos + translate_stack.back().y),
                               str,
                               z));
+#endif
 }
 
 void
 DrawingContext::print_center (const CL_Font& font_, float x_pos, float y_pos, 
const std::string& str, float z)
 {
+#if 0
   draw(new FontDrawingRequest(font_, 
                               origin_top_center,
                               CL_Vector(x_pos + translate_stack.back().x,
                                         y_pos + translate_stack.back().y),
                               str,
                               z));
+#endif 
 }
 
 void
 DrawingContext::print_right (const CL_Font& font_, float x_pos, float y_pos, 
const std::string& str, float z)
 {
+#if 0
   draw(new FontDrawingRequest(font_, 
                               origin_top_right,
                               CL_Vector(x_pos + translate_stack.back().x,
                                         y_pos + translate_stack.back().y),
                               str,
                               z));
+#endif 
 }
+#endif 
 
 Vector
 DrawingContext::screen_to_world (Vector pos)

Modified: branches/pingus_sdl/src/display/drawing_context.hxx
===================================================================
--- branches/pingus_sdl/src/display/drawing_context.hxx 2007-01-13 10:36:59 UTC 
(rev 2636)
+++ branches/pingus_sdl/src/display/drawing_context.hxx 2007-01-13 11:37:45 UTC 
(rev 2637)
@@ -22,6 +22,7 @@
 
 //#include <ClanLib/Core/Math/rect.h>
 //#include <ClanLib/Display/color.h>
+#include "SDL.h"
 #include <vector>
 #include "drawing_request.hxx"
 #include "../vector.hxx"
@@ -48,20 +49,14 @@
 
 public:
   DrawingContext();
-       virtual ~DrawingContext();
+  virtual ~DrawingContext();
 
   /** Draws everything in the drawing context to the screen */
-  void render(CL_GraphicContext* gc);
+  void render(SDL_Surface* screen);
 
   /** Empties the drawing context */
   void clear();
 
-#if 0
-  /** Fills the screen with a given color, this is different from
-      clear() in that it doesn't remove other DrawingRequest from the
-      queue */
-  void fill_screen(const CL_Color& color);
-
   /*{ */
   void draw(DrawingRequest* request);
 
@@ -71,6 +66,13 @@
       worth a try */
   void draw(DrawingContext* dc, float z = 0);
 
+#if 0
+
+  /** Fills the screen with a given color, this is different from
+      clear() in that it doesn't remove other DrawingRequest from the
+      queue */
+  void fill_screen(const CL_Color& color);
+
   void draw(const CL_Surface&  surface, const Vector& pos);
   void draw(const CL_Sprite&   sprite,  float x, float y, float z = 0);
   void draw(const std::string& text,    float x, float y, float z = 0);

Modified: branches/pingus_sdl/src/display/drawing_request.hxx
===================================================================
--- branches/pingus_sdl/src/display/drawing_request.hxx 2007-01-13 10:36:59 UTC 
(rev 2636)
+++ branches/pingus_sdl/src/display/drawing_request.hxx 2007-01-13 11:37:45 UTC 
(rev 2637)
@@ -20,11 +20,9 @@
 #ifndef HEADER_DRAWING_REQUEST_HXX
 #define HEADER_DRAWING_REQUEST_HXX
 
-///#include <ClanLib/Core/Math/cl_vector.h>
+#include "SDL.h"
 #include "math/vector3.hpp"
 
-class CL_GraphicContext;
-
 /** 
  */
 class DrawingRequest
@@ -36,7 +34,7 @@
   DrawingRequest(const Vector3& pos_) : pos(pos_) {}
   virtual ~DrawingRequest() {};
   
-  virtual void draw(CL_GraphicContext* gc) = 0;
+  virtual void draw(SDL_Surface* gc) = 0;
   
   /** Returns true if the request contains an alpha channel and needs
       to be drawn in order */

Added: branches/pingus_sdl/src/dummy_screen.hxx
===================================================================
--- branches/pingus_sdl/src/dummy_screen.hxx    2007-01-13 10:36:59 UTC (rev 
2636)
+++ branches/pingus_sdl/src/dummy_screen.hxx    2007-01-13 11:37:45 UTC (rev 
2637)
@@ -0,0 +1,54 @@
+//  $Id: screen.hxx,v 1.4 2003/10/19 12:25:47 grumbel Exp $
+//
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2000 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+#ifndef HEADER_PINGUS_DUMMY_SCREEN_HXX
+#define HEADER_PINGUS_DUMMY_SCREEN_HXX
+
+#include "gui/screen.hxx"
+
+namespace Pingus {
+
+class DrawingContext;
+
+/** DummyScreen without any actual functionality, just for testing */
+class DummyScreen : public Screen
+{
+private:
+
+public:
+  DummyScreen () { }
+  virtual ~DummyScreen () {}
+
+  /** Draw this screen @return true if draw was successfull, false if
+      frameskip has taken place ('causes a skip of flip_display) */
+  bool draw (DrawingContext& gc) { return 0; }
+
+  /** Pass a delta to the screen */
+  void update (const GameDelta& delta) {}
+
+private:
+  DummyScreen (const DummyScreen&);
+  DummyScreen& operator= (const DummyScreen&);
+};
+
+} // namespace Pingus
+
+#endif
+
+/* EOF */

Modified: branches/pingus_sdl/src/gui/display.cxx
===================================================================
--- branches/pingus_sdl/src/gui/display.cxx     2007-01-13 10:36:59 UTC (rev 
2636)
+++ branches/pingus_sdl/src/gui/display.cxx     2007-01-13 11:37:45 UTC (rev 
2637)
@@ -26,6 +26,7 @@
 namespace Pingus {
 
 std::list<DisplayHook*> Display::display_hooks;
+SDL_Surface* Display::screen;
 
 DisplayHook::DisplayHook() : is_visible(false)
 {
@@ -81,6 +82,16 @@
   display_hooks.remove(hook);
 }
 
+void
+Display::set_video_mode(int width, int height)
+{
+  screen = SDL_SetVideoMode(width, height, 0, SDL_DOUBLEBUF); // | 
SDL_FULLSCREEN
+  if (screen == NULL) {
+    printf("Unable to set video mode: %s\n", SDL_GetError());
+    exit(1);
+  }
+}
+
 } // namespace Pingus
 
 /* EOF */

Modified: branches/pingus_sdl/src/gui/display.hxx
===================================================================
--- branches/pingus_sdl/src/gui/display.hxx     2007-01-13 10:36:59 UTC (rev 
2636)
+++ branches/pingus_sdl/src/gui/display.hxx     2007-01-13 11:37:45 UTC (rev 
2637)
@@ -21,6 +21,7 @@
 #define HEADER_PINGUS_DISPLAY_HXX
 
 #include "../pingus.hxx"
+#include "SDL.h"
 #include <list>
 
 namespace Pingus {
@@ -52,6 +53,7 @@
 {
 private:
   static std::list<DisplayHook*> display_hooks;
+  static SDL_Surface* screen;
 public:
   static void draw_rect(int x1, int y1, int x2, int y2, float r, float g, 
float b, float a);
 
@@ -60,6 +62,8 @@
   static void add_flip_screen_hook(DisplayHook*);
   static void remove_flip_screen_hook(DisplayHook*);
 
+  static void set_video_mode(int width, int height);
+  static SDL_Surface* get_screen() { return screen; }
 private:
   Display ();
   Display (const Display&);

Modified: branches/pingus_sdl/src/gui/screen_manager.cxx
===================================================================
--- branches/pingus_sdl/src/gui/screen_manager.cxx      2007-01-13 10:36:59 UTC 
(rev 2636)
+++ branches/pingus_sdl/src/gui/screen_manager.cxx      2007-01-13 11:37:45 UTC 
(rev 2637)
@@ -17,6 +17,7 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "SDL.h"
 #include <iostream>
 #include "../globals.hxx"
 #include "cursor.hxx"
@@ -30,40 +31,30 @@
 
 ScreenManager* ScreenManager::instance_ = 0;
 
-ScreenManager::ScreenManager ()
+ScreenManager::ScreenManager()
 {
-#if 0 
-  // FIXME:
-  if (render_preview)
-    display_gc = new BufferGraphicContext(800, 600);
-  else
-    display_gc = new DisplayGraphicContext(0, 0, CL_Display::get_width (), 
CL_Display::get_height (),
-                                           0, 0);
-#endif
-////  display_gc = new DrawingContext();
+  display_gc = new DrawingContext();
 
   cached_action = CA_NONE;
 }
 
 ScreenManager::~ScreenManager ()
 {
-////   delete display_gc;
+  delete display_gc;
 }
 
 void
-ScreenManager::display ()
+ScreenManager::display()
 {
 #if 0
   Input::Controller* input_controller = 0;
-#if 0
+
   if (controller_file.empty())
     input_controller = new 
Input::Controller(path_manager.complete("controller/default.xml"));
   else
     input_controller = new Input::Controller(controller_file);
-#endif
   Input::Controller::set_current(input_controller);
 
-#if 0
   Cursor* cursor = 0;
   if (swcursor_enabled)
     {
@@ -71,7 +62,7 @@
       Display::add_flip_screen_hook(cursor);
       //CL_MouseCursor::hide();
     }
-#endif 
+#endif
 
   DeltaManager delta_manager;
 
@@ -88,18 +79,31 @@
          continue;
        }
 
-      // Let ClanLib fetch events
-      ///CL_System::keep_alive ();
+      { // Let SDL fetch events
+        SDL_Event event;
+        while(SDL_PollEvent(&event))
+          {
+            switch(event.type)
+              {
+              case SDL_QUIT:
+                pop_screen();
+                break;
 
+              default:
+                // FIXME: feed other events to the input manager
+                break;
+              }
+          }
+      }
+
       // Get new events from ClanLib
-      input_controller->update(time_delta);
+      ////input_controller->update(time_delta);
 
       // Fill the delta with values
-      GameDelta delta(time_delta, delta_manager.get_absolute(),
-                      input_controller->get_events());
+      GameDelta delta(time_delta, delta_manager.get_absolute(), 
Input::EventLst()); 
+      ////input_controller->get_events());
+      //// input_controller->clear();
 
-      input_controller->clear();
-
       last_screen = get_current_screen();
 
       // Most likly the screen will get changed in this update call
@@ -111,7 +115,7 @@
 #endif
 
       // Last screen has poped, so we are going to end here
-      if (screens.empty ())
+      if (screens.empty())
        continue;
 
       while (cached_action != CA_NONE)
@@ -142,21 +146,22 @@
        {
          if (get_current_screen()->draw(*display_gc))
             {
-              
////display_gc->render(CL_Display::get_current_window()->get_gc());
+              display_gc->render(Display::get_screen());
               Display::flip_display ();
-              ////display_gc->clear();
+              display_gc->clear();
             }
         }
       else
        {
          //std::cout << "ScreenManager: fading screens" << std::endl;
-         fade_over (last_screen, get_current_screen());
+         fade_over(last_screen, get_current_screen());
        }
 
       // Stupid hack to make this thing take less CPU
       ////CL_System::keep_alive(5);
     }
 
+#if 0
 ////  Display::remove_flip_screen_hook(cursor);
 ////  delete cursor;
   delete input_controller;

Modified: branches/pingus_sdl/src/gui/screen_manager.hxx
===================================================================
--- branches/pingus_sdl/src/gui/screen_manager.hxx      2007-01-13 10:36:59 UTC 
(rev 2636)
+++ branches/pingus_sdl/src/gui/screen_manager.hxx      2007-01-13 11:37:45 UTC 
(rev 2637)
@@ -35,6 +35,7 @@
 private:
   static ScreenManager* instance_;
 
+  SDL_Surface* screen;
   DrawingContext* display_gc;
 
   /** Screen stack (first is the screen, second is delete_screen,
@@ -51,7 +52,7 @@
 protected:
   ScreenManager ();
 public:
-  ~ScreenManager ();
+  ~ScreenManager();
 
   /** Start the screen manager and let it take control, this will
       not return until the somebody signals a quit() */

Modified: branches/pingus_sdl/src/pingus_main.cxx
===================================================================
--- branches/pingus_sdl/src/pingus_main.cxx     2007-01-13 10:36:59 UTC (rev 
2636)
+++ branches/pingus_sdl/src/pingus_main.cxx     2007-01-13 11:37:45 UTC (rev 
2637)
@@ -43,7 +43,8 @@
 
 #include "command_line.hpp"
 
-//#include "gui/screen_manager.hxx"
+#include "gui/screen_manager.hxx"
+#include "dummy_screen.hxx"
 // #include "gui/input_debug_screen.hxx"
 #include "path_manager.hxx"
 #include "pingus_main.hxx"
@@ -751,8 +752,11 @@
     }
   else // start a normal game
     {
-      ////ScreenManager::instance()->push_screen (PingusMenuManager::instance 
(), false);
-      ////ScreenManager::instance()->push_screen (new StoryScreen(), true);
+      std::cout << "starting normal game" << std::endl;
+      ///ScreenManager::instance()->push_screen(PingusMenuManager::instance 
(), false);
+      ////ScreenManager::instance()->push_screen(new StoryScreen(), true);
+      ScreenManager::instance()->push_screen(new DummyScreen(), true);
+      std::cout << "done: starting normal game" << std::endl;
     }
 
   if (!render_preview)
@@ -760,7 +764,7 @@
       // show the main menu, the rest of the game is spawn from there
       if (maintainer_mode)
         std::cout << "PingusMain::start screen manager" << std::endl;
-      ////ScreenManager::instance()->display();
+      ScreenManager::instance()->display();
       if (maintainer_mode)
         std::cout << "PingusMain::quit game and screen_manager" << std::endl;
 
@@ -799,7 +803,7 @@
 
       print_greeting_message();
 
-      init_clanlib();
+      init_sdl();
       init_pingus();
 
       // Avoid uglyness on window opening
@@ -843,10 +847,6 @@
   deinit_pingus();
   deinit_clanlib();
 
-#if defined WIN32 && defined _DEBUG
-  cl_console.wait_for_key();
-#endif
-
   return 0;
 }
 
@@ -858,14 +858,8 @@
     exit(1);
   }
   atexit(SDL_Quit); 
-
-  SDL_Surface *screen;
- 
-  screen = SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF | SDL_FULLSCREEN);
-  if (screen == NULL) {
-    printf("Unable to set video mode: %s\n", SDL_GetError());
-    exit(1);
-  }
+  Display::set_video_mode(screen_width, screen_height);
+  SDL_WM_SetCaption(PACKAGE_STRING " - SDL Edition", 0 /* icon */);
 }
 
 void
@@ -919,7 +913,7 @@
 PingusMain::on_exit_press()
 {
   std::cout << "Exit pressed" << std::endl;
-  ////ScreenManager::instance()->clear();
+  ScreenManager::instance()->clear();
 }
 
 void

Modified: branches/pingus_sdl/src/pingus_main.hxx
===================================================================
--- branches/pingus_sdl/src/pingus_main.hxx     2007-01-13 10:36:59 UTC (rev 
2636)
+++ branches/pingus_sdl/src/pingus_main.hxx     2007-01-13 11:37:45 UTC (rev 
2637)
@@ -31,8 +31,6 @@
 class PingusMain
 {
 private:
-  SDL_Surface* screen;
-
   bool    blitter_test;
   bool    no_config_file;
   bool    show_credits;

Modified: branches/pingus_sdl/src/story_screen.cxx
===================================================================
--- branches/pingus_sdl/src/story_screen.cxx    2007-01-13 10:36:59 UTC (rev 
2636)
+++ branches/pingus_sdl/src/story_screen.cxx    2007-01-13 11:37:45 UTC (rev 
2637)
@@ -49,12 +49,12 @@
 
   bool page_displayed_completly;
 
-       WorldMapNS::WorldMapStory *story;
-       std::vector<StoryPage> pages;
+  WorldMapNS::WorldMapStory *story;
+  std::vector<StoryPage> pages;
   CL_Sprite page_surface;
   StoryPage  current_page;
 public:
-       StoryScreenComponent (WorldMapNS::WorldMapStory *arg_pages);
+  StoryScreenComponent (WorldMapNS::WorldMapStory *arg_pages);
   virtual ~StoryScreenComponent () {}
 
   void draw (DrawingContext& gc);
@@ -62,7 +62,7 @@
 
   /** starts to display the next text page */
   void next_text();
-       WorldMapNS::WorldMapStory* get_story() const { return story; }
+  WorldMapNS::WorldMapStory* get_story() const { return story; }
 };
 
 class StoryScreenContinueButton : public GUI::SurfaceButton
@@ -108,7 +108,7 @@
 {
   page_displayed_completly = false;
   time_passed  = 0;
-       pages = story->get_pages();
+  pages = story->get_pages();
 
   current_page = pages.back();
   page_surface = Resource::load_sprite(current_page.image);
@@ -127,7 +127,7 @@
   gc.print_left(Fonts::chalk_normal,
                 static_cast<float>(CL_Display::get_width()/2  - 280),
                 static_cast<float>(CL_Display::get_height()/2 + 35),
-                                                               display_text);
+                display_text);
 }
 
 void
@@ -162,7 +162,7 @@
 void
 StoryScreen::on_startup()
 {
-       // FIXME: Load the song from the WorldMapStory
+  // FIXME: Load the song from the WorldMapStory
   Sound::PingusSound::play_music(story_comp->get_story()->get_music(), .7f);
 }
 
@@ -188,27 +188,27 @@
       else
         {
           //Out of story pages - figure out which one this was (start or end)
-                                       std::string which_story;
-                                       if (story == 
WorldMapNS::WorldMapManager::instance()->get_worldmap()->get_intro_story())
-                                               which_story = "start";
-                                       else
-                                               which_story = "end";
+          std::string which_story;
+          if (story == 
WorldMapNS::WorldMapManager::instance()->get_worldmap()->get_intro_story())
+            which_story = "start";
+          else
+            which_story = "end";
 
-                                       // Record that player has seen this 
story.
-                                       
StatManager::instance()->set_bool(WorldMapNS::WorldMapManager::instance()->get_worldmap()->get_shortname()
-                                                       + "-" + which_story + 
"story-seen", true);
+          // Record that player has seen this story.
+          
StatManager::instance()->set_bool(WorldMapNS::WorldMapManager::instance()->get_worldmap()->get_shortname()
+                                            + "-" + which_story + 
"story-seen", true);
 
-                                       bool credits_seen = false;
-                                       //Check if this is the last worldmap
-                                       if (which_story == "end" &&
-                                               
WorldMapNS::WorldMapManager::instance()->get_worldmap()->is_final_map())
-                                       {
-                                               // Check if final credits have 
been seen
-                                               
StatManager::instance()->get_bool("credits-seen", credits_seen);
-                                               if (!credits_seen)
-                   
ScreenManager::instance()->replace_screen(Credits::instance(), false);
-                                       }
-                                 
ScreenManager::instance()->replace_screen(WorldMapNS::WorldMapManager::instance 
());
+          bool credits_seen = false;
+          //Check if this is the last worldmap
+          if (which_story == "end" &&
+              
WorldMapNS::WorldMapManager::instance()->get_worldmap()->is_final_map())
+            {
+              // Check if final credits have been seen
+              StatManager::instance()->get_bool("credits-seen", credits_seen);
+              if (!credits_seen)
+                ScreenManager::instance()->replace_screen(Credits::instance(), 
false);
+            }
+          
ScreenManager::instance()->replace_screen(WorldMapNS::WorldMapManager::instance 
());
         }
     }
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]