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

3D Loading and unloading of maps More...

Data Structures

struct  T_mapGroupStruct
 

Macros

#define OBJECT_TYPE_LIGHT   924
 
#define SOUND_CRICKETS   3014
 
#define SOUND_ELECTRICITY   3001
 
#define SOUND_FIREPLACE   3008
 
#define SOUND_HUM   3013
 
#define SOUND_LAVA   3009
 
#define SOUND_LAVA_BOIL   3011
 
#define SOUND_MACHINE_BUZZ   3000
 
#define SOUND_RUMBLE   3010
 
#define SOUND_SHORELINE   3016
 
#define SOUND_STREAM   3003
 
#define SOUND_TELEPORTER   3006
 
#define SOUND_TELEPORTER2   3002
 
#define SOUND_TUBE_HUM   3015
 
#define SOUND_WARM_HUM   3012
 
#define SOUND_WATER_DRIP   3018
 
#define SOUND_WATER_FALL   3007
 
#define SOUND_WATER_FOUNTAIN   3019
 
#define SOUND_WIND_HARD   3004
 
#define SOUND_WIND_SOFT   3004
 
#define SPECIAL_OBJECT_ACID_SECTOR   1543
 
#define SPECIAL_OBJECT_AREA_SOUND_CRICKETS   1533
 
#define SPECIAL_OBJECT_AREA_SOUND_ELECTRICITY   1517
 
#define SPECIAL_OBJECT_AREA_SOUND_FIREPLACE   1509
 
#define SPECIAL_OBJECT_AREA_SOUND_HUM   1532
 
#define SPECIAL_OBJECT_AREA_SOUND_LAVA   1510
 
#define SPECIAL_OBJECT_AREA_SOUND_LAVA_BOIL   1530
 
#define SPECIAL_OBJECT_AREA_SOUND_MACHINE_BUZZ   1528
 
#define SPECIAL_OBJECT_AREA_SOUND_RUMBLE   1508
 
#define SPECIAL_OBJECT_AREA_SOUND_SHORELINE   1535
 
#define SPECIAL_OBJECT_AREA_SOUND_STREAM   1513
 
#define SPECIAL_OBJECT_AREA_SOUND_TELEPORTER   1516
 
#define SPECIAL_OBJECT_AREA_SOUND_TELEPORTER2   1529
 
#define SPECIAL_OBJECT_AREA_SOUND_TUBE_HUM   1534
 
#define SPECIAL_OBJECT_AREA_SOUND_WARM_HUM   1531
 
#define SPECIAL_OBJECT_AREA_SOUND_WATER_DRIP   1536
 
#define SPECIAL_OBJECT_AREA_SOUND_WATER_FALL   1514
 
#define SPECIAL_OBJECT_AREA_SOUND_WATER_FOUNTAIN   1515
 
#define SPECIAL_OBJECT_AREA_SOUND_WIND_HARD   1512
 
#define SPECIAL_OBJECT_AREA_SOUND_WIND_SOFT   1511
 
#define SPECIAL_OBJECT_DEPTH   1521
 
#define SPECIAL_OBJECT_DIRT_SECTOR   1503
 
#define SPECIAL_OBJECT_DOOR   1500
 
#define SPECIAL_OBJECT_DOOR_REQUIRE_ITEM   1527
 
#define SPECIAL_OBJECT_FLOW_FAST   1525
 
#define SPECIAL_OBJECT_FLOW_MEDIUM   1524
 
#define SPECIAL_OBJECT_FLOW_SLOW   1523
 
#define SPECIAL_OBJECT_FLOW_WALL_DOWN1   1540
 
#define SPECIAL_OBJECT_FLOW_WALL_DOWN2   1541
 
#define SPECIAL_OBJECT_FLOW_WALL_DOWN3   1542
 
#define SPECIAL_OBJECT_FLOW_WALL_UP1   1537
 
#define SPECIAL_OBJECT_FLOW_WALL_UP2   1538
 
#define SPECIAL_OBJECT_FLOW_WALL_UP3   1539
 
#define SPECIAL_OBJECT_GENERATOR   1502
 
