Merge branch 'develop' of git://github.com/cocos2d/cocos2d-x into unified_mac_project

This commit is contained in:
Ricardo Quesada 2013-07-01 10:39:03 -07:00
commit 464d60e24b
17 changed files with 1039 additions and 1048 deletions

View File

@ -14,7 +14,8 @@ Developers:
Javascript Binding and testjs Javascript Binding and testjs
Squallium Squallium
Added ccFPSImages entity as linked resource on linux eclipse project setting Added ccFPSImages entity as linked resource on linux eclipse project setting.
Added CocosDenshion dependency to libextension project for eclipse project of linux.
longlene longlene
Improve android project creation script Improve android project creation script
@ -365,7 +366,8 @@ Developers:
Refactoring emscripten building script. Refactoring emscripten building script.
Peter Young (young40) Peter Young (young40)
Implements setVisible() for CCEditBox Implements setVisible() for CCEditBox.
Fixing a bug that event will not be sent to server when paramMap parameter of logEvent function is nil in plugin-x.
csy1988525 csy1988525
Fixing a bug about display result is wrong when invoking CCControlButton:: setHighlighted. Fixing a bug about display result is wrong when invoking CCControlButton:: setHighlighted.

View File

@ -59,6 +59,7 @@ kazmath/src/GL/mat4stack.c \
kazmath/src/GL/matrix.c \ kazmath/src/GL/matrix.c \
keypad_dispatcher/CCKeypadDelegate.cpp \ keypad_dispatcher/CCKeypadDelegate.cpp \
keypad_dispatcher/CCKeypadDispatcher.cpp \ keypad_dispatcher/CCKeypadDispatcher.cpp \
keyboard_dispatcher/CCKeyboardDispatcher.cpp \
label_nodes/CCLabelAtlas.cpp \ label_nodes/CCLabelAtlas.cpp \
label_nodes/CCLabelBMFont.cpp \ label_nodes/CCLabelBMFont.cpp \
label_nodes/CCLabelTTF.cpp \ label_nodes/CCLabelTTF.cpp \

View File

