Skip to content

Commit cc85248

Browse files
committed
bundle SDL for osx WIP
1 parent 3d4fe80 commit cc85248

File tree

6 files changed

+45
-27
lines changed

6 files changed

+45
-27
lines changed

fonts/Vera.ttf

100755100644
File mode changed.

fonts/VeraMono.ttf

100755100644
File mode changed.

src/libprojectM/MilkdropPresetFactory/Param.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@
5757
class InitCond;
5858
class Param;
5959
class Preset;
60-
//#include <map>
60+
61+
#ifdef __SSE2__
6162
#include <immintrin.h>
63+
#endif
6264

6365

6466
/* Parameter Type */
@@ -153,4 +155,3 @@ inline void Param::set_param( float val) {
153155
}
154156

155157
#endif /** !_PARAM_TYPES_H */
156-

src/libprojectM/MilkdropPresetFactory/PresetFrameIO.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
#include <iostream>
66
#include <cmath>
77
#include "Renderer/BeatDetect.hpp"
8+
9+
#ifdef __SSE2__
810
#include <immintrin.h>
11+
#endif
912

1013

1114
PresetInputs::PresetInputs() : PipelineContext()
@@ -34,7 +37,7 @@ void PresetInputs::update(const BeatDetect & music, const PipelineContext & cont
3437

3538
float **alloc_mesh(size_t gx, size_t gy)
3639
{
37-
// round gy up to multiple 4 (for possible SSE optimization)
40+
// round gy up to multiple 4 (for possible SSE optimization)
3841
gy = (gy+3) & ~(size_t)3;
3942

4043
float **mesh = (float **)wipe_aligned_alloc(gx * sizeof(float *));
@@ -288,11 +291,11 @@ void PresetOutputs::PerPixelMath_sse(const PipelineContext &context)
288291
{
289292
// fZoom2 = std::pow(this->zoom_mesh[x][y], std::pow(this->zoomexp_mesh[x][y],
290293
// rad_mesh[x][y] * 2.0f - 1.0f));
291-
__m128 rad_mesh_scaled =
294+
__m128 rad_mesh_scaled =
292295
_mm_sub_ps(
293296
_mm_mul_ps(
294-
_mm_load_ps(&this->rad_mesh[x][y]),
295-
_mm_set_ps1(2.0f)),
297+
_mm_load_ps(&this->rad_mesh[x][y]),
298+
_mm_set_ps1(2.0f)),
296299
_mm_set_ps1(1.0f));
297300
__m128 zoom_mesh = _mm_load_ps(&this->zoom_mesh[x][y]);
298301
__m128 zoomexp_mesh = _mm_load_ps(&this->zoomexp_mesh[x][y]);
@@ -301,10 +304,10 @@ void PresetOutputs::PerPixelMath_sse(const PipelineContext &context)
301304
__m128 fZoomInv = _mm_rcp_ps(fZoom2);
302305

303306
// this->x_mesh[x][y] = this->orig_x[x][y] * 0.5f * fZoom2Inv + 0.5f;
304-
__m128 x_mesh =
307+
__m128 x_mesh =
305308
_mm_add_ps(
306309
_mm_mul_ps(
307-
_mm_load_ps(&this->orig_x[x][y]),
310+
_mm_load_ps(&this->orig_x[x][y]),
308311
_mm_mul_ps(fZoomInv,_mm_set_ps1(0.5f))), // CONSIDER: common sub-expression
309312
_mm_set_ps1(0.5f));
310313
// this->x_mesh[x][y] = (this->x_mesh[x][y] - this->cx_mesh[x][y]) / this->sx_mesh[x][y] + this->cx_mesh[x][y];
@@ -319,10 +322,10 @@ void PresetOutputs::PerPixelMath_sse(const PipelineContext &context)
319322
));
320323

