mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-26 16:07:31 +01:00
Drop IImageLoader::loadImages as only IImageLoader::loadImage is usable
This commit is contained in:
parent
462657960d
commit
fc0440ff89
@ -45,17 +45,6 @@ public:
|
|||||||
/** \param file File handle to check.
|
/** \param file File handle to check.
|
||||||
\return Pointer to newly created image, or 0 upon error. */
|
\return Pointer to newly created image, or 0 upon error. */
|
||||||
virtual IImage* loadImage(io::IReadFile* file) const = 0;
|
virtual IImage* loadImage(io::IReadFile* file) const = 0;
|
||||||
|
|
||||||
//! Creates a multiple surfaces from the file eg. whole cube map.
|
|
||||||
/** \param file File handle to check.
|
|
||||||
\param type Pointer to E_TEXTURE_TYPE where a recommended type of the texture will be stored.
|
|
||||||
\return Array of pointers to newly created images. */
|
|
||||||
virtual core::array<IImage*> loadImages(io::IReadFile* file, E_TEXTURE_TYPE* type) const
|
|
||||||
{
|
|
||||||
core::array<IImage*> image;
|
|
||||||
|
|
||||||
return image;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1196,57 +1196,33 @@ core::array<IImage*> CNullDriver::createImagesFromFile(io::IReadFile* file, E_TE
|
|||||||
|
|
||||||
core::array<IImage*> imageArray;
|
core::array<IImage*> imageArray;
|
||||||
|
|
||||||
if (file)
|
if (!file)
|
||||||
{
|
return imageArray;
|
||||||
s32 i;
|
|
||||||
|
|
||||||
// try to load file based on file extension
|
// try to load file based on file extension
|
||||||
for (i = SurfaceLoader.size() - 1; i >= 0; --i)
|
for (int i = SurfaceLoader.size() - 1; i >= 0; --i) {
|
||||||
{
|
if (!SurfaceLoader[i]->isALoadableFileExtension(file->getFileName()))
|
||||||
if (SurfaceLoader[i]->isALoadableFileExtension(file->getFileName()))
|
continue;
|
||||||
{
|
|
||||||
// reset file position which might have changed due to previous loadImage calls
|
|
||||||
file->seek(0);
|
|
||||||
imageArray = SurfaceLoader[i]->loadImages(file, type);
|
|
||||||
|
|
||||||
if (imageArray.size() == 0)
|
file->seek(0); // reset file position which might have changed due to previous loadImage calls
|
||||||
{
|
if (IImage *image = SurfaceLoader[i]->loadImage(file)) {
|
||||||
file->seek(0);
|
imageArray.push_back(image);
|
||||||
IImage* image = SurfaceLoader[i]->loadImage(file);
|
return imageArray;
|
||||||
|
|
||||||
if (image)
|
|
||||||
imageArray.push_back(image);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (imageArray.size() > 0)
|
|
||||||
return imageArray;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// try to load file based on what is in it
|
// try to load file based on what is in it
|
||||||
for (i = SurfaceLoader.size() - 1; i >= 0; --i)
|
for (int i = SurfaceLoader.size() - 1; i >= 0; --i) {
|
||||||
{
|
if (SurfaceLoader[i]->isALoadableFileExtension(file->getFileName()))
|
||||||
// dito
|
continue; // extension was tried above already
|
||||||
file->seek(0);
|
file->seek(0); // dito
|
||||||
if (SurfaceLoader[i]->isALoadableFileFormat(file)
|
if (!SurfaceLoader[i]->isALoadableFileFormat(file))
|
||||||
&& !SurfaceLoader[i]->isALoadableFileExtension(file->getFileName()) // extension was tried above already
|
continue;
|
||||||
)
|
|
||||||
{
|
|
||||||
file->seek(0);
|
|
||||||
imageArray = SurfaceLoader[i]->loadImages(file, type);
|
|
||||||
|
|
||||||
if (imageArray.size() == 0)
|
file->seek(0);
|
||||||
{
|
if (IImage *image = SurfaceLoader[i]->loadImage(file)) {
|
||||||
file->seek(0);
|
imageArray.push_back(image);
|
||||||
IImage* image = SurfaceLoader[i]->loadImage(file);
|
return imageArray;
|
||||||
|
|
||||||
if (image)
|
|
||||||
imageArray.push_back(image);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (imageArray.size() > 0)
|
|
||||||
return imageArray;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user