A library for Mode 7 style graphics.
File: |
Mode7.lib |
Version: |
1.0 |
Author: |
Marcus Johansson |
Details
Constants
Sub routines
You can use the floor, item and flag layers from maps generated with the RC editor with this library. The wall and ceiling data is ignored.
Array indexing constants. |
||
Name |
Description | |
M7_X |
X-coordinate. |
|
M7_Z |
Z-coordinate. |
|
M7_ANGLE |
Angle. |
|
M7_FLAG |
Flag. |
Name |
Parameters |
Brief description |
|
procedure |
w, h, zMax# |
Init view. |
|
function |
Get map width. |
||
function |
Return map height. |
||
procedure |
viewx#, viewz#, viewy#, angle#, pitch, fov# |
Render view. |
|
procedure |
Remove all objects. |
||
procedure |
id, img, x#, z#, y#, h#, cel, item_x, item_z |
Add object. |
|
procedure |
id, img, x#, z#, y#, h#, cel |
Modify an already existing object. |
|
procedure |
id |
Remove object. |
|
procedure |
index |
Remove object by index. |
|
function |
id |
Return true if object exists. |
|
function |
filename$ |
Load map. |
|
procedure |
w, h |
Init map. |
|
procedure |
r, g, b, zMin#, zMax# |
Set fog and clipping |
|
procedure |
x, z, img |
Set floor image. |
|
procedure |
x, z, flag |
Set game flag. |
|
procedure |
x, z, item |
Set item. |
|
procedure |
x, z |
Remove item. |
|
function |
x, z |
Get floor index. |
|
function |
x, z |
Return floor image. |
|
function |
img_index |
Get image id. |
|
function |
x, z |
Get game flag. |
|
function |
x, z |
Get item. |
|
function |
flag |
Get map position of game flag. |
procedure M7_Init ( w, h, zMax# )Init view.
[ Back ] |
function M7_GetMapWidth ( )Get map width.
Return value [ Back ] |
function M7_GetMapHeight ( )Return map height.
Return value [ Back ] |
procedure M7_Render ( viewx#, viewz#, viewy#, angle#, pitch, fov# )Render view.
[ Back ] |
procedure M7_ClearObjects ( )Remove all objects. [ Back ] |
procedure M7_AddObject ( id, img, x#, z#, y#, h#, cel, item_x, item_z )If an object with the specified id already exists, it will be replaced.
[ Back ] |
procedure M7_ModifyObject ( id, img, x#, z#, y#, h#, cel )Modify an already existing object.
[ Back ] |
procedure M7_RemoveObject ( id )Remove object.
[ Back ] |
procedure M7_RemoveObjectByIndex ( index )Remove object by index.
[ Back ] |
function M7_HasObject ( id )Return true if object exists.
Return value [ Back ] |
function M7_LoadMap[][] ( filename$ )Load map created with RC Editor. If the size of the returned array is zero, the map could not be read. Else the array contains the player's starting position and all loader flags added in the editor. The player's starting position is ([0][M7_X], [0][M7_Z]), and the set starting angle [0][M7_ANGLE]. You can get the positions of the set loader flags using [n][M7_X] and [n][M7_Z] and the flag value with [n][M7_FLAG], where n >= 1.
Return value [ Back ] |
procedure M7_InitMap ( w, h )If you're not using RC Editor, you can create an empty map with this procedure.
[ Back ] |
procedure M7_SetFog ( r, g, b, zMin#, zMax# )Set fog color and start and end distance. 'zMax' also serves as the far clip plane.
[ Back ] |
procedure M7_SetFloor ( x, z, img )Set floor image.
[ Back ] |
procedure M7_SetFlag ( x, z, flag )Set game flag.
[ Back ] |
procedure M7_SetItem ( x, z, item )Set a value in the item layer. Calling this function does not bind a visible object to the item. If you're using RC editor for your maps, you probably needn't care about this function.
[ Back ] |
procedure M7_RemoveItem ( x, z )If the map was created with RC Editor, the visible object that belongs to the item is also removed.
[ Back ] |
function M7_GetFloor ( x, z )Return the index used in RC Editor of the image used for a certain floor tile. This index makes no sense if map was not created with RC Editor.
Return value [ Back ] |
function M7_GetFloorImage ( x, z )Return floor image.
Return value [ Back ] |
function M7_GetImage ( img_index )This functions returns the id of an image for a certain index. Only makes sense if you're using RC Editor.
Return value [ Back ] |
function M7_GetFlag ( x, z )Get game flag set in RC Editor.
Return value [ Back ] |
function M7_GetItem ( x, z )Get item index set in RC Editor.
Return value [ Back ] |
function M7_GetFlagPos[] ( flag )This will return the position of the first occurence of a certain game flag in the map. Use [M7_X] and [M7_Z] to extract the coordinates. An empty array is returned if flag was not found anywhere in the map.
Return value [ Back ] |
Generated with NLDoc 20140627.