slightly-almost-kinda-working emscripten build

This commit is contained in:
Mischa S
2014-06-21 21:04:39 -07:00
parent 3e89eccb08
commit e439c751eb
8 changed files with 44 additions and 165 deletions

Binary file not shown.

View File

@ -1,11 +1,13 @@
PROJECT(projectM-emscripten)
INCLUDE(../cmake/CPack-projectM.cmake)
PROJECT(projectEM)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
ADD_EXECUTABLE(projectM-emscripten projectM_SDL_emscripten.cpp)
ADD_EXECUTABLE(projectEM projectM_SDL_emscripten.cpp)
TARGET_LINK_LIBRARIES(projectM-emscripten projectM)
TARGET_LINK_LIBRARIES(projectEM projectM)
INCLUDE_DIRECTORIES(${projectM_SOURCE_DIR})
@ -19,7 +21,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
#FIND_PACKAGE(SDL2 REQUIRED)
#INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS})
#TARGET_LINK_LIBRARIES(projectM-emscripten ${SDL2_LIBRARIES})
#TARGET_LINK_LIBRARIES(projectEM ${SDL2_LIBRARIES})
SET_TARGET_PROPERTIES(projectM-emscripten PROPERTIES LINK_FLAGS "-o projectM.html --emrun")
#SET_TARGET_PROPERTIES(projectM-emscripten PROPERTIES LINK_FLAGS "--emrun")
SET_TARGET_PROPERTIES(projectEM PROPERTIES LINK_FLAGS "-o build/projectEM.html --emrun")
#SET_TARGET_PROPERTIES(projectEM PROPERTIES LINK_FLAGS "--emrun")

View File

@ -0,0 +1,22 @@
# config.inp
# Configuration File for projectM
Texture Size = 2048 # Size of internal rendering texture
Mesh X = 2 # Width of PerPixel Equation mesh
Mesh Y = 2 # Height of PerPixel Equation mesh
FPS = 60 # Frames Per Second
Fullscreen = false
Window Width = 512 # startup window width
Window Height = 512 # startup window height
Smooth Transition Duration = 5 # in seconds
Preset Duration = 10 # in seconds
Easter Egg Parameter = 1
Hard Cut Sensitivity = 10 # Lower to make hard cuts more frequent
Aspect Correction = true # Custom Shape Aspect Correction
Preset Path = presets
Title Font = fonts/Vera.ttf
Menu Font = fonts/VeraMono.ttf

View File

@ -0,0 +1,11 @@
PROJECT(fonts)
cmake_minimum_required(VERSION 2.4.0)
cmake_policy(SET CMP0005 OLD)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
Include(../src/cmake/CPack-projectM.cmake)

Binary file not shown.

Binary file not shown.

View File

@ -1,158 +0,0 @@
/**
* projectM -- Milkdrop-esque visualisation SDK
* Copyright (C)2003-2007 projectM Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* See 'LICENSE.txt' included within this release
*
*/
/**
* $Id: sdltoprojectM.hpp,v 1.1 2004/10/08 00:35:28 cvs Exp $
*
* Translates SDL -> projectM variables
*
* $Log: sdltoprojectM.hpp,v $
* Revision 1.1 2004/10/08 00:35:28 cvs
* Moved and imported
*
* Revision 1.1.1.1 2004/10/04 12:56:00 cvs
* Imported
*
*/
#ifndef _EM_SDLTOPROJECTM_H
#define _EM_SDLTOPROJECTM_H
#include "event.h"
projectMEvent sdl2pmEvent( SDL_Event event ) { \
switch ( event.type ) { \
case SDL_VIDEORESIZE:
return PROJECTM_VIDEORESIZE; \
case SDL_KEYUP: \
return PROJECTM_KEYUP; \
case SDL_KEYDOWN: \
return PROJECTM_KEYDOWN; \
default:
return PROJECTM_KEYUP; \
} \
} \
projectMKeycode sdl2pmKeycode( SDLKey keysym ) { \
switch ( keysym ) { \
case SDLK_F1: \
return PROJECTM_K_F1; \
case SDLK_F2: \
return PROJECTM_K_F2; \
case SDLK_F3: \
return PROJECTM_K_F3; \
case SDLK_F4: \
return PROJECTM_K_F4; \
case SDLK_F5: \
return PROJECTM_K_F5; \
case SDLK_F6: \
return PROJECTM_K_F6; \
case SDLK_F7: \
return PROJECTM_K_F7; \
case SDLK_F8: \
return PROJECTM_K_F8; \
case SDLK_F9: \
return PROJECTM_K_F9; \
case SDLK_F10: \
return PROJECTM_K_F10; \
case SDLK_F11: \
return PROJECTM_K_F11; \
case SDLK_F12: \
return PROJECTM_K_F12; \
case SDLK_ESCAPE: \
return PROJECTM_K_ESCAPE;
case SDLK_a:
return PROJECTM_K_a;
case SDLK_b:
return PROJECTM_K_b;
case SDLK_c:
return PROJECTM_K_c;
case SDLK_d:
return PROJECTM_K_d;
case SDLK_e:
return PROJECTM_K_e;
case SDLK_f:
return PROJECTM_K_f;
case SDLK_g:
return PROJECTM_K_g;
case SDLK_h:
return PROJECTM_K_h;
case SDLK_i:
return PROJECTM_K_i;
case SDLK_j:
return PROJECTM_K_j;
case SDLK_k:
return PROJECTM_K_k;
case SDLK_l:
return PROJECTM_K_l;
case SDLK_m:
return PROJECTM_K_m;
case SDLK_n:
return PROJECTM_K_n;
case SDLK_o:
return PROJECTM_K_o;
case SDLK_p:
return PROJECTM_K_p;
case SDLK_q:
return PROJECTM_K_q;
case SDLK_r:
return PROJECTM_K_r;
case SDLK_s:
return PROJECTM_K_s;
case SDLK_t:
return PROJECTM_K_t;
case SDLK_u:
return PROJECTM_K_u;
case SDLK_v:
return PROJECTM_K_v;
case SDLK_w:
return PROJECTM_K_w;
case SDLK_x:
return PROJECTM_K_x;
case SDLK_y:
return PROJECTM_K_y;
case SDLK_z:
return PROJECTM_K_z;
case SDLK_UP:
return PROJECTM_K_UP;
case SDLK_RETURN:
return PROJECTM_K_RETURN;
case SDLK_RIGHT:
return PROJECTM_K_RIGHT;
case SDLK_LEFT:
return PROJECTM_K_LEFT;
case SDLK_DOWN:
return PROJECTM_K_DOWN;
case SDLK_PAGEUP:
return PROJECTM_K_PAGEUP;
case SDLK_PAGEDOWN:
return PROJECTM_K_PAGEDOWN;
default: \
return PROJECTM_K_NONE; \
} \
} \
projectMModifier sdl2pmModifier( SDLMod mod ) { \
return PROJECTM_KMOD_LSHIFT; \
} \
#endif /** _SDLTOPROJECTM_H */

View File

@ -16,6 +16,8 @@
#include <SDL.h>
#endif
const char *PROJECTEM_CONFIG_PATH = "build/config.inp";
projectM *globalPM = NULL;
bool done = false;
@ -121,7 +123,7 @@ int main( int argc, char *argv[] ) {
}
#endif
globalPM = new projectM("/usr/local/share/projectM/config.inp");
globalPM = new projectM(PROJECTEM_CONFIG_PATH);
// globalPM->renderTarget->texsize = 1024;