From 5349aa7efba0f6803020d3c92547478141e62029 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Thu, 7 Aug 2014 20:57:26 +0900 Subject: [PATCH 1/6] Add ccRandom.h --- build/cocos2d_libs.xcodeproj/project.pbxproj | 6 ++ cocos/base/ccRandom.h | 103 +++++++++++++++++++ templates/cocos2dx_files.json | 1 + 3 files changed, 110 insertions(+) create mode 100644 cocos/base/ccRandom.h diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index ae84e6534b..910a81b397 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -567,6 +567,8 @@ 1AD71EF5180E27CF00808F54 /* CCPhysicsSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71EEE180E27CF00808F54 /* CCPhysicsSprite.cpp */; }; 1AD71EF6180E27CF00808F54 /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */; }; 1AD71EF7180E27CF00808F54 /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */; }; + 1F36C031BE016A88AB195F1B /* ccRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */; }; + 1F36C5F58B5642071337D8E2 /* ccRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */; }; 2958244B19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */; }; 2958244C19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */; }; 2958244D19873D8E00F9746D /* UIScale9Sprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 2958244A19873D8E00F9746D /* UIScale9Sprite.h */; }; @@ -2393,6 +2395,7 @@ 1AD71EED180E27CF00808F54 /* CCPhysicsDebugNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsDebugNode.h; sourceTree = ""; }; 1AD71EEE180E27CF00808F54 /* CCPhysicsSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsSprite.cpp; sourceTree = ""; }; 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsSprite.h; sourceTree = ""; }; + 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccRandom.h; path = ../base/ccRandom.h; sourceTree = ""; }; 2905F9E918CF08D000240AA3 /* CocosGUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocosGUI.cpp; sourceTree = ""; }; 2905F9EA18CF08D000240AA3 /* CocosGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosGUI.h; sourceTree = ""; }; 2905F9EB18CF08D000240AA3 /* GUIDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDefine.h; sourceTree = ""; }; @@ -3469,6 +3472,7 @@ 50ABBDFB1925AB6E00A911A9 /* CCProfiling.cpp */, 50ABBDFC1925AB6E00A911A9 /* CCProfiling.h */, 50ABBDFD1925AB6E00A911A9 /* CCProtocols.h */, + 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */, 50ABBDFE1925AB6E00A911A9 /* CCRef.cpp */, 50ABBDFF1925AB6E00A911A9 /* CCRef.h */, 50ABBE001925AB6E00A911A9 /* CCRefPtr.h */, @@ -5457,6 +5461,7 @@ B6ACD899193D6693005E0B8A /* CCMeshSkin.h in Headers */, B6ACD8A0193DC0CC005E0B8A /* CCAnimate3D.h in Headers */, B6AAF84319404E0D0069DE01 /* CCBundle3D.h in Headers */, + 1F36C031BE016A88AB195F1B /* ccRandom.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5833,6 +5838,7 @@ B6ACD89A193D6693005E0B8A /* CCMeshSkin.h in Headers */, B6ACD8A1193DC0CC005E0B8A /* CCAnimate3D.h in Headers */, B6AAF84419404E0D0069DE01 /* CCBundle3D.h in Headers */, + 1F36C5F58B5642071337D8E2 /* ccRandom.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/cocos/base/ccRandom.h b/cocos/base/ccRandom.h new file mode 100644 index 0000000000..2be07b6a95 --- /dev/null +++ b/cocos/base/ccRandom.h @@ -0,0 +1,103 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#ifndef __ccRandom_H_ +#define __ccRandom_H_ + +#include "base/CCPlatformMacros.h" +#include + + +NS_CC_BEGIN + +class RandomHelper { +public: + template + static inline T random_real(T min, T max) { + std::uniform_real_distribution dist(min, max); + std::mt19937 mt = RandomHelper::getEngine(); + return dist(mt); + } + + template + static inline T random_int(T min, T max) { + std::uniform_int_distribution<> dist(min, max); + std::mt19937 mt = RandomHelper::getEngine(); + return dist(mt); + } +private: + static std::mt19937 getEngine() { + static std::random_device seed_gen; + static std::mt19937 engine(seed_gen()); + return engine; + } +}; + +/** +* returns a random value between `min` and `max` +*/ +template +inline T random(T min, T max) { + return RandomHelper::random_int(min, max); +} + +template<> +inline float random(float min, float max) { + return RandomHelper::random_real(min, max); +} + +template<> +inline long double random(long double min, long double max) { + return RandomHelper::random_real(min, max); +} + +template<> +inline double random(double min, double max) { + return RandomHelper::random_real(min, max); +} + +/** +* returns a random int between 0 and RAND_MAX +*/ +inline int random() { + return cocos2d::random(0, RAND_MAX); +}; + +/** +* returns a random float between -1 and 1 +*/ +inline float rand_minus1_1() { + return cocos2d::random(-1.f, 1.f); +}; + +/** +* returns a random float between 0 and 1 +*/ +inline float rand_0_1() { + return cocos2d::random(0.f, 1.f); +}; + +NS_CC_END +#endif //__ccRandom_H_ diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 49bba596f5..e9f888e127 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -344,6 +344,7 @@ "cocos/base/CCProfiling.cpp", "cocos/base/CCProfiling.h", "cocos/base/CCProtocols.h", + "cocos/base/ccRanrom.h", "cocos/base/CCRef.cpp", "cocos/base/CCRef.h", "cocos/base/CCRefPtr.h", From 2ca881287ff799fa21f9e4516c1b0932476992d7 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Thu, 7 Aug 2014 21:01:30 +0900 Subject: [PATCH 2/6] CCRANDOM macro use ccRandom --- cocos/base/ccMacros.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos/base/ccMacros.h b/cocos/base/ccMacros.h index 165dbab7cf..9c13d654df 100644 --- a/cocos/base/ccMacros.h +++ b/cocos/base/ccMacros.h @@ -69,16 +69,17 @@ simple macro that swaps 2 variables x = y; y = temp; \ } +#include "base/ccRandom.h" /** @def CCRANDOM_MINUS1_1 returns a random float between -1 and 1 */ -#define CCRANDOM_MINUS1_1() ((2.0f*((float)rand()/RAND_MAX))-1.0f) +#define CCRANDOM_MINUS1_1() cocos2d::rand_minus1_1() /** @def CCRANDOM_0_1 returns a random float between 0 and 1 */ -#define CCRANDOM_0_1() ((float)rand()/RAND_MAX) +#define CCRANDOM_0_1() cocos2d::rand_0_1() /** @def CC_DEGREES_TO_RADIANS converts degrees to radians From 6722f8d5463fa456dd664807fdb523c04c577639 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Fri, 8 Aug 2014 13:27:09 +0900 Subject: [PATCH 3/6] Fix typo --- templates/cocos2dx_files.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index e9f888e127..4830583baf 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -344,7 +344,7 @@ "cocos/base/CCProfiling.cpp", "cocos/base/CCProfiling.h", "cocos/base/CCProtocols.h", - "cocos/base/ccRanrom.h", + "cocos/base/ccRandom.h", "cocos/base/CCRef.cpp", "cocos/base/CCRef.h", "cocos/base/CCRefPtr.h", From 89cf0c1e8c7bf08f21fdd57960c744dcb1493a36 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Tue, 12 Aug 2014 11:56:08 +0900 Subject: [PATCH 4/6] fix getEngine --- cocos/base/ccRandom.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/base/ccRandom.h b/cocos/base/ccRandom.h index 2be07b6a95..9bb813d29d 100644 --- a/cocos/base/ccRandom.h +++ b/cocos/base/ccRandom.h @@ -37,18 +37,18 @@ public: template static inline T random_real(T min, T max) { std::uniform_real_distribution dist(min, max); - std::mt19937 mt = RandomHelper::getEngine(); + auto &mt = RandomHelper::getEngine(); return dist(mt); } template static inline T random_int(T min, T max) { std::uniform_int_distribution<> dist(min, max); - std::mt19937 mt = RandomHelper::getEngine(); + auto &mt = RandomHelper::getEngine(); return dist(mt); } private: - static std::mt19937 getEngine() { + static std::mt19937 &getEngine() { static std::random_device seed_gen; static std::mt19937 engine(seed_gen()); return engine; From 17aa2833db739f6f05cdf5b5d83559a4b6c5ade7 Mon Sep 17 00:00:00 2001 From: gin0606 Date: Tue, 12 Aug 2014 12:46:14 +0900 Subject: [PATCH 5/6] Fix xcode warning that cause `getEngine` inline expansion --- build/cocos2d_libs.xcodeproj/project.pbxproj | 6 ++++ cocos/Android.mk | 1 + cocos/base/CMakeLists.txt | 1 + cocos/base/ccRandom.cpp | 32 ++++++++++++++++++++ cocos/base/ccRandom.h | 6 +--- templates/cocos2dx_files.json | 1 + 6 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 cocos/base/ccRandom.cpp diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 910a81b397..eddca4ccc3 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -568,7 +568,9 @@ 1AD71EF6180E27CF00808F54 /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */; }; 1AD71EF7180E27CF00808F54 /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */; }; 1F36C031BE016A88AB195F1B /* ccRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */; }; + 1F36C5262E265FD5FFEA0D04 /* ccRandom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F36CB4D61681865AFA7E8DC /* ccRandom.cpp */; }; 1F36C5F58B5642071337D8E2 /* ccRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */; }; + 1F36CBBF38533B59D96661B1 /* ccRandom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F36CB4D61681865AFA7E8DC /* ccRandom.cpp */; }; 2958244B19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */; }; 2958244C19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */; }; 2958244D19873D8E00F9746D /* UIScale9Sprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 2958244A19873D8E00F9746D /* UIScale9Sprite.h */; }; @@ -2396,6 +2398,7 @@ 1AD71EEE180E27CF00808F54 /* CCPhysicsSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsSprite.cpp; sourceTree = ""; }; 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsSprite.h; sourceTree = ""; }; 1F36C53D12BFE7AD4C769D4D /* ccRandom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccRandom.h; path = ../base/ccRandom.h; sourceTree = ""; }; + 1F36CB4D61681865AFA7E8DC /* ccRandom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ccRandom.cpp; path = ../base/ccRandom.cpp; sourceTree = ""; }; 2905F9E918CF08D000240AA3 /* CocosGUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocosGUI.cpp; sourceTree = ""; }; 2905F9EA18CF08D000240AA3 /* CocosGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosGUI.h; sourceTree = ""; }; 2905F9EB18CF08D000240AA3 /* GUIDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDefine.h; sourceTree = ""; }; @@ -3506,6 +3509,7 @@ 50ABBE1C1925AB6F00A911A9 /* utlist.h */, 50ABBE1D1925AB6F00A911A9 /* ZipUtils.cpp */, 50ABBE1E1925AB6F00A911A9 /* ZipUtils.h */, + 1F36CB4D61681865AFA7E8DC /* ccRandom.cpp */, ); name = base; path = ../cocos/2d; @@ -6912,6 +6916,7 @@ B6ACD897193D6693005E0B8A /* CCMeshSkin.cpp in Sources */, B6ACD89E193DC0CC005E0B8A /* CCAnimate3D.cpp in Sources */, B6AAF84119404E0D0069DE01 /* CCBundle3D.cpp in Sources */, + 1F36CBBF38533B59D96661B1 /* ccRandom.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -7244,6 +7249,7 @@ B6ACD898193D6693005E0B8A /* CCMeshSkin.cpp in Sources */, B6ACD89F193DC0CC005E0B8A /* CCAnimate3D.cpp in Sources */, B6AAF84219404E0D0069DE01 /* CCBundle3D.cpp in Sources */, + 1F36C5262E265FD5FFEA0D04 /* ccRandom.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/cocos/Android.mk b/cocos/Android.mk index de7056977b..49cd30c780 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -128,6 +128,7 @@ base/CCEventTouch.cpp \ base/CCIMEDispatcher.cpp \ base/CCNS.cpp \ base/CCProfiling.cpp \ +base/ccRandom.cpp \ base/CCRef.cpp \ base/CCScheduler.cpp \ base/CCScriptSupport.cpp \ diff --git a/cocos/base/CMakeLists.txt b/cocos/base/CMakeLists.txt index e57058fd5a..9e4bab6394 100644 --- a/cocos/base/CMakeLists.txt +++ b/cocos/base/CMakeLists.txt @@ -23,6 +23,7 @@ set(COCOS_BASE_SRC base/CCIMEDispatcher.cpp base/CCNS.cpp base/CCProfiling.cpp + base/ccRandom.cpp base/CCRef.cpp base/CCScheduler.cpp base/CCScriptSupport.cpp diff --git a/cocos/base/ccRandom.cpp b/cocos/base/ccRandom.cpp new file mode 100644 index 0000000000..b14783f2e9 --- /dev/null +++ b/cocos/base/ccRandom.cpp @@ -0,0 +1,32 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#include "ccRandom.h" + +std::mt19937 &cocos2d::RandomHelper::getEngine() { + static std::random_device seed_gen; + static std::mt19937 engine(seed_gen()); + return engine; +} diff --git a/cocos/base/ccRandom.h b/cocos/base/ccRandom.h index 9bb813d29d..5d3a7ab2e0 100644 --- a/cocos/base/ccRandom.h +++ b/cocos/base/ccRandom.h @@ -48,11 +48,7 @@ public: return dist(mt); } private: - static std::mt19937 &getEngine() { - static std::random_device seed_gen; - static std::mt19937 engine(seed_gen()); - return engine; - } + static std::mt19937 &getEngine(); }; /** diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 4830583baf..cb271b5e8a 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -344,6 +344,7 @@ "cocos/base/CCProfiling.cpp", "cocos/base/CCProfiling.h", "cocos/base/CCProtocols.h", + "cocos/base/ccRandom.cpp", "cocos/base/ccRandom.h", "cocos/base/CCRef.cpp", "cocos/base/CCRef.h", From 34629f10148c093d981f9ca02b7eb37d15d1967e Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 20 Aug 2014 12:02:12 +0800 Subject: [PATCH 6/6] fix windows & win8 & wp8 compile error --- cocos/2d/cocos2d_wp8.vcxproj | 8 +++++++ cocos/2d/cocos2d_wp8.vcxproj.filters | 24 +++++++++++++++++++ cocos/2d/libcocos2d.vcxproj | 2 ++ cocos/2d/libcocos2d.vcxproj.filters | 6 +++++ cocos/base/ccRandom.h | 2 +- .../cpp-testsComponent.vcxproj | 4 ++++ .../cpp-testsComponent.vcxproj.filters | 15 ++++++++++++ 7 files changed, 60 insertions(+), 1 deletion(-) diff --git a/cocos/2d/cocos2d_wp8.vcxproj b/cocos/2d/cocos2d_wp8.vcxproj index ba6dbc0623..07a0aefc46 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj +++ b/cocos/2d/cocos2d_wp8.vcxproj @@ -222,6 +222,7 @@ NotUsing NotUsing + @@ -229,7 +230,9 @@ + + @@ -280,6 +283,7 @@ + @@ -442,6 +446,7 @@ + @@ -451,7 +456,9 @@ + + @@ -495,6 +502,7 @@ + diff --git a/cocos/2d/cocos2d_wp8.vcxproj.filters b/cocos/2d/cocos2d_wp8.vcxproj.filters index 2a8cead521..5a53e1329e 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj.filters +++ b/cocos/2d/cocos2d_wp8.vcxproj.filters @@ -650,6 +650,18 @@ base + + base + + + 3d + + + 3d + + + 3d + @@ -1328,6 +1340,18 @@ base + + base + + + 3d + + + 3d + + + 3d + diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index 91e74ad18a..457a0acc95 100644 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -213,6 +213,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + @@ -399,6 +400,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + diff --git a/cocos/2d/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d.vcxproj.filters index eb482baa59..b7bbac671f 100644 --- a/cocos/2d/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d.vcxproj.filters @@ -586,6 +586,9 @@ base + + base + @@ -1189,6 +1192,9 @@ base + + base + diff --git a/cocos/base/ccRandom.h b/cocos/base/ccRandom.h index 5d3a7ab2e0..272da902b2 100644 --- a/cocos/base/ccRandom.h +++ b/cocos/base/ccRandom.h @@ -32,7 +32,7 @@ THE SOFTWARE. NS_CC_BEGIN -class RandomHelper { +class CC_DLL RandomHelper { public: template static inline T random_real(T min, T max) { diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj index c152ba0746..16806e1f8c 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj @@ -185,6 +185,7 @@ + @@ -228,6 +229,7 @@ + @@ -383,6 +385,7 @@ + @@ -429,6 +432,7 @@ + diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters index 5959863578..44d9ce5bea 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters @@ -325,6 +325,9 @@ {dff38415-43e7-4aff-98ec-c6094899d142} + + {d17dc00f-2b4d-46af-a1ff-c3f4d937d621} + @@ -858,6 +861,12 @@ Classes\UITest\CocosStudioGUITest + + Classes\Sprite3DTest + + + Classes\Camera3DTest + @@ -1590,6 +1599,12 @@ Classes\UITest\CocosStudioGUITest + + Classes\Sprite3DTest + + + Classes\Camera3DTest +