pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] rev 2337 - in trunk: data/data src src/gui


From: Ingo Ruhnke
Subject: [Pingus-CVS] rev 2337 - in trunk: data/data src src/gui
Date: Thu, 17 Jun 2004 03:12:12 +0200

Author: grumbel
Date: 2004-06-17 03:12:12 +0200 (Thu, 17 Jun 2004)
New Revision: 2337

Modified:
   trunk/data/data/story.xml
   trunk/src/credits.cxx
   trunk/src/credits.hxx
   trunk/src/gui/display_graphic_context.cxx
   trunk/src/gui/screen_manager.cxx
   trunk/src/start_screen.cxx
   trunk/src/story.cxx
   trunk/src/story_screen.cxx
Log:
 - fixed throuble with the intro

Modified: trunk/data/data/story.xml
===================================================================
--- trunk/data/data/story.xml   2004-06-17 00:38:08 UTC (rev 2336)
+++ trunk/data/data/story.xml   2004-06-17 01:12:12 UTC (rev 2337)
@@ -1,5 +1,5 @@
 <resources>
-  <section name="Story">
+  <section name="story">
     <surface file="../images/story/story0.png" name="story0" />
     <surface file="../images/story/story1.png" name="story1" />
     <surface file="../images/story/story2.png" name="story2" />

Modified: trunk/src/credits.cxx
===================================================================
--- trunk/src/credits.cxx       2004-06-17 00:38:08 UTC (rev 2336)
+++ trunk/src/credits.cxx       2004-06-17 01:12:12 UTC (rev 2337)
@@ -34,9 +34,12 @@
 Credits::Credits()
 {
   fast_scrolling = false;
-  background = Resource::load_surface("core/menu/startscreenbg");
-  pingu = Resource::load_surface("core/misc/creditpingu");
+  background = Resource::load_sprite("core/menu/startscreenbg");
+  pingu = Resource::load_sprite("core/misc/creditpingu");
 
+  background.set_alignment(origin_center);
+  pingu.set_alignment(origin_center);
+
   font       = Fonts::chalk_normal;
   font_small = Fonts::chalk_large;
 
@@ -220,32 +223,22 @@
   x = CL_Display::get_width()/2;
   y = int(offset);
 
-  gc.draw(background,
-          gc.get_width()/2 - background.get_width()/2,
-          gc.get_height()/2 - background.get_height()/2);
+  gc.draw(background, Vector(gc.get_width()/2, gc.get_height()/2));
+  gc.draw(pingu, Vector(gc.get_width()/2, gc.get_height()/2 - 20));
 
-  gc.draw(pingu, (gc.get_width() / 2) - (pingu.get_width() / 2),
-          (gc.get_height() / 2) - (pingu.get_height() / 2) - 20);
-
   CL_Display::push_cliprect(CL_Rect(0, gc.get_height()/2-225, 600, 
gc.get_height()/2+200));
   yof = 0;
 
-  CL_Font myfont = font;
-  CL_Font myfont_small = font_small;
-
-  myfont.set_alignment(origin_top_center);
-  myfont_small.set_alignment(origin_top_center);
-
   for (std::vector<std::string>::iterator i = credits.begin(); i != 
credits.end(); ++i)
     {
       switch ((*i)[0])
        {
        case '-':
-         font.draw(x, y + yof, i->substr(1).c_str());
+         gc.print_center(font, x, y + yof, i->substr(1));
          yof += font.get_height() + 5;
          break;
        case '_':
-         font_small.draw(x, y + yof, i->substr(1).c_str());
+         gc.print_center(font_small, x, y + yof, i->substr(1));
          yof += font_small.get_height() + 5;
          break;
        case 'n':

Modified: trunk/src/credits.hxx
===================================================================
--- trunk/src/credits.hxx       2004-06-17 00:38:08 UTC (rev 2336)
+++ trunk/src/credits.hxx       2004-06-17 01:12:12 UTC (rev 2337)
@@ -37,8 +37,8 @@
   static Credits* instance_;
 
   bool fast_scrolling;
-  CL_Surface background;
-  CL_Surface pingu;
+  CL_Sprite background;
+  CL_Sprite pingu;
 
   CL_Font    font;
   CL_Font    font_small;

Modified: trunk/src/gui/display_graphic_context.cxx
===================================================================
--- trunk/src/gui/display_graphic_context.cxx   2004-06-17 00:38:08 UTC (rev 
2336)
+++ trunk/src/gui/display_graphic_context.cxx   2004-06-17 01:12:12 UTC (rev 
2337)
@@ -308,9 +308,8 @@
 }
 
 void
-DisplayGraphicContext::print_center (CL_Font font_, int x_pos, int y_pos, 
const std::string& str)
+DisplayGraphicContext::print_center (CL_Font font, int x_pos, int y_pos, const 
std::string& str)
 {
-  CL_Font font = font_;
   font.set_alignment(origin_top_center);
   font.draw(w2s_x(x_pos), w2s_y(y_pos), str.c_str ());
 }

Modified: trunk/src/gui/screen_manager.cxx
===================================================================
--- trunk/src/gui/screen_manager.cxx    2004-06-17 00:38:08 UTC (rev 2336)
+++ trunk/src/gui/screen_manager.cxx    2004-06-17 01:12:12 UTC (rev 2337)
@@ -277,7 +277,6 @@
 
       progress = passed_time/1.0f;
     }
-
 #endif
 }
 

