adonthell-commits
[Top][All Lists]
Advanced

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

[Adonthell-commits] CVS: adonthell/src/tools/dlgedit gui_settings.cc,NON


From: Kai Sterker <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src/tools/dlgedit gui_settings.cc,NONE,1.1.2.1 gui_settings.h,NONE,1.1.2.1 Makefile.am,1.41.2.10,1.41.2.11 dlg_module.cc,1.1.2.12,1.1.2.13 dlg_module_entry.cc,1.1.2.2,1.1.2.3 dlg_module_entry.h,1.1.2.2,1.1.2.3 dlg_types.h,1.1.2.7,1.1.2.8 gui_circle.cc,1.1.2.5,1.1.2.6 gui_circle.h,1.1.2.3,1.1.2.4 gui_dlgedit.cc,1.1.2.13,1.1.2.14 gui_dlgedit.h,1.1.2.9,1.1.2.10 gui_dlgedit_events.cc,1.1.2.7,1.1.2.8 gui_graph.cc,1.1.2.17,1.1.2.18 lex.loadlg.cc,1.12.4.2,1.12.4.3 loadlg.l,1.9.4.2,1.9.4.3 main.cc,1.52.2.4,1.52.2.5
Date: Thu, 04 Apr 2002 11:07:55 -0500

Update of /cvsroot/adonthell/adonthell/src/tools/dlgedit
In directory subversions:/tmp/cvs-serv26156/tools/dlgedit

Modified Files:
      Tag: Branch_road_to_0-4
        Makefile.am dlg_module.cc dlg_module_entry.cc 
        dlg_module_entry.h dlg_types.h gui_circle.cc gui_circle.h 
        gui_dlgedit.cc gui_dlgedit.h gui_dlgedit_events.cc 
        gui_graph.cc lex.loadlg.cc loadlg.l main.cc 
Added Files:
      Tag: Branch_road_to_0-4
        gui_settings.cc gui_settings.h 
Log Message:
FINISHED dlg_compiler
ADDED loading of character and quests
FIXED crash when loading a directory instead of a dialogue source file


***** Error reading new file: [Errno 2] No such file or directory: 
'gui_settings.cc'
***** Error reading new file: [Errno 2] No such file or directory: 
'gui_settings.h'
Index: Makefile.am
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/Makefile.am,v
retrieving revision 1.41.2.10
retrieving revision 1.41.2.11
diff -C2 -r1.41.2.10 -r1.41.2.11
*** Makefile.am 30 Mar 2002 21:55:19 -0000      1.41.2.10
--- Makefile.am 4 Apr 2002 16:07:49 -0000       1.41.2.11
***************
*** 34,37 ****
--- 34,38 ----
      gui_messages.cc \
      gui_modal_dialog.cc \
+     gui_settings.cc \
      gui_tooltip.cc \
      lex.loadlg.cc \
***************
*** 63,66 ****
--- 64,68 ----
      gui_messages.h \
      gui_modal_dialog.h \
+     gui_settings.h \
      gui_tooltip.h
  
***************
*** 73,77 ****
  # $(SDL_LIBS) $(PY_LIBS) $(GTK_LIBS)
  
! dlgedit_LDADD = $(GTK_LIBS)
  #dlgedit_LDFLAGS = -Wl,-E
  
--- 75,79 ----
  # $(SDL_LIBS) $(PY_LIBS) $(GTK_LIBS)
  
! dlgedit_LDADD = $(GTK_LIBS) ../../libbase.a
  #dlgedit_LDFLAGS = -Wl,-E
  

