Skip to content

Commit 8f277df

Browse files
Fix certain GI textures looking broken in SonicGLvl.
1 parent 888e8a1 commit 8f277df

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

src/LibGens/GITextureGroup.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -432,18 +432,17 @@ namespace LibGens {
432432
}
433433

434434
unsigned char empty=0;
435-
file->readUChar(&empty);
436-
if (empty != 0) {
437-
return;
438-
}
435+
unsigned short texture_count = 0;
439436

440-
unsigned short texture_count=0;
441-
file->readInt16(&texture_count);
437+
file->readUChar(&empty);
438+
if (empty == 0) {
439+
file->readInt16(&texture_count);
442440

443-
for (size_t i=0; i<texture_count; i++) {
444-
GITexture *texture=new GITexture(terrain_folder);
445-
texture->read(file);
446-
textures.push_back(texture);
441+
for (size_t i = 0; i < texture_count; i++) {
442+
GITexture *texture = new GITexture(terrain_folder);
443+
texture->read(file);
444+
textures.push_back(texture);
445+
}
447446
}
448447

449448
if (instance_names.size() != texture_count) {

0 commit comments

Comments
 (0)