123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- //===========================================================================//
- // Copyright (C) Microsoft Corporation. All rights reserved. //
- //===========================================================================//
- #pragma once
- #define MLR_MLRINDEXEDPRIMITIVEBASE_HPP
- #if !defined(MLR_MLR_HPP)
- #include <MLR\MLR.hpp>
- #endif
- namespace MidLevelRenderer {
- //##########################################################################
- //################### MLRIndexedPrimitiveBase ########################
- //##########################################################################
- class MLRIndexedPrimitiveBase:
- public MLRPrimitiveBase
- {
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // Initialization
- //
- public:
- static void
- InitializeClass();
- static void
- TerminateClass();
- static ClassData
- *DefaultData;
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // Constructors/Destructors
- //
- protected:
- MLRIndexedPrimitiveBase(
- ClassData *class_data,
- Stuff::MemoryStream *stream,
- int version
- );
- ~MLRIndexedPrimitiveBase();
- public:
- MLRIndexedPrimitiveBase(ClassData *class_data);
- static MLRIndexedPrimitiveBase*
- Make(
- Stuff::MemoryStream *stream,
- int version
- );
- virtual void
- Save(Stuff::MemoryStream *stream);
- virtual void InitializeDrawPrimitive(unsigned char, int=0);
- virtual void Lighting(MLRLight* const*, int nrLights) = 0;
- virtual void
- SetCoordData(
- const Stuff::Point3D *array,
- int point_count
- );
- virtual void
- SetIndexData(
- unsigned short *index_array,
- int index_count
- );
- virtual void
- GetIndexData(
- unsigned short **index_array,
- int *index_count
- );
- virtual unsigned short*
- GetGOSIndices(int=0)
- { Check_Object(this); return gos_indices; }
- int
- GetNumGOSIndices()
- { Check_Object(this); return numGOSIndices; }
- virtual void
- Transform(Stuff::Matrix4D*);
- virtual void
- TransformNoClip(Stuff::Matrix4D*, GOSVertexPool*,bool=false) = 0;
- void
- TheIndexer(int num)
- {
- Check_Object(this);
- index.SetLength(num);
- for(unsigned short i=0;i<num;i++)
- {
- index[i] = i;
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // Testing
- //
- public:
- void
- TestInstance() const;
- virtual int
- GetSize()
- {
- Check_Object(this);
- int ret = MLRPrimitiveBase::GetSize();
- ret += visibleIndexedVertices.GetSize();
- ret += index.GetSize();
- return ret;
- }
- bool
- CheckIndicies();
- protected:
- bool visibleIndexedVerticesKey;
- Stuff::DynamicArrayOf<unsigned char> visibleIndexedVertices;
- Stuff::DynamicArrayOf<unsigned short> index; // List of color indexes
- static Stuff::DynamicArrayOf<unsigned short> *clipExtraIndex; // , Max_Number_Vertices_Per_Mesh
- unsigned short *gos_indices;
- unsigned short numGOSIndices;
- };
- }
|