int ism_move_wall(unsigned char axis, int wall, int offsetaxis, int offsetheight); |
Description: |
Moves one or many walls. |
Parameters: |
axis: the wall's axis. Possible values are HIGH_X, LOW_X, HIGH_Y and LOW_Y. |
wall: the wall's number. You can use ALL to move all the walls of the given axis. |
offsetaxis, offsetheight: the offset ot the wall on the given axis and on height. |
Returns: |
0 if it worked, -1 if it failed. |
int ism_move_floor_tile(int x, int y, int offsetx, int offsety); |
Description: |
Moves one or many floor tiles. |
Parameters: |
x, y: the coordinates of the floor tile. You can use ALL on one of them to move a full row of tiles. You can use it on both of them too, to move all floor tiles. |
offsetx, offsety: the floor tile offset on the x and y axis. |
Returns: |
0 if it worked, -1 if it failed. |
ism_id ism_put_grid_object(int x, int y, int z, int height, BITMAP *map, BITMAP *shadow); |
Description: |
Puts a grid object on the isometric view. |
Parameters: |
x, y: the grid cell's coordinates where you want to put the object. |
z: the object's coordinate on the z axis, refering to it's base. You can use TOP to put it just over the highest object there, like if it hat fallen from the sky. This is useful to build stacks of objects, each one just over the previous, withouth calculating each object's z coordinate. |
height: the object's height. |
map: the object's map. If you use NULL, the object will not be drawn, but it will be there for everithing else (collisions, etc.). |
shadow: the object's shadow. If you use NULL, the object will have no shadow. |
Returns: |
The object's identifier if it worked, ID_ERROR if it failed. |
ism_id ism_put_free_object(int x, int y, int z, int widthx, int widthy, int height, BITMAP *map, BITMAP *shadow); |
Description: |
Puts a free object on the isometric view. |
Parameters: |
x, y, z: the coordinates where the object must be placed, refering to the leftmost point of it's base. |
widthx, widthy: the widths of the object on it's X and Y dimensions. |
height: the object's height. |
map: the object's map. If you use NULL, the object will not be drawn, but it will be there for everithing else (collisions, etc.). |
shadow: the object's shadow. If you use NULL, the object will have no shadow. |
Returns: |
The identifier of the object if it worked, ID_ERROR if it failed. |
int ism_get_object_data(ism_id id, unsigned char data); |
Description: |
Returns the requested object's data. |
Parameters: |
id: the object's identifier. |
data: the data you want to know about the object. Possible values are: D_X (the x coordinate), D_Y (the y coordinate), D_Z (the z coordinate), D_WIDTH_X (width on the x dimension), D_WIDTH_Y (width on the y dimension), D_HEIGHT (height) and D_TRANSP (the object's transparency percentage). |
Notes: |
Asking about a grid object's x or y coordinate will return the x or the y of it's grid cell. |
Returns: |
The requested data if it worked, -1 if it failed. |
int ism_get_object_coords(ism_id id, int *dstx, int *dsty, int *dstz); |
Description: |
Stores the object's coordinates on the given variables. |
Parameters: |
id: the object's identifier. |
dstx, dsty, dstz: the variables where the function will store the object's coordinates. |
Notes: |
If the object is a grid one, the value stored on dstx and dsty will be the x or the y of it's grid cell. |
Returns: |
0 if it worked, -1 if it failed. |
int ism_change_object_data(ism_id id, unsigned char data, int value, unsigned char mode); |
Description: |
Modifies the requested object's data. |
Parameters: |
id: the object's identifier. |
data: the object's data that you want to modify. Possible values are: D_X (the x coordinate), D_Y (the y coordinate), D_Z (the z coordinate), D_WIDTH_X (width on the x dimension), D_WIDTH_Y (width on the y dimension), D_HEIGHT (height) and D_TRANSP (the object's transparency percentage). |
value: the new value to be assigned to the requested data. |
mode: the way you want to change the data. You can use CHANGE to change the old data by value, or ADD to add value to it. |
Notes: |
An error will occur if you try to change a grid object's x or y coordinate, it's width, or it's transparency percentage. |
Returns: |
0 if it worked, -1 if it failed. |
int ism_move_object(ism_id id, int x, int y, int z, unsigned char mode); |
Description: |
Modifies an object's coordinates. |
Parameters: |
id: the object's identifier. |
x, y, z: the new coordinate's values. |
mode: the way you want to move the object. You can use CHANGE to move the object to x, y, z, or ADD to add x, y, z to the previous coordinates. |
Notes: |
An error will occur if you try to move a grid object with this function. |
Returns: |
0 if it worked, -1 if it failed. |
int ism_get_free_coords(int x, int y, int *fx, int *fy); |
Description: |
Gets the x and y coords, refered to the coordinates axis, of the leftmost point of a grid's cell. |
Parameters: |
x, y: the cell's grid coords. |
fx, fy: pointers to the variables where you want the free x and y to be stored. |
Returns: |
0 if it worked, -1 if it failed. |
int ism_coords_iso_to_2d(int xiso, int yiso, int ziso, int *x2d, int *y2d); |
Description: |
Turns 3d isometric coordinates into their 2d bitmap equivalents. That is, tells you where a certain isometric point will be drawn on your destination bitmap. |
Parameters: |
xiso, yiso, ziso: the isometric coordinates you want to translate into 2d. |
x2d, y2d: pointers to the variables where you want the 2d x and y to be stored. |
Comments: |
The returned 2d coordinates refer to the bitmap where you are drawing your isometric world, and where on it are you are drawing the isometric origin of coordinates, that is, the three parameters of your last call to ism_draw_isom_world(BITMAP *map_dest, int x0, int y0);. |
Returns: |
0 if it worked, -1 if it failed. |
int ism_coords_2d_to_iso(int *xiso, int *yiso, int *ziso, int x2d, int y2d, int fixedv, unsigned char fixedc); |
Description: |
Turns 2d bitmap coordinates into their 3d isometric equivalents. That is, tells what's the isometric point that's aligned with a certain 2d point of your destination bitmap and is into a certain plane. |
Parameters: |
xiso, yiso, ziso: pointers to the variables where you want the isometric coordinates to be stored. |
x2d, y2d: x and y of the 2d bitmap point. |
fixedv, fixedc: the plane that contains the isometric point. It must be parallel to the x, y or z plane, so fixedc can be D_X, D_Y or D_Z, while fixedv is the coordinate of that plane. |
Comments: |
Please note that a 2d bitmap point doesn't give you a single isometric point, but a whole line that's perpendicular to the bitmap, so to give you a single point, that line must be intersected by a plane, and that's the one you must tell the function with the last two parameters. For example, if you want to know about an iso point on the floor that's at your 2d bitmap coordinates, fixedv must be 0 and fixedc D_Z. |
Returns: |
0 if it worked, -1 if it failed. |
int ism_set_transp_func(void(*f_transp)(BITMAP *, BITMAP *, int, int, int)); |
Description: |
Sets the function Isomot must use to draw transparent objects. |
Parameters: |
f_transp: the transparency function to be used. |
Comments: |
f_transp must be a function returning void, and taking the following parameters: (BITMAP *src, BITMAP *dst, int x, int y, int fact), where src and dst are the source and destiny maps (that is, src will be drawn on dst), x and y are the coordinates of dst where scr will be drawn, and fact is the transparency factor, ranging from 0 (what's a 100% transparency level) to 255 (0%). This is just the same declaration as the one for the fblend_trans function from the FBlend library, and that's not a coincidence ;). So, if you use FBlend on your project, you just have to call ism_set_transp_func(fblend_trans); fot Isomot to use it, instead of the Allegro standard blenders. |
Returns: |
0 if it worked, -1 if it failed. |