/[enigma]/enigma/src/oxyd.cc
ViewVC logotype

Diff of /enigma/src/oxyd.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.41 by dheck, Wed May 14 07:32:59 2003 UTC revision 1.42 by reallysoft, Mon May 19 12:14:35 2003 UTC
# Line 69  namespace Line 69  namespace
69          /* Conversion tables from Oxyd bytecodes to Enigma object          /* Conversion tables from Oxyd bytecodes to Enigma object
70             names.  Default values are taken from `common_floor_map'             names.  Default values are taken from `common_floor_map'
71             etc. below. */             etc. below. */
72          char *floor_map[256];          const char *floor_map[256];
73          char *item_map[256];          const char *item_map[256];
74          char *stone_map[256];          const char *stone_map[256];
75    
76          virtual Stone *make_stone (int type, int x, int y);          virtual Stone *make_stone (int type, int x, int y);
77          virtual Item *make_item (int type);          virtual Item *make_item (int type);
# Line 91  namespace Line 91  namespace
91          DatFile     *m_datfile;          DatFile     *m_datfile;
92          Level       *m_level;   // Level currently being loaded          Level       *m_level;   // Level currently being loaded
93    
94          static char *common_floor_map[256];          static const char *common_floor_map[256];
95          static char *common_item_map[256];          static const char *common_item_map[256];
96          static char *common_stone_map[256];          static const char *common_stone_map[256];
97    
98          int level_index[200];          int level_index[200];
99          int nlevels;          int nlevels;
100      };      };
101  }  }
102    
103  char *LevelPack_Oxyd::common_floor_map[256] =  const char *LevelPack_Oxyd::common_floor_map[256] =
104  {  {
105      "fl-abyss",                 // 0x00      "fl-abyss",                 // 0x00
106      "fl-gray",                  // 0x01      "fl-gray",                  // 0x01
# Line 201  char *LevelPack_Oxyd::common_floor_map[2 Line 201  char *LevelPack_Oxyd::common_floor_map[2
201      0,                          // 0x60      0,                          // 0x60
202  };  };
203    
204  char *LevelPack_Oxyd::common_item_map[256] = {  const char *LevelPack_Oxyd::common_item_map[256] = {
205      0,                          // 0x00      0,                          // 0x00
206      "it-extralife",             // 0x01      "it-extralife",             // 0x01
207      "it-document",              // 0x02      "it-document",              // 0x02
# Line 304  char *LevelPack_Oxyd::common_item_map[25 Line 304  char *LevelPack_Oxyd::common_item_map[25
304      "it-trigger",               // 0x63      "it-trigger",               // 0x63
305  };  };
306    
307  char *LevelPack_Oxyd::common_stone_map[256] =  const char *LevelPack_Oxyd::common_stone_map[256] =
308  {  {
309      0,      0,
310      0,                          // 0x01      0,                          // 0x01
# Line 516  LevelPack_Oxyd::LevelPack_Oxyd (OxydVers Line 516  LevelPack_Oxyd::LevelPack_Oxyd (OxydVers
516  string  string
517  LevelPack_Oxyd::get_name() const  LevelPack_Oxyd::get_name() const
518  {  {
519      static char *names1p[] = {      static const char *names1p[] = {
520          "Oxyd 1", "Oxyd magnum", "Magnum Gold", "Per.Oxyd", "Oxyd extra"          "Oxyd 1", "Oxyd magnum", "Magnum Gold", "Per.Oxyd", "Oxyd extra"
521      };      };
522      static char *names2p[] = {      static const char *names2p[] = {
523          "Oxyd 1 (2p)", "", "", "Per.Oxyd (2p)", "Oxyd extra (2p)"          "Oxyd 1 (2p)", "", "", "Per.Oxyd (2p)", "Oxyd extra (2p)"
524      };      };
525      return level_index[0]>99 ? names2p[m_version] : names1p[m_version];      return level_index[0]>99 ? names2p[m_version] : names1p[m_version];
# Line 589  LevelPack_Oxyd::load_items (const Level Line 589  LevelPack_Oxyd::load_items (const Level
589  }  }
590    
591  Stone *  Stone *
592  LevelPack_Oxyd::make_stone (int type, int x, int y)  LevelPack_Oxyd::make_stone (int type, int /*x*/, int /*y*/)
593  {  {
594      using namespace world;      using namespace world;
595    
# Line 719  LevelPack_Oxyd::connect_signals (const L Line 719  LevelPack_Oxyd::connect_signals (const L
719  bool  bool
720  LevelPack_Oxyd::load_level (size_t index)  LevelPack_Oxyd::load_level (size_t index)
721  {  {
722      assert (0 <= index && index < size());      assert(index < size());
723    
724      string msg;      string msg;
725      Level level;      Level  level;
726    
727      if (!parseLevel (m_datfile->getLevel(level_index[index]), &level, &msg)) {      if (!parseLevel (m_datfile->getLevel(level_index[index]), &level, &msg)) {
728          Log << "Could not load " << get_name() << " level #" << index+1          Log << "Could not load " << get_name() << " level #" << index+1
# Line 1006  LP_PerOxyd::make_stone (int type, int x, Line 1007  LP_PerOxyd::make_stone (int type, int x,
1007      case 0x39: case 0x3a: case 0x3b:      case 0x39: case 0x3a: case 0x3b:
1008          // Create magic stones only if they are absolutely necessary          // Create magic stones only if they are absolutely necessary
1009          if (get_level()->getRequireMagicPiece()) {          if (get_level()->getRequireMagicPiece()) {
1010              char *names[] = { "st-magic", "st-magic", "st-magic" };              const char *names[] = { "st-magic", "st-magic", "st-magic" };
1011              st = MakeStone (names[type - 0x39]);              st = MakeStone (names[type - 0x39]);
1012          }          }
1013          break;          break;

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26