258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
void
load_world(OFString *mname) // still supports all map formats that have existed
// since the earliest cube betas!
{
stopifrecording();
cleardlights();
pruneundos();
setnames(mname);
gzFile f =
gzopen([cgzname cStringWithEncoding:OFLocale.encoding], "rb9");
if (!f) {
conoutf(@"could not read map %@", cgzname);
return;
}
|
|
|
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
void
load_world(OFString *mname) // still supports all map formats that have existed
// since the earliest cube betas!
{
stopifrecording();
cleardlights();
pruneundos(0);
setnames(mname);
gzFile f =
gzopen([cgzname cStringWithEncoding:OFLocale.encoding], "rb9");
if (!f) {
conoutf(@"could not read map %@", cgzname);
return;
}
|
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
|
s->utex = s->wtex;
s->tag = 0;
s->floor = 0;
s->ceil = 16;
break;
}
default: {
if (type < 0 || type >= MAXTYPE) {
OFString *t = [OFString
stringWithFormat:@"%d @ %d", type, k];
fatal(@"while reading map: type out of "
@"range: ",
t);
}
s->type = type;
s->floor = gzgetc(f);
s->ceil = gzgetc(f);
if (s->floor >= s->ceil)
s->floor = s->ceil - 1; // for pre 12_13
s->wtex = gzgetc(f);
s->ftex = gzgetc(f);
|
|
<
<
|
|
|
<
|
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
|
s->utex = s->wtex;
s->tag = 0;
s->floor = 0;
s->ceil = 16;
break;
}
default: {
if (type < 0 || type >= MAXTYPE)
fatal(@"while reading map: type out of range: "
@"%d @ %d",
type, k);
s->type = type;
s->floor = gzgetc(f);
s->ceil = gzgetc(f);
if (s->floor >= s->ceil)
s->floor = s->ceil - 1; // for pre 12_13
s->wtex = gzgetc(f);
s->ftex = gzgetc(f);
|