234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
|
level_title=0;
annihilate();
generation_number=TY_MAXTYPE+1;
generation_number_inc=0;
level_version=p[0]|(p[1]<<8);
level_code=p[2]|(p[3]<<8);
p+=4;
if(*p&0x80) of=OF_BIZARRO;
pfwidth=(*p++&63)+1;
pfheight=(*p++&63)+1;
while(*p && p<end) p++; // skip text for now
p++; // skip null terminator
if(p>=end) goto bad1;
level_title=strdup(buf+6);
if(!level_title) fatal("Allocation failed\n");
|
<
|
234
235
236
237
238
239
240
241
242
243
244
245
246
247
|
level_title=0;
annihilate();
generation_number=TY_MAXTYPE+1;
generation_number_inc=0;
level_version=p[0]|(p[1]<<8);
level_code=p[2]|(p[3]<<8);
p+=4;
pfwidth=(*p++&63)+1;
pfheight=(*p++&63)+1;
while(*p && p<end) p++; // skip text for now
p++; // skip null terminator
if(p>=end) goto bad1;
level_title=strdup(buf+6);
if(!level_title) fatal("Allocation failed\n");
|
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
objects[o]->y=y;
if(x>pfwidth) goto bad2;
pflink(o);
--n;
} else {
if(p>=end) goto bad1;
z=*p++;
if(z==0xFF) {
if(!of) break;
of=0;
goto restart;
}
if(z&0x20) x=*p++;
if(z&0x10) y=*p++;
if(z&0x40) x++;
if(!x || !y || x>pfwidth || y>pfheight) goto bad2;
n=z&0x70?0:1;
|
|
|
|
|
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
|
objects[o]->y=y;
if(x>pfwidth) goto bad2;
pflink(o);
--n;
} else {
if(p>=end) goto bad1;
z=*p++;
if(z==0xFF) break;
if(z==0xFE) {
of^=OF_BIZARRO;
goto restart;
}
if(z&0x20) x=*p++;
if(z&0x10) y=*p++;
if(z&0x40) x++;
if(!x || !y || x>pfwidth || y>pfheight) goto bad2;
n=z&0x70?0:1;
|