issue #1191: Updated win32 template.

This commit is contained in:
James Chen 2012-04-26 15:57:05 +08:00
parent 13098df90e
commit a771f47a1a
6 changed files with 90 additions and 20 deletions

View File

@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)cocos2dx1&quot;;&quot;$(SolutionDir)cocos2dx\actions&quot;;&quot;$(SolutionDir)cocos2dx\base_nodes&quot;;&quot;$(SolutionDir)cocos2dx\cocoa&quot;;&quot;$(SolutionDir)cocos2dx\effects&quot;;&quot;$(SolutionDir)cocos2dx\include&quot;;&quot;$(SolutionDir)cocos2dx\kazmath\include&quot;;&quot;$(SolutionDir)cocos2dx\keypad_dispatcher&quot;;&quot;$(SolutionDir)cocos2dx\label_nodes&quot;;&quot;$(SolutionDir)cocos2dx\layers_scenes_transitions_nodes&quot;;&quot;$(SolutionDir)cocos2dx\menu_nodes&quot;;&quot;$(SolutionDir)cocos2dx\misc_nodes&quot;;&quot;$(SolutionDir)cocos2dx\particle_nodes&quot;;&quot;$(SolutionDir)cocos2dx\script_support&quot;;&quot;$(SolutionDir)cocos2dx\shaders&quot;;&quot;$(SolutionDir)cocos2dx\sprite_nodes&quot;;&quot;$(SolutionDir)cocos2dx\support&quot;;&quot;$(SolutionDir)cocos2dx\text_input_node&quot;;&quot;$(SolutionDir)cocos2dx\textures&quot;;&quot;$(SolutionDir)cocos2dx\tileMap_parallax_nodes&quot;;&quot;$(SolutionDir)cocos2dx\touch_dispatcher&quot;;&quot;$(SolutionDir)cocos2dx\platform&quot;;&quot;$(SolutionDir)cocos2dx\platform\win32&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;..\Classes"
AdditionalIncludeDirectories="&quot;$(SolutionDir)cocos2dx&quot;;&quot;$(SolutionDir)cocos2dx\actions&quot;;&quot;$(SolutionDir)cocos2dx\base_nodes&quot;;&quot;$(SolutionDir)cocos2dx\cocoa&quot;;&quot;$(SolutionDir)cocos2dx\effects&quot;;&quot;$(SolutionDir)cocos2dx\include&quot;;&quot;$(SolutionDir)cocos2dx\kazmath\include&quot;;&quot;$(SolutionDir)cocos2dx\keypad_dispatcher&quot;;&quot;$(SolutionDir)cocos2dx\label_nodes&quot;;&quot;$(SolutionDir)cocos2dx\layers_scenes_transitions_nodes&quot;;&quot;$(SolutionDir)cocos2dx\menu_nodes&quot;;&quot;$(SolutionDir)cocos2dx\misc_nodes&quot;;&quot;$(SolutionDir)cocos2dx\particle_nodes&quot;;&quot;$(SolutionDir)cocos2dx\script_support&quot;;&quot;$(SolutionDir)cocos2dx\shaders&quot;;&quot;$(SolutionDir)cocos2dx\sprite_nodes&quot;;&quot;$(SolutionDir)cocos2dx\support&quot;;&quot;$(SolutionDir)cocos2dx\text_input_node&quot;;&quot;$(SolutionDir)cocos2dx\textures&quot;;&quot;$(SolutionDir)cocos2dx\tileMap_parallax_nodes&quot;;&quot;$(SolutionDir)cocos2dx\touch_dispatcher&quot;;&quot;$(SolutionDir)cocos2dx\platform&quot;;&quot;$(SolutionDir)cocos2dx\platform\win32&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;..\Classes"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="true"
BasicRuntimeChecks="3"

View File

