1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +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

@ -3,9 +3,6 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CAttributes.h"
#include "fast_atof.h"
#include "ITexture.h"
#include "IVideoDriver.h"
namespace irr
{

View file

@ -12,61 +12,34 @@ namespace irr
namespace io
{
CAttributes::CAttributes(video::IVideoDriver *driver) :
Driver(driver)
CAttributes::CAttributes()
{
#ifdef _DEBUG
setDebugName("CAttributes");
#endif
if (Driver)
Driver->grab();
}
CAttributes::~CAttributes()
{
clear();
if (Driver)
Driver->drop();
}
//! Removes all attributes
void CAttributes::clear()
{
for (u32 i = 0; i < Attributes.size(); ++i)
Attributes[i]->drop();
for (auto it : Attributes)
delete it.second;
Attributes.clear();
}
//! Returns attribute index from name, -1 if not found
s32 CAttributes::findAttribute(const c8 *attributeName) const
{
for (u32 i = 0; i < Attributes.size(); ++i)
if (Attributes[i]->Name == attributeName)
return i;
return -1;
}
IAttribute *CAttributes::getAttributeP(const c8 *attributeName) const
{
for (u32 i = 0; i < Attributes.size(); ++i)
if (Attributes[i]->Name == attributeName)
return Attributes[i];
return 0;
}
//! Sets a attribute as boolean value
void CAttributes::setAttribute(const c8 *attributeName, bool value)
{
IAttribute *att = getAttributeP(attributeName);
if (att)
att->setBool(value);
else {
Attributes.push_back(new CBoolAttribute(attributeName, value));
auto it = Attributes.find(attributeName);
if (it != Attributes.end()) {
it->second->setBool(value);
} else {
Attributes[attributeName] = new CBoolAttribute(attributeName, value);
}
}
@ -76,9 +49,9 @@ void CAttributes::setAttribute(const c8 *attributeName, bool value)
//! or 0 if attribute is not set.
bool CAttributes::getAttributeAsBool(const c8 *attributeName, bool defaultNotFound) const
{
const IAttribute *att = getAttributeP(attributeName);
if (att)
return att->getBool();
auto it = Attributes.find(attributeName);
if (it != Attributes.end())
return it->second->getBool();
else
return defaultNotFound;
}
@ -86,11 +59,11 @@ bool CAttributes::getAttributeAsBool(const c8 *attributeName, bool defaultNotFou
//! Sets a attribute as integer value
void CAttributes::setAttribute(const c8 *attributeName, s32 value)
{
IAttribute *att = getAttributeP(attributeName);
if (att)
att->setInt(value);
else {
Attributes.push_back(new CIntAttribute(attributeName, value));
auto it = Attributes.find(attributeName);
if (it != Attributes.end()) {
it->second->setInt(value);
} else {
Attributes[attributeName] = new CIntAttribute(attributeName, value);
}
}
@ -100,9 +73,9 @@ void CAttributes::setAttribute(const c8 *attributeName, s32 value)
//! or 0 if attribute is not set.
s32 CAttributes::getAttributeAsInt(const c8 *attributeName, irr::s32 defaultNotFound) const
{
const IAttribute *att = getAttributeP(attributeName);
if (att)
return att->getInt();
auto it = Attributes.find(attributeName);
if (it != Attributes.end())
return it->second->getInt();
else
return defaultNotFound;
}
@ -110,11 +83,12 @@ s32 CAttributes::getAttributeAsInt(const c8 *attributeName, irr::s32 defaultNotF
//! Sets a attribute as float value
void CAttributes::setAttribute(const c8 *attributeName, f32 value)
{
IAttribute *att = getAttributeP(attributeName);
if (att)
att->setFloat(value);
else
Attributes.push_back(new CFloatAttribute(attributeName, value));
auto it = Attributes.find(attributeName);
if (it != Attributes.end()) {
it->second->setFloat(value);
} else {
Attributes[attributeName] = new CFloatAttribute(attributeName, value);
}
}
//! Gets a attribute as integer value
@ -123,27 +97,11 @@ void CAttributes::setAttribute(const c8 *attributeName, f32 value)
//! or 0 if attribute is not set.
f32 CAttributes::getAttributeAsFloat(const c8 *attributeName, irr::f32 defaultNotFound) const
{
const IAttribute *att = getAttributeP(attributeName);
if (att)
return att->getFloat();
return defaultNotFound;
}
//! Returns amount of string attributes set in this scene manager.
u32 CAttributes::getAttributeCount() const
{
return Attributes.size();
}
//! Returns string attribute name by index.
//! \param index: Index value, must be between 0 and getStringAttributeCount()-1.
const c8 *CAttributes::getAttributeName(s32 index) const
{
if ((u32)index >= Attributes.size())
return 0;
return Attributes[index]->Name.c_str();
auto it = Attributes.find(attributeName);
if (it != Attributes.end())
return it->second->getFloat();
else
return defaultNotFound;
}
//! Returns the type of an attribute
@ -151,98 +109,17 @@ E_ATTRIBUTE_TYPE CAttributes::getAttributeType(const c8 *attributeName) const
{
E_ATTRIBUTE_TYPE ret = EAT_UNKNOWN;
const IAttribute *att = getAttributeP(attributeName);
if (att)
ret = att->getType();
auto it = Attributes.find(attributeName);
if (it != Attributes.end())
ret = it->second->getType();
return ret;
}
//! Returns attribute type by index.
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
E_ATTRIBUTE_TYPE CAttributes::getAttributeType(s32 index) const
{
if ((u32)index >= Attributes.size())
return EAT_UNKNOWN;
return Attributes[index]->getType();
}
//! Gets an attribute as integer value
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
s32 CAttributes::getAttributeAsInt(s32 index) const
{
if ((u32)index < Attributes.size())
return Attributes[index]->getInt();
else
return 0;
}
//! Gets an attribute as float value
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
f32 CAttributes::getAttributeAsFloat(s32 index) const
{
if ((u32)index < Attributes.size())
return Attributes[index]->getFloat();
else
return 0.f;
}
//! Gets an attribute as boolean value
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
bool CAttributes::getAttributeAsBool(s32 index) const
{
bool ret = false;
if ((u32)index < Attributes.size())
ret = Attributes[index]->getBool();
return ret;
}
//! Adds an attribute as integer
void CAttributes::addInt(const c8 *attributeName, s32 value)
{
Attributes.push_back(new CIntAttribute(attributeName, value));
}
//! Adds an attribute as float
void CAttributes::addFloat(const c8 *attributeName, f32 value)
{
Attributes.push_back(new CFloatAttribute(attributeName, value));
}
//! Adds an attribute as bool
void CAttributes::addBool(const c8 *attributeName, bool value)
{
Attributes.push_back(new CBoolAttribute(attributeName, value));
}
//! Returns if an attribute with a name exists
bool CAttributes::existsAttribute(const c8 *attributeName) const
{
return getAttributeP(attributeName) != 0;
}
//! Sets an attribute as boolean value
void CAttributes::setAttribute(s32 index, bool value)
{
if ((u32)index < Attributes.size())
Attributes[index]->setBool(value);
}
//! Sets an attribute as integer value
void CAttributes::setAttribute(s32 index, s32 value)
{
if ((u32)index < Attributes.size())
Attributes[index]->setInt(value);
}
//! Sets a attribute as float value
void CAttributes::setAttribute(s32 index, f32 value)
{
if ((u32)index < Attributes.size())
Attributes[index]->setFloat(value);
return Attributes.find(attributeName) != Attributes.end();
}
} // end namespace io

View file

@ -4,16 +4,14 @@
#pragma once
#include <map>
#include <string>
#include "IAttributes.h"
#include "IAttribute.h"
namespace irr
{
namespace video
{
class ITexture;
class IVideoDriver;
}
namespace io
{
@ -21,30 +19,16 @@ namespace io
class CAttributes : public IAttributes
{
public:
CAttributes(video::IVideoDriver *driver = 0);
CAttributes();
~CAttributes();
//! Returns amount of attributes in this collection of attributes.
u32 getAttributeCount() const override;
//! Returns attribute name by index.
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
const c8 *getAttributeName(s32 index) const override;
//! Returns the type of an attribute
//! \param attributeName: Name for the attribute
E_ATTRIBUTE_TYPE getAttributeType(const c8 *attributeName) const override;
//! Returns attribute type by index.
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
E_ATTRIBUTE_TYPE getAttributeType(s32 index) const override;
//! Returns if an attribute with a name exists
bool existsAttribute(const c8 *attributeName) const override;
//! Returns attribute index from name, -1 if not found
s32 findAttribute(const c8 *attributeName) const override;
//! Removes all attributes
void clear() override;
@ -55,7 +39,9 @@ public:
*/
//! Adds an attribute as integer
void addInt(const c8 *attributeName, s32 value) override;
void addInt(const c8 *attributeName, s32 value) override {
setAttribute(attributeName, value);
}
//! Sets an attribute as integer value
void setAttribute(const c8 *attributeName, s32 value) override;
@ -66,13 +52,6 @@ public:
//! \return Returns value of the attribute previously set by setAttribute()
s32 getAttributeAsInt(const c8 *attributeName, irr::s32 defaultNotFound = 0) const override;
//! Gets an attribute as integer value
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
s32 getAttributeAsInt(s32 index) const override;
//! Sets an attribute as integer value
void setAttribute(s32 index, s32 value) override;
/*
Float Attribute
@ -80,7 +59,9 @@ public:
*/
//! Adds an attribute as float
void addFloat(const c8 *attributeName, f32 value) override;
void addFloat(const c8 *attributeName, f32 value) override {
setAttribute(attributeName, value);
}
//! Sets a attribute as float value
void setAttribute(const c8 *attributeName, f32 value) override;
@ -91,19 +72,14 @@ public:
//! \return Returns value of the attribute previously set by setAttribute()
f32 getAttributeAsFloat(const c8 *attributeName, irr::f32 defaultNotFound = 0.f) const override;
//! Gets an attribute as float value
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
f32 getAttributeAsFloat(s32 index) const override;
//! Sets an attribute as float value
void setAttribute(s32 index, f32 value) override;
/*
Bool Attribute
*/
//! Adds an attribute as bool
void addBool(const c8 *attributeName, bool value) override;
void addBool(const c8 *attributeName, bool value) override {
setAttribute(attributeName, value);
}
//! Sets an attribute as boolean value
void setAttribute(const c8 *attributeName, bool value) override;
@ -114,19 +90,12 @@ public:
//! \return Returns value of the attribute previously set by setAttribute()
bool getAttributeAsBool(const c8 *attributeName, bool defaultNotFound = false) const override;
//! Gets an attribute as boolean value
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
bool getAttributeAsBool(s32 index) const override;
//! Sets an attribute as boolean value
void setAttribute(s32 index, bool value) override;
protected:
core::array<IAttribute *> Attributes;
typedef std::basic_string<c8> string;
IAttribute *getAttributeP(const c8 *attributeName) const;
video::IVideoDriver *Driver;
// specify a comparator so we can directly look up in the map with const c8*
// (works since C++14)
std::map<string, IAttribute*, std::less<>> Attributes;
};
} // end namespace io

View file

@ -433,7 +433,7 @@ bool CB3DMeshFileLoader::readChunkTRIS(scene::SSkinMeshBuffer *meshBuffer, u32 m
}
const s32 memoryNeeded = B3dStack.getLast().length / sizeof(s32);
meshBuffer->Indices.reallocate(memoryNeeded + meshBuffer->Indices.size() + 1);
meshBuffer->Indices.reserve(memoryNeeded + meshBuffer->Indices.size() + 1);
while ((B3dStack.getLast().startposition + B3dStack.getLast().length) > B3DFile->getPos()) // this chunk repeats
{

View file

@ -26,8 +26,8 @@ CBillboardSceneNode::CBillboardSceneNode(ISceneNode *parent, ISceneManager *mgr,
setSize(size);
Buffer->Vertices.set_used(4);
Buffer->Indices.set_used(6);
Buffer->Vertices.resize(4);
Buffer->Indices.resize(6);
Buffer->Indices[0] = 0;
Buffer->Indices[1] = 2;
@ -114,7 +114,7 @@ void CBillboardSceneNode::updateMesh(const irr::scene::ICameraSceneNode *camera)
view *= -1.0f;
core::array<video::S3DVertex> &vertices = Buffer->Vertices;
auto *vertices = Buffer->Vertices.data();
for (s32 i = 0; i < 4; ++i)
vertices[i].Normal = view;

View file

@ -58,14 +58,8 @@ CFileSystem::CFileSystem()
//! destructor
CFileSystem::~CFileSystem()
{
u32 i;
for (i = 0; i < FileArchives.size(); ++i) {
FileArchives[i]->drop();
}
for (i = 0; i < ArchiveLoader.size(); ++i) {
ArchiveLoader[i]->drop();
for (auto *it : ArchiveLoader) {
it->drop();
}
}
@ -75,15 +69,6 @@ IReadFile *CFileSystem::createAndOpenFile(const io::path &filename)
if (filename.empty())
return 0;
IReadFile *file = 0;
u32 i;
for (i = 0; i < FileArchives.size(); ++i) {
file = FileArchives[i]->createAndOpenFile(filename);
if (file)
return file;
}
// Create the file using an absolute path so that it matches
// the scheme used by CNullDriver::getTexture().
return CReadFile::createReadFile(getAbsolutePath(filename));
@ -150,241 +135,6 @@ IArchiveLoader *CFileSystem::getArchiveLoader(u32 index) const
return 0;
}
//! move the hirarchy of the filesystem. moves sourceIndex relative up or down
bool CFileSystem::moveFileArchive(u32 sourceIndex, s32 relative)
{
bool r = false;
const s32 dest = (s32)sourceIndex + relative;
const s32 dir = relative < 0 ? -1 : 1;
const s32 sourceEnd = ((s32)FileArchives.size()) - 1;
IFileArchive *t;
for (s32 s = (s32)sourceIndex; s != dest; s += dir) {
if (s < 0 || s > sourceEnd || s + dir < 0 || s + dir > sourceEnd)
continue;
t = FileArchives[s + dir];
FileArchives[s + dir] = FileArchives[s];
FileArchives[s] = t;
r = true;
}
return r;
}
//! Adds an archive to the file system.
bool CFileSystem::addFileArchive(const io::path &filename, bool ignoreCase,
bool ignorePaths, E_FILE_ARCHIVE_TYPE archiveType,
const core::stringc &password,
IFileArchive **retArchive)
{
IFileArchive *archive = 0;
bool ret = false;
// see if archive is already added
s32 i;
// do we know what type it should be?
if (archiveType == EFAT_UNKNOWN) {
// try to load archive based on file name
for (i = ArchiveLoader.size() - 1; i >= 0; --i) {
if (ArchiveLoader[i]->isALoadableFileFormat(filename)) {
archive = ArchiveLoader[i]->createArchive(filename, ignoreCase, ignorePaths);
if (archive)
break;
}
}
// try to load archive based on content
if (!archive) {
io::IReadFile *file = createAndOpenFile(filename);
if (file) {
for (i = ArchiveLoader.size() - 1; i >= 0; --i) {
file->seek(0);
if (ArchiveLoader[i]->isALoadableFileFormat(file)) {
file->seek(0);
archive = ArchiveLoader[i]->createArchive(file, ignoreCase, ignorePaths);
if (archive)
break;
}
}
file->drop();
}
}
} else {
// try to open archive based on archive loader type
io::IReadFile *file = 0;
for (i = ArchiveLoader.size() - 1; i >= 0; --i) {
if (ArchiveLoader[i]->isALoadableFileFormat(archiveType)) {
// attempt to open file
if (!file)
file = createAndOpenFile(filename);
// is the file open?
if (file) {
// attempt to open archive
file->seek(0);
if (ArchiveLoader[i]->isALoadableFileFormat(file)) {
file->seek(0);
archive = ArchiveLoader[i]->createArchive(file, ignoreCase, ignorePaths);
if (archive)
break;
}
} else {
// couldn't open file
break;
}
}
}
// if open, close the file
if (file)
file->drop();
}
if (archive) {
FileArchives.push_back(archive);
if (password.size())
archive->Password = password;
if (retArchive)
*retArchive = archive;
ret = true;
} else {
os::Printer::log("Could not create archive for", filename, ELL_ERROR);
}
return ret;
}
bool CFileSystem::addFileArchive(IReadFile *file, bool ignoreCase,
bool ignorePaths, E_FILE_ARCHIVE_TYPE archiveType,
const core::stringc &password, IFileArchive **retArchive)
{
if (!file)
return false;
if (file) {
IFileArchive *archive = 0;
s32 i;
if (archiveType == EFAT_UNKNOWN) {
// try to load archive based on file name
for (i = ArchiveLoader.size() - 1; i >= 0; --i) {
if (ArchiveLoader[i]->isALoadableFileFormat(file->getFileName())) {
archive = ArchiveLoader[i]->createArchive(file, ignoreCase, ignorePaths);
if (archive)
break;
}
}
// try to load archive based on content
if (!archive) {
for (i = ArchiveLoader.size() - 1; i >= 0; --i) {
file->seek(0);
if (ArchiveLoader[i]->isALoadableFileFormat(file)) {
file->seek(0);
archive = ArchiveLoader[i]->createArchive(file, ignoreCase, ignorePaths);
if (archive)
break;
}
}
}
} else {
// try to open archive based on archive loader type
for (i = ArchiveLoader.size() - 1; i >= 0; --i) {
if (ArchiveLoader[i]->isALoadableFileFormat(archiveType)) {
// attempt to open archive
file->seek(0);
if (ArchiveLoader[i]->isALoadableFileFormat(file)) {
file->seek(0);
archive = ArchiveLoader[i]->createArchive(file, ignoreCase, ignorePaths);
if (archive)
break;
}
}
}
}
if (archive) {
FileArchives.push_back(archive);
if (password.size())
archive->Password = password;
if (retArchive)
*retArchive = archive;
return true;
} else {
os::Printer::log("Could not create archive for", file->getFileName(), ELL_ERROR);
}
}
return false;
}
//! Adds an archive to the file system.
bool CFileSystem::addFileArchive(IFileArchive *archive)
{
if (archive) {
for (u32 i = 0; i < FileArchives.size(); ++i) {
if (archive == FileArchives[i]) {
return false;
}
}
FileArchives.push_back(archive);
archive->grab();
return true;
}
return false;
}
//! removes an archive from the file system.
bool CFileSystem::removeFileArchive(u32 index)
{
bool ret = false;
if (index < FileArchives.size()) {
FileArchives[index]->drop();
FileArchives.erase(index);
ret = true;
}
return ret;
}
//! removes an archive from the file system.
bool CFileSystem::removeFileArchive(const io::path &filename)
{
const path absPath = getAbsolutePath(filename);
for (u32 i = 0; i < FileArchives.size(); ++i) {
if (absPath == FileArchives[i]->getFileList()->getPath())
return removeFileArchive(i);
}
return false;
}
//! Removes an archive from the file system.
bool CFileSystem::removeFileArchive(const IFileArchive *archive)
{
for (u32 i = 0; i < FileArchives.size(); ++i) {
if (archive == FileArchives[i]) {
return removeFileArchive(i);
}
}
return false;
}
//! gets an archive
u32 CFileSystem::getFileArchiveCount() const
{
return FileArchives.size();
}
IFileArchive *CFileSystem::getFileArchive(u32 index)
{
return index < getFileArchiveCount() ? FileArchives[index] : 0;
}
//! Returns the string of the current working directory
const io::path &CFileSystem::getWorkingDirectory()
{
@ -711,17 +461,6 @@ IFileList *CFileSystem::createFileList()
//! parent
r->addItem(Path + _IRR_TEXT(".."), 0, 0, true, 0);
//! merge archives
for (u32 i = 0; i < FileArchives.size(); ++i) {
const IFileList *merge = FileArchives[i]->getFileList();
for (u32 j = 0; j < merge->getFileCount(); ++j) {
if (core::isInSameDirectory(Path, merge->getFullFileName(j)) == 0) {
r->addItem(merge->getFullFileName(j), merge->getFileOffset(j), merge->getFileSize(j), merge->isDirectory(j), 0);
}
}
}
}
if (r)
@ -738,10 +477,6 @@ IFileList *CFileSystem::createEmptyFileList(const io::path &path, bool ignoreCas
//! determines if a file exists and would be able to be opened.
bool CFileSystem::existFile(const io::path &filename) const
{
for (u32 i = 0; i < FileArchives.size(); ++i)
if (FileArchives[i]->getFileList()->findFile(filename) != -1)
return true;
#if defined(_MSC_VER)
return (_access(filename.c_str(), 0) != -1);
#elif defined(F_OK)

View file

@ -4,8 +4,8 @@
#pragma once
#include <vector>
#include "IFileSystem.h"
#include "irrArray.h"
namespace irr
{
@ -41,25 +41,6 @@ public:
//! Opens a file for write access.
IWriteFile *createAndWriteFile(const io::path &filename, bool append = false) override;
//! Adds an archive to the file system.
virtual bool addFileArchive(const io::path &filename,
bool ignoreCase = true, bool ignorePaths = true,
E_FILE_ARCHIVE_TYPE archiveType = EFAT_UNKNOWN,
const core::stringc &password = "",
IFileArchive **retArchive = 0) override;
//! Adds an archive to the file system.
virtual bool addFileArchive(IReadFile *file, bool ignoreCase = true,
bool ignorePaths = true,
E_FILE_ARCHIVE_TYPE archiveType = EFAT_UNKNOWN,
const core::stringc &password = "",
IFileArchive **retArchive = 0) override;
//! Adds an archive to the file system.
bool addFileArchive(IFileArchive *archive) override;
//! move the hirarchy of the filesystem. moves sourceIndex relative up or down
bool moveFileArchive(u32 sourceIndex, s32 relative) override;
//! Adds an external archive loader to the engine.
void addArchiveLoader(IArchiveLoader *loader) override;
@ -70,21 +51,6 @@ public:
//! Gets the archive loader by index.
IArchiveLoader *getArchiveLoader(u32 index) const override;
//! gets the file archive count
u32 getFileArchiveCount() const override;
//! gets an archive
IFileArchive *getFileArchive(u32 index) override;
//! removes an archive from the file system.
bool removeFileArchive(u32 index) override;
//! removes an archive from the file system.
bool removeFileArchive(const io::path &filename) override;
//! Removes an archive from the file system.
bool removeFileArchive(const IFileArchive *archive) override;
//! Returns the string of the current working directory
const io::path &getWorkingDirectory() override;
@ -129,9 +95,7 @@ private:
//! WorkingDirectory for Native and Virtual filesystems
io::path WorkingDirectory[2];
//! currently attached ArchiveLoaders
core::array<IArchiveLoader *> ArchiveLoader;
//! currently attached Archives
core::array<IFileArchive *> FileArchives;
std::vector<IArchiveLoader *> ArchiveLoader;
};
} // end namespace irr

View file

@ -132,48 +132,30 @@ SMesh *CMeshManipulator::createMeshCopy(scene::IMesh *mesh) const
case video::EVT_STANDARD: {
SMeshBuffer *buffer = new SMeshBuffer();
buffer->Material = mb->getMaterial();
const u32 vcount = mb->getVertexCount();
buffer->Vertices.reallocate(vcount);
video::S3DVertex *vertices = (video::S3DVertex *)mb->getVertices();
for (u32 i = 0; i < vcount; ++i)
buffer->Vertices.push_back(vertices[i]);
const u32 icount = mb->getIndexCount();
buffer->Indices.reallocate(icount);
const u16 *indices = mb->getIndices();
for (u32 i = 0; i < icount; ++i)
buffer->Indices.push_back(indices[i]);
auto *vt = static_cast<const video::S3DVertex*>(mb->getVertices());
buffer->Vertices.insert(buffer->Vertices.end(), vt, vt + mb->getVertexCount());
auto *indices = mb->getIndices();
buffer->Indices.insert(buffer->Indices.end(), indices, indices + mb->getIndexCount());
clone->addMeshBuffer(buffer);
buffer->drop();
} break;
case video::EVT_2TCOORDS: {
SMeshBufferLightMap *buffer = new SMeshBufferLightMap();
buffer->Material = mb->getMaterial();
const u32 vcount = mb->getVertexCount();
buffer->Vertices.reallocate(vcount);
video::S3DVertex2TCoords *vertices = (video::S3DVertex2TCoords *)mb->getVertices();
for (u32 i = 0; i < vcount; ++i)
buffer->Vertices.push_back(vertices[i]);
const u32 icount = mb->getIndexCount();
buffer->Indices.reallocate(icount);
const u16 *indices = mb->getIndices();
for (u32 i = 0; i < icount; ++i)
buffer->Indices.push_back(indices[i]);
auto *vt = static_cast<const video::S3DVertex2TCoords*>(mb->getVertices());
buffer->Vertices.insert(buffer->Vertices.end(), vt, vt + mb->getVertexCount());
auto *indices = mb->getIndices();
buffer->Indices.insert(buffer->Indices.end(), indices, indices + mb->getIndexCount());
clone->addMeshBuffer(buffer);
buffer->drop();
} break;
case video::EVT_TANGENTS: {
SMeshBufferTangents *buffer = new SMeshBufferTangents();
buffer->Material = mb->getMaterial();
const u32 vcount = mb->getVertexCount();
buffer->Vertices.reallocate(vcount);
video::S3DVertexTangents *vertices = (video::S3DVertexTangents *)mb->getVertices();
for (u32 i = 0; i < vcount; ++i)
buffer->Vertices.push_back(vertices[i]);
const u32 icount = mb->getIndexCount();
buffer->Indices.reallocate(icount);
const u16 *indices = mb->getIndices();
for (u32 i = 0; i < icount; ++i)
buffer->Indices.push_back(indices[i]);
auto *vt = static_cast<const video::S3DVertexTangents*>(mb->getVertices());
buffer->Vertices.insert(buffer->Vertices.end(), vt, vt + mb->getVertexCount());
auto *indices = mb->getIndices();
buffer->Indices.insert(buffer->Indices.end(), indices, indices + mb->getIndexCount());
clone->addMeshBuffer(buffer);
buffer->drop();
} break;

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;

View file

@ -494,19 +494,6 @@ public:
//! looks if the image is already loaded
video::ITexture *findTexture(const io::path &filename) override;
//! 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 setClipPlane(u32 index, const core::plane3df &plane, bool enable = false) override;
//! Enable/disable 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 enable: If true, enable the clipping plane else disable it.
void enableClipPlane(u32 index, bool enable) override;
//! Returns the graphics card vendor name.
core::stringc getVendorInfo() override { return "Not available on this driver."; }
@ -565,14 +552,14 @@ protected:
virtual ITexture *createDeviceDependentTexture(const io::path &name, IImage *image);
virtual ITexture *createDeviceDependentTextureCubemap(const io::path &name, const core::array<IImage *> &image);
virtual ITexture *createDeviceDependentTextureCubemap(const io::path &name, const std::vector<IImage*> &image);
//! checks triangle count and print warning if wrong
bool checkPrimitiveCount(u32 prmcnt) const;
bool checkImage(IImage *image) const;
bool checkImage(const core::array<IImage *> &image) const;
bool checkImage(const std::vector<IImage*> &image) const;
// adds a material renderer and drops it afterwards. To be used for internal creation
s32 addAndDropMaterialRenderer(IMaterialRenderer *m);

View file

@ -103,14 +103,6 @@ bool COGLES1Driver::genericDriverInit(const core::dimension2d<u32> &screenSize,
glPixelStorei(GL_PACK_ALIGNMENT, 1);
UserClipPlane.reallocate(MaxUserClipPlanes);
UserClipPlaneEnabled.resize(MaxUserClipPlanes);
for (s32 i = 0; i < MaxUserClipPlanes; ++i) {
UserClipPlane.push_back(core::plane3df());
UserClipPlaneEnabled[i] = false;
}
for (s32 i = 0; i < ETS_COUNT; ++i)
setTransform(static_cast<E_TRANSFORMATION_STATE>(i), core::IdentityMatrix);
@ -195,10 +187,6 @@ void COGLES1Driver::setTransform(E_TRANSFORMATION_STATE state, const core::matri
// OGLES1 only has a model matrix, view and world is not existent. so lets fake these two.
glMatrixMode(GL_MODELVIEW);
glLoadMatrixf((Matrices[ETS_VIEW] * Matrices[ETS_WORLD]).pointer());
// we have to update the clip planes to the latest view matrix
for (u32 i = 0; i < MaxUserClipPlanes; ++i)
if (UserClipPlaneEnabled[i])
uploadClipPlane(i);
} break;
case ETS_PROJECTION: {
GLfloat glmat[16];
@ -1149,15 +1137,14 @@ inline void COGLES1Driver::getGLTextureMatrix(GLfloat *o, const core::matrix4 &m
ITexture *COGLES1Driver::createDeviceDependentTexture(const io::path &name, IImage *image)
{
core::array<IImage *> imageArray(1);
imageArray.push_back(image);
std::vector<IImage*> tmp { image };
COGLES1Texture *texture = new COGLES1Texture(name, imageArray, ETT_2D, this);
COGLES1Texture *texture = new COGLES1Texture(name, tmp, ETT_2D, this);
return texture;
}
ITexture *COGLES1Driver::createDeviceDependentTextureCubemap(const io::path &name, const core::array<IImage *> &image)
ITexture *COGLES1Driver::createDeviceDependentTextureCubemap(const io::path &name, const std::vector<IImage *> &image)
{
COGLES1Texture *texture = new COGLES1Texture(name, image, ETT_CUBEMAP, this);
@ -2158,44 +2145,6 @@ void COGLES1Driver::removeTexture(ITexture *texture)
CNullDriver::removeTexture(texture);
}
//! Set/unset a clipping plane.
bool COGLES1Driver::setClipPlane(u32 index, const core::plane3df &plane, bool enable)
{
if (index >= MaxUserClipPlanes)
return false;
UserClipPlane[index] = plane;
enableClipPlane(index, enable);
return true;
}
void COGLES1Driver::uploadClipPlane(u32 index)
{
// opengl needs an array of doubles for the plane equation
float clip_plane[4];
clip_plane[0] = UserClipPlane[index].Normal.X;
clip_plane[1] = UserClipPlane[index].Normal.Y;
clip_plane[2] = UserClipPlane[index].Normal.Z;
clip_plane[3] = UserClipPlane[index].D;
glClipPlanef(GL_CLIP_PLANE0 + index, clip_plane);
}
//! Enable/disable a clipping plane.
void COGLES1Driver::enableClipPlane(u32 index, bool enable)
{
if (index >= MaxUserClipPlanes)
return;
if (enable) {
if (!UserClipPlaneEnabled[index]) {
uploadClipPlane(index);
glEnable(GL_CLIP_PLANE0 + index);
}
} else
glDisable(GL_CLIP_PLANE0 + index);
UserClipPlaneEnabled[index] = enable;
}
core::dimension2du COGLES1Driver::getMaxTextureSize() const
{
return core::dimension2du(MaxTextureSize, MaxTextureSize);

View file

@ -215,12 +215,6 @@ public:
//! checks if an OpenGL error has happened and prints it (+ some internal code which is usually the line number)
bool testGLError(int code = 0);
//! Set/unset a clipping plane.
bool setClipPlane(u32 index, const core::plane3df &plane, bool enable = false) override;
//! Enable/disable a clipping plane.
void enableClipPlane(u32 index, bool enable) override;
//! Returns the graphics card vendor name.
core::stringc getVendorInfo() override
{
@ -250,14 +244,12 @@ public:
COGLES1CacheHandler *getCacheHandler() const;
private:
void uploadClipPlane(u32 index);
//! inits the opengl-es driver
bool genericDriverInit(const core::dimension2d<u32> &screenSize, bool stencilBuffer);
ITexture *createDeviceDependentTexture(const io::path &name, IImage *image) override;
ITexture *createDeviceDependentTextureCubemap(const io::path &name, const core::array<IImage *> &image) override;
ITexture *createDeviceDependentTextureCubemap(const io::path &name, const std::vector<IImage*> &image) override;
//! creates a transposed matrix in supplied GLfloat array to pass to OGLES1
inline void getGLMatrix(GLfloat gl_matrix[16], const core::matrix4 &m);
@ -306,8 +298,6 @@ private:
u8 AntiAlias;
SMaterial Material, LastMaterial;
core::array<core::plane3df> UserClipPlane;
std::vector<bool> UserClipPlaneEnabled;
core::stringc VendorName;

View file

@ -25,7 +25,7 @@ namespace video
COGLES1ExtensionHandler::COGLES1ExtensionHandler() :
COGLESCoreExtensionHandler(),
MaxUserClipPlanes(0), MaxLights(0), pGlBlendEquationOES(0), pGlBlendFuncSeparateOES(0),
MaxLights(0), pGlBlendEquationOES(0), pGlBlendFuncSeparateOES(0),
pGlBindFramebufferOES(0), pGlDeleteFramebuffersOES(0),
pGlGenFramebuffersOES(0), pGlCheckFramebufferStatusOES(0),
pGlFramebufferTexture2DOES(0), pGlGenerateMipmapOES(0)
@ -45,11 +45,6 @@ void COGLES1ExtensionHandler::initExtensions()
GLint val = 0;
if (Version > 100 || FeatureAvailable[IRR_GL_IMG_user_clip_plane]) {
glGetIntegerv(GL_MAX_CLIP_PLANES, &val);
MaxUserClipPlanes = static_cast<u8>(val);
}
glGetIntegerv(GL_MAX_LIGHTS, &val);
MaxLights = static_cast<u8>(val);

View file

@ -171,7 +171,6 @@ public:
}
protected:
u8 MaxUserClipPlanes;
u8 MaxLights;
PFNGLBLENDEQUATIONOESPROC pGlBlendEquationOES;

View file

@ -4,7 +4,7 @@
#pragma once
#include "irrArray.h"
#include <vector>
#include "SMaterialLayer.h"
#include "ITexture.h"
#include "EDriverFeatures.h"
@ -43,19 +43,19 @@ public:
bool IsCached;
};
COpenGLCoreTexture(const io::path &name, const core::array<IImage *> &images, E_TEXTURE_TYPE type, TOpenGLDriver *driver) :
COpenGLCoreTexture(const io::path &name, const std::vector<IImage *> &srcImages, E_TEXTURE_TYPE type, TOpenGLDriver *driver) :
ITexture(name, type), Driver(driver), TextureType(GL_TEXTURE_2D),
TextureName(0), InternalFormat(GL_RGBA), PixelFormat(GL_RGBA), PixelType(GL_UNSIGNED_BYTE), Converter(0), LockReadOnly(false), LockImage(0), LockLayer(0),
KeepImage(false), MipLevelStored(0), LegacyAutoGenerateMipMaps(false)
{
_IRR_DEBUG_BREAK_IF(images.size() == 0)
_IRR_DEBUG_BREAK_IF(srcImages.empty())
DriverType = Driver->getDriverType();
TextureType = TextureTypeIrrToGL(Type);
HasMipMaps = Driver->getTextureCreationFlag(ETCF_CREATE_MIP_MAPS);
KeepImage = Driver->getTextureCreationFlag(ETCF_ALLOW_MEMORY_COPY);
getImageValues(images[0]);
getImageValues(srcImages[0]);
if (!InternalFormat)
return;
@ -71,22 +71,22 @@ public:
os::Printer::log(lbuf, ELL_DEBUG);
#endif
const core::array<IImage *> *tmpImages = &images;
const auto *tmpImages = &srcImages;
if (KeepImage || OriginalSize != Size || OriginalColorFormat != ColorFormat) {
Images.set_used(images.size());
Images.resize(srcImages.size());
for (u32 i = 0; i < images.size(); ++i) {
for (size_t i = 0; i < srcImages.size(); ++i) {
Images[i] = Driver->createImage(ColorFormat, Size);
if (images[i]->getDimension() == Size)
images[i]->copyTo(Images[i]);
if (srcImages[i]->getDimension() == Size)
srcImages[i]->copyTo(Images[i]);
else
images[i]->copyToScaling(Images[i]);
srcImages[i]->copyToScaling(Images[i]);
if (images[i]->getMipMapsData()) {
if (srcImages[i]->getMipMapsData()) {
if (OriginalSize == Size && OriginalColorFormat == ColorFormat) {
Images[i]->setMipMapsData(images[i]->getMipMapsData(), false);
Images[i]->setMipMapsData(srcImages[i]->getMipMapsData(), false);
} else {
// TODO: handle at least mipmap with changing color format
os::Printer::log("COpenGLCoreTexture: Can't handle format changes for mipmap data. Mipmap data dropped", ELL_WARNING);
@ -118,19 +118,19 @@ public:
TEST_GL_ERROR(Driver);
for (u32 i = 0; i < (*tmpImages).size(); ++i)
for (size_t i = 0; i < tmpImages->size(); ++i)
uploadTexture(true, i, 0, (*tmpImages)[i]->getData());
if (HasMipMaps && !LegacyAutoGenerateMipMaps) {
// Create mipmaps (either from image mipmaps or generate them)
for (u32 i = 0; i < (*tmpImages).size(); ++i) {
for (size_t i = 0; i < tmpImages->size(); ++i) {
void *mipmapsData = (*tmpImages)[i]->getMipMapsData();
regenerateMipMapLevels(mipmapsData, i);
}
}
if (!KeepImage) {
for (u32 i = 0; i < Images.size(); ++i)
for (size_t i = 0; i < Images.size(); ++i)
Images[i]->drop();
Images.clear();
@ -227,8 +227,8 @@ public:
if (LockImage)
LockImage->drop();
for (u32 i = 0; i < Images.size(); ++i)
Images[i]->drop();
for (auto *image : Images)
image->drop();
}
void *lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel = 0, u32 layer = 0, E_TEXTURE_LOCK_FLAGS lockFlags = ETLF_FLIP_Y_UP_RTT) override
@ -621,7 +621,7 @@ protected:
u32 LockLayer;
bool KeepImage;
core::array<IImage *> Images;
std::vector<IImage*> Images;
u8 MipLevelStored;
bool LegacyAutoGenerateMipMaps;

View file

@ -122,7 +122,6 @@ bool COpenGLDriver::genericDriverInit()
DriverAttributes->setAttribute("MaxSupportedTextures", (s32)Feature.MaxTextureUnits);
DriverAttributes->setAttribute("MaxLights", MaxLights);
DriverAttributes->setAttribute("MaxAnisotropy", MaxAnisotropy);
DriverAttributes->setAttribute("MaxUserClipPlanes", MaxUserClipPlanes);
DriverAttributes->setAttribute("MaxAuxBuffers", MaxAuxBuffers);
DriverAttributes->setAttribute("MaxMultipleRenderTargets", (s32)Feature.MultipleRenderTarget);
DriverAttributes->setAttribute("MaxIndices", (s32)MaxIndices);
@ -135,10 +134,6 @@ bool COpenGLDriver::genericDriverInit()
glPixelStorei(GL_PACK_ALIGNMENT, 1);
UserClipPlanes.reallocate(MaxUserClipPlanes);
for (i = 0; i < MaxUserClipPlanes; ++i)
UserClipPlanes.push_back(SUserClipPlane());
for (i = 0; i < ETS_COUNT; ++i)
setTransform(static_cast<E_TRANSFORMATION_STATE>(i), core::IdentityMatrix);
@ -244,11 +239,6 @@ void COpenGLDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matri
// first load the viewing transformation for user clip planes
glLoadMatrixf((Matrices[ETS_VIEW]).pointer());
// we have to update the clip planes to the latest view matrix
for (u32 i = 0; i < MaxUserClipPlanes; ++i)
if (UserClipPlanes[i].Enabled)
uploadClipPlane(i);
// now the real model-view matrix
glMultMatrixf(Matrices[ETS_WORLD].pointer());
} break;
@ -1597,15 +1587,14 @@ inline void COpenGLDriver::getGLTextureMatrix(GLfloat *o, const core::matrix4 &m
ITexture *COpenGLDriver::createDeviceDependentTexture(const io::path &name, IImage *image)
{
core::array<IImage *> imageArray(1);
imageArray.push_back(image);
std::vector tmp { image };
COpenGLTexture *texture = new COpenGLTexture(name, imageArray, ETT_2D, this);
COpenGLTexture *texture = new COpenGLTexture(name, tmp, ETT_2D, this);
return texture;
}
ITexture *COpenGLDriver::createDeviceDependentTextureCubemap(const io::path &name, const core::array<IImage *> &image)
ITexture *COpenGLDriver::createDeviceDependentTextureCubemap(const io::path &name, const std::vector<IImage *> &image)
{
COpenGLTexture *texture = new COpenGLTexture(name, image, ETT_CUBEMAP, this);
@ -3062,44 +3051,6 @@ IImage *COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RE
return newImage;
}
//! Set/unset a clipping plane.
bool COpenGLDriver::setClipPlane(u32 index, const core::plane3df &plane, bool enable)
{
if (index >= MaxUserClipPlanes)
return false;
UserClipPlanes[index].Plane = plane;
enableClipPlane(index, enable);
return true;
}
void COpenGLDriver::uploadClipPlane(u32 index)
{
// opengl needs an array of doubles for the plane equation
GLdouble clip_plane[4];
clip_plane[0] = UserClipPlanes[index].Plane.Normal.X;
clip_plane[1] = UserClipPlanes[index].Plane.Normal.Y;
clip_plane[2] = UserClipPlanes[index].Plane.Normal.Z;
clip_plane[3] = UserClipPlanes[index].Plane.D;
glClipPlane(GL_CLIP_PLANE0 + index, clip_plane);
}
//! Enable/disable a clipping plane.
void COpenGLDriver::enableClipPlane(u32 index, bool enable)
{
if (index >= MaxUserClipPlanes)
return;
if (enable) {
if (!UserClipPlanes[index].Enabled) {
uploadClipPlane(index);
glEnable(GL_CLIP_PLANE0 + index);
}
} else
glDisable(GL_CLIP_PLANE0 + index);
UserClipPlanes[index].Enabled = enable;
}
core::dimension2du COpenGLDriver::getMaxTextureSize() const
{
return core::dimension2du(MaxTextureSize, MaxTextureSize);

View file

@ -285,19 +285,6 @@ public:
//! for performance reasons only available in debug mode
bool testGLError(int code = 0);
//! 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 setClipPlane(u32 index, const core::plane3df &plane, bool enable = false) override;
//! Enable/disable 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 enable: If true, enable the clipping plane else disable it.
void enableClipPlane(u32 index, bool enable) override;
//! Enable the 2d override material
void enableMaterial2D(bool enable = true) override;
@ -343,14 +330,12 @@ private:
bool updateVertexHardwareBuffer(SHWBufferLink_opengl *HWBuffer);
bool updateIndexHardwareBuffer(SHWBufferLink_opengl *HWBuffer);
void uploadClipPlane(u32 index);
//! inits the parts of the open gl driver used on all platforms
bool genericDriverInit();
ITexture *createDeviceDependentTexture(const io::path &name, IImage *image) override;
ITexture *createDeviceDependentTextureCubemap(const io::path &name, const core::array<IImage *> &image) override;
ITexture *createDeviceDependentTextureCubemap(const io::path &name, const std::vector<IImage *> &image) override;
//! creates a transposed matrix in supplied GLfloat array to pass to OpenGL
inline void getGLMatrix(GLfloat gl_matrix[16], const core::matrix4 &m);
@ -404,15 +389,6 @@ private:
SMaterial Material, LastMaterial;
struct SUserClipPlane
{
SUserClipPlane() :
Enabled(false) {}
core::plane3df Plane;
bool Enabled;
};
core::array<SUserClipPlane> UserClipPlanes;
core::stringc VendorName;
core::matrix4 TextureFlipMatrix;

View file

@ -20,7 +20,7 @@ bool COpenGLExtensionHandler::needsDSAFramebufferHack = true;
COpenGLExtensionHandler::COpenGLExtensionHandler() :
StencilBuffer(false), TextureCompressionExtension(false), MaxLights(1),
MaxAnisotropy(1), MaxUserClipPlanes(0), MaxAuxBuffers(0), MaxIndices(65535),
MaxAnisotropy(1), MaxAuxBuffers(0), MaxIndices(65535),
MaxTextureSize(1), MaxGeometryVerticesOut(0),
MaxTextureLODBias(0.f), Version(0), ShaderLanguageVersion(0),
OcclusionQuerySupport(false), IsAtiRadeonX(false), pGlActiveTexture(0), pGlActiveTextureARB(0), pGlClientActiveTextureARB(0),
@ -428,8 +428,6 @@ void COpenGLExtensionHandler::initExtensions(video::IContextManager *cmgr, bool
if (FeatureAvailable[IRR_EXT_texture_lod_bias])
glGetFloatv(GL_MAX_TEXTURE_LOD_BIAS_EXT, &MaxTextureLODBias);
#endif
glGetIntegerv(GL_MAX_CLIP_PLANES, &num);
MaxUserClipPlanes = static_cast<u8>(num);
glGetIntegerv(GL_AUX_BUFFERS, &num);
MaxAuxBuffers = static_cast<u8>(num);
#ifdef GL_ARB_draw_buffers

View file

@ -1019,8 +1019,6 @@ public:
u8 MaxLights;
//! Maximal Anisotropy
u8 MaxAnisotropy;
//! Number of user clipplanes
u8 MaxUserClipPlanes;
//! Number of auxiliary buffers
u8 MaxAuxBuffers;
//! Optimal number of indices per meshbuffer

View file

@ -2,6 +2,8 @@
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include <algorithm>
#include "CSceneManager.h"
#include "IVideoDriver.h"
#include "IFileSystem.h"
@ -95,9 +97,8 @@ CSceneManager::~CSceneManager()
if (CollisionManager)
CollisionManager->drop();
u32 i;
for (i = 0; i < MeshLoaderList.size(); ++i)
MeshLoaderList[i]->drop();
for (auto *loader : MeshLoaderList)
loader->drop();
if (ActiveCamera)
ActiveCamera->drop();
@ -140,12 +141,11 @@ IAnimatedMesh *CSceneManager::getUncachedMesh(io::IReadFile *file, const io::pat
IAnimatedMesh *msh = 0;
// iterate the list in reverse order so user-added loaders can override the built-in ones
s32 count = MeshLoaderList.size();
for (s32 i = count - 1; i >= 0; --i) {
if (MeshLoaderList[i]->isALoadableFileExtension(filename)) {
for (auto it = MeshLoaderList.rbegin(); it != MeshLoaderList.rend(); it++) {
if ((*it)->isALoadableFileExtension(filename)) {
// reset file to avoid side effects of previous calls to createMesh
file->seek(0);
msh = MeshLoaderList[i]->createMesh(file);
msh = (*it)->createMesh(file);
if (msh) {
MeshCache->addMesh(cachename, msh);
msh->drop();
@ -388,14 +388,8 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode *node, E_SCENE_NODE_RENDE
switch (pass) {
// take camera if it is not already registered
case ESNRP_CAMERA: {
taken = 1;
for (u32 i = 0; i != CameraList.size(); ++i) {
if (CameraList[i] == node) {
taken = 0;
break;
}
}
if (taken) {
if (std::find(CameraList.begin(), CameraList.end(), node) == CameraList.end()) {
taken = 1;
CameraList.push_back(node);
}
} break;
@ -405,19 +399,19 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode *node, E_SCENE_NODE_RENDE
break;
case ESNRP_SOLID:
if (!isCulled(node)) {
SolidNodeList.push_back(node);
SolidNodeList.emplace_back(node);
taken = 1;
}
break;
case ESNRP_TRANSPARENT:
if (!isCulled(node)) {
TransparentNodeList.push_back(TransparentNodeEntry(node, camWorldPos));
TransparentNodeList.emplace_back(node, camWorldPos);
taken = 1;
}
break;
case ESNRP_TRANSPARENT_EFFECT:
if (!isCulled(node)) {
TransparentEffectNodeList.push_back(TransparentNodeEntry(node, camWorldPos));
TransparentEffectNodeList.emplace_back(node, camWorldPos);
taken = 1;
}
break;
@ -429,8 +423,7 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode *node, E_SCENE_NODE_RENDE
for (u32 i = 0; i < count; ++i) {
if (Driver->needsTransparentRenderPass(node->getMaterial(i))) {
// register as transparent node
TransparentNodeEntry e(node, camWorldPos);
TransparentNodeList.push_back(e);
TransparentNodeList.emplace_back(node, camWorldPos);
taken = 1;
break;
}
@ -438,7 +431,7 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode *node, E_SCENE_NODE_RENDE
// not transparent, register as solid
if (!taken) {
SolidNodeList.push_back(node);
SolidNodeList.emplace_back(node);
taken = 1;
}
}
@ -509,10 +502,10 @@ void CSceneManager::drawAll()
CurrentRenderPass = ESNRP_CAMERA;
Driver->getOverrideMaterial().Enabled = ((Driver->getOverrideMaterial().EnablePasses & CurrentRenderPass) != 0);
for (i = 0; i < CameraList.size(); ++i)
CameraList[i]->render();
for (auto *node : CameraList)
node->render();
CameraList.set_used(0);
CameraList.clear();
}
// render skyboxes
@ -520,10 +513,10 @@ void CSceneManager::drawAll()
CurrentRenderPass = ESNRP_SKY_BOX;
Driver->getOverrideMaterial().Enabled = ((Driver->getOverrideMaterial().EnablePasses & CurrentRenderPass) != 0);
for (i = 0; i < SkyBoxList.size(); ++i)
SkyBoxList[i]->render();
for (auto *node : SkyBoxList)
node->render();
SkyBoxList.set_used(0);
SkyBoxList.clear();
}
// render default objects
@ -531,12 +524,12 @@ void CSceneManager::drawAll()
CurrentRenderPass = ESNRP_SOLID;
Driver->getOverrideMaterial().Enabled = ((Driver->getOverrideMaterial().EnablePasses & CurrentRenderPass) != 0);
SolidNodeList.sort(); // sort by textures
std::sort(SolidNodeList.begin(), SolidNodeList.end());
for (i = 0; i < SolidNodeList.size(); ++i)
SolidNodeList[i].Node->render();
for (auto &it : SolidNodeList)
it.Node->render();
SolidNodeList.set_used(0);
SolidNodeList.clear();
}
// render transparent objects.
@ -544,11 +537,12 @@ void CSceneManager::drawAll()
CurrentRenderPass = ESNRP_TRANSPARENT;
Driver->getOverrideMaterial().Enabled = ((Driver->getOverrideMaterial().EnablePasses & CurrentRenderPass) != 0);
TransparentNodeList.sort(); // sort by distance from camera
for (i = 0; i < TransparentNodeList.size(); ++i)
TransparentNodeList[i].Node->render();
std::sort(TransparentNodeList.begin(), TransparentNodeList.end());
TransparentNodeList.set_used(0);
for (auto &it : TransparentNodeList)
it.Node->render();
TransparentNodeList.clear();
}
// render transparent effect objects.
@ -556,12 +550,12 @@ void CSceneManager::drawAll()
CurrentRenderPass = ESNRP_TRANSPARENT_EFFECT;
Driver->getOverrideMaterial().Enabled = ((Driver->getOverrideMaterial().EnablePasses & CurrentRenderPass) != 0);
TransparentEffectNodeList.sort(); // sort by distance from camera
std::sort(TransparentEffectNodeList.begin(), TransparentEffectNodeList.end());
for (i = 0; i < TransparentEffectNodeList.size(); ++i)
TransparentEffectNodeList[i].Node->render();
for (auto &it : TransparentEffectNodeList)
it.Node->render();
TransparentEffectNodeList.set_used(0);
TransparentEffectNodeList.clear();
}
// render custom gui nodes
@ -569,10 +563,10 @@ void CSceneManager::drawAll()
CurrentRenderPass = ESNRP_GUI;
Driver->getOverrideMaterial().Enabled = ((Driver->getOverrideMaterial().EnablePasses & CurrentRenderPass) != 0);
for (i = 0; i < GuiNodeList.size(); ++i)
GuiNodeList[i]->render();
for (auto *node : GuiNodeList)
node->render();
GuiNodeList.set_used(0);
GuiNodeList.clear();
}
clearDeletionList();
@ -592,7 +586,7 @@ void CSceneManager::addExternalMeshLoader(IMeshLoader *externalLoader)
//! Returns the number of mesh loaders supported by Irrlicht at this time
u32 CSceneManager::getMeshLoaderCount() const
{
return MeshLoaderList.size();
return static_cast<u32>(MeshLoaderList.size());
}
//! Retrieve the given mesh loader
@ -629,12 +623,9 @@ void CSceneManager::addToDeletionQueue(ISceneNode *node)
//! clears the deletion list
void CSceneManager::clearDeletionList()
{
if (DeletionList.empty())
return;
for (u32 i = 0; i < DeletionList.size(); ++i) {
DeletionList[i]->remove();
DeletionList[i]->drop();
for (auto *node : DeletionList) {
node->remove();
node->drop();
}
DeletionList.clear();

View file

@ -277,15 +277,15 @@ private:
ISceneCollisionManager *CollisionManager;
//! render pass lists
core::array<ISceneNode *> CameraList;
core::array<ISceneNode *> SkyBoxList;
core::array<DefaultNodeEntry> SolidNodeList;
core::array<TransparentNodeEntry> TransparentNodeList;
core::array<TransparentNodeEntry> TransparentEffectNodeList;
core::array<ISceneNode *> GuiNodeList;
std::vector<ISceneNode *> CameraList;
std::vector<ISceneNode *> SkyBoxList;
std::vector<DefaultNodeEntry> SolidNodeList;
std::vector<TransparentNodeEntry> TransparentNodeList;
std::vector<TransparentNodeEntry> TransparentEffectNodeList;
std::vector<ISceneNode *> GuiNodeList;
core::array<IMeshLoader *> MeshLoaderList;
core::array<ISceneNode *> DeletionList;
std::vector<IMeshLoader *> MeshLoaderList;
std::vector<ISceneNode *> DeletionList;
//! current active camera
ICameraSceneNode *ActiveCamera;

View file

@ -273,12 +273,12 @@ bool CXMeshFileLoader::load(io::IReadFile *file)
}
if (mesh->TCoords2.size()) {
for (i = 0; i != mesh->Buffers.size(); ++i) {
mesh->Buffers[i]->Vertices_2TCoords.reallocate(vCountArray[i]);
mesh->Buffers[i]->Vertices_2TCoords.reserve(vCountArray[i]);
mesh->Buffers[i]->VertexType = video::EVT_2TCOORDS;
}
} else {
for (i = 0; i != mesh->Buffers.size(); ++i)
mesh->Buffers[i]->Vertices_Standard.reallocate(vCountArray[i]);
mesh->Buffers[i]->Vertices_Standard.reserve(vCountArray[i]);
}
verticesLinkIndex.set_used(mesh->Vertices.size());
@ -291,10 +291,10 @@ bool CXMeshFileLoader::load(io::IReadFile *file)
if (mesh->TCoords2.size()) {
verticesLinkIndex[i] = buffer->Vertices_2TCoords.size();
buffer->Vertices_2TCoords.push_back(mesh->Vertices[i]);
buffer->Vertices_2TCoords.emplace_back(mesh->Vertices[i]);
// We have a problem with correct tcoord2 handling here
// crash fixed for now by checking the values
buffer->Vertices_2TCoords.getLast().TCoords2 = (i < mesh->TCoords2.size()) ? mesh->TCoords2[i] : mesh->Vertices[i].TCoords;
buffer->Vertices_2TCoords.back().TCoords2 = (i < mesh->TCoords2.size()) ? mesh->TCoords2[i] : mesh->Vertices[i].TCoords;
} else {
verticesLinkIndex[i] = buffer->Vertices_Standard.size();
buffer->Vertices_Standard.push_back(mesh->Vertices[i]);
@ -306,7 +306,7 @@ bool CXMeshFileLoader::load(io::IReadFile *file)
for (i = 0; i < mesh->FaceMaterialIndices.size(); ++i)
++vCountArray[mesh->FaceMaterialIndices[i]];
for (i = 0; i != mesh->Buffers.size(); ++i)
mesh->Buffers[i]->Indices.reallocate(vCountArray[i]);
mesh->Buffers[i]->Indices.reserve(vCountArray[i]);
delete[] vCountArray;
// create indices per buffer
for (i = 0; i < mesh->FaceMaterialIndices.size(); ++i) {

View file

@ -325,7 +325,7 @@ bool CZipReader::scanZipHeader(bool ignoreGPBits)
dirEnd.Offset = os::Byteswap::byteswap(dirEnd.Offset);
dirEnd.CommentLength = os::Byteswap::byteswap(dirEnd.CommentLength);
#endif
FileInfo.reallocate(dirEnd.TotalEntries);
FileInfo.reserve(dirEnd.TotalEntries);
File->seek(dirEnd.Offset);
while (scanCentralDirectoryHeader()) {
}
@ -381,9 +381,10 @@ bool CZipReader::scanCentralDirectoryHeader()
File->seek(entry.RelativeOffsetOfLocalHeader);
scanZipHeader(true);
File->seek(pos + entry.FilenameLength + entry.ExtraFieldLength + entry.FileCommentLength);
FileInfo.getLast().header.DataDescriptor.CompressedSize = entry.CompressedSize;
FileInfo.getLast().header.DataDescriptor.UncompressedSize = entry.UncompressedSize;
FileInfo.getLast().header.DataDescriptor.CRC32 = entry.CRC32;
auto &lastInfo = FileInfo.back();
lastInfo.header.DataDescriptor.CompressedSize = entry.CompressedSize;
lastInfo.header.DataDescriptor.UncompressedSize = entry.UncompressedSize;
lastInfo.header.DataDescriptor.CRC32 = entry.CRC32;
Files.getLast().Size = entry.UncompressedSize;
return true;
}

View file

@ -4,8 +4,8 @@
#pragma once
#include <vector>
#include "IReadFile.h"
#include "irrArray.h"
#include "irrString.h"
#include "IFileSystem.h"
#include "CFileList.h"
@ -209,7 +209,7 @@ protected:
IReadFile *File;
// holds extended info about files
core::array<SZipFileEntry> FileInfo;
std::vector<SZipFileEntry> FileInfo;
bool IsGZip;
};

View file

@ -4,15 +4,8 @@
#pragma once
#include "IReferenceCounted.h"
#include "SColor.h"
#include "vector3d.h"
#include "vector2d.h"
#include "position2d.h"
#include "rect.h"
#include "dimension2d.h"
#include "irrTypes.h"
#include "irrString.h"
#include "irrArray.h"
#include "EAttributes.h"
namespace irr
@ -20,16 +13,7 @@ namespace irr
namespace io
{
// All derived attribute types implement at least getter/setter for their own type (like CBoolAttribute will have setBool/getBool).
// Simple types will also implement getStringW and setString, but don't expect it to work for all types.
// String serialization makes no sense for some attribute-types (like stringw arrays or pointers), but is still useful for many types.
// (Note: I do _not_ know yet why the default string serialization is asymmetric with char* in set and wchar_t* in get).
// Additionally many attribute types will implement conversion functions like CBoolAttribute has p.E. getInt/setInt().
// The reason for conversion functions is likely to make reading old formats easier which have changed in the meantime. For example
// an old xml can contain a bool attribute which is an int in a newer format. You can still call getInt() even thought the attribute has the wrong type.
// And please do _not_ confuse these attributes here with the ones used in the xml-reader (aka SAttribute which is just a key-value pair).
class IAttribute : public virtual IReferenceCounted
class IAttribute
{
public:
virtual ~IAttribute(){};

View file

@ -257,7 +257,6 @@ bool COpenGL3DriverBase::genericDriverInit(const core::dimension2d<u32> &screenS
DriverAttributes->setAttribute("MaxSupportedTextures", (s32)Feature.MaxTextureUnits);
// DriverAttributes->setAttribute("MaxLights", MaxLights);
DriverAttributes->setAttribute("MaxAnisotropy", MaxAnisotropy);
// DriverAttributes->setAttribute("MaxUserClipPlanes", MaxUserClipPlanes);
// DriverAttributes->setAttribute("MaxAuxBuffers", MaxAuxBuffers);
// DriverAttributes->setAttribute("MaxMultipleRenderTargets", MaxMultipleRenderTargets);
DriverAttributes->setAttribute("MaxIndices", (s32)MaxIndices);
@ -268,8 +267,6 @@ bool COpenGL3DriverBase::genericDriverInit(const core::dimension2d<u32> &screenS
GL.PixelStorei(GL_PACK_ALIGNMENT, 1);
UserClipPlane.reallocate(0);
for (s32 i = 0; i < ETS_COUNT; ++i)
setTransform(static_cast<E_TRANSFORMATION_STATE>(i), core::IdentityMatrix);
@ -916,7 +913,8 @@ void COpenGL3DriverBase::draw2DImageBatch(const video::ITexture *texture,
const irr::u32 drawCount = core::min_<u32>(positions.size(), sourceRects.size());
assert(6 * drawCount <= QuadIndexCount); // FIXME split the batch? or let it crash?
core::array<S3DVertex> vtx(drawCount * 4);
std::vector<S3DVertex> vtx;
vtx.reserve(drawCount * 4);
for (u32 i = 0; i < drawCount; i++) {
core::position2d<s32> targetPos = positions[i];
@ -939,22 +937,22 @@ void COpenGL3DriverBase::draw2DImageBatch(const video::ITexture *texture,
f32 down = 2.f - (f32)poss.LowerRightCorner.Y / (f32)renderTargetSize.Height * 2.f - 1.f;
f32 top = 2.f - (f32)poss.UpperLeftCorner.Y / (f32)renderTargetSize.Height * 2.f - 1.f;
vtx.push_back(S3DVertex(left, top, 0.0f,
vtx.emplace_back(left, top, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y));
vtx.push_back(S3DVertex(right, top, 0.0f,
tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
vtx.emplace_back(right, top, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y));
vtx.push_back(S3DVertex(right, down, 0.0f,
tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
vtx.emplace_back(right, down, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y));
vtx.push_back(S3DVertex(left, down, 0.0f,
tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
vtx.emplace_back(left, down, 0.0f,
0.0f, 0.0f, 0.0f, color,
tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y));
tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
}
GL.BindBuffer(GL_ELEMENT_ARRAY_BUFFER, QuadIndexBuffer);
drawElements(GL_TRIANGLES, vt2DImage, vtx.const_pointer(), vtx.size(), 0, 6 * drawCount);
drawElements(GL_TRIANGLES, vt2DImage, vtx.data(), vtx.size(), 0, 6 * drawCount);
GL.BindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
if (clipRect)
@ -1104,15 +1102,14 @@ void COpenGL3DriverBase::endDraw(const VertexType &vertexType)
ITexture *COpenGL3DriverBase::createDeviceDependentTexture(const io::path &name, IImage *image)
{
core::array<IImage *> imageArray(1);
imageArray.push_back(image);
std::vector<IImage*> tmp { image };
COpenGL3Texture *texture = new COpenGL3Texture(name, imageArray, ETT_2D, this);
COpenGL3Texture *texture = new COpenGL3Texture(name, tmp, ETT_2D, this);
return texture;
}
ITexture *COpenGL3DriverBase::createDeviceDependentTextureCubemap(const io::path &name, const core::array<IImage *> &image)
ITexture *COpenGL3DriverBase::createDeviceDependentTextureCubemap(const io::path &name, const std::vector<IImage*> &image)
{
COpenGL3Texture *texture = new COpenGL3Texture(name, image, ETT_CUBEMAP, this);
@ -1876,40 +1873,6 @@ void COpenGL3DriverBase::removeTexture(ITexture *texture)
CNullDriver::removeTexture(texture);
}
//! Set/unset a clipping plane.
bool COpenGL3DriverBase::setClipPlane(u32 index, const core::plane3df &plane, bool enable)
{
if (index >= UserClipPlane.size())
UserClipPlane.push_back(SUserClipPlane());
UserClipPlane[index].Plane = plane;
UserClipPlane[index].Enabled = enable;
return true;
}
//! Enable/disable a clipping plane.
void COpenGL3DriverBase::enableClipPlane(u32 index, bool enable)
{
UserClipPlane[index].Enabled = enable;
}
//! Get the ClipPlane Count
u32 COpenGL3DriverBase::getClipPlaneCount() const
{
return UserClipPlane.size();
}
const core::plane3df &COpenGL3DriverBase::getClipPlane(irr::u32 index) const
{
if (index < UserClipPlane.size())
return UserClipPlane[index].Plane;
else {
_IRR_DEBUG_BREAK_IF(true) // invalid index
static const core::plane3df dummy;
return dummy;
}
}
core::dimension2du COpenGL3DriverBase::getMaxTextureSize() const
{
return core::dimension2du(MaxTextureSize, MaxTextureSize);

View file

@ -7,7 +7,6 @@
#pragma once
#include "SIrrCreationParameters.h"
#include "Common.h"
#include "CNullDriver.h"
#include "IMaterialRendererServices.h"
@ -227,18 +226,6 @@ public:
// Does *nothing* unless in debug mode.
bool testGLError(const char *file, int line);
//! Set/unset a clipping plane.
bool setClipPlane(u32 index, const core::plane3df &plane, bool enable = false) override;
//! returns the current amount of user clip planes set.
u32 getClipPlaneCount() const;
//! returns the 0 indexed Plane
const core::plane3df &getClipPlane(u32 index) const;
//! Enable/disable a clipping plane.
void enableClipPlane(u32 index, bool enable) override;
//! Returns the graphics card vendor name.
core::stringc getVendorInfo() override
{
@ -278,7 +265,7 @@ protected:
ITexture *createDeviceDependentTexture(const io::path &name, IImage *image) override;
ITexture *createDeviceDependentTextureCubemap(const io::path &name, const core::array<IImage *> &image) override;
ITexture *createDeviceDependentTextureCubemap(const io::path &name, const std::vector<IImage*> &image) override;
//! Map Irrlicht wrap mode to OpenGL enum
GLint getTextureWrapMode(u8 clamp) const;
@ -337,14 +324,6 @@ protected:
bool LockRenderStateMode;
u8 AntiAlias;
struct SUserClipPlane
{
core::plane3df Plane;
bool Enabled;
};
core::array<SUserClipPlane> UserClipPlane;
core::matrix4 TextureFlipMatrix;
using FColorConverter = void (*)(const void *source, s32 count, void *dest);

View file

@ -262,35 +262,30 @@ bool COpenGL3MaterialRenderer::linkProgram()
// seems that some implementations use an extra null terminator.
++maxlen;
c8 *buf = new c8[maxlen];
std::vector<c8> buf(maxlen);
UniformInfo.clear();
UniformInfo.reallocate(num);
UniformInfo.reserve(num);
for (GLint i = 0; i < num; ++i) {
SUniformInfo ui;
memset(buf, 0, maxlen);
memset(buf.data(), 0, buf.size());
GLint size;
GL.GetActiveUniform(Program, i, maxlen, 0, &size, &ui.type, reinterpret_cast<GLchar *>(buf));
core::stringc name = "";
GL.GetActiveUniform(Program, i, maxlen, 0, &size, &ui.type, reinterpret_cast<GLchar *>(buf.data()));
// array support, workaround for some bugged drivers.
for (s32 i = 0; i < maxlen; ++i) {
if (buf[i] == '[' || buf[i] == '\0')
break;
name += buf[i];
ui.name += buf[i];
}
ui.name = name;
ui.location = GL.GetUniformLocation(Program, buf);
ui.location = GL.GetUniformLocation(Program, buf.data());
UniformInfo.push_back(ui);
UniformInfo.push_back(std::move(ui));
}
delete[] buf;
}
return true;

View file

@ -4,12 +4,12 @@
#pragma once
#include <string>
#include <vector>
#include "EMaterialTypes.h"
#include "IMaterialRenderer.h"
#include "IMaterialRendererServices.h"
#include "IGPUProgrammingServices.h"
#include "irrArray.h"
#include "irrString.h"
#include "Common.h"
@ -79,13 +79,13 @@ protected:
struct SUniformInfo
{
core::stringc name;
std::string name;
GLenum type;
GLint location;
};
GLuint Program;
core::array<SUniformInfo> UniformInfo;
std::vector<SUniformInfo> UniformInfo;
s32 UserData;
};