Permalink
Browse files

hardcoding settings for emscripten instead of using config file

  • Loading branch information...
revmischa committed Jun 22, 2014
1 parent 222649a commit 48587f131c85f94a5f5e126bb4ed69b06aaebd8a
View
@@ -1,3 +1,5 @@
Press "r" to change to a random preset.
Press "h" to bring up a help menu.
The projectM-iTunes directory contains an XCode 5 project that emits an installer bundle. Use that to install it.
Binaries are available at: https://github.com/revmischa/projectm/releases
View
BIN +80 Bytes (100%) src/libprojectM/libprojectM.a
Binary file not shown.
@@ -134,7 +134,7 @@ class DLLEXPORT projectM
bool aspectCorrection;
float easterEgg;
bool shuffleEnabled;
bool softCutRatingsEnabled;
bool softCutRatingsEnabled;
};
projectM(std::string config_file, int flags = FLAG_NONE);
@@ -1,3 +1,5 @@
cmake_minimum_required(VERSION 2.8.0)
INCLUDE(../cmake/CPack-projectM.cmake)
PROJECT(projectEM)
@@ -23,5 +25,5 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
#INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS})
#TARGET_LINK_LIBRARIES(projectEM ${SDL2_LIBRARIES})
SET_TARGET_PROPERTIES(projectEM PROPERTIES LINK_FLAGS "-o build/projectEM.html --emrun")
SET_TARGET_PROPERTIES(projectEM PROPERTIES LINK_FLAGS "-o build/projectEM.html -g --emrun")
#SET_TARGET_PROPERTIES(projectEM PROPERTIES LINK_FLAGS "--emrun")

This file was deleted.

Oops, something went wrong.
@@ -27,7 +27,6 @@
/* Begin PBXFileReference section */
C3F90678195670BC00C8DF0F /* emprojectM */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = emprojectM; sourceTree = BUILT_PRODUCTS_DIR; };
C3F90684195670EF00C8DF0F /* emscripten_sdltoprojectM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = emscripten_sdltoprojectM.h; sourceTree = SOURCE_ROOT; };
C3F90685195670EF00C8DF0F /* projectM_SDL_emscripten.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = projectM_SDL_emscripten.cpp; sourceTree = SOURCE_ROOT; };
C3F90689195676C500C8DF0F /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
C3F9068B195676CC00C8DF0F /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = System/Library/Frameworks/GLUT.framework; sourceTree = SDKROOT; };
@@ -70,7 +69,6 @@
C3F9067A195670BC00C8DF0F /* emprojectM */ = {
isa = PBXGroup;
children = (
C3F90684195670EF00C8DF0F /* emscripten_sdltoprojectM.h */,
C3F90685195670EF00C8DF0F /* projectM_SDL_emscripten.cpp */,
);
path = emprojectM;
@@ -16,7 +16,7 @@
#include <SDL.h>
#endif
const char *PROJECTEM_CONFIG_PATH = "build/config.inp";
const float FPS = 60;
static projectM *globalPM = NULL;
static SDL_Surface *screen;
@@ -25,6 +25,9 @@ static SDL_Renderer *rend;
bool done = false;
// settings, yo
projectM::Settings settings;
void renderFrame() {
int i;
short pcm_data[2][512];
@@ -118,6 +121,10 @@ int main( int argc, char *argv[] ) {
#elif SDL_MAJOR_VERSION==1
screen = SDL_SetVideoMode(width, height, 32, SDL_OPENGL | SDL_DOUBLEBUF);
printf("SDL init version 1\n");
if (! screen) {
fprintf(stderr, "Failed to create renderer with SDL_SetVideoMode(): %s\n", SDL_GetError());
return PROJECTM_ERROR;
}
#endif
#ifdef PANTS
@@ -129,17 +136,36 @@ int main( int argc, char *argv[] ) {
}
#endif
settings.meshX = 2;
settings.meshY = 2;
settings.fps = FPS;
settings.textureSize = 2048; // idk?
settings.windowWidth = width;
settings.windowHeight = height;
settings.presetURL = "./presets";
settings.smoothPresetDuration = 5; // seconds
settings.presetDuration = 15; // seconds
settings.beatSensitivity = 0.8;
settings.aspectCorrection = 1;
settings.easterEgg = 0; // ???
settings.shuffleEnabled = 1;
settings.softCutRatingsEnabled = 1; // ???
// init projectM
globalPM = new projectM(PROJECTEM_CONFIG_PATH);
printf("initting\n");
globalPM = new projectM(settings);
printf("init projectM\n");
globalPM->selectRandom(true);
printf("select random\n");
globalPM->projectM_resetGL(width, height);
printf("resetGL\n");
// mainloop. non-emscripten version here for comparison/testing
#ifdef EMSCRIPTEN
emscripten_set_main_loop(renderFrame, 30, 0);
#else
// standard main loop
const Uint32 frame_delay = 1000/60;
const Uint32 frame_delay = 1000/FPS;
Uint32 last_time = SDL_GetTicks();
while (! done) {
renderFrame();

0 comments on commit 48587f1

Please sign in to comment.