#define SPECIAL_OBJECT_GLASS_CEILING   1520
 
#define SPECIAL_OBJECT_GLOW   1526
 
#define SPECIAL_OBJECT_ICE_SECTOR   1504
 
#define SPECIAL_OBJECT_LAVA_SECTOR   1506
 
#define SPECIAL_OBJECT_LEVEL_LINK   1518
 
#define SPECIAL_OBJECT_LEVEL_LINK_PLACE   1519
 
#define SPECIAL_OBJECT_LOCK_DOOR   1501
 
#define SPECIAL_OBJECT_MUD_SECTOR   1507
 
#define SPECIAL_OBJECT_SECTOR_ANIMATION   1522
 
#define SPECIAL_OBJECT_WATER_SECTOR   1505
 

Functions

T_void IAssignWallAt (T_sword16 x, T_sword16 y, T_word16 animNum)
 
T_sword16 View3dCalculateLowestCeiling (T_word16 sector)
 
T_mapGroup View3dCreateMapGroup (T_void)
 
T_void View3dDestroyMapGroup (T_mapGroup p_mapGroup)
 
T_void View3dGetMapGroup (T_mapGroup p_mapGroup)
 
T_void View3dGetStartLocation (T_word16 num, T_sword16 *p_x, T_sword16 *p_y, T_word16 *p_angle)
 
T_void View3dLoadMap (T_byte8 *MapName)
 
T_void View3dResolveSpecialObjects (T_void)
 
T_void View3dSetMapGroup (T_mapGroup p_mapGroup)
 
T_void View3dSetSectorType (T_word16 sector, T_word16 sectorType)
 
T_void View3dUnloadMap (T_void)
 

Variables

T_3dBlockMapG_3dBlockMapArray = NULL
 
T_3dBlockMapHeaderG_3dBlockMapHeader = NULL
 
T_sword16 G_3dCeilingHeight
 
T_resourceG_3dCeilingResourceArray = NULL
 
T_sword32 G_3dCosPlayerAngle
 
T_sword16 G_3dFloorHeight
 
T_resourceG_3dFloorResourceArray = NULL
 
T_3dLineG_3dLineArray = NULL
 
T_resourceG_3dLowerResourceArray = NULL
 
T_resourceG_3dMainResourceArray = NULL
 
T_3dNodeG_3dNodeArray = NULL
 
T_doubleLinkListG_3dObjCollisionLists
 
T_word16 G_3dPlayerAngle
 
T_sword32 G_3dPlayerHeight = 32<<16
 
T_word16 G_3dPlayerLeftAngle
 
T_word16 G_3dPlayerRightAngle
 
T_sword16 G_3dPlayerX
 
T_sword16 G_3dPlayerY
 
T_3dNode ** G_3dPNodeArray
 
T_byte8G_3dReject = NULL
 
T_sword16 G_3dRootBSPNode
 
T_3dSectorG_3dSectorArray = NULL
 
T_3dSectorInfoG_3dSectorInfoArray
 
T_3dSegmentG_3dSegArray = NULL
 
T_3dSegmentSectorG_3dSegmentSectorArray = NULL
 
T_3dSideG_3dSideArray = NULL
 
T_sword32 G_3dSinPlayerAngle
 
T_resourceG_3dUpperResourceArray = NULL
 
T_3dVertexG_3dVertexArray = NULL
 
T_word16 G_BlockmapSize
 
T_3dObjectG_First3dObject = NULL
 
T_3dObjectG_Last3dObject = NULL
 
T_word16 G_lastCollisionList
 
T_word16 G_Num3dLines
 
T_word16 G_Num3dNodes
 
T_word16 G_Num3dObjects
 
T_word16 G_Num3dSectors
 
T_word16 G_Num3dSegs
 
T_word16 G_Num3dSides
 
T_word16 G_Num3dSSectors
 
T_word16 G_Num3dVertexes
 
T_word16 G_objCollisionNumX
 
T_word16 G_objCollisionNumY
 
T_doubleLinkList G_specialObjectList = DOUBLE_LINK_LIST_BAD
 

Detailed Description

