Amulets & Armor  v1.02
Open Source Game
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Structures | Macros | Functions | Variables
_3D_VIEW

3D Rendering More...

Data Structures

struct  T_3dFloorRun
 
struct  T_3dObjectColRun
 
struct  T_3dObjectRun
 
struct  T_3dObjectRunInfo
 
struct  T_3dWall
 
struct  T_3dWallRun
 
struct  T_3dWallSlice
 
struct  T_floorInfo
 
struct  T_horzFloorInfo
 
struct  T_pictureRaster
 
struct  T_vertFloorInfo
 

Macros

#define LOWER_TYPE   2
 
#define M_PI   3.14159265358979323846
 
#define MAX_FIND_SECTOR_LINES   20
 
#define MAX_FLOOR_INDEXES   40
 
#define MAX_FLOOR_INFO   5000
 
#define MAX_INTERSECTIONS   50
 
#define MAX_OBJECT_COLUMN_RUNS   8000
 
#define MAX_OBJECT_COLUMNS   50
 
#define MAX_OBJECTS   500
 
#define MAX_WALL_RUNS   8000
 
#define MAX_WALL_SLICES_PER_COLUMN   10
 
#define NEXT_IS_NONE   0
 
#define P_vgaBuffer   ((T_byte8 *)0xA0000)
 
#define SECTOR_IS_UNKNOWN   0x8000
 
#define SECTOR_IS_WALL   0xFFFF
 
#define SECTOR_NONE   0xFFFF
 
#define UPPER_TYPE   0
 
#define VIEW3D_CROSS_RATIO   (65536 / VIEW3D_WIDTH)
 
#define VIEW_3D_LEFT_ANGLE   0x2000
 
#define WALL_TYPE   1
 
#define ZMIN   ((T_sword32) 10 << 16)
 

Functions

T_word16 CalculateDistance (T_sword32 x1, T_sword32 y1, T_sword32 x2, T_sword32 y2)
 
T_word16 CalculateDistanceOld2 (T_sword16 x1, T_sword16 y1, T_sword16 x2, T_sword16 y2)
 
T_word16 CalculateDistanceOld3 (T_sword16 x1, T_sword16 y1, T_sword16 x2, T_sword16 y2)
 
T_word16 CalculateEstimateDistance (T_sword16 x1, T_sword16 y1, T_sword16 x2, T_sword16 y2)
 
T_void ClearSampleAsm (T_byte8 *ptr)
 
T_word16 DebugIFindSectorNum (T_sword16 x, T_sword16 y)
 
