[Tux4kids-commits] r1467 - in tuxtype/trunk: data/scripts src

Matthew Trey treymd-guest at alioth.debian.org
Sun Aug 30 22:03:09 UTC 2009


Author: treymd-guest
Date: 2009-08-30 22:03:09 +0000 (Sun, 30 Aug 2009)
New Revision: 1467

Added:
   tuxtype/trunk/data/scripts/cascade.xml
   tuxtype/trunk/data/scripts/laser.xml
Modified:
   tuxtype/trunk/data/scripts/Makefile.am
   tuxtype/trunk/src/scripting.c
   tuxtype/trunk/src/titlescreen.c
Log:
simplified cascade.xml and laser.xml for now
removed a for loop in practice.c that was causing laser game instructions to hang
included cascade.xml and laser.xml back into the build
made scripting background image scale properly when in fullscreen
turned instructions back on in titlescreen.c 
(there actually isn't a button for laser instructions right now, but I imagine
that the menu shouldn't be messed with until the GSoC branch is merged?)


Modified: tuxtype/trunk/data/scripts/Makefile.am
===================================================================
--- tuxtype/trunk/data/scripts/Makefile.am	2009-08-28 02:06:02 UTC (rev 1466)
+++ tuxtype/trunk/data/scripts/Makefile.am	2009-08-30 22:03:09 UTC (rev 1467)
@@ -4,8 +4,7 @@
 scriptsdir = $(pkgdatadir)/scripts
 
 dist_scripts_DATA = projectInfo.xml \
-  Lesson_1.xml
+  Lesson_1.xml \
+  cascade.xml \
+  laser.xml
 
-## NOTE put these back in if we write them into a usable state
-##  cascade.xml \
-##  laser.xml
\ No newline at end of file

Added: tuxtype/trunk/data/scripts/cascade.xml
===================================================================
--- tuxtype/trunk/data/scripts/cascade.xml	                        (rev 0)
+++ tuxtype/trunk/data/scripts/cascade.xml	2009-08-30 22:03:09 UTC (rev 1467)
@@ -0,0 +1,18 @@
+<script title="Fish Cascade Instructions">
+  <page>
+    <img src="lessons_bkg.png" x="0" y="0">
+    <img src="main_bkg.png" x="0" y="0">
+    <img src="tux/stand-.png" x="100" y="330">
+    <text color="#FFFFFF" align="center" size="32">Help Tux Eat Fish!</text>
+    <text color="#FFFFFF" align="center">Tux is very hungry! Eating</text>
+    <text color="#FFFFFF" align="center">fish with  letters gives him</text>
+    <text color="#FFFFFF" align="center">a  tummy  ache.  Help  Tux</text>
+    <text color="#FFFFFF" align="center">eat   fish  by  pressing  the</text>
+    <text color="#FFFFFF" align="center">letters  on the  fish making</text>
+    <text color="#FFFFFF" align="center">them  go  away  so he  can</text>
+    <text color="#FFFFFF" align="center">eat them all!</text>
+    <text></text>
+    <text color="#ffffff" align="center" size="22">Press Space to Continue!</text>
+  </page>
+   <waitforinput/>
+  </page></lesson>

Added: tuxtype/trunk/data/scripts/laser.xml
===================================================================
--- tuxtype/trunk/data/scripts/laser.xml	                        (rev 0)
+++ tuxtype/trunk/data/scripts/laser.xml	2009-08-30 22:03:09 UTC (rev 1467)
@@ -0,0 +1,18 @@
+<script title="Comet Zap Instructions" background="main_bkg.jpg">
+  <page>
+  <img src="main_bkg.png" x="0" y="0">
+  <text align="center" size="28">Save The Cities From Falling Comets!</text>
+    <text align="center"t>Help Tux aim his laser beam by typing</text>
+    <text align="center">the letters on the comets.  Type quickly,</text>
+    <text align="center">because if Tux can't destroy the comets</text>
+    <text align="center"t>before they hit the ground, the cities'</text>
+    <text align="center"t>shield will be destroyed.  If they get hit</text>
+    <text align="center">again, the cities themselves will be</text>
+    <text align="center">destroyed!  Lose all of your cities</text>
+    <text align="center">and the game is over.</text>
+    <text></text>
+    <text align="center" color="#ffffff" size="22">Press Space to Continue!</text>
+  </page>
+  <waitforinput/>
+</page>
+</lesson>
\ No newline at end of file


Property changes on: tuxtype/trunk/data/scripts/laser.xml
___________________________________________________________________
Added: svn:executable
   + *

Modified: tuxtype/trunk/src/scripting.c
===================================================================
--- tuxtype/trunk/src/scripting.c	2009-08-28 02:06:02 UTC (rev 1466)
+++ tuxtype/trunk/src/scripting.c	2009-08-30 22:03:09 UTC (rev 1467)
@@ -65,7 +65,6 @@
 void InstructLaser(void)
 {
   char fn[FNLEN]; 
-  int i;
 
   /* Try theme script first: */
   if (!settings.use_english)
@@ -73,11 +72,7 @@
 
   if (load_script( fn ) == 0) /* meaning successful load */
   {
-    for (i = 0; i < 20; i++)
-    {
-      run_script();
-      SDL_Delay(500);
-    }
+    run_script();
     return;
   }
 
@@ -87,14 +82,9 @@
   if (load_script( fn ) != 0)
     return; // bail if any errors occur
 
-  for (i = 0; i < 20; i++)
-  {
-    run_script();
-    SDL_Delay(500);
-  }
+  run_script();
 }
 
-
 void ProjectInfo(void)
 {
   char fn[FNLEN]; 
@@ -192,10 +182,14 @@
     if (strlen(script_file->d_name) < 5)
       continue;
 
-    /* Don't show project info file: */
-    if (strcmp(script_file->d_name, "projectInfo.xml") == 0)
+    /* Don't show project info file or instructions files */
+    if (strcmp(script_file->d_name, "projectInfo.xml") == 0 ||
+        strcmp(script_file->d_name, "laser.xml") == 0 ||
+        strcmp(script_file->d_name, "cascade.xml") == 0)
       continue;
 
+
+
     if (strcmp(&script_file->d_name[strlen(script_file->d_name) - 4],".xml"))
       continue;
 
@@ -965,13 +959,39 @@
     if (curPage->background)
     {
       SDL_Surface* img = LoadImage(curPage->background, IMG_ALPHA|IMG_NOT_REQUIRED);
-      SDL_BlitSurface(img, NULL, screen, NULL);
+
+      /* hack: since this is the background it needs to scale when in fullscreen
+       * but shouldn't every image scale when in fullscreen? assuming svg is for that... -MDT */
+      if (settings.fullscreen)
+      {
+        SDL_Surface* fsimg = zoom(img, fs_res_x, fs_res_y);
+        SDL_BlitSurface(fsimg, NULL, screen, NULL);
+        SDL_FreeSurface(fsimg);
+      }
+      else
+      { 
+        SDL_BlitSurface(img, NULL, screen, NULL);
+      } 
+
       SDL_FreeSurface(img);
+
     }
     else if (curScript->background)
     {
       SDL_Surface* img = LoadImage(curScript->background, IMG_ALPHA|IMG_NOT_REQUIRED);
-      SDL_BlitSurface(img, NULL, screen, NULL);
+
+      /* hack: since this is the background it needs to scale when in fullscreen -MDT */
+      if (settings.fullscreen)
+      { 
+        SDL_Surface* fsimg = zoom(img, fs_res_x, fs_res_y);
+        SDL_BlitSurface(fsimg, NULL, screen, NULL);
+        SDL_FreeSurface(fsimg);
+      }
+      else
+      { 
+        SDL_BlitSurface(img, NULL, screen, NULL);
+      } 
+
       SDL_FreeSurface(img);
     }
 

Modified: tuxtype/trunk/src/titlescreen.c
===================================================================
--- tuxtype/trunk/src/titlescreen.c	2009-08-28 02:06:02 UTC (rev 1466)
+++ tuxtype/trunk/src/titlescreen.c	2009-08-30 22:03:09 UTC (rev 1467)
@@ -624,19 +624,19 @@
 
     if (menu_opt == INSTRUCT)
     {
-//      unload_media();
-      not_implemented();
+//       not_implemented();
+       unload_media();
 
-//       switch (sub_menu)
-//       {
-//         case CASCADE: InstructCascade(); break;
-//         case LASER:   InstructLaser();   break;
-//       }
+      switch (sub_menu)
+      {
+        case CASCADE: InstructCascade(); break;
+        case LASER:   InstructLaser();   break;
+      }
 
-//      load_media();
+      load_media();
 
-//      if (settings.menu_music)
-//        MusicLoad( "tuxi.ogg", -1 );
+      if (settings.menu_music)
+        MusicLoad( "tuxi.ogg", -1 );
 
       redraw = 1;
     }




More information about the Tux4kids-commits mailing list