diff options
author | 2011-10-18 10:54:29 -0700 | |
---|---|---|
committer | 2011-10-18 10:54:29 -0700 | |
commit | 5ef2f53a00f64b7e156978d9de2e097394e4036a (patch) | |
tree | fdac496264e25719720de129c41304515f0237af /libs/rs/rsMesh.h | |
parent | a744ead977b2beda89091abf295bcda860bf88b2 (diff) |
Remove ObjBaseRef from the hal struct
Change-Id: Idcac14ecfdd4d06a0f54bf50e3b9657be62e6638
Diffstat (limited to 'libs/rs/rsMesh.h')
-rw-r--r-- | libs/rs/rsMesh.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libs/rs/rsMesh.h b/libs/rs/rsMesh.h index ed1e93d63954..0fc73fba5c95 100644 --- a/libs/rs/rsMesh.h +++ b/libs/rs/rsMesh.h @@ -32,13 +32,6 @@ public: Mesh(Context *, uint32_t vertexBuffersCount, uint32_t primitivesCount); ~Mesh(); - // Either mIndexBuffer, mPrimitiveBuffer or both could have a NULL reference - // If both are null, mPrimitive only would be used to render the mesh - struct Primitive_t { - ObjectBaseRef<Allocation> mIndexBuffer; - RsPrimitive mPrimitive; - }; - virtual void serialize(OStream *stream) const; virtual RsA3DClassID getClassId() const { return RS_A3D_CLASS_ID_MESH; } static Mesh *createFromStream(Context *rsc, IStream *stream); @@ -51,10 +44,13 @@ public: // Contains vertex data // Position, normal, texcoord, etc could either be strided in one allocation // of provided separetely in multiple ones - ObjectBaseRef<Allocation> *vertexBuffers; + Allocation **vertexBuffers; uint32_t vertexBuffersCount; - Primitive_t ** primitives; + // indexBuffers[i] could be NULL, in which case only primitives[i] is used + Allocation **indexBuffers; + uint32_t indexBuffersCount; + RsPrimitive *primitives; uint32_t primitivesCount; }; State state; @@ -62,12 +58,14 @@ public: Hal mHal; void setVertexBuffer(Allocation *vb, uint32_t index) { - mHal.state.vertexBuffers[index].set(vb); + mVertexBuffers[index].set(vb); + mHal.state.vertexBuffers[index] = vb; } void setPrimitive(Allocation *idx, RsPrimitive prim, uint32_t index) { - mHal.state.primitives[index]->mIndexBuffer.set(idx); - mHal.state.primitives[index]->mPrimitive = prim; + mIndexBuffers[index].set(idx); + mHal.state.indexBuffers[index] = idx; + mHal.state.primitives[index] = prim; } void render(Context *) const; @@ -80,6 +78,8 @@ public: float mBBoxMax[3]; void computeBBox(); protected: + ObjectBaseRef<Allocation> *mVertexBuffers; + ObjectBaseRef<Allocation> *mIndexBuffers; bool mInitialized; }; |