diff --git a/CMakeLists.txt b/CMakeLists.txt index 023d290..0645b77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,7 +99,7 @@ file (COPY LICENSE.all DESTINATION share/doc/planetblupi) file (RENAME "${CMAKE_BINARY_DIR}/share/doc/planetblupi/LICENSE.all" "${CMAKE_BINARY_DIR}/share/doc/planetblupi/copyright") -if (UNIX AND NOT APPLE) +if (BUILD_LINUX) file (COPY resources/icon/hicolor DESTINATION share/icons) endif () diff --git a/src/blupi.cxx b/src/blupi.cxx index 40fcd60..081d145 100644 --- a/src/blupi.cxx +++ b/src/blupi.cxx @@ -28,8 +28,8 @@ #include #include #include -#include #include +#include #include #include @@ -663,7 +663,7 @@ parseArgs (int argc, char * argv[], bool & exit) g_settingsOverload |= SETTING_ZOOM; } - if (args["legacy"]) + // if (args["legacy"]) { Display::getDisplay ().setDisplaySize (LXLOGIC (), LYLOGIC ()); g_settingsOverload |= SETTING_LEGACY; @@ -1029,10 +1029,10 @@ DoInit (int argc, char * argv[], bool & exit) g_pPixmap->LoadCursors (); g_pPixmap->ChangeSprite (SPRITE_WAIT); - g_updateThread = new std::thread (CheckForUpdates); - if (zoom != g_zoom) - g_pEvent->SetWindowSize (g_zoom); - g_pEvent->SetFullScreen (g_bFullScreen); + // g_updateThread = new std::thread (CheckForUpdates); + // if (zoom != g_zoom) + // g_pEvent->SetWindowSize (g_zoom); + // g_pEvent->SetFullScreen (g_bFullScreen); g_pEvent->ChangePhase (EV_PHASE_INTRO1); g_bTermInit = true; @@ -1043,9 +1043,9 @@ static void initGettext () { setlocale (LC_ALL, ""); - textdomain ("planetblupi"); - bindtextdomain ("planetblupi", (GetShareDir () + "locale").c_str ()); - bind_textdomain_codeset ("planetblupi", "UTF-8"); + // textdomain ("planetblupi"); + // bindtextdomain ("planetblupi", (GetShareDir () + "locale").c_str ()); + // bind_textdomain_codeset ("planetblupi", "UTF-8"); } int diff --git a/src/event.cxx b/src/event.cxx index fd36804..10e427e 100644 --- a/src/event.cxx +++ b/src/event.cxx @@ -4067,8 +4067,6 @@ CEvent::SetLanguage (Language lang) { putenv (env); - extern int _nl_msg_cat_cntr; - ++_nl_msg_cat_cntr; } SDL_SetWindowTitle (g_window, gettext ("Planet Blupi")); diff --git a/src/sound.cxx b/src/sound.cxx index da24b20..e5f5ed2 100644 --- a/src/sound.cxx +++ b/src/sound.cxx @@ -40,10 +40,10 @@ CSound::StopAllSounds (bool immediat, const std::set * except) if (Mix_Playing (i + 1) == SDL_TRUE) { - if (immediat) + //if (immediat) Mix_HaltChannel (i + 1); - else - Mix_FadeOutChannel (i + 1, 500); + //else + // Mix_FadeOutChannel (i + 1, 500); } } @@ -176,7 +176,12 @@ CSound::Cache (Sint32 channel, const std::string & pFilename) if (m_lpSDL[channel] && m_sndFiles[channel] == sound) return true; - Mix_Chunk * chunk = Mix_LoadWAV (file.c_str ()); + Mix_Chunk * chunk = nullptr; + std::string absolute; + + if (FileExists (file, absolute, Location::LOCATION_ABSOLUTE)) + chunk = Mix_LoadWAV (file.c_str ()); + if (!chunk) { if (GetLocale () != "en") @@ -271,7 +276,7 @@ CSound::PlayImage (Sounds channel, Point pos, Sint32 rank) { stopCh = m_channelBlupi[rank]; if (stopCh >= 0 && m_lpSDL[stopCh] != nullptr) - Mix_FadeOutChannel (stopCh + 1, 500); + Mix_HaltChannel (stopCh + 1); m_channelBlupi[rank] = channel; } @@ -337,8 +342,11 @@ CSound::PlayMusic (const std::string & lpszMIDIFilename) if (m_pMusic) Mix_FreeMusic (m_pMusic); +SDL_Log(lpszMIDIFilename.c_str()); + std::string absolute; + if (FileExists (lpszMIDIFilename, absolute, Location::LOCATION_ABSOLUTE)) + m_pMusic = Mix_LoadMUS (lpszMIDIFilename.c_str ()); - m_pMusic = Mix_LoadMUS (lpszMIDIFilename.c_str ()); if (!m_pMusic) { printf ("%s\n", Mix_GetError ());