You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
793 B
29 lines
793 B
Tile *cartoon_tiles; |
|
Sprite *sprites; |
|
|
|
U0 load_cartoon_images() |
|
{ |
|
uint16 num_tile_info_records; |
|
uint16 num_tiles; |
|
cartoon_tiles = load_tiles("CARTOON.MNI", TRANSPARENT, &num_tiles); |
|
"Loading %d cartoon tiles.\n", num_tiles; |
|
|
|
sprites = load_tile_info("CARTINFO.MNI", &num_tile_info_records); |
|
"Loading %d, cartoon tile info records.\n", num_tile_info_records; |
|
} |
|
|
|
U0 display_cartoon_sequence(uint16 frame_num, uint16 x_pos, uint16 y_pos) |
|
{ |
|
TileInfo *info = &sprites[0].frames[frame_num]; |
|
Tile *tile = &cartoon_tiles[info->tile_num]; |
|
I64 x, y; |
|
|
|
for(y=0; y < info->height; y++) |
|
{ |
|
for(x=0; x < info->width; x++) |
|
{ |
|
video_draw_tile(tile, (x_pos + x) * 8, (y_pos + y - info->height + 1) * 8); |
|
tile++; |
|
} |
|
} |
|
} |