All pastes #1282165 Raw Edit

main.cpp

public cpp v1 · immutable
#1282165 ·published 2008-12-11 00:42 UTC
rendered paste body
#include <allegro.h>#include <ctime>#include <vector>#include <string>#include "main.h"#include "ent.h"using namespace std;BITMAP *buffer;BITMAP *bg;BITMAP *tmp;ent player = ent();int main(){	initialise();		const int clock_const = CLOCKS_PER_SEC / 60;	clock_t time = clock();		while ( !key[KEY_ESC] ){		clear_keybuf();		clear_bitmap(buffer);		blit(bg, buffer, 0, 0, 0, 0, buffer->w, buffer->h);		set_alpha_blender();		//		player.check();				acquire_screen();		blit(buffer, screen, 0, 0, 0, 0, buffer->w, buffer->h);		release_screen();		poll_keyboard();		while (difftime(clock(),time) < double(clock_const)) {			rest(10000);		}		time = clock();	}	return 0;	}   END_OF_MAIN();inlinevoid initialise(void) {	allegro_init();	install_keyboard();	set_color_conversion(COLORCONV_KEEP_TRANS);	set_color_depth(32);	set_gfx_mode( GFX_AUTODETECT, screen_w, 480, 0, 0);		acquire_screen();	buffer=create_bitmap( screen_w, screen_h);	buffer=load_bitmap("graphics/loading.bmp",NULL);	release_screen();		blit(buffer, screen, 0, 0, 0, 0, buffer->w, buffer->h);		bg = load_bitmap("graphics/grass.bmp",NULL);	tmp=load_tga("graphics/berrybush/berrybush_0010.tga",NULL);	set_alpha_blender();	draw_trans_sprite( bg, tmp, 200, 100);	buffer=create_bitmap( screen_w, screen_h);	blit(bg, buffer, 0, 0, 0, 0, buffer->w, buffer->h);}