123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- //===========================================================================//
- // File: MLRStuff.hpp //
- //---------------------------------------------------------------------------//
- // Copyright (C) Microsoft Corporation. All rights reserved. //
- //===========================================================================//
- #pragma once
- #define MLR_MLR_HPP
- #if !defined(STUFF_STUFF_HPP)
- #include <Stuff\Stuff.hpp>
- #endif
- namespace MidLevelRenderer
- {
- //
- //--------------
- // Stuff classes
- //--------------
- //
- enum
- {
- MLRStateClassID = Stuff::FirstMLRClassID,
- MLRClippingStateClassID,
- MLRClipperClassID,
- MLRSorterClassID,
- MLRSortByOrderClassID,
- MLRLightClassID,
- MLRTexturePoolClassID,
- MLRPrimitiveClassID,
- MLRIndexedPrimitiveClassID,
- MLRPolyMeshClassID,
- MLRIndexedPolyMeshClassID,
- MLRShapeClassID,
- MLREffectClassID,
- MLRPointCloudClassID,
- MLRTriangleCloudClassID,
- MLRAmbientLightClassID,
- MLRInfiniteLightClassID,
- MLRInfiniteLightWithFalloffClassID,
- MLRPointLightClassID,
- MLRSpotLightClassID,
- MLRLightMapClassID,
- MLRPrimitiveBaseClassID,
- MLRIndexedPrimitiveBaseClassID,
- MLR_I_PMeshClassID,
- MLR_I_C_PMeshClassID,
- MLR_I_L_PMeshClassID,
- MLR_I_DT_PMeshClassID,
- MLR_I_C_DT_PMeshClassID,
- MLR_I_L_DT_PMeshClassID,
- MLRNGonCloudClassID,
- MLRCardCloudClassID,
- MLR_I_MT_PMeshClassID,
- MLR_I_DeT_PMeshClassID,
- MLR_I_C_DeT_PMeshClassID,
- MLR_I_L_DeT_PMeshClassID,
- MLR_I_TMeshClassID,
- MLR_I_DeT_TMeshClassID,
- MLR_I_C_TMeshClassID,
- MLR_I_L_TMeshClassID,
- MLR_TerrainClassID,
- MLR_Terrain2ClassID,
- MLRLineCloudClassID,
- MLRIndexedTriangleCloudClassID,
- MLR_I_DT_TMeshClassID,
- MLR_I_C_DT_TMeshClassID,
- MLR_I_L_DT_TMeshClassID,
- MLR_I_C_DeT_TMeshClassID,
- MLR_I_L_DeT_TMeshClassID,
- MLRLookUpLightClassID,
- FirstFreeMLRClassID
- };
- enum {
- Current_MLR_Version = 9
- };
- struct Limits {
- static unsigned
- Max_Number_Vertices_Per_Frame,
- Max_Number_Primitives_Per_Frame,
- Max_Number_ScreenQuads_Per_Frame,
- Max_Size_Of_LightMap_MemoryStream;
- enum {
- Max_Number_Vertices_Per_Mesh = 1024,
- Max_Number_Vertices_Per_Polygon = 32,
- Max_Number_Of_Texture_Bits = 14,
- Max_Number_Textures = 1 << Max_Number_Of_Texture_Bits,
- Max_Number_Of_NGon_Vertices = 9,
- Max_Number_Of_Multitextures = 8,
- Max_Number_Of_Lights_Per_Primitive = 16,
- Max_Number_Of_FogStates = 4
- };
- };
- int
- ReadMLRVersion(Stuff::MemoryStream *erf_stream);
- void
- WriteMLRVersion(Stuff::MemoryStream *erf_stream);
- void InitializeClasses(
- unsigned Max_Number_Vertices_Per_Frame = 8192,
- unsigned Max_Number_Primitives_Per_Frame = 1024,
- unsigned Max_Number_ScreenQuads_Per_Frame = 512,
- unsigned Max_Size_Of_LightMap_MemoryStream = 32768,
- bool Convert_To_Triangle_Meshes = true
- );
- void TerminateClasses();
- extern HGOSHEAP Heap;
- extern HGOSHEAP StaticHeap;
- extern bool ConvertToTriangleMeshes;
- DECLARE_TIMER(extern, Scene_Draw_Time);
- DECLARE_TIMER(extern, Transform_Time);
- DECLARE_TIMER(extern, Clipping_Time);
- DECLARE_TIMER(extern, GOS_Draw_Time);
- DECLARE_TIMER(extern, Vertex_Light_Time);
- DECLARE_TIMER(extern, LightMap_Light_Time);
- DECLARE_TIMER(extern, Texture_Sorting_Time);
- DECLARE_TIMER(extern, Alpha_Sorting_Time);
- DECLARE_TIMER(extern, Unlock_Texture_Time);
- extern DWORD Number_Of_Primitives;
- extern DWORD NumAllIndices;
- extern DWORD NumAllVertices;
- extern float Index_Over_Vertex_Ratio;
- extern DWORD TransformedVertices;
- extern DWORD NumberOfAlphaSortedTriangles;
- extern DWORD LitVertices;
- extern DWORD NonClippedVertices;
- extern DWORD ClippedVertices;
- extern DWORD PolysClippedButOutside;
- extern DWORD PolysClippedButInside;
- extern DWORD PolysClippedButOnePlane;
- extern DWORD PolysClippedButGOnePlane;
- extern bool PerspectiveMode;
- }
- #define COLOR_AS_DWORD 0
- #define EFECT_CLIPPED 0
- #define FOG_HACK 1
- #define TO_DO Abort_Program("Here has work to be done !");
- #undef MLR_TRACE
- #include <MLR\MLRState.hpp>
- #include <MLR\MLRTexture.hpp>
- #include <MLR\MLRTexturePool.hpp>
- #include <MLR\MLRClippingState.hpp>
- #include <MLR\MLRClipper.hpp>
- #include <MLR\MLRSorter.hpp>
- #include <MLR\MLRSortByOrder.hpp>
- #include <MLR\MLRLight.hpp>
- #include <MLR\MLRShape.hpp>
- #include <MLR\MLREffect.hpp>
|