diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-09-30 19:20:48 -0500 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-09-30 19:20:48 -0500 |
commit | c1365802c73376609e53b97440ae037b14f6324f (patch) | |
tree | 8633e5de1122d50d100805df2edb5cdb34d83c52 /src/levelinfo.cpp | |
parent | 64f38f642113ac4bd5b1d96e76c9ae97965bc416 (diff) | |
parent | 1db72b5e45cc25eb183817f05a2ee631d8fff837 (diff) | |
download | kamek-c1365802c73376609e53b97440ae037b14f6324f.tar.gz kamek-c1365802c73376609e53b97440ae037b14f6324f.zip |
Merge branch 'level-select' of ssh://treeki.rustedlogic.net:30000/Kamek into level-select
Diffstat (limited to 'src/levelinfo.cpp')
-rw-r--r-- | src/levelinfo.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/levelinfo.cpp b/src/levelinfo.cpp index 8ce2845..d5ef8e7 100644 --- a/src/levelinfo.cpp +++ b/src/levelinfo.cpp @@ -7,10 +7,9 @@ void dLevelInfo_c::load(void *buffer) { for (int sect = 0; sect < sectionCount(); sect++) {
// parse this section
section_s *thisSect = getSectionByIndex(sect);
- entry_s *levels = getLevelsForSection(thisSect);
for (int lev = 0; lev < thisSect->levelCount; lev++) {
- entry_s *level = &levels[lev];
+ entry_s *level = &thisSect->levels[lev];
SetSomeConditionShit(level->worldSlot, level->levelSlot, level->flags);
@@ -28,7 +27,7 @@ dLevelInfo_c::entry_s *dLevelInfo_c::searchBySlot(int world, int level) { section_s *sect = getSectionByIndex(i);
for (int j = 0; j < sect->levelCount; j++) {
- entry_s *entry = &getLevelsForSection(sect)[j];
+ entry_s *entry = §->levels[j];
if (entry->worldSlot == world && entry->levelSlot == level)
return entry;
}
@@ -37,3 +36,17 @@ dLevelInfo_c::entry_s *dLevelInfo_c::searchBySlot(int world, int level) { return 0;
}
+dLevelInfo_c::entry_s *dLevelInfo_c::searchByDisplayNum(int world, int level) {
+ for (int i = 0; i < sectionCount(); i++) {
+ section_s *sect = getSectionByIndex(i);
+
+ for (int j = 0; j < sect->levelCount; j++) {
+ entry_s *entry = §->levels[j];
+ if (entry->displayWorld == world && entry->displayLevel == level)
+ return entry;
+ }
+ }
+
+ return 0;
+}
+
|