- fixed level editor menus a bit (still not 100% working)
authorIngo Ruhnke <grumbel@gmx.de>
Tue, 20 Apr 2004 11:37:10 +0000 (11:37 +0000)
committerIngo Ruhnke <grumbel@gmx.de>
Tue, 20 Apr 2004 11:37:10 +0000 (11:37 +0000)
- added resetpoint saving to Level

SVN-Revision: 587

src/level.cpp
src/leveleditor.cpp
src/setup.cpp
src/special.cpp

index c22db5e..43fd6a4 100644 (file)
@@ -560,6 +560,13 @@ Level::save(const  char * subset, int level)
     }
 
   fprintf( fi,")\n");
     }
 
   fprintf( fi,")\n");
+
+  fprintf( fi,"(reset-points\n");
+  for(std::vector<ResetPoint>::iterator i = reset_points.begin();
+      i != reset_points.end(); ++i)
+    fprintf( fi,"(point (x %d) (y %d))\n",i->x, i->y);
+  fprintf( fi,")\n");
+
   fprintf( fi,"(objects\n");
 
   for(std::vector<BadGuyData>::iterator it = badguy_data.begin();
   fprintf( fi,"(objects\n");
 
   for(std::vector<BadGuyData>::iterator it = badguy_data.begin();
index fd4893a..92c8ec5 100644 (file)
@@ -213,12 +213,13 @@ int leveleditor(int levelnb)
       /* draw editor interface */
       le_drawinterface();
 
       /* draw editor interface */
       le_drawinterface();
 
-      if(Menu::current())
+      Menu* menu = Menu::current();
+      if(menu)
         {
         {
-          Menu::current()->draw();
-          Menu::current()->action();
+          menu->draw();
+          menu->action();
 
 
-          if(Menu::current() == leveleditor_menu)
+          if(menu == leveleditor_menu)
             {
               switch (leveleditor_menu->check())
                 {
             {
               switch (leveleditor_menu->check())
                 {
@@ -233,7 +234,7 @@ int leveleditor(int levelnb)
                   break;
                 }
             }
                   break;
                 }
             }
-          else if(Menu::current() == level_settings_menu)
+          else if(menu == level_settings_menu)
             {
               switch (level_settings_menu->check())
                 {
             {
               switch (level_settings_menu->check())
                 {
@@ -247,7 +248,7 @@ int leveleditor(int levelnb)
                   break;
                 }
             }
                   break;
                 }
             }
-          else if(Menu::current() == select_tilegroup_menu)
+          else if(menu == select_tilegroup_menu)
             {
               int it = -1;
               switch (it = select_tilegroup_menu->check())
             {
               int it = -1;
               switch (it = select_tilegroup_menu->check())
@@ -263,7 +264,7 @@ int leveleditor(int levelnb)
                   break;
                 }
             }
                   break;
                 }
             }
-          else if(Menu::current() == subset_load_menu)
+          else if(menu == subset_load_menu)
             {
               switch (i = subset_load_menu->check())
                 {
             {
               switch (i = subset_load_menu->check())
                 {
@@ -292,7 +293,7 @@ int leveleditor(int levelnb)
                   break;
                 }
             }
                   break;
                 }
             }
-          else if(Menu::current() == subset_new_menu)
+          else if(menu == subset_new_menu)
             {
               if(subset_new_menu->item[2].input[0] == '\0')
                 subset_new_menu->item[3].kind = MN_DEACTIVE;
             {
               if(subset_new_menu->item[2].input[0] == '\0')
                 subset_new_menu->item[3].kind = MN_DEACTIVE;
@@ -324,7 +325,7 @@ int leveleditor(int levelnb)
                     }
                 }
             }
                     }
                 }
             }
-          else if(Menu::current() == subset_settings_menu)
+          else if(menu == subset_settings_menu)
             {
               if(le_level_subset.title.compare(subset_settings_menu->item[2].input) == 0 && le_level_subset.description.compare(subset_settings_menu->item[3].input) == 0  )
                 subset_settings_menu->item[5].kind = MN_DEACTIVE;
             {
               if(le_level_subset.title.compare(subset_settings_menu->item[2].input) == 0 && le_level_subset.description.compare(subset_settings_menu->item[3].input) == 0  )
                 subset_settings_menu->item[5].kind = MN_DEACTIVE;
index 5389142..dca1cf2 100644 (file)
@@ -1,14 +1,21 @@
-/*
-  setup.c
-  
-  Super Tux - Setup
-  
-  by Bill Kendrick
-  bill@newbreedsoftware.com
-  http://www.newbreedsoftware.com/supertux/
-  
-  April 11, 2000 - March 15, 2004
-*/
+//  $Id$
+//
+//  SuperTux -  A Jump'n Run
+//  Copyright (C) 2000 Bill Kendrick <bill@newbreedsoftware.com>
+//
+//  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.
 
 #include <assert.h>
 #include <stdio.h>
 
 #include <assert.h>
 #include <stdio.h>
index 752d60f..8016dc5 100644 (file)
@@ -1,14 +1,21 @@
+//  $Id$
 //
 //
-// C Implementation: special
+//  SuperTux -  A Jump'n Run
+//  Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
 //
 //
-// Description:
-//
-//
-// Author: Tobias Glaesser <tobi.web@gmx.de> & Bill Kendrick, (C) 2004
-//
-// Copyright: See COPYING file that comes with this distribution
+//  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.
 
 #include <assert.h>
 #include "SDL.h"
 
 #include <assert.h>
 #include "SDL.h"