Modified: trunk/src/start_screen.cxx
===================================================================
--- trunk/src/start_screen.cxx  2004-06-17 00:38:08 UTC (rev 2336)
+++ trunk/src/start_screen.cxx  2004-06-17 01:12:12 UTC (rev 2337)
@@ -42,7 +42,7 @@
 {
 private:
   PLFHandle plf;
-  Sprite background;
+  CL_Sprite background;
   std::string time_str;
   std::string description;
 
@@ -130,8 +130,8 @@
 StartScreenComponent::StartScreenComponent(PLFHandle p)
   : plf(p)
 {
-  background = Sprite("menu/startscreenbg", "core");
-  background.set_align_center();
+  background = Resource::load_sprite("core/menu/startscreenbg");
+  background.set_alignment(origin_center);
   time_str = GameTime::ticks_to_realtime_string(plf->get_time());
 }
 

Modified: trunk/src/story.cxx
===================================================================
--- trunk/src/story.cxx 2004-06-17 00:38:08 UTC (rev 2336)
+++ trunk/src/story.cxx 2004-06-17 01:12:12 UTC (rev 2337)
@@ -41,7 +41,7 @@
   credits.title = _("The Journey Continues");
   credits.pages.push_back
     (StoryPage
-     (ResDescriptor("Story/credits1", "story"),
+     (ResDescriptor("story/credits1"),
       StringFormat::break_line(
       _("Now after you and the Pingus have learned the basics and\n"
         "practiced a bit it is time to move on and begin the journey into\n"
@@ -53,7 +53,7 @@
 
   credits.pages.push_back
     (StoryPage
-     (ResDescriptor("Story/credits2", "story"),
+     (ResDescriptor("story/credits2"),
       StringFormat::break_line(
       _("But as the eldest have said, the Tutorial Island provides not\n"
         "only a good way to practice, but it is also the starting point into\n"
@@ -64,7 +64,7 @@
 
   credits.pages.push_back
     (StoryPage
-     (ResDescriptor("Story/credits3", "story"),
+     (ResDescriptor("story/credits3"),
       StringFormat::break_line(
       _("So the Pingus set out and constructed some large rafts, enough\n"
         "to carry them all. After also packing a bunch of provisions\n"
@@ -74,7 +74,7 @@
 
   credits.pages.push_back
     (StoryPage
-     (ResDescriptor("Story/credits4", "story"),
+     (ResDescriptor("story/credits4"),
       StringFormat::break_line(
       _("So the Pingus sit on their raft, worrying about what's to come and\n"
         "where to go, while floating into the sunset.\n"
@@ -91,7 +91,7 @@
   intro.title = _("The Journey Begins");
   intro.pages.push_back
     (StoryPage
-     (ResDescriptor("Story/story0", "story"),
+     (ResDescriptor("story/story0"),
       StringFormat::break_line(
       _("For a long time, the Pingus have lived happily in peace on the\n"
         "South Pole along with all the other animals. Everything was in\n"
@@ -101,7 +101,7 @@
 
   intro.pages.push_back
     (StoryPage
-     (ResDescriptor("Story/story1", "story"),
+     (ResDescriptor("story/story1"),
       StringFormat::break_line(
       _("But then one day, things began to change slowly: the sky got darker\n"
         "and the earth got warmer. Firstly, they thought this was just a\n"
@@ -112,7 +112,7 @@
 
   intro.pages.push_back
     (StoryPage
-     (ResDescriptor("Story/story2", "story"),
+     (ResDescriptor("story/story2"),
       StringFormat::break_line(
       _("The snow began to melt away in a few areas and food became an\n"
         "issue. Other animals tried to leave the region to search\n"
@@ -122,7 +122,7 @@
 
   intro.pages.push_back
     (StoryPage
-     (ResDescriptor("Story/story3", "story"),
+     (ResDescriptor("story/story3"),
       StringFormat::break_line(
       _("So the circle of the eldest came together to decide what to do\n"
         "about it. They decided to send out an expedition around the world\n"
@@ -132,7 +132,7 @@
 
   intro.pages.push_back
     (StoryPage
-     (ResDescriptor("Story/story4", "story"),
+     (ResDescriptor("story/story4"),
       StringFormat::break_line(
       _("And they picked you to lead them on their journey around the\n"
         "world. Since the journey will be dangerous and difficult, your\n"
@@ -143,7 +143,7 @@
 
   intro.pages.push_back
     (StoryPage
-     (ResDescriptor("Story/story5", "story"),
+     (ResDescriptor("story/story5"),
       StringFormat::break_line(
       _("The island consists of many areas that are ideal to teach the\n"
         "Pingus their abilities. The Pingus can learn to build\n"
@@ -153,7 +153,7 @@
 
   intro.pages.push_back
     (StoryPage
-     (ResDescriptor("Story/story6", "story"),
+     (ResDescriptor("story/story6"),
       StringFormat::break_line(
       _("While there, you can practice your abilities in commanding\n"
         "and guiding the Pingus. You can also get familiar with\n"
@@ -164,7 +164,7 @@
 
   intro.pages.push_back
     (StoryPage
-     (ResDescriptor("Story/story6", "story"),
+     (ResDescriptor("story/story6"),
       StringFormat::break_line(
       _("Now that you and the Pingus have arrived at Tutorial Island it\n"
         "is time to take command and begin your mission.\n"

Modified: trunk/src/story_screen.cxx
===================================================================
--- trunk/src/story_screen.cxx  2004-06-17 00:38:08 UTC (rev 2336)
+++ trunk/src/story_screen.cxx  2004-06-17 01:12:12 UTC (rev 2337)
@@ -44,7 +44,7 @@
 private:
   bool show_credits;
 
-  CL_Surface background;
+  CL_Sprite background;
   std::string display_text;
   float time_passed;
 
@@ -116,15 +116,14 @@
 
   current_page = story.pages.back();
   page_surface = Resource::load_surface(current_page.image);
-  background   = Resource::load_surface("menu/startscreenbg", "core");
+  background   = Resource::load_sprite("core/menu/startscreenbg");
+  background.set_alignment(origin_center);
 }
 
 void
 StoryScreenComponent::draw (GraphicContext& gc)
 {
-  gc.draw(background,
-          gc.get_width()/2 - background.get_width()/2,
-          gc.get_height()/2 - background.get_height()/2);
+  gc.draw(background, Vector(gc.get_width()/2, gc.get_height()/2));
 
   gc.print_center(Fonts::chalk_large, CL_Display::get_width()/2,
                   CL_Display::get_height()/2 - 200, story.title);





reply via email to

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