diff --git a/CMakeLists.txt b/CMakeLists.txt index 784c2d0ac0..d764a1ca6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 2.8) - +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override") project(emulationstation-all) #------------------------------------------------------------------------------- diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index 5e2b9b4c2e..082c25ed1d 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -185,13 +185,24 @@ void SystemData::populateFolder(FileData* folder) //fyi, folders *can* also match the extension and be added as games - this is mostly just to support higan //see issue #75: https://github.com/Aloshi/EmulationStation/issues/75 + //We'll ignore any filenames starting with a period. + // + //Generally a good idea on unix-ish systems, but especially important on OS X when files are stored + //on a filesystem (e.g. network share) which does not have native support for HFS+ metadata. + // + //In that situation, OS X puts ._SomeFile clutter all over the place. + + std::string prefix = "."; + isGame = false; - if(std::find(mSearchExtensions.begin(), mSearchExtensions.end(), extension) != mSearchExtensions.end()) + if(std::find(mSearchExtensions.begin(), mSearchExtensions.end(), extension) != mSearchExtensions.end() && + filePath.filename().string().compare(0, prefix.length(), prefix) != 0) { FileData* newGame = new FileData(GAME, filePath.generic_string(), this); folder->addChild(newGame); isGame = true; } + //add directories that also do not match an extension as folders if(!isGame && fs::is_directory(filePath)) diff --git a/es-app/src/VolumeControl.cpp b/es-app/src/VolumeControl.cpp index 989d8e323f..181192819e 100644 --- a/es-app/src/VolumeControl.cpp +++ b/es-app/src/VolumeControl.cpp @@ -18,7 +18,7 @@ std::weak_ptr VolumeControl::sInstance; VolumeControl::VolumeControl() : originalVolume(0), internalVolume(0) #if defined (__APPLE__) - #error TODO: Not implemented for MacOS yet!!! + #elif defined(__linux__) , mixerIndex(0), mixerHandle(nullptr), mixerElem(nullptr), mixerSelemId(nullptr) #elif defined(WIN32) || defined(_WIN32) @@ -68,7 +68,7 @@ void VolumeControl::init() { //initialize audio mixer interface #if defined (__APPLE__) - #error TODO: Not implemented for MacOS yet!!! + #elif defined(__linux__) //try to open mixer device if (mixerHandle == nullptr) @@ -212,7 +212,7 @@ void VolumeControl::deinit() { //deinitialize audio mixer interface #if defined (__APPLE__) - #error TODO: Not implemented for MacOS yet!!! + #elif defined(__linux__) if (mixerHandle != nullptr) { snd_mixer_detach(mixerHandle, mixerCard); @@ -239,7 +239,7 @@ int VolumeControl::getVolume() const int volume = 0; #if defined (__APPLE__) - #error TODO: Not implemented for MacOS yet!!! + return 0; #elif defined(__linux__) if (mixerElem != nullptr) { @@ -333,7 +333,7 @@ void VolumeControl::setVolume(int volume) //store values in internal variables internalVolume = volume; #if defined (__APPLE__) - #error TODO: Not implemented for MacOS yet!!! + return; #elif defined(__linux__) if (mixerElem != nullptr) { diff --git a/es-app/src/VolumeControl.h b/es-app/src/VolumeControl.h index 8f35ea2c27..aead48da1b 100644 --- a/es-app/src/VolumeControl.h +++ b/es-app/src/VolumeControl.h @@ -4,7 +4,7 @@ #include #if defined (__APPLE__) - #error TODO: Not implemented for MacOS yet!!! + #elif defined(__linux__) #include #include @@ -22,7 +22,7 @@ Singleton pattern. Call getInstance() to get an object. class VolumeControl { #if defined (__APPLE__) - #error TODO: Not implemented for MacOS yet!!! + #elif defined(__linux__) static const char * mixerName; static const char * mixerCard; diff --git a/es-app/src/components/TextListComponent.h b/es-app/src/components/TextListComponent.h index 8067cd7391..6c56e1cd84 100644 --- a/es-app/src/components/TextListComponent.h +++ b/es-app/src/components/TextListComponent.h @@ -31,8 +31,10 @@ class TextListComponent : public IList using IList::getTransform; using IList::mSize; using IList::mCursor; +#ifndef __APPLE__ using IList::Entry; - +#endif + public: using IList::size; using IList::isScrolling; diff --git a/es-core/src/AudioManager.cpp b/es-core/src/AudioManager.cpp index c75d3c4caa..8e67c88eb5 100644 --- a/es-core/src/AudioManager.cpp +++ b/es-core/src/AudioManager.cpp @@ -3,7 +3,7 @@ #include #include "Log.h" -std::vector> AudioManager::sSoundVector; +std::vector > AudioManager::sSoundVector; SDL_AudioSpec AudioManager::sAudioFormat; std::shared_ptr AudioManager::sInstance; @@ -16,7 +16,7 @@ void AudioManager::mixAudio(void *unused, Uint8 *stream, int len) SDL_memset(stream, 0, len); //iterate through all our samples - std::vector>::const_iterator soundIt = sSoundVector.cbegin(); + std::vector >::const_iterator soundIt = sSoundVector.cbegin(); while (soundIt != sSoundVector.cend()) { std::shared_ptr sound = *soundIt; diff --git a/es-core/src/AudioManager.h b/es-core/src/AudioManager.h index 37b6d9f7b2..4ff2306271 100644 --- a/es-core/src/AudioManager.h +++ b/es-core/src/AudioManager.h @@ -12,7 +12,7 @@ class AudioManager { static SDL_AudioSpec sAudioFormat; - static std::vector> sSoundVector; + static std::vector > sSoundVector; static std::shared_ptr sInstance; static void mixAudio(void *unused, Uint8 *stream, int len); diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index 76bb1754e3..3e9754c958 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -11,9 +11,18 @@ Window::Window() : mNormalizeNextUpdate(false), mFrameTimeElapsed(0), mFrameCountElapsed(0), mAverageDeltaTime(10), mAllowSleep(true), mSleeping(false), mTimeSinceLastInput(0) { + mHelp = new HelpComponent(this); mBackgroundOverlay = new ImageComponent(this); - mBackgroundOverlay->setImage(":/scroll_gradient.png"); + + +#ifndef __APPLE__ + // This ends up calling some OpenGL methods before SDL has been asked to create a context + // On Mac OS X at least, this causes a EXC_BAD_ACCESS (segfault) + mBackgroundOverlay->setImage(":/scroll_gradient.png"); +#endif + + } Window::~Window() @@ -59,6 +68,9 @@ GuiComponent* Window::peekGui() bool Window::init(unsigned int width, unsigned int height) { + + + if(!Renderer::init(width, height)) { LOG(LogError) << "Renderer failed to initialize!"; @@ -69,6 +81,7 @@ bool Window::init(unsigned int width, unsigned int height) ResourceManager::getInstance()->reloadAll(); + //keep a reference to the default fonts, so they don't keep getting destroyed/recreated if(mDefaultFonts.empty()) { diff --git a/es-core/src/components/ImageGridComponent.h b/es-core/src/components/ImageGridComponent.h index b00a6c624b..2dff4f8faa 100644 --- a/es-core/src/components/ImageGridComponent.h +++ b/es-core/src/components/ImageGridComponent.h @@ -21,8 +21,10 @@ class ImageGridComponent : public IList using IList::getTransform; using IList::mSize; using IList::mCursor; - using IList::Entry; - using IList::mWindow; +#ifndef __APPLE__ + using IList::Entry; +#endif + using IList::mWindow; public: using IList::size;