3D Loading and unloading of maps

Routines for loading maps are handled here. This code differs from the MAP code by handling the raw 3D information about a map. It knows about vertixes, wall segments, objects on the map, and any of the 'raw' information about the world needed for rendering. At the heart of it, it is loading DOOM PWAD/IWAD maps since Deep 95 was used to make the maps.

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

Macro Definition Documentation

#define OBJECT_TYPE_LIGHT   924
#define SOUND_CRICKETS   3014
#define SOUND_ELECTRICITY   3001
#define SOUND_FIREPLACE   3008
#define SOUND_HUM   3013
#define SOUND_LAVA   3009
#define SOUND_LAVA_BOIL   3011
#define SOUND_MACHINE_BUZZ   3000
#define SOUND_RUMBLE   3010
#define SOUND_SHORELINE   3016
#define SOUND_STREAM   3003
#define SOUND_TELEPORTER   3006
#define SOUND_TELEPORTER2   3002
#define SOUND_TUBE_HUM   3015
#define SOUND_WARM_HUM   3012
#define SOUND_WATER_DRIP   3018
#define SOUND_WATER_FALL   3007
#define SOUND_WATER_FOUNTAIN   3019
#define SOUND_WIND_HARD   3004
#define SOUND_WIND_SOFT   3004
#define SPECIAL_OBJECT_ACID_SECTOR   1543
#define SPECIAL_OBJECT_AREA_SOUND_CRICKETS   1533
#define SPECIAL_OBJECT_AREA_SOUND_ELECTRICITY   1517
#define SPECIAL_OBJECT_AREA_SOUND_FIREPLACE   1509
#define SPECIAL_OBJECT_AREA_SOUND_HUM   1532
#define SPECIAL_OBJECT_AREA_SOUND_LAVA   1510
#define SPECIAL_OBJECT_AREA_SOUND_LAVA_BOIL   1530
#define SPECIAL_OBJECT_AREA_SOUND_MACHINE_BUZZ   1528
#define SPECIAL_OBJECT_AREA_SOUND_RUMBLE   1508
#define SPECIAL_OBJECT_AREA_SOUND_SHORELINE   1535
#define SPECIAL_OBJECT_AREA_SOUND_STREAM   1513
#define SPECIAL_OBJECT_AREA_SOUND_TELEPORTER   1516
#define SPECIAL_OBJECT_AREA_SOUND_TELEPORTER2   1529
#define SPECIAL_OBJECT_AREA_SOUND_TUBE_HUM   1534
#define SPECIAL_OBJECT_AREA_SOUND_WARM_HUM   1531
#define SPECIAL_OBJECT_AREA_SOUND_WATER_DRIP   1536
#define SPECIAL_OBJECT_AREA_SOUND_WATER_FALL   1514
#define SPECIAL_OBJECT_AREA_SOUND_WATER_FOUNTAIN   1515
#define SPECIAL_OBJECT_AREA_SOUND_WIND_HARD   1512
#define SPECIAL_OBJECT_AREA_SOUND_WIND_SOFT   1511
#define SPECIAL_OBJECT_DEPTH   1521
#define SPECIAL_OBJECT_DIRT_SECTOR   1503
#define SPECIAL_OBJECT_DOOR   1500

View3dResolveSpecialObjects is used to actually create all the

#define SPECIAL_OBJECT_DOOR_REQUIRE_ITEM   1527
#define SPECIAL_OBJECT_FLOW_FAST   1525
#define SPECIAL_OBJECT_FLOW_MEDIUM   1524
#define SPECIAL_OBJECT_FLOW_SLOW   1523
#define SPECIAL_OBJECT_FLOW_WALL_DOWN1   1540
#define SPECIAL_OBJECT_FLOW_WALL_DOWN2   1541
#define SPECIAL_OBJECT_FLOW_WALL_DOWN3   1542
#define SPECIAL_OBJECT_FLOW_WALL_UP1   1537
#define SPECIAL_OBJECT_FLOW_WALL_UP2   1538
#define SPECIAL_OBJECT_FLOW_WALL_UP3   1539
#define SPECIAL_OBJECT_GENERATOR   1502
#define SPECIAL_OBJECT_GLASS_CEILING   1520
#define SPECIAL_OBJECT_GLOW   1526
#define SPECIAL_OBJECT_ICE_SECTOR   1504
#define SPECIAL_OBJECT_LAVA_SECTOR   1506
#define SPECIAL_OBJECT_LEVEL_LINK   1518
#define SPECIAL_OBJECT_LEVEL_LINK_PLACE   1519
#define SPECIAL_OBJECT_LOCK_DOOR   1501
#define SPECIAL_OBJECT_MUD_SECTOR   1507
#define SPECIAL_OBJECT_SECTOR_ANIMATION   1522
#define SPECIAL_OBJECT_WATER_SECTOR   1505

