Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-07-17 09:23:17 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-07-17 09:23:17 +0400
commit90fb63152628927d5d13b0101f4f2dcec025d2f7 (patch)
tree2f5f652729252632e3dc5c74e5c433ca2d297db1 /source/gameengine/Rasterizer/RAS_MeshObject.h
parent5ff83fa2b8c63a9267722f01b5626ee0da41adda (diff)
Port a few rasterizer changes from tuhopuu2:
Up the max batch size. Clean up some of the code - move code in headers to source files etc.
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_MeshObject.h')
-rw-r--r--source/gameengine/Rasterizer/RAS_MeshObject.h47
1 files changed, 11 insertions, 36 deletions
diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h
index 9058fe4d31f..f2be0355c6e 100644
--- a/source/gameengine/Rasterizer/RAS_MeshObject.h
+++ b/source/gameengine/Rasterizer/RAS_MeshObject.h
@@ -120,9 +120,6 @@ inline bool operator <( const RAS_MatArrayIndex& rhs,const RAS_MatArrayIndex& l
class RAS_MeshObject
{
- enum { BUCKET_MAX_INDICES = 16384 };//2048};//8192};
- enum { BUCKET_MAX_TRIANGLES = 4096 };
-
// GEN_Map<class RAS_IPolyMaterial,KX_ArrayOptimizer*> m_matVertexArrayS;
//vector<class RAS_IPolyMaterial*,KX_ArrayOptimizer> m_vertexArrays;
virtual KX_ArrayOptimizer* GetArrayOptimizer(RAS_IPolyMaterial* polymat);
@@ -137,40 +134,15 @@ class RAS_MeshObject
static STR_String s_emptyname;
bool m_zsort;
- struct polygonSlot
- {
- float m_z;
- RAS_Polygon *m_poly;
-
- polygonSlot(float z, RAS_Polygon* poly) :
- m_z(z),
- m_poly(poly)
- {}
- /**
- * pnorm and pval form the plane equation that the distance from is used to
- * sort against.
- */
- polygonSlot(const MT_Vector3 &pnorm, const MT_Scalar &pval, RAS_MeshObject* mesh, RAS_Polygon* poly);
- };
-
- struct backtofront
- {
- bool operator()(const polygonSlot &a, const polygonSlot &b) const
- {
- return a.m_z < b.m_z;
- }
- };
-
- struct fronttoback
- {
- bool operator()(const polygonSlot &a, const polygonSlot &b) const
- {
- return a.m_z > b.m_z;
- }
- };
+ struct polygonSlot;
+ struct backtofront;
+ struct fronttoback;
protected:
+ enum { BUCKET_MAX_INDICES = 65535 };//2048};//8192};
+ enum { BUCKET_MAX_TRIANGLES = 65535 };
+
GEN_Map<class RAS_IPolyMaterial,KX_ArrayOptimizer*> m_matVertexArrayS;
RAS_MaterialBucket::Set m_materials;
@@ -218,7 +190,10 @@ public:
void DebugColor(unsigned int abgr);
- void SortPolygons(const MT_Transform &transform);
+ /**
+ * Sorts the polygons by their transformed z values.
+ */
+ void SortPolygons(const MT_Transform &transform);
void SchedulePolygons(
const MT_Transform &transform,
@@ -233,7 +208,7 @@ public:
virtual RAS_TexVert* GetVertex(
short array,
- short index,
+ unsigned int index,
RAS_IPolyMaterial* polymat
);