Skip to content

Commit

Permalink
Slightly simpler layer list management when creating pictures.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescan committed Aug 5, 2024
1 parent f3a236c commit 5ccd32c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Src/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -992,14 +992,12 @@ void Image::PopulatePicturesDDS(const tImageDDS& dds)
int w = dds.GetWidth();
int h = dds.GetHeight();

tList<tLayer> layers;
tList<tLayer> layers(tListMode::External);
dds.GetLayers(layers);

int numMipmaps = layers.GetNumItems();
for (tLayer* layer = layers.First(); layer; layer = layer->Next())
Pictures.Append(new tPicture(layer->Width, layer->Height, (tPixel4b*)layer->Data, true));

layers.Reset();
}
}

Expand Down Expand Up @@ -1105,14 +1103,12 @@ void Image::PopulatePicturesPVR(const tImagePVR& pvr)
int w = pvr.GetWidth();
int h = pvr.GetHeight();

tList<tLayer> layers;
tList<tLayer> layers(tListMode::External);
pvr.GetLayers(layers);

int numMipmaps = layers.GetNumItems();
for (tLayer* layer = layers.First(); layer; layer = layer->Next())
Pictures.Append(new tPicture(layer->Width, layer->Height, (tPixel4b*)layer->Data, true));

layers.Reset();
}
}

Expand Down Expand Up @@ -1218,14 +1214,12 @@ void Image::PopulatePicturesKTX(const tImageKTX& ktx)
int w = ktx.GetWidth();
int h = ktx.GetHeight();

tList<tLayer> layers;
tList<tLayer> layers(tListMode::External);
ktx.GetLayers(layers);

int numMipmaps = layers.GetNumItems();
for (tLayer* layer = layers.First(); layer; layer = layer->Next())
Pictures.Append(new tPicture(layer->Width, layer->Height, (tPixel4b*)layer->Data, true));

layers.Reset();
}
}

Expand Down

0 comments on commit 5ccd32c

Please sign in to comment.