mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
WIP
This commit is contained in:
parent
1216ca08b6
commit
561469f4fd
@ -99,7 +99,7 @@ file (COPY LICENSE.all DESTINATION share/doc/planetblupi)
|
|||||||
file (RENAME "${CMAKE_BINARY_DIR}/share/doc/planetblupi/LICENSE.all"
|
file (RENAME "${CMAKE_BINARY_DIR}/share/doc/planetblupi/LICENSE.all"
|
||||||
"${CMAKE_BINARY_DIR}/share/doc/planetblupi/copyright")
|
"${CMAKE_BINARY_DIR}/share/doc/planetblupi/copyright")
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE)
|
if (BUILD_LINUX)
|
||||||
file (COPY resources/icon/hicolor DESTINATION share/icons)
|
file (COPY resources/icon/hicolor DESTINATION share/icons)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <vector>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <SDL_image.h>
|
#include <SDL_image.h>
|
||||||
#include <argagg/argagg.hpp>
|
#include <argagg/argagg.hpp>
|
||||||
@ -663,7 +663,7 @@ parseArgs (int argc, char * argv[], bool & exit)
|
|||||||
g_settingsOverload |= SETTING_ZOOM;
|
g_settingsOverload |= SETTING_ZOOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args["legacy"])
|
// if (args["legacy"])
|
||||||
{
|
{
|
||||||
Display::getDisplay ().setDisplaySize (LXLOGIC (), LYLOGIC ());
|
Display::getDisplay ().setDisplaySize (LXLOGIC (), LYLOGIC ());
|
||||||
g_settingsOverload |= SETTING_LEGACY;
|
g_settingsOverload |= SETTING_LEGACY;
|
||||||
@ -1029,10 +1029,10 @@ DoInit (int argc, char * argv[], bool & exit)
|
|||||||
g_pPixmap->LoadCursors ();
|
g_pPixmap->LoadCursors ();
|
||||||
g_pPixmap->ChangeSprite (SPRITE_WAIT);
|
g_pPixmap->ChangeSprite (SPRITE_WAIT);
|
||||||
|
|
||||||
g_updateThread = new std::thread (CheckForUpdates);
|
// g_updateThread = new std::thread (CheckForUpdates);
|
||||||
if (zoom != g_zoom)
|
// if (zoom != g_zoom)
|
||||||
g_pEvent->SetWindowSize (g_zoom);
|
// g_pEvent->SetWindowSize (g_zoom);
|
||||||
g_pEvent->SetFullScreen (g_bFullScreen);
|
// g_pEvent->SetFullScreen (g_bFullScreen);
|
||||||
g_pEvent->ChangePhase (EV_PHASE_INTRO1);
|
g_pEvent->ChangePhase (EV_PHASE_INTRO1);
|
||||||
|
|
||||||
g_bTermInit = true;
|
g_bTermInit = true;
|
||||||
@ -1043,9 +1043,9 @@ static void
|
|||||||
initGettext ()
|
initGettext ()
|
||||||
{
|
{
|
||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
textdomain ("planetblupi");
|
// textdomain ("planetblupi");
|
||||||
bindtextdomain ("planetblupi", (GetShareDir () + "locale").c_str ());
|
// bindtextdomain ("planetblupi", (GetShareDir () + "locale").c_str ());
|
||||||
bind_textdomain_codeset ("planetblupi", "UTF-8");
|
// bind_textdomain_codeset ("planetblupi", "UTF-8");
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -4067,8 +4067,6 @@ CEvent::SetLanguage (Language lang)
|
|||||||
|
|
||||||
{
|
{
|
||||||
putenv (env);
|
putenv (env);
|
||||||
extern int _nl_msg_cat_cntr;
|
|
||||||
++_nl_msg_cat_cntr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_SetWindowTitle (g_window, gettext ("Planet Blupi"));
|
SDL_SetWindowTitle (g_window, gettext ("Planet Blupi"));
|
||||||
|
@ -40,10 +40,10 @@ CSound::StopAllSounds (bool immediat, const std::set<Sint32> * except)
|
|||||||
|
|
||||||
if (Mix_Playing (i + 1) == SDL_TRUE)
|
if (Mix_Playing (i + 1) == SDL_TRUE)
|
||||||
{
|
{
|
||||||
if (immediat)
|
//if (immediat)
|
||||||
Mix_HaltChannel (i + 1);
|
Mix_HaltChannel (i + 1);
|
||||||
else
|
//else
|
||||||
Mix_FadeOutChannel (i + 1, 500);
|
// 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)
|
if (m_lpSDL[channel] && m_sndFiles[channel] == sound)
|
||||||
return true;
|
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 (!chunk)
|
||||||
{
|
{
|
||||||
if (GetLocale () != "en")
|
if (GetLocale () != "en")
|
||||||
@ -271,7 +276,7 @@ CSound::PlayImage (Sounds channel, Point pos, Sint32 rank)
|
|||||||
{
|
{
|
||||||
stopCh = m_channelBlupi[rank];
|
stopCh = m_channelBlupi[rank];
|
||||||
if (stopCh >= 0 && m_lpSDL[stopCh] != nullptr)
|
if (stopCh >= 0 && m_lpSDL[stopCh] != nullptr)
|
||||||
Mix_FadeOutChannel (stopCh + 1, 500);
|
Mix_HaltChannel (stopCh + 1);
|
||||||
|
|
||||||
m_channelBlupi[rank] = channel;
|
m_channelBlupi[rank] = channel;
|
||||||
}
|
}
|
||||||
@ -337,8 +342,11 @@ CSound::PlayMusic (const std::string & lpszMIDIFilename)
|
|||||||
|
|
||||||
if (m_pMusic)
|
if (m_pMusic)
|
||||||
Mix_FreeMusic (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)
|
if (!m_pMusic)
|
||||||
{
|
{
|
||||||
printf ("%s\n", Mix_GetError ());
|
printf ("%s\n", Mix_GetError ());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user