321324
// this->y_mesh[x][y] = this->orig_y[x][y] * 0.5f * fZoom2Inv + 0.5f;
322-
__m128 y_mesh =
325+
__m128 y_mesh =
323326
_mm_add_ps(
324327
_mm_mul_ps(
325-
_mm_load_ps(&this->orig_y[x][y]),
328+
_mm_load_ps(&this->orig_y[x][y]),
326329
_mm_mul_ps(fZoomInv,_mm_set_ps1(0.5f))),
327330
_mm_set_ps1(0.5f));
328331
// this->y_mesh[x][y] = (this->y_mesh[x][y] - this->cy_mesh[x][y]) / this->sy_mesh[x][y] + this->cy_mesh[x][y];
@@ -340,7 +343,7 @@ void PresetOutputs::PerPixelMath_sse(const PipelineContext &context)
340343

341344
const float fWarpTime = context.time * this->fWarpAnimSpeed;
342345
const float fWarpScaleInv = 1.0f / this->fWarpScale;
343-
const float f[4] =
346+
const float f[4] =
344347
{
345348
11.68f + 4.0f * cosf(fWarpTime * 1.413f + 10),
346349
8.77f + 3.0f * cosf(fWarpTime * 1.113f + 7),
@@ -359,7 +362,7 @@ void PresetOutputs::PerPixelMath_sse(const PipelineContext &context)
359362
const __m128 orig_y = _mm_load_ps(&this->orig_y[x][y]);
360363
const __m128 warp_mesh = _mm_mul_ps(_mm_load_ps(&this->warp_mesh[x][y]), _mm_set_ps1(0.0035f));
361364

362-
// this->x_mesh[x][y] +=
365+
// this->x_mesh[x][y] +=
363366
// (warp_mesh * sinf(fWarpTime * 0.333f + fWarpScaleInv * (orig_x * f[0] - orig_y * f[3]))) +
364367
// (warp_mesh * cosf(fWarpTime * 0.753f - fWarpScaleInv * (orig_x * f[1] - orig_y * f[2])));
365368
_mm_store_ps(&this->x_mesh[x][y],
@@ -382,7 +385,7 @@ void PresetOutputs::PerPixelMath_sse(const PipelineContext &context)
382385
_mm_mul_ps(orig_y, _mm_set_ps1(f[2]))
383386
))))))));
384387

