summaryrefslogtreecommitdiff
path: root/src/graphic/graphic.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2004-11-26 21:09:45 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2004-11-26 21:09:45 +0000
commit36afa75c11b66fd9547f67819edb35388694adfa (patch)
tree4600cf534176275660023457a5dc9b65e53c1168 /src/graphic/graphic.cpp
parente1a160b243717b4e5acae42f1cd27aad73d47d95 (diff)
downloadmana-36afa75c11b66fd9547f67819edb35388694adfa.tar.gz
mana-36afa75c11b66fd9547f67819edb35388694adfa.tar.bz2
mana-36afa75c11b66fd9547f67819edb35388694adfa.tar.xz
mana-36afa75c11b66fd9547f67819edb35388694adfa.zip
Auto detect keyboard WIN32
Diffstat (limited to 'src/graphic/graphic.cpp')
-rw-r--r--src/graphic/graphic.cpp19
1 files changed, 15 insertions, 4 deletions
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) {