Function Documentation

T_void IAssignWallAt ( T_sword16  x,
T_sword16  y,
T_word16  animNum 
)
T_sword16 View3dCalculateLowestCeiling ( T_word16  sector)
T_mapGroup View3dCreateMapGroup ( T_void  )
T_void View3dDestroyMapGroup ( T_mapGroup  p_mapGroup)
T_void View3dGetMapGroup ( T_mapGroup  p_mapGroup)
T_void View3dGetStartLocation ( T_word16  num,
T_sword16 p_x,
T_sword16 p_y,
T_word16 p_angle 
)

ILoadSectorInfo reads in all the accompany information data that

T_void View3dLoadMap ( T_byte8 MapName)

View3dLoadMap loads into memory a precompiled map that contains all walls, sectors, lines, things, etc.

IDumpData() ;

T_void View3dResolveSpecialObjects ( T_void  )
T_void View3dSetMapGroup ( T_mapGroup  p_mapGroup)
T_void View3dSetSectorType ( T_word16  sector,
T_word16  sectorType 
)
T_void View3dUnloadMap ( T_void  )

View3dUnloadMap unallocates any memory used by the current map.

Variable Documentation

T_3dBlockMap* G_3dBlockMapArray = NULL
T_3dBlockMapHeader* G_3dBlockMapHeader = NULL
T_sword16 G_3dCeilingHeight
T_resource* G_3dCeilingResourceArray = NULL
T_sword32 G_3dCosPlayerAngle
T_sword16 G_3dFloorHeight
T_resource* G_3dFloorResourceArray = NULL
T_3dLine* G_3dLineArray = NULL
T_resource* G_3dLowerResourceArray = NULL
T_resource* G_3dMainResourceArray = NULL
T_3dNode* G_3dNodeArray = NULL
T_doubleLinkList* G_3dObjCollisionLists
T_word16 G_3dPlayerAngle
T_sword32 G_3dPlayerHeight = 32<<16
T_word16 G_3dPlayerLeftAngle
T_word16 G_3dPlayerRightAngle
T_sword16 G_3dPlayerX
T_sword16 G_3dPlayerY
T_3dNode** G_3dPNodeArray
T_byte8* G_3dReject = NULL
T_sword16 G_3dRootBSPNode
T_3dSector* G_3dSectorArray = NULL
T_3dSectorInfo* G_3dSectorInfoArray
T_3dSegment* G_3dSegArray = NULL
T_3dSegmentSector* G_3dSegmentSectorArray = NULL
T_3dSide* G_3dSideArray = NULL
T_sword32 G_3dSinPlayerAngle
T_resource* G_3dUpperResourceArray = NULL
T_3dVertex* G_3dVertexArray = NULL
T_word16 G_BlockmapSize
T_3dObject* G_First3dObject = NULL
T_3dObject* G_Last3dObject = NULL
T_word16 G_lastCollisionList
T_word16 G_Num3dLines
T_word16 G_Num3dNodes
T_word16 G_Num3dObjects
T_word16 G_Num3dSectors
T_word16 G_Num3dSegs
T_word16 G_Num3dSides
T_word16 G_Num3dSSectors
T_word16 G_Num3dVertexes
T_word16 G_objCollisionNumX
T_word16 G_objCollisionNumY
T_doubleLinkList G_specialObjectList = DOUBLE_LINK_LIST_BAD