Amulets & Armor
v1.02
Open Source Game
|
Map Interface. More...
Macros | |
#define | TICKS_PER_DAY 0x7FFFFL |
Map Interface.
All map handling routines come here. Need to know about a sector's floor and ceiling heights. This is the place. This code differs from the 3D_IO code because it handles all the extra code needed for the game for lighting, walls sliding, textures on walls, backdrops, and traveling. Perhaps it is best to think of it as the "Map State"
#define TICKS_PER_DAY 0x7FFFFL |
MapUpdateLighting updates all lighting effects for the map.
MapCheckCrush sees if lowering the ceiling of the given sector to the new height will cause a character to be crushed.
sector | – Sector to consider |
newHeight | – New ceiling height to consider |
MapCheckCrushByFloor if raising the floor of a given sector to the new height will cause a character to be crushed.
sector | – Sector to consider |
newHeight | – New floor height to consider |
MapFinish is called to finish up any data or code needed by the Map Module.
T_void MapForceOpenForwardWall | ( | T_3dObject * | p_obj) |
MapForceOpenForwardWall always opens the forward wall. If the door is locked and/or requires an item, the door is unlocked and gets rid of the item.
p_obj | – Object doing the open |
MapGetCeilingHeight gets the given sector's ceiling height.
sector | – Sector's ceiling to change. |
MapGetCeilingTextureName returens the name of the ceiling texture in a given sector.
sectorNum | – Number of sector |
MapGetFloorHeight returns the height of the given sector.
sector | – Sector's floor to get. |
MapGetFloorTextureName returns the name of the floor texture name in a given sector.
sectorNum | – Number of sector |
T_word16 MapGetForwardWallActivation | ( | T_3dObject * | p_obj) |
The following routines are not needed for the server-only build. MapGetForwardWallActivation is used to get the activation number of the wall in front of the current POV.
NOTE: The current 3d engine does not allow for wall activation.
T_void MapGetForwardWallActivationType | ( | T_3dObject * | p_obj, |
E_wallActivation * | p_type, | ||
T_word16 * | p_data | ||
) |
MapGetForwardWallActivationType returns the type of action that will occur (including specific data) if the forward wall is activated.
p_obj | – Thing opening door |
p_type | – Type of wall activation |
p_data | – Reutrn wall activation value |
MapGetLowerTextureName returns the name of the lower texture name on a given side of a wall.
sideNum | – Number of side |
MapGetMainTextureName returns the name of the main texture name on a given side of a wall.
sideNum | – Number of side |
MapGetNextMapAndPlace returns the map link for the given sector.
sector | – Sector to get map link |
p_nextMap | – Place to store next map number |
p_nextMapPlace | – Place to store next place number |
MapGetOutsideLighting returns how much light is outside.
SERVER_ONLY MapGetSectorAction returns the corresponding activity number for the given sector.
sector | – Sector to get activity of |
MapGetSectorLighting gets a sector have a different light level.
sector | – Number of sector |
T_sectorType MapGetSectorType | ( | T_word16 | sectorNum) |
MapGetStartLocation uses the given number to return by indirection the location of the map's starting point.
num | – Number of starting point |
p_x | – X starting location |
p_y | – Y starting location |
p_angle | – Angle of starting location |
MapGetTextureXOffset returns the x offset of a texture on a wall side.
sideNum | – Number of wall side |
MapGetTextureYOffset returns the y offset of a texture on a wall side.
sideNum | – Number of wall side |
MapGetUpperTextureName returns the name of the upper texture name on a given side of a wall.
sideNum | – Number of side |
MapGetWalkingFloorHeight returns height of the floor if a thing is walking on it. For water areas, this can be lower than the actual floor height.
sector | – Sector's floor to get. |
MapGetWalkingFloorHeightAtXY returns the height of the floor given a map coordinate.
x | – X Position on map. |
y | – Y Position on map. |
E_Boolean MapGetWallDamage | ( | T_3dObject * | p_obj, |
T_word16 * | p_damageAmount, | ||
T_byte8 * | p_damageType | ||
) |
MapGetWallDamage is called to determine if an object is being damaged by a wall animation.
p_obj | – Object to check |
p_damageAmount | – Amount of damage |
p_damageType | – Type of damage to be done |
MapInitialize is called to start up any data or code needed by the Map Module.
MapLoad reads in the given file and uses it as the map for the current game. This only controls the map and the objects within. Player position or other related information is not defined.
mapNumber | – Number of the map to load |
Change the tune.
T_void MapOpenForwardWall | ( | T_3dObject * | p_obj, |
E_Boolean | checkForItemRequired | ||
) |
MapOpenForwardWall tries to open a door attached to the forward wall.
MapSave writes the given file and all the information out to the current map number.
NOTE: Current 3d engine doesn't allow easy saving of the map. (Not that it's impossible or anything – just not yet).
mapNumber | – Number of the map to save |
Does nothing yet. !!!!
MapSetBackdrop requires a pointer to a 320x100 (or bigger) picture and copies it into the backdrop to be used by the computer. (Actually, you pass in a 320x200 picture where the top 100 lines is half of the image and the next 100 lines are the right half of the image).
p_backdrop | – Pointer to backdrop |
MapSetCeilingHeight makes the given sector's floor height go to the given height (instantly).
sector | – Sector's ceiling to change. |
height | – New height for ceiling. |
MapSetCeilingTextureForSector declares the texture to be used on the given sector ceiling.
sectorNum | – Sector to affect. |
p_textureName | – Name of texture to use. |
MapSetFloorHeight makes the given sector's floor height go to the given height (instantly).
sector | – Sector's floor to change. |
height | – New height for floor. |
MapSetFloorTextureForSector declares the texture to be used on the given sector floor.
sectorNum | – Sector to affect. |
p_textureName | – Name of texture to use. |
MapSetLowerTextureForSide changes the texture used on the lower part of walls.
sideNum | – Side definition to affect. |
p_textureName | – Name of texture to use. |
MapSetMainTexture changes the texture used on the middle part of walls.
sideNum | – Side definition to affect. |
p_textureName | – Name of texture to use. |
MapSetOutsideLighting declares how much light is outside the world.
outsideLight | – Light level of outside |
MapSetSectorLighting makes a sector have a different light level.
sector | – Number of sector |
lightLevel | – new lighting level |
MapSetUpperTextureForSide changes the texture used on the lower part of walls.
sideNum | – Side definition to affect. |
p_textureName | – Name of texture to use. |
T_void MapSetWallBitmapTextureXY | ( | T_word16 | wallNum, |
T_word16 | side, | ||
T_sword16 | offX, | ||
T_sword16 | offY | ||
) |
MapSetWallBitmapTextureXY changes the x and y offset of a wall's texture. Just pass in what wall, side, and the new x & y offset.
wallNum | – Number of wall to change. |
side | – Side of the wall (0 or 1) |
offX | – Offset in X (left to right) direction. |
offY | – Offset in Y (top to bottom) direction. |
MapSetWallTexture tries to be the all-in-wall way to change wall textures. If called on a wall, it will only change one part of the wall based on what exists based on the following priority - Main, Lower, & Upper.
sideNum | – Side definition to affect. |
p_textureName | – Name of texture to use. |
When the current map is no longer needed, call this routine to remove it. All information and pictures concerning that map is removed from memory.