1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Irrlicht cleanups (mostly getting rid of core::array)

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
This commit is contained in:
sfan5 2024-08-17 19:49:11 +02:00 committed by GitHub
parent 5acc2736db
commit 5d226268df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 308 additions and 1227 deletions

View file

@ -64,7 +64,6 @@ CNullDriver::CNullDriver(io::IFileSystem *io, const core::dimension2d<u32> &scre
DriverAttributes->addInt("MaxTextures", MATERIAL_MAX_TEXTURES);
DriverAttributes->addInt("MaxSupportedTextures", MATERIAL_MAX_TEXTURES);
DriverAttributes->addInt("MaxAnisotropy", 1);
// DriverAttributes->addInt("MaxUserClipPlanes", 0);
// DriverAttributes->addInt("MaxAuxBuffers", 0);
DriverAttributes->addInt("MaxMultipleRenderTargets", 1);
DriverAttributes->addInt("MaxIndices", -1);
@ -361,7 +360,7 @@ ITexture *CNullDriver::addTextureCubemap(const io::path &name, IImage *imagePosX
ITexture *t = 0;
core::array<IImage *> imageArray(6);
std::vector<IImage*> imageArray;
imageArray.push_back(imagePosX);
imageArray.push_back(imageNegX);
imageArray.push_back(imagePosY);
@ -391,7 +390,7 @@ ITexture *CNullDriver::addTextureCubemap(const irr::u32 sideLen, const io::path
return 0;
}
core::array<IImage *> imageArray(6);
std::vector<IImage*> imageArray;
for (int i = 0; i < 6; ++i)
imageArray.push_back(new CImage(format, core::dimension2du(sideLen, sideLen)));
@ -548,7 +547,7 @@ ITexture *CNullDriver::createDeviceDependentTexture(const io::path &name, IImage
return dummy;
}
ITexture *CNullDriver::createDeviceDependentTextureCubemap(const io::path &name, const core::array<IImage *> &image)
ITexture *CNullDriver::createDeviceDependentTextureCubemap(const io::path &name, const std::vector<IImage*> &image)
{
return new SDummyTexture(name, ETT_CUBEMAP);
}
@ -913,17 +912,17 @@ bool CNullDriver::checkImage(IImage *image) const
return true;
}
bool CNullDriver::checkImage(const core::array<IImage *> &image) const
bool CNullDriver::checkImage(const std::vector<IImage*> &image) const
{
if (!image.size())
if (image.empty())
return false;
ECOLOR_FORMAT lastFormat = image[0]->getColorFormat();
core::dimension2d<u32> lastSize = image[0]->getDimension();
auto lastSize = image[0]->getDimension();
for (u32 i = 0; i < image.size(); ++i) {
for (size_t i = 0; i < image.size(); ++i) {
ECOLOR_FORMAT format = image[i]->getColorFormat();
core::dimension2d<u32> size = image[i]->getDimension();
auto size = image[i]->getDimension();
if (!checkImage(image[i]))
return false;
@ -1699,22 +1698,6 @@ IVideoDriver *createNullDriver(io::IFileSystem *io, const core::dimension2d<u32>
return nullDriver;
}
//! Set/unset a clipping plane.
//! There are at least 6 clipping planes available for the user to set at will.
//! \param index: The plane index. Must be between 0 and MaxUserClipPlanes.
//! \param plane: The plane itself.
//! \param enable: If true, enable the clipping plane else disable it.
bool CNullDriver::setClipPlane(u32 index, const core::plane3df &plane, bool enable)
{
return false;
}
//! Enable/disable a clipping plane.
void CNullDriver::enableClipPlane(u32 index, bool enable)
{
// not necessary
}
void CNullDriver::setMinHardwareBufferVertexCount(u32 count)
{
MinVertexCountForVBO = count;