diff --git a/src/projectM-sdl/SDLprojectM.xcodeproj/project.pbxproj b/src/projectM-sdl/SDLprojectM.xcodeproj/project.pbxproj index 47b59d8a5..252085e59 100644 --- a/src/projectM-sdl/SDLprojectM.xcodeproj/project.pbxproj +++ b/src/projectM-sdl/SDLprojectM.xcodeproj/project.pbxproj @@ -195,8 +195,8 @@ 166853F02105E2850042793A /* SDL2.framework */, 1612CA10207A8D2400862A3A /* shaders */, 1612C98C207A807000862A3A /* libprojectM.xcodeproj */, - 169501FE1F7009E9008FAF86 /* pmSDL.cpp */, 169501FF1F7009E9008FAF86 /* pmSDL.hpp */, + 169501FE1F7009E9008FAF86 /* pmSDL.cpp */, C345214E1BF022A5001707D2 /* projectM_SDL_main.cpp */, C307DFD31D565B57002F6B9E /* presets */, 16A42128207802AF006F30CE /* Dependencies */, diff --git a/src/projectM-sdl/pmSDL.cpp b/src/projectM-sdl/pmSDL.cpp index f7dbb5a0f..42d393c9d 100644 --- a/src/projectM-sdl/pmSDL.cpp +++ b/src/projectM-sdl/pmSDL.cpp @@ -181,8 +181,6 @@ void projectMSDL::addFakePCM() { void projectMSDL::resize(unsigned int width_, unsigned int height_) { width = width_; height = height_; - settings.windowWidth = width; - settings.windowHeight = height; projectM_resetGL(width, height); } diff --git a/src/projectM-sdl/pmSDL.hpp b/src/projectM-sdl/pmSDL.hpp index 42c271ff2..9ac3166ad 100644 --- a/src/projectM-sdl/pmSDL.hpp +++ b/src/projectM-sdl/pmSDL.hpp @@ -27,8 +27,6 @@ #endif #endif -const float FPS = 60; - class projectMSDL : public projectM { public: bool done; @@ -51,7 +49,6 @@ private: SDL_Window *win; SDL_GLContext *glCtx; bool isFullScreen; - projectM::Settings settings; SDL_AudioDeviceID audioInputDevice; unsigned int width, height; bool renderToTexture; diff --git a/src/projectM-sdl/projectM_SDL_main.cpp b/src/projectM-sdl/projectM_SDL_main.cpp index dcac3cdf5..5d2f75443 100644 --- a/src/projectM-sdl/projectM_SDL_main.cpp +++ b/src/projectM-sdl/projectM_SDL_main.cpp @@ -118,15 +118,16 @@ int main(int argc, char *argv[]) { if (! configFilePath.empty()) { // found config file, use it app = new projectMSDL(configFilePath, 0); + SDL_Log("Using config from %s", configFilePath.c_str()); } else { - SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Config file not found, using development settings\n"); + SDL_Log("Config file not found, using development settings"); float heightWidthRatio = (float)height / (float)width; projectM::Settings settings; settings.windowWidth = width; settings.windowHeight = height; settings.meshX = 300; settings.meshY = settings.meshX * heightWidthRatio; - settings.fps = FPS; + settings.fps = 60; settings.smoothPresetDuration = 3; // seconds settings.presetDuration = 7; // seconds settings.beatSensitivity = 0.8; @@ -165,7 +166,11 @@ int main(int argc, char *argv[]) { #endif // standard main loop - const Uint32 frame_delay = 1000/FPS; + int fps = app->settings().fps; + printf("fps: %d\n", fps); + if (fps <= 0) + fps = 60; + const Uint32 frame_delay = 1000/fps; Uint32 last_time = SDL_GetTicks(); while (! app->done) { app->renderFrame();