From ad12a9189f33e65de827219eb573a6e63c7862c9 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 19 Jan 2005 12:10:31 +0000 Subject: *** empty log message *** --- src/game.cpp | 8 -------- src/main.cpp | 38 ++++++++++++++++++++++++++------------ src/main.h | 2 ++ src/sound/sound.cpp | 9 ++------- src/sound/sound.h | 14 ++------------ 5 files changed, 32 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/game.cpp b/src/game.cpp index 990a139b..3498345c 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -39,10 +39,6 @@ char map_path[480]; -#ifndef WIN32 -extern Sound sound; -#endif /* not WIN32 */ - unsigned short dest_x, dest_y, src_x, src_y; unsigned int player_x, player_y; bool refresh_beings = false; @@ -130,9 +126,7 @@ void do_init() { error("Could not find map file"); } -#ifndef WIN32 sound.startBgm("./data/sound/Mods/somemp.xm", -1); -#endif /* not WIN32 */ // Initialize timers tick_time = 0; @@ -872,12 +866,10 @@ void do_parse() { // Level up case 0x019b: if (RFIFOL(2) == player_node->id) { -#ifndef WIN32 SOUND_SID sound_id = sound.loadItem( "./data/sound/wavs/level.ogg"); sound.startItem(sound_id, 64); sound.clearCache(); -#endif /* not WIN32 */ } break; // Emotion diff --git a/src/main.cpp b/src/main.cpp index 9d128581..c2f2f0fa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -62,9 +62,8 @@ unsigned char direction; unsigned char stretch_mode, screen_mode; char *dir; -#ifndef WIN32 Sound sound; -#endif /* not WIN32 */ + // ini file configuration reader Configuration config; @@ -188,12 +187,6 @@ void init_engine() { config.init(dir); -#ifdef MACOSX - //set_color_depth(32); -#else - //set_color_depth(16); -#endif - SDL_WM_SetCaption("The Mana World", NULL); @@ -217,6 +210,31 @@ void init_engine() { exit(1); } +#ifdef __DEBUG + const SDL_VideoInfo *vi = SDL_GetVideoInfo(); + std::cout << "It is " << ((vi->hw_available) ? "" : "not") << + " possible to create hardware surfaces.\n"; + std::cout << "There is " << ((vi->wm_available) ? "a" : "no") << + " window manager available.\n"; + std::cout << "Hardware to hardware blits are " << + ((vi->blit_hw) ? "" : "not") << " accelerated.\n"; + std::cout << "Hardware to hardware colorkey blits are " << + ((vi->blit_hw_CC) ? "" : "not") << " accelerated.\n"; + std::cout << "Hardware to hardware alpha blits are " << + ((vi->blit_hw_A) ? "" : "not") << " accelerated.\n"; + std::cout << "Software to hardware blits are " << + ((vi->blit_sw) ? "" : "not") << " accelerated.\n"; + std::cout << "Software to hardware colorkey blits are " << + ((vi->blit_sw_CC) ? "" : "not") << " accelerated.\n"; + std::cout << "Software to hardware alpha blits are " << + ((vi->blit_sw_A) ? "" : "not") << " accelerated.\n"; + std::cout << "Color fills are " << + ((vi->blit_fill) ? "" : "not") << " accelerated.\n"; + std::cout << "Available video memory: " << vi->video_mem << "\n"; +#endif + + //vfmt Pixel format of the video device + // Create the graphics context graphics = new Graphics(); @@ -239,7 +257,6 @@ void init_engine() { init_gui(graphics); state = LOGIN; -#ifndef WIN32 // initialize sound-engine and start playing intro-theme /-kth5 try { if (config.getValue("sound", 0) == 1) { @@ -259,7 +276,6 @@ void init_engine() { new OkDialog("Sound Engine", err, &initWarningListener); warning(err); } -#endif /* not WIN32 */ } /** Clear the engine */ @@ -301,9 +317,7 @@ int main(int argc, char *argv[]) { charSelect(); break; case GAME: -#ifndef WIN32 sound.stopBgm(); -#endif /* not WIN32 */ status("GAME"); try { map_start(); diff --git a/src/main.h b/src/main.h index 9444f75b..fd1e4cdb 100644 --- a/src/main.h +++ b/src/main.h @@ -32,6 +32,7 @@ #include "log.h" #include "game.h" #include "net/protocol.h" +#include "sound/sound.h" #include #define CORE_VERSION "0.0.8" @@ -87,5 +88,6 @@ extern unsigned char state; extern unsigned short x, y; extern unsigned char direction; extern Configuration config; +extern Sound sound; #endif diff --git a/src/sound/sound.cpp b/src/sound/sound.cpp index d9f8d4ce..ffaf2379 100644 --- a/src/sound/sound.cpp +++ b/src/sound/sound.cpp @@ -21,15 +21,12 @@ * $Id$ */ -#ifndef WIN32 - #include "sound.h" -#ifdef WIN32 - #pragma warning(disable:4312) +#ifdef __DEBUG + #include #endif - /** \brief install the sound engine \param voices overall reserved voices @@ -238,5 +235,3 @@ bool Sound::isMaxVol(int vol) { if (vol > 0 && vol < 128) return false; else return true; } - -#endif /* not WIN32 */ diff --git a/src/sound/sound.h b/src/sound/sound.h index 1404ba48..6209c13e 100644 --- a/src/sound/sound.h +++ b/src/sound/sound.h @@ -24,21 +24,12 @@ #ifndef _TMW_SOUND_H #define _TMW_SOUND_H -#ifndef WIN32 - -#ifdef WIN32 - #pragma warning(disable:4312) -#endif -#include -#include +#include +#include #include #include #include -#ifdef __DEBUG - #include -#endif - typedef short SOUND_SID ; /** @@ -85,5 +76,4 @@ class Sound { bool isMaxVol(int); }; -#endif /* not WIN32 */ #endif -- cgit v1.2.3-70-g09d2