Bitmaps and sprite routines

Objects:
BITMAP Stores the contents of a bitmap. The `w' and `h' fields can be used to obtain the size of an existing bitmap. The clipping rectangle is inclusive on the left and top (0 allows drawing to position 0) but exclusive on the right and bottom (10 allows drawing to position 9, but not to 10). Note this is not the same format as that of the clipping API, which takes inclusive coordinates for all four corners. All the values of this structure should be regarded as read-only, with the exception of the line field, whose access is described in depth in the "Direct access to video memory" section of the manual. If you want to modify the clipping region, please refrain from changing this structure. Use set_clip_rect() instead.
RLE_SPRITE RLE sprites store the image in a simple run-length encoded format, where repeated zero pixels are replaced by a single length count, and strings of non-zero pixels are preceded by a counter giving the length of the solid run.
Routines:
create_bitmap Creates a memory bitmap.
create_sub_bitmap Creates a memory sub bitmap.
destroy_bitmap Destroys any type of created bitmap.
is_sub_bitmap Tells if a bitmap is a sub bitmap.
set_clip_rect Sets the clipping rectangle of a bitmap.
get_clip_rect Returns the clipping rectangle of a bitmap.
add_clip_rect Intersects a bitmap's clipping rectangle with the given area.
is_inside_bitmap Tells if a point is inside a bitmap.
set_clip_state Turns on or off the clipping of a bitmap.
get_clip_state Tells if clipping is on for a bitmap.
blit Copies a rectangular area from one bitmap to another.
stretch_blit Scales a rectangular area from one bitmap to another.
masked_blit Copies a rectangle skipping pixels with the mask color.
masked_stretch_blit Scales a rectangular area skipping pixels with the mask color.
stretch_sprite Stretches a sprite to the destination bitmap.
draw_sprite Draws a copy of the sprite onto the destination bitmap.
draw_character_ex Draws non transparent pixels of the sprite with a color.
get_rle_sprite Creates an RLE sprite using a bitmap as source.
destroy_rle_sprite Destroys an RLE sprite.
draw_rle_sprite Draws an RLE sprite.

Drawing primitives

Routines:
clear_bitmap Clears the bitmap to color 0.
clear_to_color Clears the bitmap to the specified color.
putpixel Writes a pixel into a bitmap.
getpixel Reads a pixel from a bitmap.
rectfill Draws a solid filled rectangle.
rect Draws an outline rectangle
do_line Calculates all the points along a line.
line Draws a line onto the bitmap.
vline Draws a vertical line onto the bitmap.
hline Draws a horizontal line onto the bitmap.
triangle Draws a outlined triangle.
do_circle Calculates all the points in a circle.
circle Draws a circle.
circlefill Draws a filled circle.
do_ellipse Calculates all the points in an ellipse
ellipse Draws an ellipse.
ellipsefill Draws a filled ellipse.
do_arc Calculates all the points in a circular arc.
arc Draws a circular arc.
floodfill Floodfills an enclosed area.

DataFiles

Objects:
DATAFILE The only really important piece of information here is the `dat' field, which points to the contents of the object.
DATAFILE_PROPERTY Property of DATAFILE object. Each DATAFILE object can store few number of properties.
Routines:
load_datafile Loads an entire data file into memory, and returns array of DATAFILE objects.

Colors

Routines:
color_to_int Converts C# Color object into the int
int_to_color Converts int into the C# Color object
makecol_depth Converts R, G, and B values (ranging 0-255) to whatever pixel format is required by the specified color depth.
makeacol_depth Converts R, G, B, and A values (ranging 0-255) to whatever pixel format is required by the specified color depth.

Perfect Pixel Collision Detection

Objects:
PPCOL_MASK Pixel perfect collision sprite mask structure
Routines:
create_ppcol_mask This is the mask creation routine. Given a sprite it creates a mask for that sprite. Returns a pointer to a PPCOL_MASK or null if there is a problem.
destroy_ppcol_mask Destroys mask object.
check_bb_collision This is the bounding box collision detection.
check_ppmask_collision This is the pixel perfect collision detection routine. Returns false if there is not collision and true if there is a collision.
draw_ppmask Draw mask object with specified color.

Last edited Oct 12, 2010 at 7:30 PM by plandem, version 9

Comments

No comments yet.