Make irrArray backed by std::vector (#101)

This commit is contained in:
paradust7
2022-05-21 14:56:36 -07:00
committed by GitHub
parent 593103a261
commit 3e81f38098
10 changed files with 147 additions and 426 deletions

View File

@ -70,9 +70,9 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file)
const u32 WORD_BUFFER_LENGTH = 512;
core::array<core::vector3df, core::irrAllocatorFast<core::vector3df> > vertexBuffer(1000);
core::array<core::vector3df, core::irrAllocatorFast<core::vector3df> > normalsBuffer(1000);
core::array<core::vector2df, core::irrAllocatorFast<core::vector2df> > textureCoordBuffer(1000);
core::array<core::vector3df> vertexBuffer(1000);
core::array<core::vector3df> normalsBuffer(1000);
core::array<core::vector2df> textureCoordBuffer(1000);
SObjMtl * currMtl = new SObjMtl();
Materials.push_back(currMtl);

View File

@ -112,12 +112,12 @@ bool COGLES1Driver::genericDriverInit(const core::dimension2d<u32>& screenSize,
glPixelStorei(GL_PACK_ALIGNMENT, 1);
UserClipPlane.reallocate(MaxUserClipPlanes);
UserClipPlaneEnabled.reallocate(MaxUserClipPlanes);
UserClipPlaneEnabled.resize(MaxUserClipPlanes);
for (s32 i = 0; i < MaxUserClipPlanes; ++i)
{
UserClipPlane.push_back(core::plane3df());
UserClipPlaneEnabled.push_back(false);
UserClipPlaneEnabled[i] = false;
}
for (s32 i = 0; i < ETS_COUNT; ++i)

View File

@ -363,7 +363,7 @@ namespace video
SMaterial Material, LastMaterial;
core::array<core::plane3df> UserClipPlane;
core::array<bool> UserClipPlaneEnabled;
std::vector<bool> UserClipPlaneEnabled;
core::stringc VendorName;

View File

@ -231,6 +231,9 @@ namespace scene
struct DefaultNodeEntry
{
DefaultNodeEntry()
{ }
DefaultNodeEntry(ISceneNode* n) :
Node(n), TextureValue(0)
{
@ -251,6 +254,9 @@ namespace scene
//! sort on distance (center) to camera
struct TransparentNodeEntry
{
TransparentNodeEntry()
{ }
TransparentNodeEntry(ISceneNode* n, const core::vector3df& camera)
: Node(n)
{

View File

@ -1042,7 +1042,7 @@ void CSkinnedMesh::finalize()
for (i=0; i<LocalBuffers.size(); ++i)
{
Vertices_Moved.push_back( core::array<bool>() );
Vertices_Moved.push_back( core::array<char>() );
Vertices_Moved[i].set_used(LocalBuffers[i]->getVertexCount());
}

View File

@ -196,7 +196,9 @@ private:
core::array<SJoint*> AllJoints;
core::array<SJoint*> RootJoints;
core::array< core::array<bool> > Vertices_Moved;
// bool can't be used here because std::vector<bool>
// doesn't allow taking a reference to individual elements.
core::array< core::array<char> > Vertices_Moved;
core::aabbox3d<f32> BoundingBox;