comparison src/textures.cc @ 59:55bd29745535

Fix a NASTY bug in TEXTURE2 lump directory reading. This sometimes/often caused many operations (such as texture aligning) to fail.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 26 Sep 2011 07:03:29 +0300
parents 522a71f40632
children 1dfcb729ef3d
comparison
equal deleted inserted replaced
58:d554e443475d 59:55bd29745535
529 { 529 {
530 dir->wadfile->seek(dir->dir.start); 530 dir->wadfile->seek(dir->dir.start);
531 dir->wadfile->read_i32(&numtex); 531 dir->wadfile->read_i32(&numtex);
532 // Read in the offsets for texture2 names 532 // Read in the offsets for texture2 names
533 offsets = (i32 *) GetMemory((long) numtex * 4); 533 offsets = (i32 *) GetMemory((long) numtex * 4);
534 dir->wadfile->read_i32(offsets); 534 dir->wadfile->read_i32(offsets, numtex);
535 for (n = 0; n < numtex && !texofs; n++) 535 for (n = 0; n < numtex && !texofs; n++)
536 { 536 {
537 dir->wadfile->seek(dir->dir.start + offsets[n]); 537 dir->wadfile->seek(dir->dir.start + offsets[n]);
538 dir->wadfile->read_bytes(&tname, WAD_TEX_NAME); 538 dir->wadfile->read_bytes(&tname, WAD_TEX_NAME);
539 if (!y_strnicmp(tname, texname, WAD_TEX_NAME)) 539 if (!y_strnicmp(tname, texname, WAD_TEX_NAME))