diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2004-11-26 21:09:45 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2004-11-26 21:09:45 +0000 |
commit | 36afa75c11b66fd9547f67819edb35388694adfa (patch) | |
tree | 4600cf534176275660023457a5dc9b65e53c1168 /src | |
parent | e1a160b243717b4e5acae42f1cd27aad73d47d95 (diff) | |
download | mana-36afa75c11b66fd9547f67819edb35388694adfa.tar.gz mana-36afa75c11b66fd9547f67819edb35388694adfa.tar.bz2 mana-36afa75c11b66fd9547f67819edb35388694adfa.tar.xz mana-36afa75c11b66fd9547f67819edb35388694adfa.zip |
Auto detect keyboard WIN32
Diffstat (limited to 'src')
-rw-r--r-- | src/game.cpp | 14 | ||||
-rw-r--r-- | src/graphic/graphic.cpp | 19 |
2 files changed, 19 insertions, 14 deletions
diff --git a/src/game.cpp b/src/game.cpp index 37f0a000..9d26add8 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -229,16 +229,10 @@ void do_input() { action_time = false; //alert("","","","","",0,0); } - if(key[KEY_F12] && action_time==true) { - if(screen_mode==2) { - screen_mode = 1; - } else { - screen_mode = 2; - } - if(set_gfx_mode(screen_mode, 800, 600, 0, 0)) { - error(allegro_error); - } - action_time = false; + if(key[KEY_F10] && action_time==true) { + screen_mode = 1-(screen_mode-1)+1; + if(set_gfx_mode(screen_mode, 800, 600, 0, 0)) + error(allegro_error); } if(key[KEY_ENTER]) { diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp index f7ed419d..6a0c1dba 100644 --- a/src/graphic/graphic.cpp +++ b/src/graphic/graphic.cpp @@ -219,6 +219,16 @@ void init_graphic() { if((gfx_capabilities & GFX_HW_VRAM_BLIT)&& stretch_mode==0) { vpage[0] = create_video_bitmap(SCREEN_W, SCREEN_H); vpage[1] = create_video_bitmap(SCREEN_W, SCREEN_H); + if(!vpage[0]) { + warning("Not enough video memory [VPAGE_0]"); + vpage[0] = create_bitmap(SCREEN_W, SCREEN_W); + if(!vpage[0])error("Not enough memory [VPAGE_0]"); + } + if(!vpage[1]) { + warning("Not enough video memory [VPAGE_1]"); + vpage[1] = create_bitmap(SCREEN_W, SCREEN_W); + if(!vpage[1])error("Not enough memory [VPAGE_1]"); + } } else { vpage[0] = create_bitmap(SCREEN_W, SCREEN_H); vpage[1] = create_bitmap(SCREEN_W, SCREEN_H); @@ -252,7 +262,8 @@ void do_graphic(void) { sort(); frame++; - acquire_bitmap(vbuffer); + if(is_video_bitmap(vbuffer)) + acquire_bitmap(vbuffer); for(int j=0;j<20;j++) for(int i=0;i<26;i++) { @@ -371,7 +382,8 @@ void do_graphic(void) { for(int i=0;i<26;i++) if(get_tile(i+camera_x, j+camera_y, 2)>0 && get_tile(i+camera_x, j+camera_y, 2)<600) masked_blit(vtileset, vbuffer, get_tile_x(i+camera_x, j+camera_y, 2)*16, get_tile_y(i+camera_x, j+camera_y, 2)*16, i*16-offset_x, j*16-offset_y, 16, 16); - release_bitmap(vbuffer); + if(is_video_bitmap(vbuffer)) + release_bitmap(vbuffer); if(stretch_mode==0) { acquire_bitmap(vpage[page_num]); @@ -380,10 +392,9 @@ void do_graphic(void) { Super2xSaI(vbuffer, vpage[page_num], 0, 0, 0, 0, 400, 300); else if(stretch_mode==2) SuperEagle(vbuffer, vpage[page_num], 0, 0, 0, 0, 400, 300); + textprintf_ex(vpage[page_num], font, 0, 0, makecol(255,255,255), -1, "[%i fps]", fps); - - // Draw player speech node = get_head(); while(node) { |