1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00
This commit is contained in:
Mathieu Schroeter 2018-07-20 14:54:08 +02:00
parent 1216ca08b6
commit 561469f4fd
4 changed files with 24 additions and 18 deletions

View File

@ -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 ()

View File

@ -28,8 +28,8 @@
#include <stdlib.h>
#include <string>
#include <thread>
#include <vector>
#include <unistd.h>
#include <vector>
#include <SDL_image.h>
#include <argagg/argagg.hpp>
@ -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

View File

@ -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"));

View File

@ -40,10 +40,10 @@ CSound::StopAllSounds (bool immediat, const std::set<Sint32> * 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 ());