385-
// this->y_mesh[x][y] +=
388+
// this->y_mesh[x][y] +=
386389
// (warp_mesh * cosf(fWarpTime * 0.375f - fWarpScaleInv * (orig_x * f[2] + orig_y * f[1]))) +
387390
// (warp_mesh * sinf(fWarpTime * 0.825f + fWarpScaleInv * (orig_x * f[0] + orig_y * f[3])));
388391
_mm_store_ps(&this->y_mesh[x][y],

src/projectM-iTunes/projectM Visualizer.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
16A4214D20781836006F30CE /* libNativePresetFactory.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 16A4214620781835006F30CE /* libNativePresetFactory.a */; };
1616
16A4214E20781836006F30CE /* libprojectM.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 16A4214720781836006F30CE /* libprojectM.a */; };
1717
16A4214F20781836006F30CE /* libprojectM.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 16A4214720781836006F30CE /* libprojectM.a */; };
18-
16A42151207818F6006F30CE /* Cg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16A42150207818F6006F30CE /* Cg.framework */; };
19-
16A421522078196A006F30CE /* Cg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16A42150207818F6006F30CE /* Cg.framework */; };
20-
16A4215320781A41006F30CE /* Cg.framework in Copy Files */ = {isa = PBXBuildFile; fileRef = 16A42150207818F6006F30CE /* Cg.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
2118
C34E811C1956D0D4001AC5B5 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C34E811B1956D0D4001AC5B5 /* libz.a */; };
2219
C34E811E1956D0D6001AC5B5 /* libpng15.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C34E811D1956D0D6001AC5B5 /* libpng15.a */; };
2320
C34E81201956D0D8001AC5B5 /* libftgl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C34E811F1956D0D8001AC5B5 /* libftgl.a */; };
@@ -44,7 +41,6 @@
4441
C3F9D7D917B83CF1009E58CB /* iTunesAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C3F9D7D617B83CF1009E58CB /* iTunesAPI.cpp */; };
4542
C3FAE59217B87D8700F4B110 /* getConfigFilename.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C3FAE59017B87D8700F4B110 /* getConfigFilename.cpp */; };
4643
C3FAE5AA17B898C200F4B110 /* iProjectM-pkg.plist in plist */ = {isa = PBXBuildFile; fileRef = C3FAE5A717B898B000F4B110 /* iProjectM-pkg.plist */; };
47-
C3FAF97717B89F7400F4B110 /* shaders in share */ = {isa = PBXBuildFile; fileRef = C3FAF97617B89F7200F4B110 /* shaders */; };
4844
C3FAF97817B89F7B00F4B110 /* config.inp in share */ = {isa = PBXBuildFile; fileRef = C3FAF97517B89F7200F4B110 /* config.inp */; };
4945
C3FAF97B17B8A45200F4B110 /* fonts in share */ = {isa = PBXBuildFile; fileRef = C3FAF97917B8A43B00F4B110 /* fonts */; };
5046
/* End PBXBuildFile section */
@@ -66,7 +62,6 @@
6662
dstPath = "";
6763
dstSubfolderSpec = 10;
6864
files = (
69-
16A4215320781A41006F30CE /* Cg.framework in Copy Files */,
7065
);
7166
name = "Copy Files";
7267
runOnlyForDeploymentPostprocessing = 0;
@@ -88,7 +83,6 @@
8883
dstPath = share;
8984
dstSubfolderSpec = 16;
9085
files = (
91-
C3FAF97717B89F7400F4B110 /* shaders in share */,
9286
C3FAF97B17B8A45200F4B110 /* fonts in share */,
9387
C3FAF97817B89F7B00F4B110 /* config.inp in share */,
9488
);
@@ -161,7 +155,6 @@
161155
isa = PBXFrameworksBuildPhase;
162156
buildActionMask = 2147483647;
163157
files = (
164-
16A421522078196A006F30CE /* Cg.framework in Frameworks */,
165158
16A4214D20781836006F30CE /* libNativePresetFactory.a in Frameworks */,
166159
16A4214920781836006F30CE /* libRenderer.a in Frameworks */,
167160
16A4214B20781836006F30CE /* libMilkdropPresetFactory.a in Frameworks */,
@@ -174,7 +167,6 @@
174167
isa = PBXFrameworksBuildPhase;
175168
buildActionMask = 2147483647;
176169
files = (
177-
16A42151207818F6006F30CE /* Cg.framework in Frameworks */,
178170
C3C24435195764870021FCD4 /* libGLEW.a in Frameworks */,
179171
16A4214C20781836006F30CE /* libNativePresetFactory.a in Frameworks */,
180172
C34E81241956D0DA001AC5B5 /* libbz2.a in Frameworks */,

src/projectM-sdl/SDLprojectM.xcodeproj/project.pbxproj

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
1612C998207A80A200862A3A /* libRenderer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1612C992207A807000862A3A /* libRenderer.a */; };
1212
1612C9E2207A85C100862A3A /* libMilkdropPresetFactory.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1612C9DF207A85BD00862A3A /* libMilkdropPresetFactory.a */; };
1313
1612C9E3207A85C100862A3A /* libNativePresetFactory.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1612C9E1207A85BD00862A3A /* libNativePresetFactory.a */; };
14-
1612CA11207A8D2F00862A3A /* shaders in Copy Files */ = {isa = PBXBuildFile; fileRef = 1612CA10207A8D2400862A3A /* shaders */; };
1514
165E542A20D68810004AEA81 /* presets in Resources */ = {isa = PBXBuildFile; fileRef = C307DFD31D565B57002F6B9E /* presets */; };
16-
166853F12105E2850042793A /* SDL2.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 166853F02105E2850042793A /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
15+
166853F12105E2850042793A /* SDL2.framework in Copy SDL2 framework */ = {isa = PBXBuildFile; fileRef = 166853F02105E2850042793A /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1716
169502001F7009E9008FAF86 /* pmSDL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 169501FE1F7009E9008FAF86 /* pmSDL.cpp */; };
17+
16B52AA9211054E900830F34 /* projectMSDL-pkg.plist in Resources */ = {isa = PBXBuildFile; fileRef = 16B52AA8211054E900830F34 /* projectMSDL-pkg.plist */; };
18+
16B52AAB21105A6900830F34 /* config.inp in Copy Files */ = {isa = PBXBuildFile; fileRef = 16B52AAA21105A6900830F34 /* config.inp */; };
1819
C345214F1BF022A5001707D2 /* projectM_SDL_main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C345214E1BF022A5001707D2 /* projectM_SDL_main.cpp */; };
1920
C345215C1BF025A9001707D2 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C345215B1BF025A9001707D2 /* OpenGL.framework */; };
2021
C345215E1BF025CF001707D2 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C345215D1BF025CF001707D2 /* CoreFoundation.framework */; };
@@ -87,14 +88,15 @@
8788
/* End PBXContainerItemProxy section */
8889

