1 #ifndef RENDERWORLD_H 2 #define RENDERWORLD_H 3 4 extern BOOLEAN gfDoVideoScroll; 5 extern UINT8 gubCurScrollSpeedID; 6 7 enum RenderFlags 8 { 9 RENDER_FLAG_NONE = 0, 10 RENDER_FLAG_FULL = 0x00000001, 11 RENDER_FLAG_SHADOWS = 0x00000002, 12 RENDER_FLAG_MARKED = 0x00000004, 13 RENDER_FLAG_SAVEOFF = 0x00000008, 14 RENDER_FLAG_NOZ = 0x00000010, 15 RENDER_FLAG_ROOMIDS = 0x00000020, 16 RENDER_FLAG_CHECKZ = 0x00000040, 17 RENDER_FLAG_FOVDEBUG = 0x00000200 18 }; 19 ENUM_BITSET(RenderFlags) 20 21 #define SCROLL_UP 0x00000001 22 #define SCROLL_DOWN 0x00000002 23 #define SCROLL_RIGHT 0x00000004 24 #define SCROLL_LEFT 0x00000008 25 26 27 #define Z_SUBLAYERS 8 28 #define LAND_Z_LEVEL 0 29 #define OBJECT_Z_LEVEL 1 30 #define SHADOW_Z_LEVEL 2 31 #define MERC_Z_LEVEL 3 32 #define STRUCT_Z_LEVEL 4 33 #define ROOF_Z_LEVEL 5 34 #define ONROOF_Z_LEVEL 6 35 #define TOPMOST_Z_LEVEL 32767 36 37 /* number of pixels to show the exit sector cursor at the edge of the map */ 38 #define NO_PX_SHOW_EXIT_CURS 15 39 40 enum RenderLayerFlags 41 { 42 // Highest bit value is rendered first 43 TILES_LAYER_ALL = 0xFFFFFFFF, 44 TILES_STATIC_LAND = 0x00040000, 45 TILES_STATIC_OBJECTS = 0x00020000, 46 TILES_STATIC_SHADOWS = 0x00008000, 47 TILES_STATIC_STRUCTURES = 0x00004000, 48 TILES_STATIC_ROOF = 0x00002000, 49 TILES_STATIC_ONROOF = 0x00001000, 50 TILES_STATIC_TOPMOST = 0x00000800, 51 TILES_ALL_DYNAMICS = 0x00000FFF, 52 TILES_DYNAMIC_LAND = 0x00000200, 53 TILES_DYNAMIC_OBJECTS = 0x00000100, 54 TILES_DYNAMIC_SHADOWS = 0x00000080, 55 TILES_DYNAMIC_STRUCT_MERCS = 0x00000040, 56 TILES_DYNAMIC_MERCS = 0x00000020, 57 TILES_DYNAMIC_STRUCTURES = 0x00000010, 58 TILES_DYNAMIC_ROOF = 0x00000008, 59 TILES_DYNAMIC_HIGHMERCS = 0x00000004, 60 TILES_DYNAMIC_ONROOF = 0x00000002, 61 TILES_DYNAMIC_TOPMOST = 0x00000001, 62 TILES_LAYER_NONE = 0 63 }; 64 ENUM_BITSET(RenderLayerFlags) 65 66 67 extern INT16 gsScrollXIncrement; 68 extern INT16 gsScrollYIncrement; 69 extern INT16 gsRenderHeight; 70 71 72 extern INT16 gsRenderCenterX; 73 extern INT16 gsRenderCenterY; 74 extern INT16 gsRenderWorldOffsetX; 75 extern INT16 gsRenderWorldOffsetY; 76 77 // CURRENT VIEWPORT IN WORLD COORDS 78 extern INT16 gsTopLeftWorldX; 79 extern INT16 gsTopLeftWorldY; 80 extern INT16 gsBottomRightWorldX; 81 extern INT16 gsBottomRightWorldY; 82 83 84 // GLOBAL COORDINATES 85 extern INT16 gCenterWorldX; 86 extern INT16 gCenterWorldY; 87 extern INT16 gsLeftX; 88 extern INT16 gsTopY; 89 extern INT16 gsRightX; 90 extern INT16 gsBottomY; 91 extern INT16 gsCX; 92 extern INT16 gsCY; 93 extern double gdScaleX; 94 extern double gdScaleY; 95 96 extern BOOLEAN gfIgnoreScrollDueToCenterAdjust; 97 98 99 void ScrollWorld(void); 100 void InitRenderParams(UINT8 ubRestrictionID); 101 void RenderWorld(void); 102 103 void ResetSpecificLayerOptimizing(RenderLayerFlags); 104 105 void SetRenderFlags(RenderFlags); 106 void ClearRenderFlags(RenderFlags); 107 108 void RenderSetShadows(BOOLEAN fShadows); 109 110 extern UINT16* gpZBuffer; 111 extern UINT16 gZBufferPitch; 112 extern BOOLEAN gfIgnoreScrolling; 113 114 extern bool g_scroll_inertia; 115 extern BOOLEAN gfScrollPending; 116 117 void RenderStaticWorldRect(INT16 sLeft, INT16 sTop, INT16 sRight, INT16 sBottom, BOOLEAN fDynamicsToo); 118 119 void InvalidateWorldRedundency(void); 120 121 void SetRenderCenter(INT16 sNewX, INT16 sNewY); 122 123 #if defined _DEBUG 124 void RenderFOVDebug(void); 125 void RenderCoverDebug(void); 126 #endif 127 128 #endif 129