summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-17 23:57:16 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-17 23:57:16 +0000
commit39ea054b214612ae7d56a01884904dcb63181598 (patch)
tree975b05806f0e939d3f2369b46676009f89e692c8 /src/main.cpp
parent40e8a99139fa494f837670737c25755817b961a4 (diff)
downloadmana-39ea054b214612ae7d56a01884904dcb63181598.tar.gz
mana-39ea054b214612ae7d56a01884904dcb63181598.tar.bz2
mana-39ea054b214612ae7d56a01884904dcb63181598.tar.xz
mana-39ea054b214612ae7d56a01884904dcb63181598.zip
Added support for hwaccel option.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index df5cbeec..758e18f3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -197,11 +197,18 @@ void init_engine() {
SDL_WM_SetCaption("The Mana World", NULL);
- int displayFlags = SDL_SWSURFACE | SDL_ANYFORMAT;
+ int displayFlags = SDL_ANYFORMAT;
if ((int)config.getValue("screen", 0)) {
displayFlags |= SDL_FULLSCREEN;
}
+ if ((int)config.getValue("hwaccel", 0)) {
+ std::cout << "Attempting to use hardware acceleration.\n";
+ displayFlags |= SDL_HWSURFACE | SDL_DOUBLEBUF;
+ }
+ else {
+ displayFlags |= SDL_SWSURFACE;
+ }
screen = SDL_SetVideoMode(800, 600, 16, displayFlags);
if (screen == NULL) {
@@ -210,10 +217,6 @@ void init_engine() {
exit(1);
}
- //if (set_gfx_mode((unsigned char)config.getValue("screen", 0), 800, 600,
- // 0, 0)) {
- //}
-
// Create the graphics context
graphics = new Graphics();