8990
/* Begin PBXCopyFilesBuildPhase section */
90-
166853EF2105E25B0042793A /* CopyFiles */ = {
91+
166853EF2105E25B0042793A /* Copy SDL2 framework */ = {
9192
isa = PBXCopyFilesBuildPhase;
9293
buildActionMask = 2147483647;
9394
dstPath = "";
9495
dstSubfolderSpec = 10;
9596
files = (
96-
166853F12105E2850042793A /* SDL2.framework in CopyFiles */,
97+
166853F12105E2850042793A /* SDL2.framework in Copy SDL2 framework */,
9798
);
99+
name = "Copy SDL2 framework";
98100
runOnlyForDeploymentPostprocessing = 0;
99101
};
100102
C34521421BF02293001707D2 /* Copy Files */ = {
@@ -103,8 +105,8 @@
103105
dstPath = "";
104106
dstSubfolderSpec = 16;
105107
files = (
108+
16B52AAB21105A6900830F34 /* config.inp in Copy Files */,
106109
C3D30B901BF02BEC009AAACD /* fonts in Copy Files */,
107-
1612CA11207A8D2F00862A3A /* shaders in Copy Files */,
108110
);
109111
name = "Copy Files";
110112
runOnlyForDeploymentPostprocessing = 0;
@@ -118,6 +120,8 @@
118120
166853F22105E2CF0042793A /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SDL2.framework; sourceTree = "<group>"; };
119121
169501FE1F7009E9008FAF86 /* pmSDL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pmSDL.cpp; sourceTree = "<group>"; };
120122
169501FF1F7009E9008FAF86 /* pmSDL.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pmSDL.hpp; sourceTree = "<group>"; };
123+
16B52AA8211054E900830F34 /* projectMSDL-pkg.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "projectMSDL-pkg.plist"; sourceTree = "<group>"; };
124+
16B52AAA21105A6900830F34 /* config.inp */ = {isa = PBXFileReference; lastKnownFileType = text; path = config.inp; sourceTree = "<group>"; };
121125
C307DFD31D565B57002F6B9E /* presets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = presets; path = ../../presets; sourceTree = "<group>"; };
122126
C34521441BF02294001707D2 /* SDLprojectM */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = SDLprojectM; sourceTree = BUILT_PRODUCTS_DIR; };
123127
C345214E1BF022A5001707D2 /* projectM_SDL_main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = projectM_SDL_main.cpp; sourceTree = SOURCE_ROOT; };
@@ -192,6 +196,8 @@
192196
C345213B1BF02293001707D2 = {
193197
isa = PBXGroup;
194198
children = (
199+
16B52AAA21105A6900830F34 /* config.inp */,
200+
16B52AA8211054E900830F34 /* projectMSDL-pkg.plist */,
195201
166853F02105E2850042793A /* SDL2.framework */,
196202
1612CA10207A8D2400862A3A /* shaders */,
197203
1612C98C207A807000862A3A /* libprojectM.xcodeproj */,
@@ -226,7 +232,8 @@
226232
C34521421BF02293001707D2 /* Copy Files */,
227233
1659FEE920D67E2E00092B7D /* Run Script */,
228234
165E542920D68779004AEA81 /* Resources */,
229-
166853EF2105E25B0042793A /* CopyFiles */,
235+
166853EF2105E25B0042793A /* Copy SDL2 framework */,
236+
16B52AA7211053B500830F34 /* Generate Installer Package */,
230237
);
231238
buildRules = (
232239
);
@@ -315,6 +322,7 @@
315322
buildActionMask = 2147483647;
316323
files = (
317324
165E542A20D68810004AEA81 /* presets in Resources */,
325+
16B52AA9211054E900830F34 /* projectMSDL-pkg.plist in Resources */,
318326
);
319327
runOnlyForDeploymentPostprocessing = 0;
320328
};
@@ -337,6 +345,20 @@
337345
shellPath = /bin/sh;
338346
shellScript = "POUT=$BUILT_PRODUCTS_DIR/presets\nPIN=$SRCROOT/../../presets\n\nmkdir -p $POUT\ncp $PIN/presets_bltc201/* $POUT/\ncp $PIN/presets_milkdrop/* $POUT/\ncp $PIN/presets_milkdrop_104/* $POUT/\ncp $PIN/presets_milkdrop_200/* $POUT/\ncp $PIN/presets_projectM/* $POUT/\ncp $PIN/presets_stock/* $POUT/\ncp $PIN/presets_tryptonaut/* $POUT/\ncp $PIN/presets_yin/* $POUT/\necho \"Copied presets to $POUT\"";
339347
};
348+
16B52AA7211053B500830F34 /* Generate Installer Package */ = {
349+
isa = PBXShellScriptBuildPhase;
350+
buildActionMask = 2147483647;
351+
files = (
352+
);
353+
inputPaths = (
354+
);
355+
name = "Generate Installer Package";
356+
outputPaths = (
357+
);
358+
runOnlyForDeploymentPostprocessing = 0;
359+
shellPath = /bin/sh;
360+
shellScript = "ls \"$CONFIGURATION_BUILD_DIR\"\n\nmkdir -p \"$DSTROOT/usr/local/share/projectM\"\nmkdir -p \"$DSTROOT/Applications/projectM\"\ncp -p \"$CONFIGURATION_BUILD_DIR/SDLprojectM\" \"$DSTROOT/Applications/projectM/SDL\"\ncp -rp \"$CONFIGURATION_BUILD_DIR/SDL2.framework\" \"$DSTROOT/Applications/projectM/\"\ncp -r \"$CONFIGURATION_BUILD_DIR\"/presets \"$DSTROOT/usr/local/share/projectM/\"\ncp -r \"$CONFIGURATION_BUILD_DIR\"/fonts \"$DSTROOT/usr/local/share/projectM/\"\ncp \"$CONFIGURATION_BUILD_DIR\"/config.inp \"$DSTROOT/usr/local/share/projectM/\"\n\n#install_name_tool -change @executable_path/../Frameworks/Cg.framework/Cg @loader_path/../Frameworks/SDL2.framework/SDL2 \"$DSTROOT/Library/iTunes/iTunes Plug-ins/iProjectM.bundle/Contents/MacOS/iProjectM\"\n#cp -r $CONFIGURATION_BUILD_DIR/share/* \"$DSTROOT/usr/local/share/projectM\"\npkgbuild --component-plist \"$SRCROOT/projectMSDL-pkg.plist\" --root \"$DSTROOT\" \"$SRCROOT/projectM.pkg\"\n";
361+
};
340362
/* End PBXShellScriptBuildPhase section */
341363

342364
/* Begin PBXSourcesBuildPhase section */

0 commit comments

Comments
 (0)