summaryrefslogtreecommitdiff
path: root/src/graphic/graphic.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2004-12-20 08:08:32 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2004-12-20 08:08:32 +0000
commit41b0b5c0ed80d812d13c8c92d286a8663084ec58 (patch)
tree26e968bb48a886bccf8aa17e8064e6f3b8f2bc5d /src/graphic/graphic.cpp
parent1883b8b5e20506e41f31bdf6b802fbfd3f63f961 (diff)
downloadmana-41b0b5c0ed80d812d13c8c92d286a8663084ec58.tar.gz
mana-41b0b5c0ed80d812d13c8c92d286a8663084ec58.tar.bz2
mana-41b0b5c0ed80d812d13c8c92d286a8663084ec58.tar.xz
mana-41b0b5c0ed80d812d13c8c92d286a8663084ec58.zip
Updated Debian package, some fixes, new classes for the new graphic engine
Diffstat (limited to 'src/graphic/graphic.cpp')
-rw-r--r--src/graphic/graphic.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp
index 8435c5c5..375f2256 100644
--- a/src/graphic/graphic.cpp
+++ b/src/graphic/graphic.cpp
@@ -244,6 +244,7 @@ void init_graphic() {
skill_list_player = init_dialog(skill_list_dialog, -1);
npc_list_player = init_dialog(npc_list_dialog, -1);
//gui_bitmap = vpage[page_num];
+ text_mode(-1);
inventory.create(100, 100);
#ifdef WIN32
@@ -609,3 +610,37 @@ void exit_graphic() {
shutdown_dialog(npc_player);
shutdown_dialog(skill_player);
}
+
+GraphicEngine::GraphicEngine() {
+ tileset = new Spriteset("./data/graphic/tileset.dat");
+
+ if(gfx_capabilities & GFX_HW_VRAM_BLIT) {
+ BITMAP *page1 = create_video_bitmap(SCREEN_W, SCREEN_H);
+ BITMAP *page2 = create_video_bitmap(SCREEN_W, SCREEN_H);
+ if(page1 && page2) {
+ surface = new VideoSurface(page1, page2);
+ } else {
+ if(page1)destroy_bitmap(page1);
+ if(page2)destroy_bitmap(page2);
+ BITMAP *buffer = create_bitmap(SCREEN_W, SCREEN_H);
+ if(!buffer) {
+ error("Not enough memory to create primary surface");
+ }
+ else {
+ warning("Not enough video memory to create primary surface");
+ }
+ surface = new MemorySurface(buffer);
+ }
+ }
+ else {
+ BITMAP *buffer = create_bitmap(SCREEN_W, SCREEN_H);
+ if(!buffer) {
+ error("Not enough memory to create primary surface");
+ }
+ surface = new MemorySurface(buffer);
+ }
+}
+
+GraphicEngine::~GraphicEngine() {
+ delete tileset;
+} \ No newline at end of file