@ -32,10 +32,34 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests\proj.win32\t
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hello5.win32", "hello5\hello5.win32.vcproj", "{4DB5AE27-1695-47F3-98F2-A85D6F61F361}"
ProjectSection(ProjectDependencies) = postProject
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hellobox2d.win32", "hellobox2d\hellobox2d.win32.vcproj", "{8F9F807A-875A-4A19-9326-D68776F38D45}"
ProjectSection(ProjectDependencies) = postProject
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
{929480E7-23C0-4DF6-8456-096D71547116} = {929480E7-23C0-4DF6-8456-096D71547116}
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hellochipmunk.win32", "hellochipmunk\hellochipmunk.win32.vcproj", "{CAF29F4C-B857-44B5-8BC3-89E227D225BD}"
ProjectSection(ProjectDependencies) = postProject
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
{207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "helloluatest.win32", "helloluatest\helloluatest.win32.vcproj", "{C5C9CB75-5E49-420B-B2B2-9D8A776E4916}"
ProjectSection(ProjectDependencies) = postProject
{DDC3E27F-004D-4DD4-9DD3-931A013D2159} = {DDC3E27F-004D-4DD4-9DD3-931A013D2159}
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}
EndProjectSection
EndProject
Global
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
@ -73,8 +97,27 @@ Global
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32
{4DB5AE27-1695-47F3-98F2-A85D6F61F361}.Debug|Win32.ActiveCfg = Debug|Win32
{4DB5AE27-1695-47F3-98F2-A85D6F61F361}.Debug|Win32.Build.0 = Debug|Win32
{4DB5AE27-1695-47F3-98F2-A85D6F61F361}.Release|Win32.ActiveCfg = Release|Win32
{4DB5AE27-1695-47F3-98F2-A85D6F61F361}.Release|Win32.Build.0 = Release|Win32
{8F9F807A-875A-4A19-9326-D68776F38D45}.Debug|Win32.ActiveCfg = Debug|Win32
{8F9F807A-875A-4A19-9326-D68776F38D45}.Debug|Win32.Build.0 = Debug|Win32
{8F9F807A-875A-4A19-9326-D68776F38D45}.Release|Win32.ActiveCfg = Release|Win32
{8F9F807A-875A-4A19-9326-D68776F38D45}.Release|Win32.Build.0 = Release|Win32
{CAF29F4C-B857-44B5-8BC3-89E227D225BD}.Debug|Win32.ActiveCfg = Debug|Win32
{CAF29F4C-B857-44B5-8BC3-89E227D225BD}.Debug|Win32.Build.0 = Debug|Win32
{CAF29F4C-B857-44B5-8BC3-89E227D225BD}.Release|Win32.ActiveCfg = Release|Win32
{CAF29F4C-B857-44B5-8BC3-89E227D225BD}.Release|Win32.Build.0 = Release|Win32
{C5C9CB75-5E49-420B-B2B2-9D8A776E4916}.Debug|Win32.ActiveCfg = Debug|Win32
{C5C9CB75-5E49-420B-B2B2-9D8A776E4916}.Debug|Win32.Build.0 = Debug|Win32
{C5C9CB75-5E49-420B-B2B2-9D8A776E4916}.Release|Win32.ActiveCfg = Release|Win32
{C5C9CB75-5E49-420B-B2B2-9D8A776E4916}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
EndGlobalSection
EndGlobal

View File