@ -64,9 +64,7 @@ THE SOFTWARE.
#include "platform/CCImage.h" #include "platform/CCImage.h"
#include "CCEGLView.h" #include "CCEGLView.h"
#include "CCConfiguration.h" #include "CCConfiguration.h"
#ifdef CC_KEYBOARD_SUPPORT
#include "keyboard_dispatcher/CCKeyboardDispatcher.h" #include "keyboard_dispatcher/CCKeyboardDispatcher.h"
#endif
/** /**
@ -154,10 +152,8 @@ bool Director::init(void)
_touchDispatcher = new TouchDispatcher(); _touchDispatcher = new TouchDispatcher();
_touchDispatcher->init(); _touchDispatcher->init();
#ifdef CC_KEYBOARD_SUPPORT
// KeyboardDispatcher // KeyboardDispatcher
_keyboardDispatcher = new KeyboardDispatcher(); _keyboardDispatcher = new KeyboardDispatcher();
#endif
// KeypadDispatcher // KeypadDispatcher
_keypadDispatcher = new KeypadDispatcher(); _keypadDispatcher = new KeypadDispatcher();
@ -185,9 +181,7 @@ Director::~Director(void)
CC_SAFE_RELEASE(_scheduler); CC_SAFE_RELEASE(_scheduler);
CC_SAFE_RELEASE(_actionManager); CC_SAFE_RELEASE(_actionManager);
CC_SAFE_RELEASE(_touchDispatcher); CC_SAFE_RELEASE(_touchDispatcher);
#ifdef CC_KEYBOARD_SUPPORT
CC_SAFE_RELEASE(_keyboardDispatcher); CC_SAFE_RELEASE(_keyboardDispatcher);
#endif
CC_SAFE_RELEASE(_keypadDispatcher); CC_SAFE_RELEASE(_keypadDispatcher);
CC_SAFE_DELETE(_accelerometer); CC_SAFE_DELETE(_accelerometer);
@ -1004,7 +998,6 @@ TouchDispatcher* Director::getTouchDispatcher()
return _touchDispatcher; return _touchDispatcher;
} }
#ifdef CC_KEYBOARD_SUPPORT
void Director::setKeyboardDispatcher(KeyboardDispatcher* pKeyboardDispatcher) void Director::setKeyboardDispatcher(KeyboardDispatcher* pKeyboardDispatcher)
{ {
CC_SAFE_RETAIN(pKeyboardDispatcher); CC_SAFE_RETAIN(pKeyboardDispatcher);
@ -1016,7 +1009,6 @@ KeyboardDispatcher* Director::getKeyboardDispatcher()
{ {
return _keyboardDispatcher; return _keyboardDispatcher;
} }
#endif
void Director::setKeypadDispatcher(KeypadDispatcher* pKeypadDispatcher) void Director::setKeypadDispatcher(KeypadDispatcher* pKeypadDispatcher)
{ {

View File

@ -71,9 +71,7 @@ class Node;
class Scheduler; class Scheduler;
class ActionManager; class ActionManager;
class TouchDispatcher; class TouchDispatcher;
#ifdef CC_KEYBOARD_SUPPORT
class KeyboardDispatcher; class KeyboardDispatcher;
#endif
class KeypadDispatcher; class KeypadDispatcher;
class Accelerometer; class Accelerometer;
@ -328,12 +326,12 @@ public:
*/ */
CC_PROPERTY(TouchDispatcher*, _touchDispatcher, TouchDispatcher); CC_PROPERTY(TouchDispatcher*, _touchDispatcher, TouchDispatcher);
#ifdef CC_KEYBOARD_SUPPORT
/** KeyboardDispatcher associated with this director /** KeyboardDispatcher associated with this director
@since v?.? @note Supported on Mac and Linux only now.
@since v3.0
*/ */
CC_PROPERTY(KeyboardDispatcher*, _keyboardDispatcher, KeyboardDispatcher); CC_PROPERTY(KeyboardDispatcher*, _keyboardDispatcher, KeyboardDispatcher);
#endif
/** KeypadDispatcher associated with this director /** KeypadDispatcher associated with this director
@since v2.0 @since v2.0
*/ */

View File

@ -33,8 +33,8 @@ NS_CC_BEGIN
// //
//------------------------------------------------------------------ //------------------------------------------------------------------
KeyboardDispatcher::KeyboardDispatcher() KeyboardDispatcher::KeyboardDispatcher()
: _keyPressDelegate(NULL) : _keyPressDelegate(nullptr)
, _keyReleaseDelegate(NULL) , _keyReleaseDelegate(nullptr)
{ {
} }

View File

