#include #include #include #include #include "bmp2txt.h" int main(int argc, char** argv) { int i; int f; /* Internal-to-Screen ratio */ int iw, ih; /* Internal width and height */ int sw, sh; /* Screen width and height */ int x, y, w, h; /* Range of buffer to display */ PALETTE pal; BITMAP* bmp; BITMAP* bmp2; BITMAP* buffer; font_t* font; map_t* map; srand(time(NULL)); sw = 80; sh = 24; f = 2; /* Adjust me! */ iw = ih = sw * f; x = 0; y = (ih - sh * f) / 2; w = iw; h = sh * f; install_allegro(SYSTEM_NONE, &errno, atexit); set_color_depth(8); generate_palette(pal); select_palette(pal); bmp = create_bitmap(iw, ih); buffer = create_bitmap(iw, ih); bmp2 = create_bitmap(sw, sh); map = init_permutation(iw, ih); font = init_bmp2txt(); // for (i = 0; i < 200; i++) { while (1) { permute_bmp(map, bmp, buffer); stretch_blit(bmp, bmp2, x, y, w, h, 0, 0, sw, sh); asciify_bmp(font, bmp2); } cleanup_permutation(map); cleanup_bmp2txt(font); destroy_bitmap(bmp); destroy_bitmap(buffer); return EXIT_SUCCESS; } END_OF_MAIN();