From ff233728e43a044221d4bba1c7ed65fb9b2bea0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Tue, 23 Jul 2013 11:47:18 +0200 Subject: [PATCH 1/2] added emscripten keyboard support --- AUTHORS | 1 + cocos2dx/proj.emscripten/Makefile | 1 + cocos2dx/proj.emscripten/cocos2dx.mk | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 6f15e87a6ad7..4e2aed42bd11 100644 --- a/AUTHORS +++ b/AUTHORS @@ -417,6 +417,7 @@ Developers: Creation of CCDeprecated-ext.h Use of a single emscripten HTML template file. Added some guards in fileutils. Fixed a bug in emscripten file utils. + Added emscripten keyboard support elmiro Correction of passed buffer size to readlink and verification of result return by readlink. diff --git a/cocos2dx/proj.emscripten/Makefile b/cocos2dx/proj.emscripten/Makefile index 233981553aac..b82b0be2adb1 100644 --- a/cocos2dx/proj.emscripten/Makefile +++ b/cocos2dx/proj.emscripten/Makefile @@ -46,6 +46,7 @@ SOURCES = ../actions/CCAction.cpp \ ../effects/CCGrid.cpp \ ../keypad_dispatcher/CCKeypadDelegate.cpp \ ../keypad_dispatcher/CCKeypadDispatcher.cpp \ +../keyboard_dispatcher/CCKeyboardDispatcher.cpp \ ../label_nodes/CCLabelAtlas.cpp \ ../label_nodes/CCLabelBMFont.cpp \ ../label_nodes/CCLabelTTF.cpp \ diff --git a/cocos2dx/proj.emscripten/cocos2dx.mk b/cocos2dx/proj.emscripten/cocos2dx.mk index b6893beeea36..6fe6718f7dba 100644 --- a/cocos2dx/proj.emscripten/cocos2dx.mk +++ b/cocos2dx/proj.emscripten/cocos2dx.mk @@ -1,6 +1,6 @@ all: -DEFINES += -DEMSCRIPTEN +DEFINES += -DEMSCRIPTEN -DCC_KEYBOARD_SUPPORT THIS_MAKEFILE := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) ifndef COCOS_ROOT @@ -52,8 +52,8 @@ LBITS := $(shell getconf LONG_BIT) INCLUDES += -I$(COCOS_SRC)/platform/third_party/linux ifeq ($(DEBUG), 1) -CCFLAGS += -O0 -s ASSERTIONS=1 -s SAFE_HEAP=1 --jcache -s GL_UNSAFE_OPTS=0 -CXXFLAGS += -O0 -s ASSERTIONS=1 -s SAFE_HEAP=1 --jcache -s GL_UNSAFE_OPTS=0 +CCFLAGS += -O0 -s ASSERTIONS=1 --jcache -s GL_UNSAFE_OPTS=0 # -s SAFE_HEAP=1 As of 2013-23-07 this options causes a segfault +CXXFLAGS += -O0 -s ASSERTIONS=1 --jcache -s GL_UNSAFE_OPTS=0 # -s SAFE_HEAP=1 As of 2013-23-07 this options causes a segfault DEFINES += -D_DEBUG -DCOCOS2D_DEBUG=1 -DCP_USE_DOUBLES=0 OBJ_DIR := $(OBJ_DIR)/debug LIB_DIR := $(LIB_DIR)/debug From eaa60df7b883690a5c6bd9fb2e1891e09fba7cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Mon, 29 Jul 2013 10:58:14 +0200 Subject: [PATCH 2/2] Re-use SAFE_HEAP option in emscripten. --- cocos2dx/proj.emscripten/cocos2dx.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2dx/proj.emscripten/cocos2dx.mk b/cocos2dx/proj.emscripten/cocos2dx.mk index 6fe6718f7dba..ccc6cdf4782a 100644 --- a/cocos2dx/proj.emscripten/cocos2dx.mk +++ b/cocos2dx/proj.emscripten/cocos2dx.mk @@ -52,8 +52,8 @@ LBITS := $(shell getconf LONG_BIT) INCLUDES += -I$(COCOS_SRC)/platform/third_party/linux ifeq ($(DEBUG), 1) -CCFLAGS += -O0 -s ASSERTIONS=1 --jcache -s GL_UNSAFE_OPTS=0 # -s SAFE_HEAP=1 As of 2013-23-07 this options causes a segfault -CXXFLAGS += -O0 -s ASSERTIONS=1 --jcache -s GL_UNSAFE_OPTS=0 # -s SAFE_HEAP=1 As of 2013-23-07 this options causes a segfault +CCFLAGS += -O0 -s ASSERTIONS=1 -s SAFE_HEAP=1 --jcache -s GL_UNSAFE_OPTS=0 +CXXFLAGS += -O0 -s ASSERTIONS=1 -s SAFE_HEAP=1 --jcache -s GL_UNSAFE_OPTS=0 DEFINES += -D_DEBUG -DCOCOS2D_DEBUG=1 -DCP_USE_DOUBLES=0 OBJ_DIR := $(OBJ_DIR)/debug LIB_DIR := $(LIB_DIR)/debug