@ -38,9 +38,7 @@ THE SOFTWARE.
#include "support/TransformUtils.h" #include "support/TransformUtils.h"
// extern // extern
#include "kazmath/GL/matrix.h" #include "kazmath/GL/matrix.h"
#ifdef CC_KEYBOARD_SUPPORT
#include "keyboard_dispatcher/CCKeyboardDispatcher.h" #include "keyboard_dispatcher/CCKeyboardDispatcher.h"
#endif
NS_CC_BEGIN NS_CC_BEGIN
@ -48,9 +46,7 @@ NS_CC_BEGIN
Layer::Layer() Layer::Layer()
: _touchEnabled(false) : _touchEnabled(false)
, _accelerometerEnabled(false) , _accelerometerEnabled(false)
#ifdef CC_KEYBOARD_SUPPORT
, _keyboardEnabled(false) , _keyboardEnabled(false)
#endif
, _keypadEnabled(false) , _keypadEnabled(false)
, _scriptTouchHandlerEntry(NULL) , _scriptTouchHandlerEntry(NULL)
, _scriptKeypadHandlerEntry(NULL) , _scriptKeypadHandlerEntry(NULL)
@ -279,7 +275,6 @@ void Layer::unregisterScriptAccelerateHandler(void)
CC_SAFE_RELEASE_NULL(_scriptAccelerateHandlerEntry); CC_SAFE_RELEASE_NULL(_scriptAccelerateHandlerEntry);
} }
#ifdef CC_KEYBOARD_SUPPORT
/// isKeyboardEnabled getter /// isKeyboardEnabled getter
bool Layer::isKeyboardEnabled() bool Layer::isKeyboardEnabled()
{ {
@ -300,12 +295,11 @@ void Layer::setKeyboardEnabled(bool enabled)
} }
else else
{ {
pDirector->getKeyboardDispatcher()->setKeyPressDelegate(NULL); pDirector->getKeyboardDispatcher()->setKeyPressDelegate(nullptr);
pDirector->getKeyboardDispatcher()->setKeyReleaseDelegate(NULL); pDirector->getKeyboardDispatcher()->setKeyReleaseDelegate(nullptr);
} }
} }
} }
#endif
/// isKeypadEnabled getter /// isKeypadEnabled getter
bool Layer::isKeypadEnabled() bool Layer::isKeypadEnabled()

View File

@ -134,12 +134,12 @@ public:
You can enable / disable accelerometer events with this property. You can enable / disable accelerometer events with this property.
it's new in cocos2d-x it's new in cocos2d-x
*/ */
#ifdef CC_KEYBOARD_SUPPORT
virtual bool isKeyboardEnabled(); virtual bool isKeyboardEnabled();
virtual void setKeyboardEnabled(bool value); virtual void setKeyboardEnabled(bool value);
virtual void keyPressed(int keyCode) {}; virtual void keyPressed(int keyCode) {};
virtual void keyReleased(int keyCode) {}; virtual void keyReleased(int keyCode) {};
#endif
virtual bool isKeypadEnabled(); virtual bool isKeypadEnabled();
virtual void setKeypadEnabled(bool value); virtual void setKeypadEnabled(bool value);
@ -157,9 +157,7 @@ public:
protected: protected:
bool _touchEnabled; bool _touchEnabled;
bool _accelerometerEnabled; bool _accelerometerEnabled;
#ifdef CC_KEYBOARD_SUPPORT
bool _keyboardEnabled; bool _keyboardEnabled;
#endif
bool _keypadEnabled; bool _keypadEnabled;
private: private:

View File

