@@ -94,18 +94,18 @@ truth dungeon::PrepareLevel(int Index, truth Visual)
94
94
{
95
95
festring fsGenLoopDL;{const char * pc = std::getenv (" IVAN_DebugGenDungeonLevelLoopID" );if (pc!=NULL )fsGenLoopDL<<pc;}
96
96
int iGenLoopMax=250 ;{const char * pc = std::getenv (" IVAN_DebugGenDungeonLevelLoopMax" );if (pc!=NULL )iGenLoopMax=atoi (pc);}
97
-
97
+
98
98
festring fsDL;fsDL<<GetIndex ()<<Index;
99
99
int iRetryMax = fsGenLoopDL==fsDL ? iGenLoopMax : 10 ;
100
-
100
+
101
101
DBG3 (" GeneratingDungeonLevel" ,fsDL.CStr (),fsGenLoopDL.CStr ());
102
-
102
+
103
103
level* NewLevel=NULL ;
104
104
cbitmap* EnterImage=NULL ;
105
105
for (int i=0 ;i<iRetryMax;i++){
106
106
try {
107
107
if (!genericException::ToggleGenNewLvl ())ABORT (" expecting gen lvl to become: true" );
108
-
108
+
109
109
NewLevel = Level[Index] = new level;
110
110
NewLevel->SetDungeon (this );
111
111
NewLevel->SetIndex (Index);
@@ -123,11 +123,11 @@ truth dungeon::PrepareLevel(int Index, truth Visual)
123
123
game::SetEnterTextDisplacement (Displacement);
124
124
game::TextScreen (CONST_S (" Entering " ) + GetLevelDescription (Index)
125
125
+ CONST_S (" ...\n\n This may take some time, please wait." ),
126
- Displacement, WHITE, false ,
126
+ Displacement, WHITE, false ,
127
127
true , &game::BusyAnimation);
128
128
game::TextScreen (CONST_S (" Entering " ) + GetLevelDescription (Index)
129
129
+ CONST_S (" ...\n\n Press any key to continue." ),
130
- Displacement, WHITE, game::GetAutoPlayMode ()<2 ,
130
+ Displacement, WHITE, game::GetAutoPlayMode ()<2 ,
131
131
false , &game::BusyAnimation);
132
132
game::SetEnterImage (0 );
133
133
delete EnterImage;
@@ -158,7 +158,7 @@ truth dungeon::PrepareLevel(int Index, truth Visual)
158
158
// TODO it is not working well, memory usage keeps increasing...
159
159
if (NewLevel ){delete NewLevel ;NewLevel=NULL ;}
160
160
if (EnterImage){delete EnterImage;EnterImage=NULL ;}
161
-
161
+
162
162
// retry
163
163
}
164
164
} // for()
@@ -210,10 +210,6 @@ void dungeon::PrepareMusic(int Index)
210
210
}
211
211
audio::SetPlaybackStatus (audio::PLAYING);
212
212
}
213
-
214
-
215
-
216
-
217
213
}
218
214
219
215
void dungeon::SaveLevel (cfestring& SaveName, int Number, truth DeleteAfterwards)
@@ -312,7 +308,7 @@ inputfile& operator>>(inputfile& SaveFile, dungeon*& Dungeon)
312
308
313
309
/* *
314
310
* The wrong luminance saved to a lsquare problem
315
- * may happen after craft/split eg. : a blue crystal stone,
311
+ * may happen after craft/split e.g. : a blue crystal stone,
316
312
* then you save the game and re-load it and the luminance would be still there.
317
313
* TODO this workaround will not be necessary when the problem is fixed on it's origin
318
314
*/
@@ -333,7 +329,7 @@ level* dungeon::LoadLevel(inputfile& SaveFile, int Number)
333
329
Level[Number]->SetLevelScript (GetLevelScript (Number));
334
330
PrepareMusic (Number);
335
331
WorkaroundFixLuminance (Level[Number]);
336
-
332
+
337
333
return Level[Number];
338
334
}
339
335
0 commit comments