Index: dlg_module.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/Attic/dlg_module.cc,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -C2 -r1.1.2.12 -r1.1.2.13
*** dlg_module.cc       3 Apr 2002 21:43:07 -0000       1.1.2.12
--- dlg_module.cc       4 Apr 2002 16:07:49 -0000       1.1.2.13
***************
*** 193,214 ****
          switch (i = parse_dlgfile (s, n))
          {
!             case LOAD_VARS:
              {
!                 if (parse_dlgfile (s, n) == LOAD_STR);
!                 break;
!             }
! 
!             case LOAD_NAME:
!             {
!                 if (parse_dlgfile (s, n) == LOAD_STR)
!                 {/*
!                     data::characters.erase (wnd->myplayer->get_name().c_str 
());
!                     wnd->myplayer->set_name (s);
!                     data::characters[wnd->myplayer->get_name().c_str ()] =
!                         (character*) wnd->myplayer;
!                 */}
!                 break;
              }
- 
              case LOAD_NOTE:
              {
--- 193,201 ----
          switch (i = parse_dlgfile (s, n))
          {
!             case LOAD_PROJECT:
              {
!                 if (parse_dlgfile (s, n) == LOAD_STR) entry_.setProject (s);
!                 break;                
              }
              case LOAD_NOTE:
              {
***************
*** 319,322 ****
--- 306,312 ----
  
      // Save settings and stuff
+     if (entry_.project () != "")
+         out << "Proj §" << entry_.project () << "§\n";
+     
      if (entry_.imports () != "")
          out << "Inc  §" << entry_.imports () << "§\n";

Index: dlg_module_entry.cc
===================================================================
RCS file: 
/cvsroot/adonthell/adonthell/src/tools/dlgedit/Attic/dlg_module_entry.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** dlg_module_entry.cc 2 Apr 2002 17:43:29 -0000       1.1.2.2
--- dlg_module_entry.cc 4 Apr 2002 16:07:49 -0000       1.1.2.3
***************
*** 21,32 ****
--- 21,126 ----
  
  #include <algorithm>
+ #include "game.h"
+ #include "quest.h"
+ #include "character_base.h"
+ #include "fileops.h"
  #include "dlg_module_entry.h"
  
  DlgModuleEntry::DlgModuleEntry ()
  {
+     project_ = "";
      imports_ = "";
      ctor_ = "";
      dtor_ = "";
      methods_ = "";
+ }
+ 
+ // set the project
+ bool DlgModuleEntry::setProject (std::string p)
+ {
+     bool retval = true;
+     
+     if (project_ != p)
+     {
+         project_ = p;
+         
+         // empty character and quest array
+         characters.clear ();
+         quests.clear ();
+         
+         retval &= loadCharacters ();
+         retval &= loadQuests ();
+     }
+     
+     return retval;
+ }
+ 
+ // load the character names
+ bool DlgModuleEntry::loadCharacters ()
+ {
+     // look for a character file
+     std::string file = game::find_file (project_ + "/character.data");
+     if (file == "") return false;
+     
+     // open the file
+     igzstream in;
+     in.open (file);
+     
+     // version check
+     if (!fileops::get_version (in, 3, 3, file))
+         return false;
+     
+     // load characters
+     character_base *mychar; 
+     char ctemp;
+ 
+     do
+     {
+         mychar = new character_base;
+         mychar->get_state (in);
+  
+         // save the name of the NPC's
+         if (mychar->get_id () != "Player") 
+             addCharacter (mychar->get_name ());
+         
+         delete mychar;
+     }
+     while (ctemp << in);
+     
+     // close file
+     in.close ();
+ 
+     return true; 
+ }
+ 
+ // load the quest names
+ bool DlgModuleEntry::loadQuests ()
+ {
+     // look for a character file
+     std::string file = game::find_file (project_ + "/quest.data");
+     if (file == "") return false;
+     
+     // open the file
+     igzstream in;
+     in.open (file);
+     
+     // version check
+     if (!fileops::get_version (in, 1, 1, file))
+         return false;
+ 
+     ::quest myquest;
+     char ctemp;
+ 
+     // save the name of each Quest
+     while (ctemp << in)
+     {
+         myquest.load (in);
+         addQuest (myquest.name);
+     }
+     
+     // close file
+     in.close ();
+ 
+     return true; 
  }
  

Index: dlg_module_entry.h
===================================================================
RCS file: 
/cvsroot/adonthell/adonthell/src/tools/dlgedit/Attic/dlg_module_entry.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** dlg_module_entry.h  2 Apr 2002 17:43:29 -0000       1.1.2.2
--- dlg_module_entry.h  4 Apr 2002 16:07:49 -0000       1.1.2.3
***************
*** 40,43 ****
--- 40,48 ----
      //@{
      /**
+      * Get the project this module is assigned to.
+      * @return the project the module belongs to.
+      */
+     std::string project ()          { return project_; }
+     /**
       * Get the import statements assigned to this module.
       * @return the module's additional imports.
***************
*** 59,62 ****
--- 64,75 ----
       */
      std::string methods ()          { return methods_; }
+     /**
+      * Sets the project this dialogue belongs to. Then loads the NPC and
+      * Quest names of this project.
+      * @param p Project name
+      * @return <b>true</b> if NPC's and Quests could be loaded,
+      *         <b>false</b> otherwise.
+      */
+     bool setProject (std::string p);
      
      void setImports (std::string i) { imports_ = i; }
***************
*** 65,71 ****
      void setMethods (std::string m) { methods_ = m; }
      
-     void addCharacter (std::string c);
-     void addQuest (std::string q);
-     
      bool isCharacter (const std::string &c);
      bool isQuest (const std::string &q);
--- 78,81 ----
***************
*** 76,79 ****
--- 86,96 ----
          
  private:
+     bool loadCharacters ();
+     bool loadQuests ();
+     
+     void addCharacter (std::string c);
+     void addQuest (std::string q);
+ 
+     std::string project_;           // project the dialogue belongs to
      std::string imports_;           // additional import statements
      std::string ctor_;              // constructor code

Index: dlg_types.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/Attic/dlg_types.h,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -r1.1.2.7 -r1.1.2.8
*** dlg_types.h 31 Mar 2002 10:32:09 -0000      1.1.2.7
--- dlg_types.h 4 Apr 2002 16:07:49 -0000       1.1.2.8
***************
*** 93,123 ****
  #define SAVE    2
  
! // For loading Dialogue Files
  enum
  {
!     LOAD_CIRCLE = 1,
!     LOAD_ARROW = 2,
!     LOAD_END = 3,
!     LOAD_TYPE = 4,
!     LOAD_PREV = 5,
!     LOAD_NEXT = 6,
!     LOAD_LINK = 7,
!     LOAD_POS = 8,
!     LOAD_NOTE = 9,
!     LOAD_TEXT = 10,
!     LOAD_COND = 11,
!     LOAD_VARS = 12,
!     LOAD_FUNC = 13,
!     LOAD_ACT = 14,
!     LOAD_NAME = 15,
!     LOAD_RACE = 16,
!     LOAD_GENDER = 17,
!     LOAD_NPC = 18,
!     LOAD_STR = 19,
!     LOAD_NUM = 20,
!     LOAD_IMPORTS = 21,
!     LOAD_CTOR = 22,
!     LOAD_DTOR = 23,
!     LOAD_UNKNOWN = 24
  };
  
--- 93,126 ----
  #define SAVE    2
  
! /**
!  * Defines for the various parts of a dialogue source file.
!  */
  enum
  {
!     LOAD_CIRCLE     = 1,
!     LOAD_ARROW      = 2,
!     LOAD_END        = 3,
!     LOAD_TYPE       = 4,
!     LOAD_PREV       = 5,
!     LOAD_NEXT       = 6,
!     LOAD_LINK       = 7,
!     LOAD_POS        = 8,
!     LOAD_NOTE       = 9,
!     LOAD_TEXT       = 10,
!     LOAD_COND       = 11,
!     LOAD_VARS       = 12,
!     LOAD_FUNC       = 13,
!     LOAD_ACT        = 14,
!     LOAD_NAME       = 15,
!     LOAD_RACE       = 16,
!     LOAD_GENDER     = 17,
!     LOAD_NPC        = 18,
!     LOAD_STR        = 19,
!     LOAD_NUM        = 20,
!     LOAD_IMPORTS    = 21,
!     LOAD_CTOR       = 22,
!     LOAD_DTOR       = 23,
!     LOAD_PROJECT    = 24,
!     LOAD_UNKNOWN    = 25
  };
  

Index: gui_circle.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/Attic/gui_circle.cc,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -C2 -r1.1.2.5 -r1.1.2.6
*** gui_circle.cc       13 Mar 2002 21:53:45 -0000      1.1.2.5
--- gui_circle.cc       4 Apr 2002 16:07:49 -0000       1.1.2.6
***************
*** 24,28 ****
   */
  
! GuiCircle::GuiCircle (node_type *t, DlgCircleEntry *e) : GuiModalDialog ()
  {
      entry = e;
--- 24,28 ----
   */
  
! GuiCircle::GuiCircle (node_type *t, DlgCircleEntry *e, DlgModuleEntry *dme) : 
GuiModalDialog ()
  {
      entry = e;
***************
*** 212,234 ****
      gtk_menu_append (GTK_MENU (npc_selection_menu), glade_menuitem);
      gtk_option_menu_set_menu (GTK_OPTION_MENU (npc_selection), 
npc_selection_menu);
! 
!     /*
!     dictionary <character *>::iterator itc; 
!     for (itc = data::characters.begin (); itc != data::characters.end () && 
itc->second != NULL; itc++) 
!         //     while ((mychar = (character *) data::characters.next ()) != 
NULL)
      {
!         // don't add the player character to the list
!         if (!strcmp (itc->second->get_name().c_str (), ((character *) 
data::the_player)->get_name().c_str ())) continue;
!         
!         glade_menuitem = gtk_menu_item_new_with_label 
(itc->second->get_name().c_str ());
!         gtk_object_set_user_data (GTK_OBJECT (glade_menuitem), (void *) 
itc->second->get_name().c_str ());
          gtk_widget_show (glade_menuitem);
          gtk_menu_append (GTK_MENU (npc_selection_menu), glade_menuitem);
          gtk_option_menu_set_menu (GTK_OPTION_MENU (npc_selection), 
npc_selection_menu);
      }
!     
!     if (circle->character != "") 
!         set_option (GTK_OPTION_MENU (npc_selection), 
circle->character.c_str());
!     */
      
      // the option menu with the available moods
--- 212,227 ----
      gtk_menu_append (GTK_MENU (npc_selection_menu), glade_menuitem);
      gtk_option_menu_set_menu (GTK_OPTION_MENU (npc_selection), 
npc_selection_menu);
!  
!     for (std::string name = dme->character (); name != ""; name = 
dme->character ()) 
      {
!         glade_menuitem = gtk_menu_item_new_with_label (name.c_str ());
!         gtk_object_set_user_data (GTK_OBJECT (glade_menuitem), (void *) 
name.c_str ());
          gtk_widget_show (glade_menuitem);
          gtk_menu_append (GTK_MENU (npc_selection_menu), glade_menuitem);
          gtk_option_menu_set_menu (GTK_OPTION_MENU (npc_selection), 
npc_selection_menu);
      }
! 
!     // set the NPC this circle is assigned to    
!     setOption (GTK_OPTION_MENU (npc_selection), e->npc ().c_str ());
      
      // the option menu with the available moods

Index: gui_circle.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/Attic/gui_circle.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** gui_circle.h        7 Mar 2002 21:29:34 -0000       1.1.2.3
--- gui_circle.h        4 Apr 2002 16:07:49 -0000       1.1.2.4
***************
*** 25,28 ****
--- 25,29 ----
  #include <string>
  #include "dlg_circle_entry.h"
+ #include "dlg_module_entry.h"
  #include "dlg_types.h"
  #include "gui_edit.h"
***************
*** 43,48 ****
       * @param type The type of the circle to display (NPC, PLAYER or NARRATOR)
       * @param entry The contents of the circle
       */
!     GuiCircle (node_type *type, DlgCircleEntry *entry);
  
      /**
--- 44,50 ----
       * @param type The type of the circle to display (NPC, PLAYER or NARRATOR)
       * @param entry The contents of the circle
+      * @param dme The contents of the dialogue
       */
!     GuiCircle (node_type *type, DlgCircleEntry *entry, DlgModuleEntry *dme);
  
      /**

Index: gui_dlgedit.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/Attic/gui_dlgedit.cc,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -C2 -r1.1.2.13 -r1.1.2.14
*** gui_dlgedit.cc      3 Apr 2002 21:43:07 -0000       1.1.2.13
--- gui_dlgedit.cc      4 Apr 2002 16:07:49 -0000       1.1.2.14
***************
*** 30,36 ****
--- 30,38 ----
  #include <sys/stat.h>
  #include <unistd.h>
+ #include <stdio.h>
  #include "gettext.h"
  #include "dlg_compiler.h"
  #include "gui_code.h"
+ #include "gui_settings.h"
  #include "gui_dlgedit.h"
  #include "gui_dlgedit_events.h"
***************
*** 371,375 ****
          return;
      }
! 
      // get the name to use for the dialogue
      file += g_strdup_printf ("-%i", ++number);
--- 373,386 ----
          return;
      }
!     
!     // check if it's a regular file
!     struct stat statbuf;
!     fstat (fileno (loadlgin), &statbuf);
!     if (!S_ISREG (statbuf.st_mode))
!     {
!         message->display (-2, file.c_str ());
!         return;
!     }
!     
      // get the name to use for the dialogue
      file += g_strdup_printf ("-%i", ++number);
***************
*** 461,464 ****
--- 472,479 ----
          GuiCode::dialog->display (module->entry (), module->name ());
      
+     // update the settings if neccessary
+     if (GuiSettings::dialog != NULL)
+         GuiSettings::dialog->display (module->entry (), module->name ());
+ 
      // update the window title
      initTitle ();
***************
*** 482,485 ****
--- 497,514 ----
      // report success
      message->display (212);
+ }
+ 
+ // edit the genral dialogu settings
+ void GuiDlgedit::settings ()
+ {
+     DlgModule *module = graph_->dialogue ();
+     if (module == NULL) return;
+ 
+     // if the dialog isn't already open ...
+     if (GuiSettings::dialog == NULL) 
+         GuiSettings::dialog = new GuiSettings ();
+     
+     // otherwise just show it
+     GuiSettings::dialog->display (module->entry (), module->name ());
  }
  

Index: gui_dlgedit.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/Attic/gui_dlgedit.h,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -C2 -r1.1.2.9 -r1.1.2.10
*** gui_dlgedit.h       30 Mar 2002 21:55:19 -0000      1.1.2.9
--- gui_dlgedit.h       4 Apr 2002 16:07:49 -0000       1.1.2.10
***************
*** 143,146 ****
--- 143,150 ----
      void customCode ();
      /**
+      * Edit the settings of the current module.
+      */
+     void settings ();
+     /**
       * preview translation for a dialogue
       * @param catalogue full path to a gnu gettext compliant binary catalogue

Index: gui_dlgedit_events.cc
===================================================================
RCS file: 
/cvsroot/adonthell/adonthell/src/tools/dlgedit/Attic/gui_dlgedit_events.cc,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -r1.1.2.7 -r1.1.2.8
*** gui_dlgedit_events.cc       30 Mar 2002 21:55:19 -0000      1.1.2.7
--- gui_dlgedit_events.cc       4 Apr 2002 16:07:49 -0000       1.1.2.8
***************
*** 73,84 ****
  void on_dialogue_player_activate (GtkMenuItem * menuitem, gpointer user_data)
  {
!     /*
!     MainFrame *wnd = (MainFrame *) user_data;
!     
!     preset_dlg dlg (wnd);
!     dlg.run  ();
!     
!     gtk_main ();
! */
  }
  
--- 73,77 ----
  void on_dialogue_player_activate (GtkMenuItem * menuitem, gpointer user_data)
  {
!     GuiDlgedit::window->settings ();
  }
  

Index: gui_graph.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/Attic/gui_graph.cc,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -C2 -r1.1.2.17 -r1.1.2.18
*** gui_graph.cc        20 Mar 2002 20:53:05 -0000      1.1.2.17
--- gui_graph.cc        4 Apr 2002 16:07:49 -0000       1.1.2.18
***************
*** 444,448 ****
          scrolling = false;
          
!         GuiCircle edit (&selected->type (), selected->entry ());
  
            // Editing aborted?
--- 444,448 ----
          scrolling = false;
          
!         GuiCircle edit (&selected->type (), selected->entry (), module->entry 
());
  
            // Editing aborted?

Index: lex.loadlg.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/lex.loadlg.cc,v
retrieving revision 1.12.4.2
retrieving revision 1.12.4.3
diff -C2 -r1.12.4.2 -r1.12.4.3
*** lex.loadlg.cc       31 Mar 2002 10:32:09 -0000      1.12.4.2
--- lex.loadlg.cc       4 Apr 2002 16:07:49 -0000       1.12.4.3
***************
*** 304,321 ****
        yy_c_buf_p = yy_cp;
  
! #define YY_NUM_RULES 28
! #define YY_END_OF_BUFFER 29
! static yyconst short int yy_accept[95] =
      {   0,
!         0,    0,    0,    0,   29,   27,   26,   26,    1,   27,
!        25,   27,   27,   27,   27,   27,   27,   27,   27,   27,
!        27,   27,   27,   27,   22,   24,   23,   26,    1,    1,
!        25,    0,    0,    0,    0,    0,    0,    0,    0,    0,
          0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
!         0,   24,    0,    0,    0,    0,    0,    4,    0,    0,
!        19,    0,   15,    0,    0,    0,    9,    0,    0,    0,
!         0,    0,    0,    0,   12,   21,   20,   14,    0,    8,
!        16,    7,   10,    6,   17,   11,    5,   13,    3,    0,
!         0,    2,   18,    0
  
      } ;
--- 304,321 ----
        yy_c_buf_p = yy_cp;
  
! #define YY_NUM_RULES 29
! #define YY_END_OF_BUFFER 30
! static yyconst short int yy_accept[97] =
      {   0,
!         0,    0,    0,    0,   30,   28,   27,   27,    1,   28,
!        26,   28,   28,   28,   28,   28,   28,   28,   28,   28,
!        28,   28,   28,   28,   23,   25,   24,   27,    1,    1,
!        26,    0,    0,    0,    0,    0,    0,    0,    0,    0,
          0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
!         0,   25,    0,    0,    0,    0,    0,    4,    0,    0,
!        20,    0,   15,    0,    0,    0,    9,    0,    0,    0,
!         0,    0,    0,    0,    0,   12,   22,   21,   14,    0,
!         8,   16,    7,   10,    6,   19,   17,   11,    5,   13,
!         3,    0,    0,    2,   18,    0
  
      } ;
***************
*** 334,344 ****
          1,    1,    1,    1,    1,    1,   20,    1,   21,   22,
  
!        23,    1,    1,    1,   24,    1,   25,   26,   27,   28,
!        29,   30,    1,   31,   32,   33,   34,   35,   36,   37,
!        38,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
!         1,    1,    1,    1,    1,    1,   39,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
--- 334,344 ----
          1,    1,    1,    1,    1,    1,   20,    1,   21,   22,
  
!        23,    1,    1,    1,   24,   25,   26,   27,   28,   29,
!        30,   31,    1,   32,   33,   34,   35,   36,   37,   38,
!        39,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
!         1,    1,    1,    1,    1,    1,   40,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
***************
*** 353,434 ****
      } ;
  
! static yyconst int yy_meta[40] =
      {   0,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
!         1,    1,    1,    1,    1,    1,    1,    1,    2
      } ;
  
! static yyconst short int yy_base[98] =
      {   0,
!         0,    0,   80,   79,  117,  120,   38,   40,  113,  109,
!       108,   82,   20,   79,   83,   76,   86,   80,   83,   31,
!        17,   86,   27,   85,  120,    0,  120,   53,  101,  120,
!        97,   71,   70,   72,   70,   69,   75,   68,   67,   73,
!        65,   84,   64,   53,   56,   56,   64,   65,   48,   54,
!        52,    0,   53,   60,   58,   48,   47,  120,   56,   54,
!       120,   50,  120,   51,   40,   49,  120,   36,   47,   31,
!        40,   30,   25,   33,  120,  120,  120,  120,   35,  120,
!       120,  120,  120,  120,  120,  120,  120,  120,  120,   34,
!        21,  120,  120,  120,   65,   67,   44
  
      } ;
  
! static yyconst short int yy_def[98] =
      {   0,
!        94,    1,   95,   95,   94,   94,   94,   94,   96,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   94,   94,   94,   94,   97,   94,   94,   96,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   97,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   94,   94,    0,   94,   94,   94
  
      } ;
  
! static yyconst short int yy_nxt[160] =
      {   0,
          6,    7,    8,    9,   10,   11,   12,   13,   14,   15,
         16,   17,   18,   19,   20,   21,   22,   23,   24,    6,
          6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
!         6,    6,    6,    6,    6,    6,    6,    6,   25,   28,
!        28,   28,   28,   33,   52,   46,   42,   47,   34,   49,
!        43,   93,   35,   44,   28,   28,   92,   91,   90,   45,
!        89,   88,   87,   86,   50,   26,   26,   29,   29,   85,
!        84,   83,   82,   81,   80,   79,   78,   77,   76,   75,
!        74,   73,   72,   71,   70,   69,   68,   67,   66,   65,
!        64,   63,   62,   61,   60,   59,   58,   57,   56,   55,
! 
!        54,   53,   31,   30,   51,   48,   41,   40,   39,   38,
!        37,   36,   32,   31,   31,   30,   94,   27,   27,    5,
!        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94
      } ;
  
! static yyconst short int yy_chk[160] =
      {   0,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
!         1,    1,    1,    1,    1,    1,    1,    1,    1,    7,
!         7,    8,    8,   13,   97,   21,   20,   21,   13,   23,
!        20,   91,   13,   20,   28,   28,   90,   79,   74,   20,
!        73,   72,   71,   70,   23,   95,   95,   96,   96,   69,
!        68,   66,   65,   64,   62,   60,   59,   57,   56,   55,
!        54,   53,   51,   50,   49,   48,   47,   46,   45,   44,
!        43,   42,   41,   40,   39,   38,   37,   36,   35,   34,
! 
!        33,   32,   31,   29,   24,   22,   19,   18,   17,   16,
!        15,   14,   12,   11,   10,    9,    5,    4,    3,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
!        94,   94,   94,   94,   94,   94,   94,   94,   94
      } ;
  
--- 353,436 ----
      } ;
  
! static yyconst int yy_meta[41] =
      {   0,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
!         1,    1,    1,    1,    1,    1,    1,    1,    1,    2
      } ;
  
! static yyconst short int yy_base[100] =
      {   0,
!         0,    0,   82,   81,  120,  123,   39,   41,  116,  112,
!       111,   84,   21,   81,   85,   78,   89,   82,   86,   30,
!        17,   89,   25,   88,  123,    0,  123,   54,  104,  123,
!       100,   73,   72,   74,   72,   71,   78,   70,   69,   76,
!        67,   87,   66,   55,   58,   58,   29,   69,   51,   57,
!        55,    0,   56,   64,   62,   51,   50,  123,   60,   58,
!       123,   53,  123,   55,   43,   53,  123,   39,   49,   50,
!        38,   48,   37,   32,   36,  123,  123,  123,  123,   39,
!       123,  123,  123,  123,  123,  123,  123,  123,  123,  123,
!       123,   38,   26,  123,  123,  123,   64,   66,   53
  
      } ;
  
! static yyconst short int yy_def[100] =
      {   0,
!        96,    1,   97,   97,   96,   96,   96,   96,   98,   96,
!        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96,   96,   96,   99,   96,   96,   98,   96,
!        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   99,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96,   96,   96,    0,   96,   96,   96
  
      } ;
  
! static yyconst short int yy_nxt[164] =
      {   0,
          6,    7,    8,    9,   10,   11,   12,   13,   14,   15,
         16,   17,   18,   19,   20,   21,   22,   23,   24,    6,
          6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
!         6,    6,    6,    6,    6,    6,    6,    6,    6,   25,
!        28,   28,   28,   28,   33,   42,   46,   49,   47,   43,
!        34,   68,   44,   52,   35,   28,   28,   95,   69,   45,
!        94,   93,   92,   50,   26,   26,   29,   29,   91,   90,
!        89,   88,   87,   86,   85,   84,   83,   82,   81,   80,
!        79,   78,   77,   76,   75,   74,   73,   72,   71,   70,
!        67,   66,   65,   64,   63,   62,   61,   60,   59,   58,
! 
!        57,   56,   55,   54,   53,   31,   30,   51,   48,   41,
!        40,   39,   38,   37,   36,   32,   31,   31,   30,   96,
!        27,   27,    5,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96
      } ;
  
! static yyconst short int yy_chk[164] =
      {   0,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
!         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
!         7,    7,    8,    8,   13,   20,   21,   23,   21,   20,
!        13,   47,   20,   99,   13,   28,   28,   93,   47,   20,
!        92,   80,   75,   23,   97,   97,   98,   98,   74,   73,
!        72,   71,   70,   69,   68,   66,   65,   64,   62,   60,
!        59,   57,   56,   55,   54,   53,   51,   50,   49,   48,
!        46,   45,   44,   43,   42,   41,   40,   39,   38,   37,
! 
!        36,   35,   34,   33,   32,   31,   29,   24,   22,   19,
!        18,   17,   16,   15,   14,   12,   11,   10,    9,    5,
!         4,    3,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
!        96,   96,   96
      } ;
  
***************
*** 470,474 ****
  #define YY_NO_UNPUT 1
  #define YY_NEVER_INTERACTIVE 1
! #line 473 "lex.loadlg.cc"
  
  /* Macros after this point can all be overridden by user definitions in
--- 472,476 ----
  #define YY_NO_UNPUT 1
  #define YY_NEVER_INTERACTIVE 1
! #line 475 "lex.loadlg.cc"
  
  /* Macros after this point can all be overridden by user definitions in
***************
*** 624,628 ****
  
  
! #line 627 "lex.loadlg.cc"
  
        if ( yy_init )
--- 626,630 ----
  
  
! #line 629 "lex.loadlg.cc"
  
        if ( yy_init )
***************
*** 675,679 ****
                                {
                                yy_current_state = (int) 
yy_def[yy_current_state];
!                               if ( yy_current_state >= 95 )
                                        yy_c = yy_meta[(unsigned int) yy_c];
                                }
--- 677,681 ----
                                {
                                yy_current_state = (int) 
yy_def[yy_current_state];
!                               if ( yy_current_state >= 97 )
                                        yy_c = yy_meta[(unsigned int) yy_c];
                                }
***************
*** 681,685 ****
                        ++yy_cp;
                        }
!               while ( yy_base[yy_current_state] != 120 );
  
  yy_find_action:
--- 683,687 ----
                        ++yy_cp;
                        }
!               while ( yy_base[yy_current_state] != 123 );
  
  yy_find_action:
***************
*** 800,851 ****
  YY_RULE_SETUP
  #line 50 "loadlg.l"
! return LOAD_IMPORTS;
        YY_BREAK
  case 20:
  YY_RULE_SETUP
  #line 51 "loadlg.l"
! return LOAD_DTOR;
        YY_BREAK
  case 21:
  YY_RULE_SETUP
  #line 52 "loadlg.l"
! return LOAD_CTOR;
        YY_BREAK
  case 22:
  YY_RULE_SETUP
! #line 54 "loadlg.l"
! mytext = ""; BEGIN(text);
        YY_BREAK
  case 23:
  YY_RULE_SETUP
  #line 55 "loadlg.l"
! BEGIN(INITIAL); return LOAD_STR;
        YY_BREAK
  case 24:
  YY_RULE_SETUP
  #line 56 "loadlg.l"
! mytext += yytext;
        YY_BREAK
  case 25:
  YY_RULE_SETUP
! #line 58 "loadlg.l"
! mynum = atoi (yytext); return LOAD_NUM;
        YY_BREAK
  case 26:
  YY_RULE_SETUP
! #line 60 "loadlg.l"
! ;
        YY_BREAK
  case 27:
  YY_RULE_SETUP
  #line 61 "loadlg.l"
! return LOAD_UNKNOWN;
        YY_BREAK
  case 28:
  YY_RULE_SETUP
  #line 62 "loadlg.l"
  ECHO;
        YY_BREAK
! #line 850 "lex.loadlg.cc"
  case YY_STATE_EOF(INITIAL):
  case YY_STATE_EOF(text):
--- 802,858 ----
  YY_RULE_SETUP
  #line 50 "loadlg.l"
! return LOAD_PROJECT;
        YY_BREAK
  case 20:
  YY_RULE_SETUP
  #line 51 "loadlg.l"
! return LOAD_IMPORTS;
        YY_BREAK
  case 21:
  YY_RULE_SETUP
  #line 52 "loadlg.l"
! return LOAD_DTOR;
        YY_BREAK
  case 22:
  YY_RULE_SETUP
! #line 53 "loadlg.l"
! return LOAD_CTOR;
        YY_BREAK
  case 23:
  YY_RULE_SETUP
  #line 55 "loadlg.l"
! mytext = ""; BEGIN(text);
        YY_BREAK
  case 24:
  YY_RULE_SETUP
  #line 56 "loadlg.l"
! BEGIN(INITIAL); return LOAD_STR;
        YY_BREAK
  case 25:
  YY_RULE_SETUP
! #line 57 "loadlg.l"
! mytext += yytext;
        YY_BREAK
  case 26:
  YY_RULE_SETUP
! #line 59 "loadlg.l"
! mynum = atoi (yytext); return LOAD_NUM;
        YY_BREAK
  case 27:
  YY_RULE_SETUP
  #line 61 "loadlg.l"
! ;
        YY_BREAK
  case 28:
  YY_RULE_SETUP
  #line 62 "loadlg.l"
+ return LOAD_UNKNOWN;
+       YY_BREAK
+ case 29:
+ YY_RULE_SETUP
+ #line 63 "loadlg.l"
  ECHO;
        YY_BREAK
! #line 857 "lex.loadlg.cc"
  case YY_STATE_EOF(INITIAL):
  case YY_STATE_EOF(text):
***************
*** 1140,1144 ****
                        {
                        yy_current_state = (int) yy_def[yy_current_state];
!                       if ( yy_current_state >= 95 )
                                yy_c = yy_meta[(unsigned int) yy_c];
                        }
--- 1147,1151 ----
                        {
                        yy_current_state = (int) yy_def[yy_current_state];
!                       if ( yy_current_state >= 97 )
                                yy_c = yy_meta[(unsigned int) yy_c];
                        }
***************
*** 1175,1183 ****
                {
                yy_current_state = (int) yy_def[yy_current_state];
!               if ( yy_current_state >= 95 )
                        yy_c = yy_meta[(unsigned int) yy_c];
                }
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) 
yy_c];
!       yy_is_jam = (yy_current_state == 94);
  
        return yy_is_jam ? 0 : yy_current_state;
--- 1182,1190 ----
                {
                yy_current_state = (int) yy_def[yy_current_state];
!               if ( yy_current_state >= 97 )
                        yy_c = yy_meta[(unsigned int) yy_c];
                }
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) 
yy_c];
!       yy_is_jam = (yy_current_state == 96);
  
        return yy_is_jam ? 0 : yy_current_state;
***************
*** 1734,1736 ****
        }
  #endif
! #line 62 "loadlg.l"
--- 1741,1743 ----
        }
  #endif
! #line 63 "loadlg.l"

Index: loadlg.l
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/loadlg.l,v
retrieving revision 1.9.4.2
retrieving revision 1.9.4.3
diff -C2 -r1.9.4.2 -r1.9.4.3
*** loadlg.l    31 Mar 2002 10:32:09 -0000      1.9.4.2
--- loadlg.l    4 Apr 2002 16:07:49 -0000       1.9.4.3
***************
*** 48,51 ****
--- 48,52 ----
  Race            return LOAD_RACE;
  Gender          return LOAD_GENDER;
+ Proj            return LOAD_PROJECT;
  Inc             return LOAD_IMPORTS;
  Dtor            return LOAD_DTOR;

Index: main.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/main.cc,v
retrieving revision 1.52.2.4
retrieving revision 1.52.2.5
diff -C2 -r1.52.2.4 -r1.52.2.5
*** main.cc     30 Mar 2002 21:55:19 -0000      1.52.2.4
--- main.cc     4 Apr 2002 16:07:50 -0000       1.52.2.5
***************
*** 28,33 ****
  #include <getopt.h>
  #include "gettext.h"
  #include "gui_dlgedit.h"
! 
  int parse_arguments (int argc, char *argv[])
  {
--- 28,34 ----
  #include <getopt.h>
  #include "gettext.h"
+ #include "game.h"
  #include "gui_dlgedit.h"
! /*
  int parse_arguments (int argc, char *argv[])
  {
***************
*** 48,52 ****
      return optind;
  }
! 
  int main (int argc, char *argv[])
  {
--- 49,53 ----
      return optind;
  }
! */
  int main (int argc, char *argv[])
  {
***************
*** 56,60 ****
      // Init i18n
      setlocale (LC_ALL, "");
!     
      // Create the User Interface
      GuiDlgedit dlgedit;
--- 57,64 ----
      // Init i18n
      setlocale (LC_ALL, "");
!   
!     // init game directory
!     game::init (DATA_DIR"/games");
!       
      // Create the User Interface
      GuiDlgedit dlgedit;




reply via email to

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