diff --git a/.gitignore b/.gitignore index 1c5b44e09..f8f95d42f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,15 +2,3 @@ xcuserdata src/projectM-emscripten/build/presets presets/custom project.xcworkspace - -# cmake -CMakeCache.txt -CMakeFiles -CMakeScripts -Testing -Makefile -cmake_install.cmake -install_manifest.txt -compile_commands.json -CTestTestfile.cmake - diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..31a6eb1df --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "build"] + path = build + url = https://github.com/c3d/build.git diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..3795091ad --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +all: src.build + +src.build: + $(MAKE) -C src \ No newline at end of file diff --git a/build b/build new file mode 160000 index 000000000..7f0436fc2 --- /dev/null +++ b/build @@ -0,0 +1 @@ +Subproject commit 7f0436fc2765649af4c564f1daf5380e8969e9c1 diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 000000000..f69bbc73f --- /dev/null +++ b/src/Makefile @@ -0,0 +1,9 @@ +.PHONY: libprojectM SDL + +all: libprojectM SDL + +libprojectM: + $(MAKE) -C libprojectM + +SDL: + $(MAKE) -C projectM-sdl diff --git a/src/libprojectM/Common.hpp b/src/libprojectM/Common.hpp index 366802ad6..68a137607 100755 --- a/src/libprojectM/Common.hpp +++ b/src/libprojectM/Common.hpp @@ -46,7 +46,7 @@ //extern FILE *debugFile; #endif -#ifdef MACOS +#ifdef __APPLE__ #include extern FILE *fmemopen(void *buf, size_t len, const char *pMode); #endif /** MACOS */ @@ -75,7 +75,7 @@ extern FILE *fmemopen(void *buf, size_t len, const char *pMode); #define projectM_isnan(x) ((x) != (x)) #endif -#ifdef MACOS +#ifdef __APPLE__ #define projectM_isnan(x) ((x) != (x)) #endif @@ -87,7 +87,7 @@ extern FILE *fmemopen(void *buf, size_t len, const char *pMode); #define projectM_fmax(x,y) ((x) >= (y) ? (x): (y)) #endif -#ifdef MACOS +#ifdef __APPLE__ #define projectM_fmax(x,y) ((x) >= (y) ? (x): (y)) #endif @@ -99,7 +99,7 @@ extern FILE *fmemopen(void *buf, size_t len, const char *pMode); #define projectM_fmin(x,y) ((x) <= (y) ? (x): (y)) #endif -#ifdef MACOS +#ifdef __APPLE__ #define projectM_fmin(x,y) ((x) <= (y) ? (x): (y)) #endif diff --git a/src/libprojectM/Makefile b/src/libprojectM/Makefile new file mode 100644 index 000000000..fa60c009d --- /dev/null +++ b/src/libprojectM/Makefile @@ -0,0 +1,19 @@ +BUILD=../../build/ + +SOURCES=projectM.cpp PCM.cpp Preset.cpp fftsg.cpp KeyHandler.cpp \ + timer.cpp wipemalloc.cpp PresetLoader.cpp PresetChooser.cpp \ + PipelineMerger.cpp ConfigFile.cpp \ + TimeKeeper.cpp PresetFactory.cpp PresetFactoryManager.cpp + +CONFIG=libgl + +CPPFLAGS+= -I . -I Renderer +LDFLAGS+=-lgl +LIBRARIES=Renderer MilkdropPresetFactory NativePresetFactory + +PRODUCTS=libprojectM.lib + +include $(BUILD)rules.mk + +$(BUILD)rules.mk: + cd .. && git submodule update --init --recursive diff --git a/src/libprojectM/MilkdropPresetFactory/Makefile b/src/libprojectM/MilkdropPresetFactory/Makefile new file mode 100644 index 000000000..342c84630 --- /dev/null +++ b/src/libprojectM/MilkdropPresetFactory/Makefile @@ -0,0 +1,28 @@ +BUILD=../../../build/ + +SOURCES= \ + BuiltinFuncs.cpp \ + Func.cpp MilkdropPreset.cpp \ + PresetFrameIO.cpp \ + CustomShape.cpp \ + Eval.cpp \ + MilkdropPresetFactory.cpp \ + PerPixelEqn.cpp BuiltinParams.cpp \ + InitCond.cpp Parser.cpp \ + CustomWave.cpp Expr.cpp \ + PerPointEqn.cpp Param.cpp \ + PerFrameEqn.cpp \ + IdlePreset.cpp \ + ../PresetFactory.cpp \ + + +CPPFLAGS+= -I. -I.. +#LDFLAGS+=-lftgl -lgl -lfreetype -lprojectM + +#LIBRARIES=../libprojectM +PRODUCTS=MilkdropPresetFactory.lib + +include $(BUILD)rules.mk + +$(BUILD)rules.mk: + cd .. && git submodule update --init --recursive diff --git a/src/libprojectM/NativePresetFactory/Makefile b/src/libprojectM/NativePresetFactory/Makefile new file mode 100644 index 000000000..79e645684 --- /dev/null +++ b/src/libprojectM/NativePresetFactory/Makefile @@ -0,0 +1,10 @@ +BUILD=../../../build/ + +SOURCES=NativePresetFactory.cpp +CPPFLAGS+= -I. -I.. +PRODUCTS=NativePresetFactory.lib + +include $(BUILD)rules.mk + +$(BUILD)rules.mk: + cd .. && git submodule update --init --recursive diff --git a/src/libprojectM/PresetLoader.cpp b/src/libprojectM/PresetLoader.cpp index 83e71be06..f1a276989 100644 --- a/src/libprojectM/PresetLoader.cpp +++ b/src/libprojectM/PresetLoader.cpp @@ -23,7 +23,7 @@ extern "C" } #endif -#ifdef MACOS +#ifdef __APPLE__ extern "C" { #include diff --git a/src/libprojectM/Renderer/FBO.hpp b/src/libprojectM/Renderer/FBO.hpp index 8182412bd..aa0e30ca4 100755 --- a/src/libprojectM/Renderer/FBO.hpp +++ b/src/libprojectM/Renderer/FBO.hpp @@ -81,7 +81,7 @@ public: /** Opaque pbuffer context and pbuffer */ /* -#ifdef MACOS +#ifdef __APPLE__ void *origContext; void *pbufferContext; void *pbuffer; diff --git a/src/libprojectM/Renderer/Makefile b/src/libprojectM/Renderer/Makefile new file mode 100644 index 000000000..3fd599c26 --- /dev/null +++ b/src/libprojectM/Renderer/Makefile @@ -0,0 +1,40 @@ +BUILD=../../../build/ + +SOURCES= \ + SOIL2/image_DXT.c \ + SOIL2/image_helper.c \ + SOIL2/SOIL2.c \ + SOIL2/etc1_utils.c \ + FBO.cpp \ + MilkdropWaveform.cpp \ + PerPixelMesh.cpp \ + Pipeline.cpp \ + Renderer.cpp \ + ShaderEngine.cpp \ + UserTexture.cpp \ + Waveform.cpp \ + Filters.cpp \ + PerlinNoise.cpp \ + PipelineContext.cpp \ + Renderable.cpp \ + BeatDetect.cpp \ + Shader.cpp \ + TextureManager.cpp \ + VideoEcho.cpp \ + RenderItemDistanceMetric.cpp \ + RenderItemMatcher.cpp \ + ../KeyHandler.cpp + + +CONFIG=libftgl libGL libfreetype + +CPPFLAGS+= -I. -I.. -ISOIL2 +LDFLAGS+=-lftgl -lgl -lfreetype -lprojectM + +LIBRARIES=../libprojectM +PRODUCTS=Renderer.lib + +include $(BUILD)rules.mk + +$(BUILD)rules.mk: + cd .. && git submodule update --init --recursive diff --git a/src/libprojectM/Renderer/TextureManager.cpp b/src/libprojectM/Renderer/TextureManager.cpp index 743ecfee2..6034e9417 100644 --- a/src/libprojectM/Renderer/TextureManager.cpp +++ b/src/libprojectM/Renderer/TextureManager.cpp @@ -28,7 +28,7 @@ #include #endif -#ifdef MACOS +#ifdef __APPLE__ #include #endif #include "TextureManager.hpp" @@ -219,7 +219,7 @@ unsigned int TextureManager::getTextureMemorySize() void TextureManager::loadTextureDir() { - std::string dirname = CMAKE_INSTALL_PREFIX "/share/projectM/textures"; + std::string dirname = "/usr/local/share/projectM/textures"; DIR * m_dir; diff --git a/src/libprojectM/Renderer/VideoEcho.cpp b/src/libprojectM/Renderer/VideoEcho.cpp index 1ddad57a1..66d3ea5fa 100644 --- a/src/libprojectM/Renderer/VideoEcho.cpp +++ b/src/libprojectM/Renderer/VideoEcho.cpp @@ -77,7 +77,7 @@ void VideoEcho::Draw(RenderContext &context) default: flipx=1;flipy=1; break; } - float pointsFlip[4][2] = {{-0.5*flipx, -0.5*flipy}, + double pointsFlip[4][2] = {{-0.5*flipx, -0.5*flipy}, {-0.5*flipx, 0.5*flipy}, { 0.5*flipx, 0.5*flipy}, { 0.5*flipx, -0.5*flipy}}; diff --git a/src/libprojectM/projectM.hpp b/src/libprojectM/projectM.hpp index 4be695649..dae3314cc 100755 --- a/src/libprojectM/projectM.hpp +++ b/src/libprojectM/projectM.hpp @@ -43,7 +43,7 @@ #endif #include -#ifdef MACOS +#ifdef __APPLE__ //#include //#include //#include @@ -84,7 +84,7 @@ class MasterRenderItemMerge; #pragma warning (disable:4305) #endif /** WIN32 */ -#ifdef MACOS2 +#ifdef __APPLE__2 #define inline #endif diff --git a/src/projectM-moviegen/projectMmovie.c b/src/projectM-moviegen/projectMmovie.c index 6198e8239..106a09228 100755 --- a/src/projectM-moviegen/projectMmovie.c +++ b/src/projectM-moviegen/projectMmovie.c @@ -229,7 +229,7 @@ fprintf( debugFile, "post SDL_SetVideoMode()\n" ); } #endif -#ifdef MACOS +#ifdef __APPLE__ globalPM->fontURL = (char *)malloc( sizeof( char ) * 512 ); strcpy( globalPM->fontURL, "../../fonts" ); diff --git a/src/projectM-sdl/Makefile b/src/projectM-sdl/Makefile new file mode 100644 index 000000000..dfc51e112 --- /dev/null +++ b/src/projectM-sdl/Makefile @@ -0,0 +1,18 @@ +BUILD=../../build/ + +SOURCES= \ + pmSDL.cpp \ + projectM_SDL_main.cpp + +CPPFLAGS+=-I. -I../libprojectM +CPPFLAGS_macosx-clang+=-F/Library/Frameworks + +LDFLAGS+=-framework OpenGL -F/Library/Frameworks -framework SDL2 +LIBRARIES=../libprojectM ../libprojectM/Renderer ../libprojectM/NativePresetFactory ../libprojectM/MilkdropPresetFactory + +PRODUCTS=projectMSDL.exe + +include $(BUILD)rules.mk + +$(BUILD)rules.mk: + cd .. && git submodule update --init --recursive diff --git a/src/projectM-sdl/pmSDL.cpp b/src/projectM-sdl/pmSDL.cpp index 734e7d916..06704596b 100644 --- a/src/projectM-sdl/pmSDL.cpp +++ b/src/projectM-sdl/pmSDL.cpp @@ -69,6 +69,7 @@ int projectMSDL::openAudioInput() { audioSampleRate = have.freq; audioSampleCount = have.samples; audioFormat = have.format; + audioInputDevice = audioDeviceID; return 1; } @@ -144,8 +145,8 @@ void projectMSDL::addFakePCM() { } void projectMSDL::resize(unsigned int width, unsigned int height) { - width = width; - height = height; + this->width = width; + this->height = height; settings.windowWidth = width; settings.windowHeight = height; projectM_resetGL(width, height); diff --git a/src/projectM-sdlvis/projectMvis.cc b/src/projectM-sdlvis/projectMvis.cc index 3c0c52970..781f71292 100755 --- a/src/projectM-sdlvis/projectMvis.cc +++ b/src/projectM-sdlvis/projectMvis.cc @@ -256,7 +256,7 @@ fprintf( debugFile, "post SDL_SetVideoMode()\n" ); } #endif -#ifdef MACOS +#ifdef __APPLE__ globalPM->fontURL = (char *)malloc( sizeof( char ) * 512 ); strcpy( globalPM->fontURL, "../../fonts" );