@ -13,9 +13,7 @@
#include "touch_dispatcher/CCTouch.h" #include "touch_dispatcher/CCTouch.h"
#include "touch_dispatcher/CCTouchDispatcher.h" #include "touch_dispatcher/CCTouchDispatcher.h"
#include "text_input_node/CCIMEDispatcher.h" #include "text_input_node/CCIMEDispatcher.h"
#ifdef CC_KEYBOARD_SUPPORT
#include "keyboard_dispatcher/CCKeyboardDispatcher.h" #include "keyboard_dispatcher/CCKeyboardDispatcher.h"
#endif
PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT = NULL; PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT = NULL;
PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT = NULL; PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT = NULL;
@ -157,7 +155,6 @@ int closeEventHandle() {
return GL_TRUE; return GL_TRUE;
} }
#ifdef CC_KEYBOARD_SUPPORT
void GLFWCALL keyboardEventHandle(int keyCode, int action) void GLFWCALL keyboardEventHandle(int keyCode, int action)
{ {
KeyboardDispatcher *kbDisp = Director::sharedDirector()->getKeyboardDispatcher(); KeyboardDispatcher *kbDisp = Director::sharedDirector()->getKeyboardDispatcher();
@ -172,7 +169,6 @@ void GLFWCALL keyboardEventHandle(int keyCode, int action)
break; break;
} }
} }
#endif
void EGLView::setFrameSize(float width, float height) void EGLView::setFrameSize(float width, float height)
{ {

View File

@ -1 +1 @@
0bfb5fd7085d3486aae4789b60c34035491f0338 d668f142f61f02f102e45e6839b7df302d545b79

View File

@ -109,6 +109,11 @@ files
"*.h" "*.h"
"*.cpp" "*.cpp"
("../keyboard_dispatcher")
[keyboard_dispatcher]
"*.h"
"*.cpp"
("../label_nodes") ("../label_nodes")
[label_nodes] [label_nodes]
"*.h" "*.h"

View File

@ -37,6 +37,7 @@ SOURCES = ../actions/CCAction.cpp \
../effects/CCGrid.cpp \ ../effects/CCGrid.cpp \
../keypad_dispatcher/CCKeypadDelegate.cpp \ ../keypad_dispatcher/CCKeypadDelegate.cpp \
../keypad_dispatcher/CCKeypadDispatcher.cpp \ ../keypad_dispatcher/CCKeypadDispatcher.cpp \
../keyboard_dispatcher/CCKeyboardDispatcher.cpp \
../label_nodes/CCLabelAtlas.cpp \ ../label_nodes/CCLabelAtlas.cpp \
../label_nodes/CCLabelBMFont.cpp \ ../label_nodes/CCLabelBMFont.cpp \
../label_nodes/CCLabelTTF.cpp \ ../label_nodes/CCLabelTTF.cpp \

View File

@ -172,6 +172,7 @@ xcopy /Y /Q "$(ProjectDir)..\platform\third_party\win32\libraries\*.*" "$(OutDir
<ClCompile Include="..\actions\CCActionProgressTimer.cpp" /> <ClCompile Include="..\actions\CCActionProgressTimer.cpp" />
<ClCompile Include="..\actions\CCActionTiledGrid.cpp" /> <ClCompile Include="..\actions\CCActionTiledGrid.cpp" />
<ClCompile Include="..\actions\CCActionTween.cpp" /> <ClCompile Include="..\actions\CCActionTween.cpp" />
<ClCompile Include="..\keyboard_dispatcher\CCKeyboardDispatcher.cpp" />
<ClCompile Include="..\label_nodes\CCLabelAtlas.cpp" /> <ClCompile Include="..\label_nodes\CCLabelAtlas.cpp" />
<ClCompile Include="..\label_nodes\CCLabelBMFont.cpp" /> <ClCompile Include="..\label_nodes\CCLabelBMFont.cpp" />
<ClCompile Include="..\label_nodes\CCLabelTTF.cpp" /> <ClCompile Include="..\label_nodes\CCLabelTTF.cpp" />
@ -312,6 +313,7 @@ xcopy /Y /Q "$(ProjectDir)..\platform\third_party\win32\libraries\*.*" "$(OutDir
<ClInclude Include="..\include\CCProtocols.h" /> <ClInclude Include="..\include\CCProtocols.h" />
<ClInclude Include="..\include\ccTypes.h" /> <ClInclude Include="..\include\ccTypes.h" />
<ClInclude Include="..\include\cocos2d.h" /> <ClInclude Include="..\include\cocos2d.h" />
<ClInclude Include="..\keyboard_dispatcher\CCKeyboardDispatcher.h" />
<ClInclude Include="..\label_nodes\CCLabelAtlas.h" /> <ClInclude Include="..\label_nodes\CCLabelAtlas.h" />
<ClInclude Include="..\label_nodes\CCLabelBMFont.h" /> <ClInclude Include="..\label_nodes\CCLabelBMFont.h" />
<ClInclude Include="..\label_nodes\CCLabelTTF.h" /> <ClInclude Include="..\label_nodes\CCLabelTTF.h" />

File diff suppressed because it is too large Load Diff

View File

@ -40,6 +40,7 @@
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
<listOptionValue builtIn="false" value="../../../external"/> <listOptionValue builtIn="false" value="../../../external"/>
<listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/> <listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../.."/> <listOptionValue builtIn="false" value="../.."/>
@ -66,6 +67,7 @@
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
<listOptionValue builtIn="false" value="../../../external"/> <listOptionValue builtIn="false" value="../../../external"/>
<listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/> <listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../.."/> <listOptionValue builtIn="false" value="../.."/>
@ -133,6 +135,7 @@
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
<listOptionValue builtIn="false" value="../../../external"/> <listOptionValue builtIn="false" value="../../../external"/>
<listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/> <listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../.."/> <listOptionValue builtIn="false" value="../.."/>
@ -159,6 +162,7 @@
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
<listOptionValue builtIn="false" value="../../../external"/> <listOptionValue builtIn="false" value="../../../external"/>
<listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/> <listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../.."/> <listOptionValue builtIn="false" value="../.."/>
@ -218,6 +222,7 @@
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
<listOptionValue builtIn="false" value="../../../external"/> <listOptionValue builtIn="false" value="../../../external"/>
<listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/> <listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../.."/> <listOptionValue builtIn="false" value="../.."/>
@ -244,6 +249,7 @@
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
<listOptionValue builtIn="false" value="../../../external"/> <listOptionValue builtIn="false" value="../../../external"/>
<listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/> <listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../.."/> <listOptionValue builtIn="false" value="../.."/>
@ -312,6 +318,7 @@
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
<listOptionValue builtIn="false" value="../../../external"/> <listOptionValue builtIn="false" value="../../../external"/>
<listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/> <listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../.."/> <listOptionValue builtIn="false" value="../.."/>
@ -338,6 +345,7 @@
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libjpeg"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libtiff/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/> <listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/linux/libwebp"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
<listOptionValue builtIn="false" value="../../../external"/> <listOptionValue builtIn="false" value="../../../external"/>
<listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/> <listOptionValue builtIn="false" value="../../../external/chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../.."/> <listOptionValue builtIn="false" value="../.."/>

View File

@ -74,7 +74,11 @@ THE SOFTWARE.
- (void) logEvent: (NSString*) eventId withParam:(NSMutableDictionary*) paramMap - (void) logEvent: (NSString*) eventId withParam:(NSMutableDictionary*) paramMap
{ {
OUTPUT_LOG(@"Umeng logEventWithParam invoked"); OUTPUT_LOG(@"Umeng logEventWithParam invoked");
[MobClick event:eventId attributes:paramMap]; if (paramMap != nil) {
[MobClick event:eventId attributes:paramMap];
} else {
[MobClick event:eventId];
}
} }
- (void) logTimedEventBegin: (NSString*) eventId - (void) logTimedEventBegin: (NSString*) eventId

View File

@ -5,16 +5,7 @@
# Author: WangZhe # Author: WangZhe
# define global variables # define global variables
context = { context = {}.fromkeys(("language", "src_project_name", "src_package_name", "dst_project_name", "dst_package_name", "src_project_path", "dst_project_path", "script_dir"));
"language" : "undefined",
"src_project_name" : "undefined",
"src_package_name" : "undefined",
"dst_project_name" : "undeifned",
"dst_package_name" : "undefined",
"src_project_path" : "undefined",
"dst_project_path" : "undefined",
"script_dir" : "undefined",
}
platforms_list = [] platforms_list = []
# begin # begin
@ -23,52 +14,42 @@ import os, os.path
import json import json
import shutil import shutil
def dumpUsage():
print "Usage: create_project.py -project PROJECT_NAME -package PACKAGE_NAME -language PROGRAMING_LANGUAGE"
print "Options:"
print " -project PROJECT_NAME Project name, for example: MyGame"
print " -package PACKAGE_NAME Package name, for example: com.MyCompany.MyAwesomeGame"
print " -language PROGRAMING_LANGUAGE Major programing lanauge you want to used, should be [cpp | lua | javascript]"
print ""
print "Sample : ./create_project.py -project MyGame -package com.MyCompany.AwesomeGame -language javascript"
print ""
def checkParams(context): def checkParams(context):
from optparse import OptionParser
# set the parser to parse input params
# the correspond variable name of "-x, --xxx" is parser.xxx
parser = OptionParser(usage="Usage: ./%prog -p <PROJECT_NAME> -k <PACKAGE_NAME> -l <cpp|lua|javascript>\nSample: ./%prog -p MyGame -k com.MyCompany.AwesomeGame -l javascript")
parser.add_option("-p", "--project", metavar="PROJECT_NAME", help="Set a project name")
parser.add_option("-k", "--package", metavar="PACKAGE_NAME", help="Set a package name for project")
parser.add_option("-l", "--language",
metavar="PROGRAMMING_NAME",
type="choice",
choices=["cpp", "lua", "javascript"],
help="Major programing lanauge you want to used, should be [cpp | lua | javascript]")
#parse the params
(opts, args) = parser.parse_args()
# generate our internal params # generate our internal params
context["script_dir"] = os.getcwd() + "/" context["script_dir"] = os.getcwd() + "/"
global platforms_list global platforms_list
# invalid invoke, tell users how to input params if opts.project:
if len(sys.argv) < 7: context["dst_project_name"] = opts.project
dumpUsage() context["dst_project_path"] = os.getcwd() + "/../../projects/" + context["dst_project_name"]
sys.exit() else:
parser.error("-p or --project is not specified")
# find our params
for i in range(1, len(sys.argv)): if opts.package:
if "-project" == sys.argv[i]: context["dst_package_name"] = opts.package
# read the next param as project_name else:
context["dst_project_name"] = sys.argv[i+1] parser.error("-k or --package is not specified")
context["dst_project_path"] = os.getcwd() + "/../../projects/" + context["dst_project_name"]
elif "-package" == sys.argv[i]: if opts.language:
# read the next param as g_PackageName context["language"] = opts.language
context["dst_package_name"] = sys.argv[i+1] else:
elif "-language" == sys.argv[i]: parser.error("-l or --language is not specified")
# choose a scripting language
context["language"] = sys.argv[i+1]
# pinrt error log our required paramters are not ready
raise_error = False
if context["dst_project_name"] == "undefined":
print "Invalid -project parameter"
raise_error = True
if context["dst_package_name"] == "undefined":
print "Invalid -package parameter"
raise_error = True
if context["language"] == "undefined":
print "Invalid -language parameter"
raise_error = True
if raise_error != False:
sys.exit()
# fill in src_project_name and src_package_name according to "language" # fill in src_project_name and src_package_name according to "language"
if ("cpp" == context["language"]): if ("cpp" == context["language"]):

View File

@ -44,7 +44,7 @@ skip = Node::[convertToWindowSpace ^setPosition$ getGrid setGLServerState descri
LayerColor::[getBlendFunc setBlendFunc], LayerColor::[getBlendFunc setBlendFunc],
ParticleSystem::[getBlendFunc setBlendFunc], ParticleSystem::[getBlendFunc setBlendFunc],
DrawNode::[getBlendFunc setBlendFunc drawPolygon], DrawNode::[getBlendFunc setBlendFunc drawPolygon],
Director::[getAccelerometer getKeypadDispatcher getTouchDispatcher setWatcherCallbackFun getOpenGLView getProjection getClassTypeInfo], Director::[getAccelerometer (g|s)et.*Dispatcher getOpenGLView getProjection getClassTypeInfo],
Layer.*::[didAccelerate (g|s)etBlendFunc], Layer.*::[didAccelerate (g|s)etBlendFunc],
Menu.*::[.*Target getSubItems create initWithItems alignItemsInRows alignItemsInColumns], Menu.*::[.*Target getSubItems create initWithItems alignItemsInRows alignItemsInColumns],
MenuItem.*::[create setCallback initWithCallback], MenuItem.*::[create setCallback initWithCallback],