T_void DrawObjectColumnAsm (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTextureColumnAsm1 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTextureColumnAsm128 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTextureColumnAsm16 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTextureColumnAsm2 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTextureColumnAsm256 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTextureColumnAsm32 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTextureColumnAsm4 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTextureColumnAsm64 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTextureColumnAsm8 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTextureRowAsm (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTextureRowAsm1 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTextureRowAsm128 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTextureRowAsm16 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTextureRowAsm2 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTextureRowAsm256 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTextureRowAsm32 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTextureRowAsm4 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTextureRowAsm64 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTextureRowAsm8 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTransColumnAsm (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTranslucentColumnAsm1 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTranslucentColumnAsm128 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTranslucentColumnAsm16 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTranslucentColumnAsm2 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTranslucentColumnAsm256 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTranslucentColumnAsm32 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTranslucentColumnAsm4 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTranslucentColumnAsm64 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTranslucentColumnAsm8 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTranslucentObjectColumnAsm (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTransparentColumnAsm1 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTransparentColumnAsm128 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTransparentColumnAsm16 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTransparentColumnAsm2 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTransparentColumnAsm256 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTransparentColumnAsm32 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTransparentColumnAsm4 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTransparentColumnAsm64 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTransparentColumnAsm8 (T_byte8 *p_shade, T_word32 count, T_sword32 textureStep, T_sword32 textureOffset, T_byte8 *p_pixel)
 
T_void DrawTransRowAsm (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTransRowAsm1 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTransRowAsm128 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTransRowAsm16 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTransRowAsm2 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTransRowAsm256 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTransRowAsm32 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTransRowAsm4 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTransRowAsm64 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_void DrawTransRowAsm8 (T_byte8 *p_shade, T_word32 count, T_sword32 xOffset, T_sword32 yOffset, T_byte8 *p_pixel)
 
T_sword32 FindInterXAsm (T_sword32 deltaX, T_sword32 deltaZ, T_sword32 tanViewAngle, T_sword32 zTop)
 
T_void IAddLowerWall (T_void)
 
T_void IAddMainWall (T_void)
 
T_void IAddObjectSlice (T_sword32 zDist, T_sword16 x, T_sword16 clipTop, T_sword16 clipBottom)
 
T_void IAddUpperWall (T_void)
 
T_void IAddWall (T_sword16 sx1, T_sword16 sx2, T_sword16 relativeBottom, T_sword16 relativeTop, T_sword16 relativeFromZ, T_sword16 relativeToZ)
 
T_void ICalculateWallMatrix (T_void)
 
E_Boolean ICheckValidRow (T_word16 row, T_word16 run)
 
E_Boolean ICheckValidRow2 (T_word16 row, T_word16 run)
 
int ICompareObjectRuns (const void *first, const void *second)
 
T_word32 IDetermineDistToLine (T_sword16 x, T_sword16 y, T_word16 lineNum)
 
T_byte8IDetermineShade (T_sword32 distance, T_word16 shadeStart)
 
T_void IDrawColumn (T_word16 x, T_word16 top, T_word16 bottom, T_byte8 color)
 
T_void IDrawFloorRun (T_word16 y, T_horzFloorInfo *p_floor)
 
T_void IDrawNode (T_word16 nodeIndex)
 
T_void IDrawObjectAndWallRuns (T_void)
 
T_void IDrawObjectColumn (T_word16 column, T_3dObjectColRun *p_objCol)
 
T_void IDrawPixel (T_byte8 *p_pixel, T_byte8 color)
 
T_void IDrawRow (T_word16 y, T_word16 left, T_word16 right, T_byte8 color)
 
T_void IDrawRuns (T_void)
 
T_void IDrawSegment (T_word16 segmentIndex)
 
T_void IDrawSSector (T_word16 ssectorIndex)
 
T_void IDrawTextureColumn (T_word16 x, T_3dWallRun *p_run)
 
T_void IDrawTextureColumnNew (T_byte8 *p_shade, T_word16 numPixels, T_word32 textureStep, T_word32 textureOffset, T_byte8 *p_pixel, T_byte8 shift)
 
T_void IDumpVertFloor (T_void)
 
T_sword32 IFindIntersectX (T_word16 line, T_sword16 y)
 
E_Boolean IFindObject (T_3dObject *p_obj)
 
T_void IFindObjects (T_void)
 
T_word16 IFindSectorNum (T_sword16 x, T_sword16 y)
 
E_Boolean IIsSegmentGood (T_word16 segmentIndex)
 
T_void IMarkOffWall (T_void)
 
T_sword16 IObjectPartition (T_sword16 p, T_sword16 r)
 
T_byte8 IOnRightOfLine (T_sword16 x, T_sword16 y, T_word16 line)
 
T_word16 IQuickSquareRoot (T_word32 value)
 
T_void ISetupDistanceTable (T_void)
 
T_void ISortObjectQuick (T_sword16 p, T_sword16 q)
 
T_void ISortObjects (T_void)
 
T_sword32 MultAndDivideAsm (T_sword32 multA, T_sword32 multB, T_sword32 divC)
 
T_sword32 MultAndShift16 (T_sword32 a, T_sword32 b)
 
T_sword32 MultAndShift22 (T_sword32 a, T_sword32 b)
 
T_sword32 MultAndShift32 (T_sword32 a, T_sword32 b)
 
T_sword32 MultAndShift6 (T_sword32 a, T_sword32 b)
 
T_void View3dAddObject (T_3dObject *p_obj)
 
T_3dObjectView3dAllocateObject (T_void)
 
T_void View3dCheckObjectListEmpty (T_void)
 
T_void View3dClipCenter (T_word16 centerWidth)
 
T_void View3dDisplayView (T_void)
 
T_void View3dDrawView (T_void)
 
T_word16 View3dFindClosestLine (T_sword16 x, T_sword16 y)
 
T_word16 View3dFindSide (T_sword16 x, T_sword16 y)
 
T_void View3dFinish (T_void)
 
T_void View3dFreeObject (T_3dObject *p_obj)
 
T_word16 View3dGetObjectAtColumn (T_word16 objPos, T_3dObject **p_obj, T_word16 column)
 
T_word16 View3dGetObjectAtXY (T_word16 objPos, T_3dObject **p_obj, T_word16 x, T_word16 y)
 
T_word16 View3dGetSectorSide (T_word16 lineNum, T_sword16 x, T_sword16 y)
 
T_word16 View3dGetSide (T_word16 lineNum, T_sword16 x, T_sword16 y)
 
T_sword32 View3dGetUpDownAngle (T_void)
 
T_void View3dGetView (T_sword16 *p_x, T_sword16 *p_y, T_sword32 *p_height, T_word16 *p_angle)
 
T_void View3dInitialize (T_void)
 
T_byte8 View3dLeftSideInCone (T_word16 nodeIndex)
 
T_byte8 View3dOnRightByNode (T_word16 nodeIndex)
 
T_byte8 View3dOnRightByNodeWithXY (T_word16 nodeIndex, T_sword16 x, T_sword16 y)
 
T_byte8 View3dOnRightByVertices (T_word16 from, T_word16 to)
 
T_byte8 View3dOnRightByVerticesXY (T_word16 from, T_word16 to, T_sword16 x, T_sword16 y)
 
T_void View3dRemapSectors (T_void)
 
T_void View3dRemoveObject (T_3dObject *p_obj)
 
T_byte8 View3dRightSideInCone (T_word16 nodeIndex)
 
T_void View3dSetDarknessAdjustment (T_sbyte8 darkAdjust)
 
T_void View3dSetHeight (T_sword32 height)
 
T_void View3dSetSize (T_word16 width, T_word16 height)
 
T_void View3dSetUpDownAngle (T_sword32 alpha)
 
T_void View3dSetView (T_sword16 x, T_sword16 y, T_sword32 height, T_word16 angle)
 
T_void View3dUnmapSectors (T_void)
 
T_void View3dUpdateSectorLightAnimation (T_void)
 

Variables

T_sword32 G_3dCosPlayerLeftAngle
 
T_sword32 G_3dCosPlayerRightAngle
 
T_sword32 G_3dSinPlayerLeftAngle
 
T_sword32 G_3dSinPlayerRightAngle
 
T_word16 G_allocatedColRun = 0
 
T_sword32 G_alpha = 0x0000
 
T_byte8G_backdrop = NULL
 T_byte8 *GG_palette ;. More...
 
T_word16 G_backdropOffset = 0
 
T_word16 G_colCount
 
T_byte8 G_colDone [MAX_VIEW3D_WIDTH]
 
T_byte8G_CurrentTexturePos
 
T_sbyte8 G_darknessAdjustment
 
E_Boolean G_didDrawWall
 
T_word16 G_firstSSector
 
T_word16 G_intCount [MAX_VIEW3D_WIDTH]
 
T_word16 G_intersections [MAX_INTERSECTIONS][MAX_VIEW3D_WIDTH]
 
T_sword16 G_maxY [MAX_VIEW3D_WIDTH]
 
T_sword16 G_minY [MAX_VIEW3D_WIDTH]
 
T_word16 G_nodeCount
 
T_word16 G_numVertFloor
 
T_byte8 G_numWallSlices [MAX_VIEW3D_WIDTH]
 
T_word16 G_objColumnEnd
 
T_word16 G_objColumnStart
 
T_3dObjectColRun G_objectColRunList [MAX_OBJECT_COLUMN_RUNS]
 
T_word16 G_objectColStart [MAX_VIEW3D_WIDTH]
 
T_word16 G_objectCount
 
T_3dObjectRun G_objectRun [MAX_OBJECTS]
 
T_word16G_remapSectorCeilingArray
 
T_word16G_remapSectorFloorArray
 
T_sword32 G_screenObjectDistance [MAX_VIEW3D_WIDTH]
 
T_word16 G_screenObjectPosition [MAX_VIEW3D_WIDTH]
 
T_word16 G_segCount
 
T_byte8 G_squareRootTable [16384]
 
T_word32 G_textureAndX =63
 
T_word32 G_textureAndY =63
 
T_word16 G_textureShift =6
 
T_sword32 G_textureStepX
 
T_sword32 G_textureStepY
 
T_vertFloorInfo G_vertFloorInfo [MAX_FLOOR_INFO]
 
T_word16 G_vertFloorStarts [MAX_VIEW3D_WIDTH]
 
T_3dWall G_wall
 
T_word16 G_wallAttempt
 
T_word16 G_wallCount
 
T_word16 G_wallRunCount
 
T_3dWallSlice G_wallSlices [MAX_VIEW3D_WIDTH][MAX_WALL_SLICES_PER_COLUMN]
 
T_byte8P_doubleBuffer
 
T_byte8 P_shadeIndex [16384]
 
T_sword16 VIEW3D_CLIP_LEFT = 100
 
T_sword16 VIEW3D_CLIP_RIGHT = 200
 
T_sword16 VIEW3D_EVEN_HALF_HEIGHT = 70
 
T_sword16 VIEW3D_HALF_HEIGHT = 70
 
T_sword16 VIEW3D_HALF_WIDTH = 150
 
T_sword16 VIEW3D_HEIGHT = 140
 
T_sword16 VIEW3D_WIDTH = 300
 

Detailed Description

3D Rendering

All 3D rendering is done through this section of code.

See Also
http://www.amuletsandarmor.com/AALicense.txt

Macro Definition Documentation

#define LOWER_TYPE   2
#define M_PI   3.14159265358979323846
#define MAX_FIND_SECTOR_LINES   20
#define MAX_FLOOR_INDEXES   40
#define MAX_FLOOR_INFO   5000
#define MAX_INTERSECTIONS   50
#define MAX_OBJECT_COLUMN_RUNS   8000
#define MAX_OBJECT_COLUMNS   50
#define MAX_OBJECTS   500
#define MAX_WALL_RUNS   8000
#define MAX_WALL_SLICES_PER_COLUMN   10
#define NEXT_IS_NONE   0
#define P_vgaBuffer   ((T_byte8 *)0xA0000)
#define SECTOR_IS_UNKNOWN   0x8000
#define SECTOR_IS_WALL   0xFFFF
#define SECTOR_NONE   0xFFFF
#define UPPER_TYPE   0
#define VIEW3D_CROSS_RATIO   (65536 / VIEW3D_WIDTH)
#define VIEW_3D_LEFT_ANGLE   0x2000
#define WALL_TYPE   1
#define ZMIN   ((T_sword32) 10 << 16)

Function Documentation

T_word16 CalculateDistance ( T_sword32  x1,
T_sword32  y1,
T_sword32  x2,
T_sword32  y2 
)
T_word16 CalculateDistanceOld2 ( T_sword16  x1,
T_sword16  y1,
T_sword16  x2,
T_sword16  y2 
)
T_word16 CalculateDistanceOld3 ( T_sword16  x1,
T_sword16  y1,
T_sword16  x2,
T_sword16  y2 
)
T_word16 CalculateEstimateDistance ( T_sword16  x1,
T_sword16  y1,
T_sword16  x2,
T_sword16  y2 
)
T_void ClearSampleAsm ( T_byte8 ptr)
T_word16 DebugIFindSectorNum ( T_sword16  x,
T_sword16  y 
)

puts("Here") ;

printf("line=%d, side=%d", closestLine, side) ;

T_void DrawObjectColumnAsm ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTextureColumnAsm1 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTextureColumnAsm128 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTextureColumnAsm16 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTextureColumnAsm2 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTextureColumnAsm256 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTextureColumnAsm32 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTextureColumnAsm4 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTextureColumnAsm64 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTextureColumnAsm8 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTextureRowAsm ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTextureRowAsm1 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTextureRowAsm128 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTextureRowAsm16 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTextureRowAsm2 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTextureRowAsm256 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTextureRowAsm32 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTextureRowAsm4 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTextureRowAsm64 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTextureRowAsm8 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTransColumnAsm ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTranslucentColumnAsm1 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTranslucentColumnAsm128 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTranslucentColumnAsm16 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTranslucentColumnAsm2 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTranslucentColumnAsm256 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTranslucentColumnAsm32 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTranslucentColumnAsm4 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTranslucentColumnAsm64 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTranslucentColumnAsm8 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTranslucentObjectColumnAsm ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTransparentColumnAsm1 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTransparentColumnAsm128 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTransparentColumnAsm16 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTransparentColumnAsm2 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTransparentColumnAsm256 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTransparentColumnAsm32 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTransparentColumnAsm4 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTransparentColumnAsm64 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTransparentColumnAsm8 ( T_byte8 p_shade,
T_word32  count,
T_sword32  textureStep,
T_sword32  textureOffset,
T_byte8 p_pixel 
)
T_void DrawTransRowAsm ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTransRowAsm1 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTransRowAsm128 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTransRowAsm16 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTransRowAsm2 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTransRowAsm256 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTransRowAsm32 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTransRowAsm4 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTransRowAsm64 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_void DrawTransRowAsm8 ( T_byte8 p_shade,
T_word32  count,
T_sword32  xOffset,
T_sword32  yOffset,
T_byte8 p_pixel 
)
T_sword32 FindInterXAsm ( T_sword32  deltaX,
T_sword32  deltaZ,
T_sword32  tanViewAngle,
T_sword32  zTop 
)
T_void IAddLowerWall ( T_void  )

IAddLowerWall sets up a lower wall to be draw by the 3d engine.

T_void IAddMainWall ( T_void  )

IAddMainWall sets up a main wall to be draw by the 3d engine.

T_void IAddObjectSlice ( T_sword32  zDist,
T_sword16  x,
T_sword16  clipTop,
T_sword16  clipBottom 
)
T_void IAddUpperWall ( T_void  )

IAddUpperWall sets up a upper wall to be draw by the 3d engine.

T_void IAddWall ( T_sword16  sx1,
T_sword16  sx2,
T_sword16  relativeBottom,
T_sword16  relativeTop,
T_sword16  relativeFromZ,
T_sword16  relativeToZ 
)

IAddWall is called once a wall has been found to be on the screen, has been clipped, and the full coordinates have been located. This routine "draws" the wall into the run lists.

Parameters
sx1– Screen X1 coordinate
sx2– Screen X2 coordinate
relativeBottom– Height of the wall at base
relativeTop– Height of the wall at top
relativeFromZ– Distance to first coordinate along Z
relativeToZ– Distance to second coordinate along Z
T_void ICalculateWallMatrix ( T_void  )

ICalculateWallMatrix determines the matrix for a wall segment given that it has already been determined to be on the screen. Directly changes the matrix values in G_wall

NOTE: Must call IIsSegmentGood any time before this routine.

E_Boolean ICheckValidRow ( T_word16  row,
T_word16  run 
)
E_Boolean ICheckValidRow2 ( T_word16  row,
T_word16  run 
)
int ICompareObjectRuns ( const void *  first,
const void *  second 
)
T_word32 IDetermineDistToLine ( T_sword16  x,
T_sword16  y,
T_word16  lineNum 
)

printf("Line %d, xA=%d, xB=%d, angle=%d, dy=%d, dx=%d -- ", lineNum, xA, xB, angle, y2-y1, x2-x1) ;

puts("Yes") ;

puts("No") ;

T_byte8 * IDetermineShade ( T_sword32  distance,
T_word16  shadeStart 
)
T_void IDrawColumn ( T_word16  x,
T_word16  top,
T_word16  bottom,
T_byte8  color 
)

IDrawColumn draws a vertical line at the given x position from the given top and bottom pixels. The color is also passed in.

Parameters
x– X position on screen
top– Top Y position
bottom– Bottom Y position
color– Color to draw line in
T_void IDrawFloorRun ( T_word16  y,
T_horzFloorInfo p_floor 
)
T_void IDrawNode ( T_word16  nodeIndex)

IDrawNode is a self-calling recursive routine that travels through the BSP tree and determines the order that walls (and floors) should be drawn.

Parameters
nodeIndex– Index to head node of sub-BSP tree
T_void IDrawObjectAndWallRuns ( T_void  )
T_void IDrawObjectColumn ( T_word16  column,
T_3dObjectColRun p_objCol 
)
T_void IDrawPixel ( T_byte8 p_pixel,
T_byte8  color 
)
T_void IDrawRow ( T_word16  y,
T_word16  left,
T_word16  right,
T_byte8  color 
)

IDrawColumn draws a vertical line at the given x position from the given top and bottom pixels. The color is also passed in.

Parameters
y– Y position on screen
left– Left X position
right– Right Y position
color– Color to draw line in
T_void IDrawRuns ( T_void  )

IDrawRuns does the actual work of drawing all the different parts onto the screen.

T_void IDrawSegment ( T_word16  segmentIndex)

IDrawSegment does all the work to determine if the given segment can be drawn on the screen and if so, calls the appropriate routines to add the wall and floor runs.

Parameters
segmentIndex– Segment to draw
T_void IDrawSSector ( T_word16  ssectorIndex)

IDrawSSector draws all the facing sectors in a segment sector.

Parameters
ssectorIndex– Index to segment sector
T_void IDrawTextureColumn ( T_word16  x,
T_3dWallRun p_run 
)

IDrawTextureColumn draws a vertical line using a given run length and column.

Parameters
x– X position on screen
p_run– Wall run length to draw

p_shade = &P_shadeIndex[p_run->shadeIndex<<8] ;

p_pixel = &P_doubleBuffer[((top << 2) + (top << 4)) + (x>>2)] ;

T_void IDrawTextureColumnNew ( T_byte8 p_shade,
T_word16  numPixels,
T_word32  textureStep,
T_word32  textureOffset,
T_byte8 p_pixel,
T_byte8  shift 
)

IDrawTextureColumnNew is the new version of IDrawTextureColumn. The difference is that this routine JUST dispatches the data to the correct texture drawing routine. No calculations are done on this level any more.

Parameters
p_shade– Pointer into shade table
numPixels– How many pixels high to draw
textureStep– How fast to step through the texture
textureOffset– Start position in texture
p_pixel– First position on the screen
shift– Texture power of 2 factor up and down
T_void IDumpVertFloor ( T_void  )
T_sword32 IFindIntersectX ( T_word16  line,
T_sword16  y 
)
E_Boolean IFindObject ( T_3dObject p_obj)

Apply lighting only if applicable.

T_void IFindObjects ( T_void  )

IFindObjects locates all objects in the view and add them to the wall runs.

T_word16 IFindSectorNum ( T_sword16  x,
T_sword16  y 
)
E_Boolean IIsSegmentGood ( T_word16  segmentIndex)

IIsSegmentGood determines if a segment is in the view and if it will be drawn on the screen.

Parameters
segmentIndex– Segment to check if need to draw.
T_void IMarkOffWall ( T_void  )

IMarkOffWall goes through all the columns in a wall and marks off any empty slots. This signifies that the column is done and is no longer going to have anything drawn onto it.

T_sword16 IObjectPartition ( T_sword16  p,
T_sword16  r 
)
T_byte8 IOnRightOfLine ( T_sword16  x,
T_sword16  y,
T_word16  line 
)
T_word16 IQuickSquareRoot ( T_word32  value)

IQuickSquareRoot uses an approximation method to calculate the square root of a 32 bit number (into a 16 bit number).

Parameters
value– 32 bit number to take square root of
Returns
square root calculated
T_void ISetupDistanceTable ( T_void  )
T_void ISortObjectQuick ( T_sword16  p,
T_sword16  q 
)
T_void ISortObjects ( T_void  )
T_sword32 MultAndDivideAsm ( T_sword32  multA,
T_sword32  multB,
T_sword32  divC 
)
T_sword32 MultAndShift16 ( T_sword32  a,
T_sword32  b 
)
T_sword32 MultAndShift22 ( T_sword32  a,
T_sword32  b 
)
T_sword32 MultAndShift32 ( T_sword32  a,
T_sword32  b 
)
T_sword32 MultAndShift6 ( T_sword32  a,
T_sword32  b 
)
T_void View3dAddObject ( T_3dObject p_obj)

View3dAddObject attaches a new object to the list of objects in the 3d world.

Parameters
p_obj– Object to bring into world.
T_3dObject* View3dAllocateObject ( T_void  )

View3dAllocateObject either finds an old object slot that is no longer being used or allocates a fresh one. The number to the object is returned.

NOTE: None of the fields are initialized, the object is just allocated. The fields need to be setup before another frame is drawn.

Returns
Pointer to the newly created object.
T_void View3dCheckObjectListEmpty ( T_void  )
T_void View3dClipCenter ( T_word16  centerWidth)

View3dClipCenter sets up the clipping left and right egdes based on the given view size already. Just pass in how wide you want the final view to be.

NOTE: Do not try to clip a width bigger than the width of the view.

Parameters
centerWidth– How width is the clipped view.
T_void View3dDisplayView ( T_void  )

View3dDisplayView actually draws/flips to the actual screen to use.

GrScreenSet((T_screen)(P_doubleBuffer-VIEW3D_CLIP_LEFT)) ;

GrTransferRectangle( GRAPHICS_ACTUAL_SCREEN, VIEW3D_CLIP_LEFT, 0, VIEW3D_CLIP_RIGHT-1, VIEW3D_HEIGHT-1, 4, 3) ;

T_void View3dDrawView ( T_void  )

View3dDrawView is the main routine to call when you wish to draw the whole view. This routine calls all the other routines necessary.

T_word16 View3dFindClosestLine ( T_sword16  x,
T_sword16  y 
)
T_word16 View3dFindSide ( T_sword16  x,
T_sword16  y 
)
T_void View3dFinish ( T_void  )

View3dFinish closes out all information that is stored in memory.

T_void View3dFreeObject ( T_3dObject p_obj)

View3dFreeObject deletes an object and updates the links assocaited with it.

Parameters
p_obj– pointer to object to free
T_word16 View3dGetObjectAtColumn ( T_word16  objPos,
T_3dObject **  p_obj,
T_word16  column 
)

View3dGetObjectAtColumn is a utility routine that checks the sorted list of objects to see if there is an object at the given row. The routine takes in the an integer of where in the list it is, a place to store the found object, and the column of where it is to search. It returns where in the list is the next object, or 0xFFFF if at end.

Parameters
objPos– Position in list to search.
p_obj– Object found (NULL if none)
column– Column on screen to search.
Returns
Next position to be searched, or 0xFFFF if at end.
T_word16 View3dGetObjectAtXY ( T_word16  objPos,
T_3dObject **  p_obj,
T_word16  x,
T_word16  y 
)

View3dGetObjectAtXY is a utility routine that checks the sorted list of objects to see if there is an object at the given X&Y. The routine takes in the an integer of where in the list it is, a place to store the found object, and the X & Y of where it is to search. It returns where in the list is the next object, or 0xFFFF if at end.

Parameters
objPos– Position in list to search.
p_obj– Object found (NULL if none)
x– X (column) on screen to search
y– Y (row) on screen to search
Returns
Next position to be searched, or 0xFFFF if at end.
T_word16 View3dGetSectorSide ( T_word16  lineNum,
T_sword16  x,
T_sword16  y 
)
T_word16 View3dGetSide ( T_word16  lineNum,
T_sword16  x,
T_sword16  y 
)
T_sword32 View3dGetUpDownAngle ( T_void  )
T_void View3dGetView ( T_sword16 p_x,
T_sword16 p_y,
T_sword32 p_height,
T_word16 p_angle 
)

View3dGetView returns the position, angle, and height of the current point of view.

Parameters
p_x– X position
p_y– Y position
p_height– Height of position
p_angle– Angle being faced
T_void View3dInitialize ( T_void  )

END OF GRAPHICS-SPECIFIC (i.e. non-server) CODE SERVER_ONLY View3dInitialize starts up anything that relates to the 3d view.

Server-only build doesn't need graphics.

GG_palette = (T_byte8 *)FileLoad("game.pal", &size) ; DebugCheck(size == 768) ;

T_byte8 View3dLeftSideInCone ( T_word16  nodeIndex)

View3dLeftSideInCone checks to see if the given node (a left child node) is in the current viewing cone.

Parameters
nodeIndex– Number of node to check
Returns
TRUE if on right, FALSE if not
T_byte8 View3dOnRightByNode ( T_word16  nodeIndex)

View3dOnRightByNode checks to see if the player is on the right of a line segment (given by line's node number) and returns TRUE if so (otherwise, FALSE).

Parameters
nodeIndex– Node index to check
Returns
TRUE if player on right of segment, FALSE if not.
T_byte8 View3dOnRightByNodeWithXY ( T_word16  nodeIndex,
T_sword16  x,
T_sword16  y 
)
T_byte8 View3dOnRightByVertices ( T_word16  from,
T_word16  to 
)

View3dOnRightByVertices checks to see if the player is on the right of a line segment (given by their vertice indexes) and returns TRUE if so (otherwise, FALSE).

Parameters
from– From vertex
to– To vertex
Returns
TRUE if player on right of segment, FALSE if not.
T_byte8 View3dOnRightByVerticesXY ( T_word16  from,
T_word16  to,
T_sword16  x,
T_sword16  y 
)
T_void View3dRemapSectors ( T_void  )

View3dRemapSectors is called after a map is loaded. This routine sets up optimization for floor and ceiling drawing by finding similar ceilings and floors and declares them to be the "same" ceiling and pattern.

NOTE: This routine MUST be called before the wall textures are locked into memory.

T_void View3dRemoveObject ( T_3dObject p_obj)

View3dRemoveObject detaches an object from the list of objects in the 3d world.

Parameters
p_obj– Object to bring into world.
T_byte8 View3dRightSideInCone ( T_word16  nodeIndex)

View3dRightSideInCone checks to see if the given node (a right child node) is in the current viewing cone.

Parameters
nodeIndex– Number of node to check
Returns
TRUE if on right, FALSE if not
T_void View3dSetDarknessAdjustment ( T_sbyte8  darkAdjust)

View3dSetDarknessAdjustment sets how much light to add to all floors and ceilings. If negative, makes darker.

Parameters
darkAdjust– 0 = Normal, 63=perfect night vision, -63=Blind.
T_void View3dSetHeight ( T_sword32  height)

View3dSetHeight sets the current point of view to the new location and prepares the appropriate calculations.

Parameters
height– Height to move to.
T_void View3dSetSize ( T_word16  width,
T_word16  height 
)
T_void View3dSetUpDownAngle ( T_sword32  alpha)
T_void View3dSetView ( T_sword16  x,
T_sword16  y,
T_sword32  height,
T_word16  angle 
)

BEGIN GRAPHICS-MODE (i.e. not req'd by server) FUNCTION DEFS View3dSetView moves the current point of view to the new location and prepares the appropriate calculations.

Parameters
x– X position to move to.
y– Y position to move to.
height– Height to move to.
angle– Angle to face.
T_void View3dUnmapSectors ( T_void  )

View3dUnmapSectors frees memory used by View3dRemapSectors. It is usually called when a map ends.

T_void View3dUpdateSectorLightAnimation ( T_void  )

Updates all sector light animations.

How long has it been since the last update?

Loop through all the sectors.

Add the elapsed time to the light animation state.

Check the type of sector light animation for this sector.

No animation; no action necessary.

Oscillate smoothly between the lower and upper bounds.

This just involves mapping time to a sine wave.

This is pretty simple. Just keep incrementing.

Did I exceed my limit?

Yes. Set my value to the minimum.

Have at least two (scaled) seconds elapsed?

Yes. It's time for a flicker. Pick a random light

value within the limits.

Just copy the light value from another sector.

Variable Documentation

T_sword32 G_3dCosPlayerLeftAngle
T_sword32 G_3dCosPlayerRightAngle
T_sword32 G_3dSinPlayerLeftAngle
T_sword32 G_3dSinPlayerRightAngle
T_word16 G_allocatedColRun = 0
T_sword32 G_alpha = 0x0000
T_byte8* G_backdrop = NULL

T_byte8 *GG_palette ;.

T_word16 G_backdropOffset = 0
T_word16 G_colCount
T_byte8* G_CurrentTexturePos
T_sbyte8 G_darknessAdjustment
E_Boolean G_didDrawWall
T_word16 G_firstSSector
T_word16 G_nodeCount
T_word16 G_numVertFloor
T_byte8 G_numWallSlices[MAX_VIEW3D_WIDTH]
T_word16 G_objColumnEnd
T_word16 G_objColumnStart
T_word16 G_objectColStart[MAX_VIEW3D_WIDTH]
T_word16 G_objectCount
T_3dObjectRun G_objectRun[MAX_OBJECTS]
T_word16* G_remapSectorCeilingArray
T_word16* G_remapSectorFloorArray
T_sword32 G_screenObjectDistance[MAX_VIEW3D_WIDTH]
T_word16 G_screenObjectPosition[MAX_VIEW3D_WIDTH]
T_word16 G_segCount
T_byte8 G_squareRootTable

CalculateDistance determines the approximate distance between two coordinates.

Parameters
x1– First X coordinate
y1– First Y coordinate
x2– Second X coordinate
y2– Second Y coordinate
Returns
Approx. distance between too points.

CalculateEstimateDistance determines the quick and approximate distance between two points.

Parameters
x1– First X coordinate
y1– First Y coordinate
x2– Second X coordinate
y2– Second Y coordinate
Returns
Approx. distance between too points.
T_word32 G_textureAndX =63
T_word32 G_textureAndY =63
T_word16 G_textureShift =6
T_sword32 G_textureStepX
T_sword32 G_textureStepY
T_vertFloorInfo G_vertFloorInfo[MAX_FLOOR_INFO]
T_word16 G_vertFloorStarts[MAX_VIEW3D_WIDTH]
T_3dWall G_wall
T_word16 G_wallAttempt
T_word16 G_wallCount
T_word16 G_wallRunCount
T_byte8* P_doubleBuffer
T_byte8 P_shadeIndex[16384]

When you need to draw a shaded bitmap, call this routine. It uses the standard (raw) format of bitmaps. It will blip it on the active screen with NO masking. (Sorry, black is black)

NOTE: No matter how much you want it to, this routine does NOT clip the bitmap at the edge on the screen and trying to will cause it to bomb.

Parameters
p_bitmap– Pointer to a bitmap picture
x_left– Position of the left
y_top– Position of the top
shade– Shading value (0-255, 0=black, 255=normal)
T_sword16 VIEW3D_CLIP_LEFT = 100
T_sword16 VIEW3D_CLIP_RIGHT = 200
T_sword16 VIEW3D_EVEN_HALF_HEIGHT = 70
T_sword16 VIEW3D_HALF_HEIGHT = 70
T_sword16 VIEW3D_HALF_WIDTH = 150
T_sword16 VIEW3D_HEIGHT = 140
T_sword16 VIEW3D_WIDTH = 300