diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-08 15:39:29 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-08 15:39:29 -0800 |
commit | 128ea802e3ec1268b6a934373f2b45d37c6f501f (patch) | |
tree | fab7db982423bb2586324fa1c9153ceee0f57432 | |
parent | a25e9721173dc072c5ab82b7084a6ebe3d24dec9 (diff) | |
parent | 1e4e155f25751f87b7b246448f98644c5f5c535c (diff) |
Merge pull request #1761 from prenaux/develop
GLUT support for DELETE & BACKSPACE keys ; Fixed lzma.js doit.sh so that it works on Windows ; Removed unnecessary warning in em++ ;
-rw-r--r-- | .gitignore | 3 | ||||
-rwxr-xr-x | em++ | 2 | ||||
-rw-r--r-- | src/library_glut.js | 9 | ||||
-rwxr-xr-x | third_party/lzma.js/doit.sh | 11 |
4 files changed, 17 insertions, 8 deletions
@@ -6,7 +6,7 @@ src/relooper*.js node_modules/ -# Ignore generated files +# Ignore generated files src/relooper.js src/relooper.js.raw.js src/relooper/*.o @@ -18,3 +18,4 @@ tests/freetype/objs/*.lo third_party/lzma.js/lzip/*.o third_party/lzma.js/lzma-native +third_party/lzma.js/lzma-native.exe @@ -8,7 +8,5 @@ import os, subprocess, sys from tools import shared os.environ['EMMAKEN_CXX'] = '1' -if not os.path.exists(shared.PYTHON): - print >> sys.stderr, 'warning: PYTHON does not seem to be defined properly in ~/.emscripten (%s)' % shared.PYTHON exit(subprocess.call([shared.PYTHON, shared.EMCC] + sys.argv[1:])) diff --git a/src/library_glut.js b/src/library_glut.js index 5e303fd2..ba4d75ab 100644 --- a/src/library_glut.js +++ b/src/library_glut.js @@ -59,6 +59,9 @@ var LibraryGLUT = { getSpecialKey: function(keycode) { var key = null; switch (keycode) { + case 8: key = 120 /* backspace */; break; + case 46: key = 111 /* delete */; break; + case 0x70 /*DOM_VK_F1*/: key = 1 /* GLUT_KEY_F1 */; break; case 0x71 /*DOM_VK_F2*/: key = 2 /* GLUT_KEY_F2 */; break; case 0x72 /*DOM_VK_F3*/: key = 3 /* GLUT_KEY_F3 */; break; @@ -228,14 +231,14 @@ var LibraryGLUT = { if (delta < 0) { button = 4; // wheel down } - + if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); Runtime.dynCall('viiii', GLUT.mouseFunc, [button, 0/*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY]); } }, - + // TODO add fullscreen API ala: // http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/ onFullScreenEventChange: function(event) { @@ -304,7 +307,7 @@ var LibraryGLUT = { // Firefox window.addEventListener("DOMMouseScroll", GLUT.onMouseWheel, true); } - + Browser.resizeListeners.push(function(width, height) { if (GLUT.reshapeFunc) { Runtime.dynCall('vii', GLUT.reshapeFunc, [width, height]); diff --git a/third_party/lzma.js/doit.sh b/third_party/lzma.js/doit.sh index 1f530651..6046022c 100755 --- a/third_party/lzma.js/doit.sh +++ b/third_party/lzma.js/doit.sh @@ -5,7 +5,14 @@ export CXX=`../../../em-config LLVM_ROOT`/clang++ echo "native" make clean DECODER_ONLY=0 make lzip -j 4 # native build -mv lzip ../lzma-native +case `uname` in + *_NT*) + mv lzip.exe ../lzma-native.exe + ;; + *) + mv lzip ../lzma-native + ;; +esac exit # just build natively, that's it @@ -18,7 +25,7 @@ echo "bitcode decoder only" make clean DECODER_ONLY=1 ../../../emmake make lzip -j 4 mv lzip lzip-decoder.bc - + cd .. echo "javascript full" |