@ -218,9 +218,31 @@ function AddConfigurations(proj, strProjectName) {
// Additional Inlcude Directories
var strAddIncludeDir = '.;.\\win32;.\\Classes';
strAddIncludeDir += ';..\\cocos2dx;..\\cocos2dx\\include';
strAddIncludeDir += ';..\\cocos2dx\\platform';
strAddIncludeDir += ';..\\cocos2dx\\platform\\third_party\\win32\\OGLES';
strAddIncludeDir += ';..\\cocos2dx';
strAddIncludeDir += ';..\\cocos2dx\\actions';
strAddIncludeDir += ';..\\cocos2dx\\base_nodes';
strAddIncludeDir += ';..\\cocos2dx\\cocoa';
strAddIncludeDir += ';..\\cocos2dx\\effects';
strAddIncludeDir += ';..\\cocos2dx\\include';
strAddIncludeDir += ';..\\cocos2dx\\kazmath\\include';
strAddIncludeDir += ';..\\cocos2dx\\keypad_dispatcher';
strAddIncludeDir += ';..\\cocos2dx\\label_nodes';
strAddIncludeDir += ';..\\cocos2dx\\layers_scenes_transitions_nodes';
strAddIncludeDir += ';..\\cocos2dx\\menu_nodes';
strAddIncludeDir += ';..\\cocos2dx\\misc_nodes';
strAddIncludeDir += ';..\\cocos2dx\\particle_nodes';
strAddIncludeDir += ';..\\cocos2dx\\script_support';
strAddIncludeDir += ';..\\cocos2dx\\shaders';
strAddIncludeDir += ';..\\cocos2dx\\sprite_nodes';
strAddIncludeDir += ';..\\cocos2dx\\support';
strAddIncludeDir += ';..\\cocos2dx\\text_input_node';
strAddIncludeDir += ';..\\cocos2dx\\textures';
strAddIncludeDir += ';..\\cocos2dx\\tileMap_parallax_nodes';
strAddIncludeDir += ';..\\cocos2dx\\touch_dispatcher';
strAddIncludeDir += ';..\\cocos2dx\\platform';
strAddIncludeDir += ';..\\cocos2dx\\platform\\win32';
strAddIncludeDir += ';..\\cocos2dx\\platform\\third_party\\win32';
strAddIncludeDir += ';..\\cocos2dx\\platform\\third_party\\win32\\OGLES';
if (wizard.FindSymbol('CC_USE_BOX2D')) {
strAddIncludeDir += ';..\\';
@ -277,7 +299,7 @@ function AddConfigurations(proj, strProjectName) {
}
// Additional Library Directories
var strAddDepends = 'libcocos2d.lib libgles_cm.lib';
var strAddDepends = 'libcocos2d.lib libGLESv2.lib';
if (wizard.FindSymbol('CC_USE_BOX2D')) {
strAddDepends += ' libBox2d.lib';
}

View File

@ -38,6 +38,9 @@ bool AppDelegate::initInstance()
CC_BREAK_IF(! pMainWnd
|| ! pMainWnd->Create(TEXT("cocos2d: Hello World"), 480, 320));
// set the design resolution screen size, if you want to use Design Resoulution scaled to current screen, please uncomment next line.
//pMainWnd->setDesignResolutionSize(480, 320);
#endif // CC_PLATFORM_WIN32
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
@ -102,7 +105,7 @@ bool AppDelegate::applicationDidFinishLaunching()
// pDirector->enableRetinaDisplay(true);
// turn on display FPS
pDirector->setDisplayFPS(true);
pDirector->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
@ -130,7 +133,7 @@ bool AppDelegate::applicationDidFinishLaunching()
#endif
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE)
string path = CCFileUtils::fullPathFromRelativePath("hello.lua");
std::string path = CCFileUtils::fullPathFromRelativePath("hello.lua");
pEngine->addSearchPath(path.substr(0, path.find_last_of("/")).c_str());
pEngine->executeScriptFile(path.c_str());
#endif

View File

@ -42,7 +42,7 @@ bool HelloWorld::init()
// 1. Add a menu item with "X" image, which is clicked to quit the program.
// Create a "close" menu item with close icon, it's an auto release object.
CCMenuItemImage *pCloseItem = CCMenuItemImage::itemFromNormalImage(
CCMenuItemImage *pCloseItem = CCMenuItemImage::itemWithNormalImage(
"CloseNormal.png",
"CloseSelected.png",
this,
@ -63,12 +63,12 @@ bool HelloWorld::init()
// 2. Add a label shows "Hello World".
// Create a label and initialize with string "Hello World".
CCLabelTTF* pLabel = CCLabelTTF::labelWithString("Hello World", "Thonburi", 64);
CCLabelTTF* pLabel = CCLabelTTF::labelWithString("Hello World", "Arial", 24);
CC_BREAK_IF(! pLabel);
// Get window size and place the label upper.
CCSize size = CCDirector::sharedDirector()->getWinSize();
pLabel->setPosition(ccp(size.width / 2, size.height - 20));
pLabel->setPosition(ccp(size.width / 2, size.height - 50));
// Add the label to HelloWorld layer as a child layer.
this->addChild(pLabel, 1);

View File

@ -30,12 +30,13 @@ local function creatDog()
spriteDog.isPaused = false
spriteDog:setPosition(0, winSize.height / 4 * 3)
local animFrames = CCMutableArray_CCSpriteFrame__:new(2)
local animFrames = CCArray:arrayWithCapacity(2)
animFrames:addObject(frame0)
animFrames:addObject(frame1)
local animation = CCAnimation:animationWithFrames(animFrames, 0.5)
local animate = CCAnimate:actionWithAnimation(animation, false);
local animation = CCAnimation:animationWithSpriteFrames(animFrames, 0.5)
local animate = CCAnimate:actionWithAnimation(animation);
spriteDog:runAction(CCRepeatForever:actionWithAction(animate))
-- moving dog at every frame
@ -47,10 +48,11 @@ local function creatDog()
else
x = x + 1
end
spriteDog:setPositionX(x)
end
CCScheduler:sharedScheduler():scheduleScriptFunc(tick, 0, false)
CCDirector:sharedDirector():getScheduler():scheduleScriptFunc(tick, 0, false)
return spriteDog
end
@ -110,7 +112,7 @@ local function createLayerFram()
end
local function onTouchEnded(x, y)
cclog("onTouchEnded")
cclog("onTouchEnded: %0.2f, %0.2f", x, y)
touchBeginPoint = nil
spriteDog.isPaused = false
end
@ -151,7 +153,7 @@ local function createLayerMenu()
end
-- add a popup menu
local menuPopupItem = CCMenuItemImage:itemFromNormalImage("menu2.png", "menu2.png")
local menuPopupItem = CCMenuItemImage:itemWithNormalImage("menu2.png", "menu2.png")
menuPopupItem:setPosition(0, 0)
menuPopupItem:registerScriptHandler(menuCallbackClosePopup)
menuPopup = CCMenu:menuWithItem(menuPopupItem)
@ -160,7 +162,7 @@ local function createLayerMenu()
layerMenu:addChild(menuPopup)
-- add the left-bottom "tools" menu to invoke menuPopup
local menuToolsItem = CCMenuItemImage:itemFromNormalImage("menu1.png", "menu1.png")
local menuToolsItem = CCMenuItemImage:itemWithNormalImage("menu1.png", "menu1.png")
menuToolsItem:setPosition(0, 0)
menuToolsItem:registerScriptHandler(menuCallbackOpenPopup)
menuTools = CCMenu:menuWithItem(menuToolsItem)