void fillarea(int x, int y, int w, int h, int t){ for(int i=x; i> areamap[i][j]; } } } } void init(){ test=false; teststring="TEST = True"; state=0; gt=0; tileset=1; savednote=0; numentities=0; paraadjustdelay=0; currentarea="unset"; //currentarea="lab"; //currentarea="otherlevel"; //Setup Allegro allegro_init(); //Setup input install_keyboard(); install_mouse(); show_os_cursor(MOUSE_CURSOR_ARROW); //Setup timer install_timer(); LOCK_VARIABLE(speed_counter); LOCK_FUNCTION(increment_speed_counter); install_int_ex(increment_speed_counter, BPS_TO_TIMER(60)); //Setup graphics8 set_color_depth(16); set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0); register_png_file_type(); currentpage=0; fullscreen=false; worldmap=create_bitmap(800,600); buffer=load_png("../../engine/current/data/graphics/tiles.png", dummypal); for(int y=0;y<30;y++){ for(int x=0;x<40;x++){ tiles[x+(y*40)] = create_bitmap(8, 8); rectfill(tiles[x+(y*40)], 0, 0, 8, 8, makecol(16,16,16)); blit(buffer, tiles[x+(y*40)], x*8, y*8, 0, 0, 8,8); } } destroy_bitmap(buffer); buffer=load_png("../../engine/current/data/graphics/tiles2.png", dummypal); for(int y=0;y<30;y++){ for(int x=0;x<40;x++){ tiles2[x+(y*40)] = create_bitmap(8, 8); rectfill(tiles2[x+(y*40)], 0, 0, 8, 8, makecol(16,16,16)); blit(buffer, tiles2[x+(y*40)], x*8, y*8, 0, 0, 8,8); } } destroy_bitmap(buffer); buffer=create_bitmap(320,240); biggerbuffer=create_bitmap(640,480); page[0]=create_video_bitmap(640, 480); page[1]=create_video_bitmap(640, 480); page[2]=create_video_bitmap(640, 480); currentpage=0; //Setup sound set_volume_per_voice(0); if (install_sound(DIGI_AUTODETECT, MIDI_NONE, 0) < 0) { set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); allegro_message("Error installing sound.\n"); } //Init map //Load last? //Blank mapx=100; mapy=100; initworld(); if(!loadmap(mapx, mapy)){ for(int j=0; j<30; j++){ for(int i=0; i<40; i++){ mapcontents[i][j]=0; } } } xp=0; yp=0; ctile=0; tileselectdelay=0; reversekey=0; }