diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/CCXAppWiz.uphone.vcproj b/template/CCXAppWiz.vs/CCXAppWiz.uphone/CCXAppWiz.uphone.vcproj
index 8ecc0884f0..073d35117b 100644
--- a/template/CCXAppWiz.vs/CCXAppWiz.uphone/CCXAppWiz.uphone.vcproj
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/CCXAppWiz.uphone.vcproj
@@ -119,6 +119,42 @@
RelativePath=".\Templates\1033\uphone\TG3AppDllEntry.h"
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Scripts/1033/default.js b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Scripts/1033/default.js
index 1e89cf80fe..f2e16b46a9 100644
--- a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Scripts/1033/default.js
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Scripts/1033/default.js
@@ -10,6 +10,16 @@ function OnFinish(selProj, selObj) {
wizard.AddSymbol('PROJECT_NAME_LOWER', strProjectName.toLowerCase(), false);
wizard.AddSymbol('PROJECT_NAME_UPPER', strProjectName.toUpperCase(), false);
+ if (strProjectName.length >= 6) {
+ wizard.AddSymbol('PRO_NAME_PREFIX', strProjectName.substr(0, 6).toUpperCase(), false);
+ }
+ else {
+ var strRes = '_RES';
+ var strNewFormId = strProjectName + strRes.substr(0, (6 - strProjectName.length));
+
+ wizard.AddSymbol('PRO_NAME_PREFIX', strNewFormId.toUpperCase(), false);
+ }
+
// Set current year symbol
var d = new Date();
var nYear = 0;
@@ -282,7 +292,11 @@ function GetTargetName(strName, strProjectName) {
var nIndex = strName.indexOf("root");
if (nIndex >= 0) {
- strTarget = strName.substring(0, nIndex) + strProjectName + strName.substring(nIndex + 4, strName.length);
+ var strMid = strProjectName;
+ if (strName.indexOf("_res_") >= 0) {
+ strMid = wizard.FindSymbol('PROJECT_NAME_LOWER');
+ }
+ strTarget = strName.substring(0, nIndex) + strMid + strName.substring(nIndex + 4, strName.length);
}
return strTarget;
@@ -294,6 +308,9 @@ function GetTargetName(strName, strProjectName) {
}
function AddFilesToCustomProj(proj, strProjectName, strProjectPath, InfFile) {
+ var FileSys = new ActiveXObject('Scripting.FileSystemObject');
+ var log = FileSys.OpenTextFile("log.txt", 2, true);
+
try {
var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH');
@@ -307,7 +324,7 @@ function AddFilesToCustomProj(proj, strProjectName, strProjectPath, InfFile) {
if (!strName.length || strName == '') {
continue;
}
-
+ log.WriteLine(strName);
var strTarget = GetTargetName(strName, strProjectName);
var strTemplate = strTemplatePath + '\\' + strName;
var strFile = strProjectPath + '\\' + strTarget;
@@ -340,4 +357,5 @@ function AddFilesToCustomProj(proj, strProjectName, strProjectPath, InfFile) {
catch (e) {
throw e;
}
+ log.Close();
}
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/AppDelegate.cpp b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/AppDelegate.cpp
index 1e1e04da94..7ab75d5caa 100644
--- a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/AppDelegate.cpp
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/AppDelegate.cpp
@@ -8,7 +8,6 @@
[! if CCX_USE_UI_RESOURCE]
#include "Resource.h"
-extern const AppResourceEntry [!output PROJECT_NAME]ResourceEntry;
[! endif]
using namespace cocos2d;
@@ -26,34 +25,36 @@ AppDelegate::~AppDelegate()
bool AppDelegate::applicationDidFinishLaunching()
{
- // init the window
- if (!(m_pMainWnd = new CCXEGLView(this)) ||
- ! m_pMainWnd->Create(&TRectangle(0,0,GetScreenWidth(),GetScreenHeight())))
- {
+ // init the window
+ if (!(m_pMainWnd = new CCXEGLView(this)) ||
+ ! m_pMainWnd->Create(&TRectangle(0,0,GetScreenWidth(),GetScreenHeight())))
+ {
CCX_SAFE_DELETE(m_pMainWnd);
- return false;
- }
+ return false;
+ }
// init director
CCDirector * pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(m_pMainWnd);
pDirector->setDeviceOrientation(kCCDeviceOrientationLandscapeLeft);
- // pDirector->setDeviceOrientation(kCCDeviceOrientationPortrait);
+ // pDirector->setDeviceOrientation(kCCDeviceOrientationPortrait);
pDirector->setDisplayFPS(true);
// set the resource path
CCFileUtils::setResourcePath("/NEWPLUS/TDA_DATA/Data/[!output PROJECT_NAME]/");
[! if CCX_USE_UI_RESOURCE]
- // set the ResourceEntry
- CCFileUtils::setResourceEntry(&cocosTemplateResourceEntry);
+ // cocos2d find image in ResourceEntry first, in ResourcePath second.
+ // set the ResourceEntry,
+ CCFileUtils::setResourceEntry(&[!output PROJECT_NAME]ResourceEntry);
+
// set the Images ResInfo (name and ResID)
CCFileUtils::setResourceInfo(ResInfo, sizeof(ResInfo) / sizeof(T_ResourceInfo));
[! endif]
CCScene * pScene = HelloWorld::scene();
- pDirector->runWithScene(pScene);
+ pDirector->runWithScene(pScene);
return true;
}
@@ -63,9 +64,9 @@ bool AppDelegate::applicationDidFinishLaunching()
void AppDelegate::applicationDidEnterBackground()
{
CCDirector::sharedDirector()->stopAnimation();
-
[! if CCX_USE_COCOS_DENSHION_SIMPLE_AUDIO_ENGINE]
- SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
+
+ SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
[! endif]
}
@@ -73,8 +74,8 @@ void AppDelegate::applicationDidEnterBackground()
void AppDelegate::applicationWillEnterForeground()
{
CCDirector::sharedDirector()->startAnimation();
-
[! if CCX_USE_COCOS_DENSHION_SIMPLE_AUDIO_ENGINE]
- SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
+
+ SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
[! endif]
}
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/AppDelegate.h b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/AppDelegate.h
index c9f0af8fdd..70145fe984 100644
--- a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/AppDelegate.h
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/AppDelegate.h
@@ -6,8 +6,8 @@
class AppDelegate : public cocos2d::CCXApplication
{
public:
- AppDelegate();
- ~AppDelegate();
+ AppDelegate();
+ ~AppDelegate();
virtual bool applicationDidFinishLaunching();
virtual void applicationDidEnterBackground();
@@ -17,6 +17,4 @@ protected:
cocos2d::CCXEGLView *m_pMainWnd;
};
-
-#endif // __APP_DELEGATE_H__
-
+#endif // __APP_DELEGATE_H__
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/HelloWorldScene.cpp b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/HelloWorldScene.cpp
index 9ee48be00f..4cd65e1e12 100644
--- a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/HelloWorldScene.cpp
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/HelloWorldScene.cpp
@@ -6,65 +6,65 @@ using namespace cocos2d;
CCScene* HelloWorld::scene()
{
- // 'scene' is an autorelease object
- CCScene * scene = CCScene::node();
-
- // 'layer' is an autorelease object
- HelloWorld * layer = HelloWorld::node();
+ // 'scene' is an autorelease object
+ CCScene * scene = CCScene::node();
+
+ // 'layer' is an autorelease object
+ HelloWorld * layer = HelloWorld::node();
- // add layer as a child to scene
- scene->addChild(layer);
+ // add layer as a child to scene
+ scene->addChild(layer);
- // return the scene
- return scene;
+ // return the scene
+ return scene;
}
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
- //////////////////////////////
- // 1. super init first
- if (! CCLayer::init())
- {
- return false;
- }
+ //////////////////////////////
+ // 1. super init first
+ if (! CCLayer::init())
+ {
+ return false;
+ }
- /////////////////////////////
- // 2. add a menu item with "X" image, which is clicked to quit the program
- // you may modify it.
+ /////////////////////////////
+ // 2. add a menu item with "X" image, which is clicked to quit the program
+ // you may modify it.
- // add a "close" icon to exit the progress. it's an autorelease object
- CCMenuItemImage *pCloseItem = CCMenuItemImage::itemFromNormalImage(
- (ResInfo[0]).ResName,
- (ResInfo[1]).ResName,
- this,
- menu_selector(HelloWorld::menuCloseCallback) );
- pCloseItem->setPosition( ccp(CCDirector::sharedDirector()->getWinSize().width - 20, 20) );
+ // add a "close" icon to exit the progress. it's an autorelease object
+ CCMenuItemImage *pCloseItem = CCMenuItemImage::itemFromNormalImage(
+ (ResInfo[0]).ResName,
+ (ResInfo[1]).ResName,
+ this,
+ menu_selector(HelloWorld::menuCloseCallback) );
+ pCloseItem->setPosition( ccp(CCDirector::sharedDirector()->getWinSize().width - 20, 20) );
- // create menu, it's an autorelease object
- CCMenu* pMenu = CCMenu::menuWithItems(pCloseItem, NULL);
- pMenu->setPosition(CGPointZero);
- this->addChild(pMenu);
+ // create menu, it's an autorelease object
+ CCMenu* pMenu = CCMenu::menuWithItems(pCloseItem, NULL);
+ pMenu->setPosition(CGPointZero);
+ this->addChild(pMenu);
- /////////////////////////////
- // 3. add your codes below...
- // add a label shows "Hello World"
- // create and initialize a label
- CCLabel* pLabel = CCLabel::labelWithString("HelloWorld", "Thonburi", 64);
+ /////////////////////////////
+ // 3. add your codes below...
+ // add a label shows "Hello World"
+ // create and initialize a label
+ CCLabel* pLabel = CCLabel::labelWithString("HelloWorld", "Thonburi", 64);
- // ask director the window size
- CGSize size = CCDirector::sharedDirector()->getWinSize();
+ // ask director the window size
+ CGSize size = CCDirector::sharedDirector()->getWinSize();
- // position the label on the center of the screen
- pLabel->setPosition(ccp(size.width / 2, size.height / 2));
+ // position the label on the center of the screen
+ pLabel->setPosition(ccp(size.width / 2, size.height / 2));
- // add the label as a child to this layer
- this->addChild(pLabel);
-
- return true;
+ // add the label as a child to this layer
+ this->addChild(pLabel);
+
+ return true;
}
void HelloWorld::menuCloseCallback(NSObject* pSender)
{
- CCDirector::sharedDirector()->end();
+ CCDirector::sharedDirector()->end();
}
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/HelloWorldScene.h b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/HelloWorldScene.h
index 8d1d92330a..a75e896ea4 100644
--- a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/HelloWorldScene.h
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Classes/HelloWorldScene.h
@@ -6,17 +6,17 @@
class HelloWorld : public cocos2d::CCLayer
{
public:
- // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
- virtual bool init();
+ // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
+ virtual bool init();
- // there's no 'id' in cpp, so we recommand to return the exactly class pointer
- static cocos2d::CCScene* scene();
-
- // a selector callback
- virtual void menuCloseCallback(NSObject* pSender);
+ // there's no 'id' in cpp, so we recommand to return the exactly class pointer
+ static cocos2d::CCScene* scene();
+
+ // a selector callback
+ virtual void menuCloseCallback(NSObject* pSender);
// implement the "static node()" method manually
- LAYER_NODE_FUNC(HelloWorld);
+ LAYER_NODE_FUNC(HelloWorld);
};
-#endif // _HELLOWORLD_SCENE_H_
\ No newline at end of file
+#endif // _HELLOWORLD_SCENE_H_
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Templates.inf b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Templates.inf
index a5150e3e4d..616d6e8d63 100644
--- a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Templates.inf
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/Templates.inf
@@ -5,11 +5,22 @@ uphone/NewDeleteOp.cpp
uphone/TG3AppDllEntry.cpp
uphone/TG3AppDllEntry.h
+uphone/main.cpp
+
uphone/resource.h
uphone/rootUnicodeScript.h
uphone/rootUnicodeScript_str.h
-uphone/main.cpp
+[! if CCX_USE_UI_RESOURCE]
+uphone/Res/root_Res.ENU.tr3
+uphone/Res/root_Res.ENU.tr3.tts
+uphone/Res/root_Res.h
+uphone/Res/root_Res.TR3
+uphone/Res/root_Res.TRG
+uphone/Res/root_res_c.h
+uphone/Res/root_res_def.h
+uphone/Res/root_res_h.h
+[! endif]
Classes/AppDelegate.h
Classes/AppDelegate.cpp
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/NewDeleteOp.cpp b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/NewDeleteOp.cpp
index e773818e7a..f22bc21df0 100644
--- a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/NewDeleteOp.cpp
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/NewDeleteOp.cpp
@@ -1,25 +1,25 @@
/*!
* @file NewDeleteOp.cpp
-* @author ȫǴ
+* @author 全智达
* @brief
*
* @section Copyright
* =======================================================================
*
* Copyright (c) 2005-2010 Tranzda Technologies Co.,Ltd.
-* ȫǴƼ˾ Ȩ2005-2010
+* 深圳市全智达科技有限公司 版权所有2005-2010
*
* PROPRIETARY RIGHTS of Tranzda Technologies Co.,Ltd. are involved in
* the subject matter of this material. All manufacturing, reproduction,
* use, and sales rights pertaining to this subject matter are governed
* by the license agreement. The recipient of this software implicitly
* accepts the terms of the license.
-* ĵȫǴƼ˾ĺϷʲκʿĶʹ
-* ñϱӦȨ,еκͽӦķԼ
+* 本软件文档资料是深圳市全智达科技有限公司的合法资产,任何人士阅读和使
+* 用本资料必须获得相应的书面授权,承担保密责任和接受相应的法律约束。
*
-* ˾ַ http://www.tranzda.com
-* ˾䣺support@tranzda.com
+* 公司网址: http://www.tranzda.com
+* 公司邮箱:support@tranzda.com
* =======================================================================
*/
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.ENU.tr3 b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.ENU.tr3
new file mode 100644
index 0000000000..6c7ccdb16b
--- /dev/null
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.ENU.tr3
@@ -0,0 +1,52 @@
+
+// Original file name: [!output PROJECT_NAME]_Res.ENU.tr3
+// Generated by Cocos2d-uphone Wizard Date: [!output CCX_CURRENT_DATE]
+
+
+//$VERSION 60006
+//$SETTINGS
+//$Begin
+//$VCPRJFILE="..\..\[!output PROJECT_NAME].uphone.vcproj"
+//$End
+LANGUAGE = 1033
+// ImageLists
+
+// Project
+PROJECT
+BEGIN
+ ScreenWidth 320
+ ScreenHeight 480
+ ScreenDPI 165
+END
+
+
+// TComObject
+
+// Forms
+
+// Menus
+
+// Alerts Ϣ
+
+// Strings
+
+// Fonts
+
+// Bitmaps
+
+IMAGEFOLDER ID ResFolder1001 FOLDERNAME $0052$006F$006F$0074$0028$0041$006C$006C$0029
+// ļ: Root(All)
+BEGIN
+ BITMAP ID CloseNormal NOCOMPRESS HasAlphaData TRANSPARENTCOLOR $FFFFFFFF
+ FileName $002E$002E$005C$002E$002E$005C$0052$0065$0073$006F$0075$0072$0063$0065$005C$0043$006C$006F$0073$0065$004E$006F$0072$006D$0061$006C$002E$0070$006E$0067
+ //..\..\Resource\CloseNormal.png
+
+ BITMAP ID CloseSelected NOCOMPRESS HasAlphaData TRANSPARENTCOLOR $FFFFFFFF
+ FileName $002E$002E$005C$002E$002E$005C$0052$0065$0073$006F$0075$0072$0063$0065$005C$0043$006C$006F$0073$0065$0053$0065$006C$0065$0063$0074$0065$0064$002E$0070$006E$0067
+ //..\..\Resource\CloseSelected.png
+
+END
+// raw data
+
+// Application
+
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.ENU.tr3.tts b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.ENU.tr3.tts
new file mode 100644
index 0000000000..61b796ca48
--- /dev/null
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.ENU.tr3.tts
@@ -0,0 +1,5 @@
+
+// Original file name: [!output PROJECT_NAME]_Res.ENU.tr3.tts
+// Generated by Cocos2d-uphone Wizard Date: [!output CCX_CURRENT_DATE]
+
+
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.TR3 b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.TR3
new file mode 100644
index 0000000000..b0e2241ac0
--- /dev/null
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.TR3
@@ -0,0 +1,55 @@
+
+// Original file name: [!output PROJECT_NAME]_Res.TR3
+// Generated by Cocos2d-uphone Wizard Date: [!output CCX_CURRENT_DATE]
+
+
+#include "[!output PROJECT_NAME]_Res.h"
+
+//$VERSION 60006
+//$SETTINGS
+//$Begin
+//$VCPRJFILE="..\..\[!output PROJECT_NAME].uphone.vcproj"
+//$End
+
+LANGUAGE = 2052
+// ImageLists
+
+// Project
+PROJECT
+BEGIN
+ ScreenWidth 320
+ ScreenHeight 480
+ ScreenDPI 165
+END
+
+
+// TComObject
+
+// Forms
+
+// Menus
+
+// Alerts Ϣ
+
+// Strings
+
+// Fonts
+
+// Bitmaps
+
+IMAGEFOLDER ID ResFolder1001 FOLDERNAME $0052$006F$006F$0074$0028$0041$006C$006C$0029
+// ļ: Root(All)
+BEGIN
+ BITMAP ID CloseNormal NOCOMPRESS HasAlphaData TRANSPARENTCOLOR $FFFFFFFF
+ FileName $002E$002E$005C$002E$002E$005C$0052$0065$0073$006F$0075$0072$0063$0065$005C$0043$006C$006F$0073$0065$004E$006F$0072$006D$0061$006C$002E$0070$006E$0067
+ //..\..\Resource\CloseNormal.png
+
+ BITMAP ID CloseSelected NOCOMPRESS HasAlphaData TRANSPARENTCOLOR $FFFFFFFF
+ FileName $002E$002E$005C$002E$002E$005C$0052$0065$0073$006F$0075$0072$0063$0065$005C$0043$006C$006F$0073$0065$0053$0065$006C$0065$0063$0074$0065$0064$002E$0070$006E$0067
+ //..\..\Resource\CloseSelected.png
+
+END
+// raw data
+
+// Application
+
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.TRG b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.TRG
new file mode 100644
index 0000000000..38f940fa93
--- /dev/null
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.TRG
@@ -0,0 +1,19 @@
+// Application resource group file.
+
+// Original file name: [!output PROJECT_NAME]_Res.TRG
+// Generated by Cocos2d-uphone Wizard Date: [!output CCX_CURRENT_DATE]
+
+
+
+VERSION 60001
+PROJECT
+Begin
+ IsLangBase
+ FileName = ".\[!output PROJECT_NAME]_Res.TR3"
+End
+
+PROJECT
+Begin
+ FileName = ".\[!output PROJECT_NAME]_Res.ENU.tr3"
+End
+
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.h b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.h
new file mode 100644
index 0000000000..1e14cfa03b
--- /dev/null
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_Res.h
@@ -0,0 +1,12 @@
+// Original file name: [!output PROJECT_NAME_LOWER]_Res.h
+// Generated by Cocos2d-uphone Wizard Date: [!output CCX_CURRENT_DATE]
+
+#ifndef __[!output PROJECT_NAME_UPPER]_RES_DEF_H__
+#define __[!output PROJECT_NAME_UPPER]_RES_DEF_H__
+
+#define ResFolder1001 1001
+#define CloseNormal 1002
+#define CloseSelected 1003
+
+#endif
+
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_res_c.h b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_res_c.h
new file mode 100644
index 0000000000..2e6bfdb9a5
--- /dev/null
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/Res/root_res_c.h
@@ -0,0 +1,210 @@
+// Original file name: [!output PROJECT_NAME_LOWER]_Res.h
+// Generated by Cocos2d-uphone Wizard Date: [!output CCX_CURRENT_DATE]
+
+#include "[!output PROJECT_NAME_LOWER]_res_h.h"
+#ifndef WIN32
+//#pragma diag_remark 1296
+#endif
+#if 11
#endif
-//TCOMʵҪõĺ
+//TCOM实现中需要用到的函数和数据
-//ʵõĴ
+//实例对象被引用的次数
static Int32 __TCOM_ClsidInstanceRefCount;
-//ClassFactoryLockedĴ
+//ClassFactory被Locked的次数
static Int32 __TCOM_CalssFactoryLockedCount;
-//Ҫijʼ
+//做必要的初始化
static Int32 __TCOM_Init()
{
__TCOM_ClsidInstanceRefCount = 0;
@@ -51,13 +51,13 @@ static Int32 __TCOM_Init()
return 0;
}
-//Ҫ
+//做必要的清除工作
static Int32 __TCOM_DeInit()
{
return 0;
}
-//DLLȫʹãӶʵô
+//DLL全局使用:增加对象实例被引用次数
Int32 TCOM_AddClsidInstanceRefCount()
{
__TCOM_ClsidInstanceRefCount++;
@@ -72,7 +72,7 @@ Int32 TCOM_AddClsidInstanceRefCount()
return __TCOM_ClsidInstanceRefCount;
}
-//DLLȫʹãٶʵô
+//DLL全局使用:减少对象实例被引用次数
Int32 TCOM_DecClsidInstanceRefCount()
{
__TCOM_ClsidInstanceRefCount--;
@@ -87,7 +87,7 @@ Int32 TCOM_DecClsidInstanceRefCount()
return __TCOM_ClsidInstanceRefCount;
}
-//DLLȫʹãClassFactoryLockedĴ
+//DLL全局使用:增加ClassFactory被Locked的次数
Int32 TCOM_AddCalssFactoryLockedCount()
{
__TCOM_CalssFactoryLockedCount++;
@@ -102,7 +102,7 @@ Int32 TCOM_AddCalssFactoryLockedCount()
return __TCOM_CalssFactoryLockedCount;
}
-//DLLȫʹãClassFactoryLockedĴ
+//DLL全局使用:减少ClassFactory被Locked的次数
Int32 TCOM_DecCalssFactoryLockedCount()
{
__TCOM_CalssFactoryLockedCount--;
@@ -117,15 +117,15 @@ Int32 TCOM_DecCalssFactoryLockedCount()
return __TCOM_CalssFactoryLockedCount;
}
-//ʵTCOMҪDLL
+//实现TCOM所需要的DLL函数
-//DLLṩĻȡָCLSIDָӿ
+//DLL提供的获取指定CLSID的指定接口
SS_EXPORT HRESULT TDllGetClassObject(TREFCLSID rclsid, TREFIID riid, LPVOID * ppv)
{
return TCOM_Srv_GetClassObject(rclsid, riid, ppv);
}
-//DLLṩIJѯDLLܷUnload
+//DLL提供的查询DLL能否被Unload
SS_EXPORT HRESULT TDllCanUnloadNow(void)
{
#ifdef __TCOM_OUTPUT_DEBUG_INFO__
@@ -138,13 +138,13 @@ SS_EXPORT HRESULT TDllCanUnloadNow(void)
return TCOM_S_FALSE;
}
-//DLLṩİDLLTCOMϢ뵽ע
+//DLL提供的把DLL的TCOM信息加入到注册表
SS_EXPORT HRESULT TDllRegisterServer(void)
{
return TCOM_Srv_RegisterServer();
}
-//DLLṩİDLLTCOMϢעɾ
+//DLL提供的把DLL的TCOM信息从注册表中删除
SS_EXPORT HRESULT TDllUnregisterServer(void)
{
return TCOM_Srv_UnregisterServer();
@@ -163,19 +163,19 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
- //̼ض̬еIJ
+ //进程加载动态库进行的操作
#ifdef __TCOM_SUPPORT__
__TCOM_Init();
#endif
break;
case DLL_THREAD_ATTACH:
- //̼߳ض̬еIJ
+ //线程加载动态库进行的操作
break;
case DLL_THREAD_DETACH:
- //߳жض̬еIJ
+ //线程卸载动态库进行的操作
break;
case DLL_PROCESS_DETACH:
- //жض̬еIJ
+ //进程卸载动态库进行的操作
#ifdef __TCOM_SUPPORT__
__TCOM_DeInit();
#endif
@@ -191,7 +191,7 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
void __attribute((constructor)) TG3_Dll_Attach()
{
- //̼ض̬еIJ
+ //进程加载动态库进行的操作
#ifdef __TCOM_SUPPORT__
__TCOM_Init();
#endif
@@ -199,7 +199,7 @@ void __attribute((constructor)) TG3_Dll_Attach()
void __attribute((destructor)) TG3_Dll_Detach()
{
- //жض̬еIJ
+ //进程卸载动态库进行的操作
#ifdef __TCOM_SUPPORT__
__TCOM_DeInit();
#endif
@@ -207,20 +207,20 @@ void __attribute((destructor)) TG3_Dll_Detach()
#endif
-//ΪTG3Ķ̬ӦãVCĿкTMK3ļж __TG3_PURE_DLL__
+//如果不是作为TG3的动态库应用,请在VC项目中和TMK3文件中定义 __TG3_PURE_DLL__ 宏
#ifndef __TG3_PURE_DLL__
-//̬Ӧʹõͳһֵں
+//动态库应用使用的统一导出名字的入口函数
SS_EXPORT Int32 TDllTG3AppMain(const TUChar * pAppID, UInt32 nCmd, void * pCmdParam)
{
Int32 retValue;
- //ʼTCOM
+ //初始化TCOM
TCoInitialize(NULL);
retValue = TG3AppMain(pAppID, nCmd, pCmdParam);
- //ͷTCOM
+ //释放TCOM
TCoUninitialize();
return retValue;
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/TG3AppDllEntry.h b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/TG3AppDllEntry.h
index e91464ed88..e4cbd3c76f 100644
--- a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/TG3AppDllEntry.h
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/TG3AppDllEntry.h
@@ -14,35 +14,35 @@
#include "TCOM.h"
-//ṩDLLʵߵõĺȫּ¼ʵClassFactoryõĴ
-//ӰDLLǷܱڴжأʵڲʵּͬʱȫּ
-//DLLпܻʵڵʱϵͳԶǿж
+//提供给DLL实现者调用的函数,用于在全局记录实例和ClassFactory被引用的次数,
+//这两个计数影响DLL是否可能被从内存中卸载,请大家在实例中内部实现计数的同时更新全局计数,
+//否则DLL很有可能会在实例还存在的时候被系统自动强制卸载
-//DLLȫʹãӶʵô
+//DLL全局使用:增加对象实例被引用次数
Int32 TCOM_AddClsidInstanceRefCount();
-//DLLȫʹãٶʵô
+//DLL全局使用:减少对象实例被引用次数
Int32 TCOM_DecClsidInstanceRefCount();
-//DLLȫʹãClassFactoryLockedĴ
+//DLL全局使用:增加ClassFactory被Locked的次数
Int32 TCOM_AddCalssFactoryLockedCount();
-//DLLȫʹãClassFactoryLockedĴ
+//DLL全局使用:减少ClassFactory被Locked的次数
Int32 TCOM_DecCalssFactoryLockedCount();
-//ӦDLL֧TCOMʱṩʹõĺ
+//应用DLL在支持TCOM的时候提供给导出函数使用的函数
-//ӦøݸCLSIDClassFactoryӿIIDClassFactoryĽӿ
-//ֵοTCOM_S_ϵк궨
+//应用根据给出的CLSID和ClassFactory接口IID返回ClassFactory的接口
+//返回值:参考TCOM_S_系列宏定义
HRESULT TCOM_Srv_GetClassObject(TREFCLSID rclsid, TREFIID riid, LPVOID * ppv);
-//ӦṩİTCOMϢ뵽ע
-//ֵοTCOM_S_ϵк궨
+//应用提供的把TCOM信息加入到注册表
+//返回值:参考TCOM_S_系列宏定义
HRESULT TCOM_Srv_RegisterServer(void);
-//ӦṩİTCOMϢעɾ
-//ֵοTCOM_S_ϵк궨
+//应用提供的把TCOM信息从注册表中删除
+//返回值:参考TCOM_S_系列宏定义
HRESULT TCOM_Srv_UnregisterServer(void);
#endif //__TCOM_SUPPORT__
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/main.cpp b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/main.cpp
index 68a8237c9c..e1528d641b 100644
--- a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/main.cpp
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/main.cpp
@@ -1,27 +1,27 @@
#include "AppDelegate.h"
[! if CCX_USE_UI_RESOURCE]
-#include "[!output PROJECT_NAME]_res_c.h"
+#include "[!output PROJECT_NAME_LOWER]_res_c.h"
-const ResourceRegisterEntry ResRegList_[!output PROJECT_NAME][] =
+const ResourceRegisterEntry ResRegList_[!output PROJECT_NAME][] =
{
- TG_RESOURCE_DEFINE
+ TG_RESOURCE_DEFINE
};
-extern const AppResourceEntry [!output PROJECT_NAME]ResourceEntry =
+extern const AppResourceEntry [!output PROJECT_NAME]ResourceEntry =
{
- (ResourceRegisterEntry*)ResRegList_[!output PROJECT_NAME], // res list in this app
- sizeof(ResRegList_[!output PROJECT_NAME]) / sizeof(ResourceRegisterEntry), //number of item in res
+ (ResourceRegisterEntry*)ResRegList_[!output PROJECT_NAME], // res list in this app
+ sizeof(ResRegList_[!output PROJECT_NAME]) / sizeof(ResourceRegisterEntry), //number of item in res
};
[! endif]
Int32 TG3AppMain(const TUChar * pAppID, UInt32 nCmd, void * pCmdParam)
{
- AppDelegate app;
+ AppDelegate app;
[! if CCX_USE_UI_RESOURCE]
- app.WM_SetResourceEntry(&[!output PROJECT_NAME]ResourceEntry);
+ app.WM_SetResourceEntry(&[!output PROJECT_NAME]ResourceEntry);
[! endif]
- app.Run();
+ app.Run();
- return 1;
+ return 1;
}
diff --git a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/resource.h b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/resource.h
index bc8c9cf717..cdbb34556a 100644
--- a/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/resource.h
+++ b/template/CCXAppWiz.vs/CCXAppWiz.uphone/Templates/1033/uphone/resource.h
@@ -4,15 +4,16 @@
#include "[!output PROJECT_NAME]UnicodeScript_str.h";
[! if CCX_USE_UI_RESOURCE]
-#include "[!output PROJECT_NAME]_res_c.h"
+#include "[!output PROJECT_NAME_LOWER]_res_def.h"
+extern const AppResourceEntry [!output PROJECT_NAME]ResourceEntry;
[! endif]
#include "cocos2d.h"
const T_ResourceInfo ResInfo[] =
{
- { "CloseNormal.png", [! if CCX_USE_UI_RESOURCE]COCOST_ID_BITMAP_CloseNormal[! else]0[! endif] },
- { "CloseSelected.png", [! if CCX_USE_UI_RESOURCE]COCOST_ID_BITMAP_CloseSelected[! else]0[! endif] },
+ { "CloseNormal.png", [! if CCX_USE_UI_RESOURCE][!output PRO_NAME_PREFIX]_ID_BITMAP_CloseNormal[! else]0[! endif] },
+ { "CloseSelected.png", [! if CCX_USE_UI_RESOURCE][!output PRO_NAME_PREFIX]_ID_BITMAP_CloseSelected[! else]0[! endif] },
};
#endif // __RESOURCE_H__