issue #5057, Merge branch 'v3' into refactor5057

Conflicts:
	cocos/ui/CocosGUI.h
This commit is contained in:
andyque 2014-05-09 15:39:02 +08:00
commit c5a505ec4c
40 changed files with 2942 additions and 452 deletions

View File

@ -1,10 +1,14 @@
cocos2d-x-3.1-alpha1 May.8 2014
[NEW] UI: add navigation support
[NEW] UI: add a widget to play video
[NEW] VS: support VS 2013
[FIX] Audio: pause sound automatically when go to background on Android
[FIX] Label: label is unsharp if it's created by system font with small size on iOS & Mac OS X
[FIX] Label: Label created with system font is still visible when its opacity is 0
[FIX] Label: Label created with system font havs black border on WP8/WINRT
[FIX] Lua: A potential crash in the bindings of sp.SkeletonAnimation.setAnimation
[FIX] Lua: Lua template should fail to launch on lua error
[FIX] ParticleSystem: Particles can be created without a texture

View File

@ -1123,6 +1123,8 @@
3E26D40518ACB5D100834404 /* CCImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E26D40418ACB5D100834404 /* CCImage.cpp */; };
3E26D40618ACB5D100834404 /* CCImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E26D40418ACB5D100834404 /* CCImage.cpp */; };
3E26D40818ACB63900834404 /* CCDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3E26D40718ACB63900834404 /* CCDevice.mm */; };
3EA0FB6B191C841D00B170C8 /* UIVideoPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA0FB69191C841D00B170C8 /* UIVideoPlayer.h */; };
3EA0FB6C191C841D00B170C8 /* UIVideoPlayerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3EA0FB6A191C841D00B170C8 /* UIVideoPlayerIOS.mm */; };
460E468118080832000CDD6D /* cocos-ext.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A167D21807AF4D005B8026 /* cocos-ext.h */; };
460E468218080836000CDD6D /* cocos-ext.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A167D21807AF4D005B8026 /* cocos-ext.h */; };
460E477B180808F5000CDD6D /* ExtensionMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168321807AF4E005B8026 /* ExtensionMacros.h */; };
@ -2315,6 +2317,8 @@
37936A3E1869B76800E974DD /* writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = writer.h; sourceTree = "<group>"; };
3E26D40418ACB5D100834404 /* CCImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCImage.cpp; sourceTree = "<group>"; };
3E26D40718ACB63900834404 /* CCDevice.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCDevice.mm; sourceTree = "<group>"; };
3EA0FB69191C841D00B170C8 /* UIVideoPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIVideoPlayer.h; sourceTree = "<group>"; };
3EA0FB6A191C841D00B170C8 /* UIVideoPlayerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIVideoPlayerIOS.mm; sourceTree = "<group>"; };
46A15FCC1807A544005B8026 /* AUTHORS */ = {isa = PBXFileReference; lastKnownFileType = text; name = AUTHORS; path = ../AUTHORS; sourceTree = "<group>"; };
46A15FCE1807A544005B8026 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = "<group>"; };
46A15FE11807A56F005B8026 /* Export.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = "<group>"; };
@ -3974,6 +3978,8 @@
2905F9E618CF08D000240AA3 /* ui */ = {
isa = PBXGroup;
children = (
3EA0FB69191C841D00B170C8 /* UIVideoPlayer.h */,
3EA0FB6A191C841D00B170C8 /* UIVideoPlayerIOS.mm */,
2905F9E918CF08D000240AA3 /* CocosGUI.cpp */,
2905F9EA18CF08D000240AA3 /* CocosGUI.h */,
2905F9EB18CF08D000240AA3 /* GUIDefine.h */,
@ -5613,6 +5619,7 @@
B2AF2FAC18EBAEAE00C5807C /* Vector4.h in Headers */,
5027253B190BF1B900AAF4ED /* cocos2d.h in Headers */,
1AD71DFC180E26E600808F54 /* CCNodeLoaderListener.h in Headers */,
3EA0FB6B191C841D00B170C8 /* UIVideoPlayer.h in Headers */,
1AD71E00180E26E600808F54 /* CCParticleSystemQuadLoader.h in Headers */,
1AD71E04180E26E600808F54 /* CCScale9SpriteLoader.h in Headers */,
1AD71E08180E26E600808F54 /* CCScrollViewLoader.h in Headers */,
@ -6548,6 +6555,7 @@
500DC92B19106300007B91BF /* atitc.cpp in Sources */,
46A170FE1807CECB005B8026 /* CCPhysicsContact.cpp in Sources */,
46A170391807CBFE005B8026 /* CCThread.cpp in Sources */,
3EA0FB6C191C841D00B170C8 /* UIVideoPlayerIOS.mm in Sources */,
46A170421807CC07005B8026 /* CCGLView.mm in Sources */,
1A570062180BC5A10088DEC7 /* CCAction.cpp in Sources */,
1A570066180BC5A10088DEC7 /* CCActionCamera.cpp in Sources */,

View File

@ -812,6 +812,9 @@
29080DE4191B595E0066F8DF /* UIWidgetAddNodeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D89191B595E0066F8DF /* UIWidgetAddNodeTest.cpp */; };
29080DE5191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */; };
29080DE6191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */; };
3EA0FB5E191B92F100B170C8 /* cocosvideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */; };
3EA0FB66191B933000B170C8 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; };
3EA0FB72191C844400B170C8 /* UIVideoPlayerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA0FB70191C844400B170C8 /* UIVideoPlayerTest.cpp */; };
A05FCACA177C124500BE600E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };
A07A521E1783A1D20073F6A7 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };
A07A521F1783A1D20073F6A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };
@ -1844,6 +1847,10 @@
29080D8A191B595E0066F8DF /* UIWidgetAddNodeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidgetAddNodeTest.h; sourceTree = "<group>"; };
29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIWidgetAddNodeTest_Editor.cpp; sourceTree = "<group>"; };
29080D8C191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidgetAddNodeTest_Editor.h; sourceTree = "<group>"; };
3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; name = cocosvideo.mp4; path = "../tests/cpp-tests/Resources/cocosvideo.mp4"; sourceTree = "<group>"; };
3EA0FB65191B933000B170C8 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; };
3EA0FB70191C844400B170C8 /* UIVideoPlayerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIVideoPlayerTest.cpp; sourceTree = "<group>"; };
3EA0FB71191C844400B170C8 /* UIVideoPlayerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIVideoPlayerTest.h; sourceTree = "<group>"; };
46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = cocos2d_libs.xcodeproj; sourceTree = "<group>"; };
A035A71117822E9E00987F6C /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; };
A07A52291783A1D20073F6A7 /* cpp-tests iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "cpp-tests iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
@ -2011,6 +2018,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3EA0FB66191B933000B170C8 /* MediaPlayer.framework in Frameworks */,
1AAF53FE180E39D4000584C8 /* libbox2d iOS.a in Frameworks */,
1AAF53FF180E39D4000584C8 /* libchipmunk iOS.a in Frameworks */,
1AAF5400180E39D4000584C8 /* libcocos2dx iOS.a in Frameworks */,
@ -3256,6 +3264,7 @@
1AC35CA818CED83500F37B72 /* Resources */ = {
isa = PBXGroup;
children = (
3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */,
1AC35CA918CED84500F37B72 /* animations */,
1AC35CAE18CED84500F37B72 /* ccb */,
1A221C9B191771E300FD2BE4 /* ccs-res */,
@ -3462,6 +3471,7 @@
29080D1E191B595E0066F8DF /* CocoStudioGUITest */ = {
isa = PBXGroup;
children = (
3EA0FB6F191C844400B170C8 /* UIVideoPlayerTest */,
29080D1F191B595E0066F8DF /* CocosGUIScene.cpp */,
29080D20191B595E0066F8DF /* CocosGUIScene.h */,
29080D21191B595E0066F8DF /* CocoStudioGUITest.cpp */,
@ -3733,6 +3743,7 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
3EA0FB65191B933000B170C8 /* MediaPlayer.framework */,
1ABCA3AF18CDA06D0087CE3A /* libz.dylib */,
1ABCA3A818CD9F130087CE3A /* AudioToolbox.framework */,
1ABCA3A618CD9F0D0087CE3A /* OpenAL.framework */,
@ -3769,6 +3780,15 @@
name = Frameworks;
sourceTree = "<group>";
};
3EA0FB6F191C844400B170C8 /* UIVideoPlayerTest */ = {
isa = PBXGroup;
children = (
3EA0FB70191C844400B170C8 /* UIVideoPlayerTest.cpp */,
3EA0FB71191C844400B170C8 /* UIVideoPlayerTest.h */,
);
path = UIVideoPlayerTest;
sourceTree = "<group>";
};
46A15F9D1807A4F8005B8026 /* Products */ = {
isa = PBXGroup;
children = (
@ -4440,6 +4460,7 @@
1AC35D0518CED84500F37B72 /* Shaders in Resources */,
1AC35CD318CED84500F37B72 /* background.ogg in Resources */,
1AC35CCB18CED84500F37B72 /* animations in Resources */,
3EA0FB5E191B92F100B170C8 /* cocosvideo.mp4 in Resources */,
1AC35C8C18CECF1400F37B72 /* Icon-114.png in Resources */,
1AC35CF118CED84500F37B72 /* hd in Resources */,
1AC35C9318CECF1400F37B72 /* Icon-57.png in Resources */,
@ -4827,6 +4848,7 @@
1AC35C8618CECF1400F37B72 /* RootViewController.mm in Sources */,
1AC35C5C18CECF0C00F37B72 /* TileMapTest.cpp in Sources */,
29080DC2191B595E0066F8DF /* UIRichTextTest.cpp in Sources */,
3EA0FB72191C844400B170C8 /* UIVideoPlayerTest.cpp in Sources */,
1AC35B4818CECF0C00F37B72 /* Bug-899.cpp in Sources */,
1AC35C1C18CECF0C00F37B72 /* NewEventDispatcherTest.cpp in Sources */,
1AC35C2E18CECF0C00F37B72 /* PerformanceNodeChildrenTest.cpp in Sources */,

View File

@ -221,10 +221,12 @@
<ClCompile Include="..\base\CCEventAcceleration.cpp" />
<ClCompile Include="..\base\CCEventCustom.cpp" />
<ClCompile Include="..\base\CCEventDispatcher.cpp" />
<ClCompile Include="..\base\CCEventFocus.cpp" />
<ClCompile Include="..\base\CCEventKeyboard.cpp" />
<ClCompile Include="..\base\CCEventListener.cpp" />
<ClCompile Include="..\base\CCEventListenerAcceleration.cpp" />
<ClCompile Include="..\base\CCEventListenerCustom.cpp" />
<ClCompile Include="..\base\CCEventListenerFocus.cpp" />
<ClCompile Include="..\base\CCEventListenerKeyboard.cpp" />
<ClCompile Include="..\base\CCEventListenerMouse.cpp" />
<ClCompile Include="..\base\CCEventListenerTouch.cpp" />
@ -430,10 +432,12 @@
<ClInclude Include="..\base\CCEventAcceleration.h" />
<ClInclude Include="..\base\CCEventCustom.h" />
<ClInclude Include="..\base\CCEventDispatcher.h" />
<ClInclude Include="..\base\CCEventFocus.h" />
<ClInclude Include="..\base\CCEventKeyboard.h" />
<ClInclude Include="..\base\CCEventListener.h" />
<ClInclude Include="..\base\CCEventListenerAcceleration.h" />
<ClInclude Include="..\base\CCEventListenerCustom.h" />
<ClInclude Include="..\base\CCEventListenerFocus.h" />
<ClInclude Include="..\base\CCEventListenerKeyboard.h" />
<ClInclude Include="..\base\CCEventListenerMouse.h" />
<ClInclude Include="..\base\CCEventListenerTouch.h" />

View File

@ -594,6 +594,12 @@
<ClCompile Include="..\math\TransformUtils.cpp">
<Filter>math</Filter>
</ClCompile>
<ClCompile Include="..\base\CCEventFocus.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\base\CCEventListenerFocus.cpp">
<Filter>base</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\physics\CCPhysicsBody.h">
@ -1174,6 +1180,12 @@
<ClInclude Include="..\math\TransformUtils.h">
<Filter>math</Filter>
</ClInclude>
<ClInclude Include="..\base\CCEventFocus.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\base\CCEventListenerFocus.h">
<Filter>base</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\math\MathUtil.inl">

View File

@ -43,7 +43,7 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
// Constants
// ===========================================================
private static final String TAG = Cocos2dxActivity.class.getSimpleName();
private final static String TAG = Cocos2dxActivity.class.getSimpleName();
// ===========================================================
// Fields
@ -51,7 +51,8 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
private Cocos2dxGLSurfaceView mGLSurfaceView;
private Cocos2dxHandler mHandler;
private static Context sContext = null;
private static Cocos2dxActivity sContext = null;
private Cocos2dxVideoHelper mVideoHelper = null;
public static Context getContext() {
return sContext;
@ -81,9 +82,12 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
sContext = this;
this.mHandler = new Cocos2dxHandler(this);
this.init();
Cocos2dxHelper.init(this);
this.init();
if (mVideoHelper == null) {
mVideoHelper = new Cocos2dxVideoHelper(this, mFrameLayout);
}
}
// ===========================================================
@ -142,6 +146,7 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
}
protected FrameLayout mFrameLayout = null;
// ===========================================================
// Methods
// ===========================================================
@ -151,8 +156,8 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
ViewGroup.LayoutParams framelayout_params =
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
FrameLayout framelayout = new FrameLayout(this);
framelayout.setLayoutParams(framelayout_params);
mFrameLayout = new FrameLayout(this);
mFrameLayout.setLayoutParams(framelayout_params);
// Cocos2dxEditText layout
ViewGroup.LayoutParams edittext_layout_params =
@ -162,13 +167,13 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
edittext.setLayoutParams(edittext_layout_params);
// ...add to FrameLayout
framelayout.addView(edittext);
mFrameLayout.addView(edittext);
// Cocos2dxGLSurfaceView
this.mGLSurfaceView = this.onCreateView();
// ...add to FrameLayout
framelayout.addView(this.mGLSurfaceView);
mFrameLayout.addView(this.mGLSurfaceView);
// Switch to supported OpenGL (ARGB888) mode on emulator
if (isAndroidEmulator())
@ -178,7 +183,7 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
this.mGLSurfaceView.setCocos2dxEditText(edittext);
// Set framelayout as the content view
setContentView(framelayout);
setContentView(mFrameLayout);
}
public Cocos2dxGLSurfaceView onCreateView() {

View File

@ -292,6 +292,16 @@ public class Cocos2dxHelper {
}
}
public static void onEnterBackground() {
sCocos2dSound.onEnterBackground();
sCocos2dMusic.onEnterBackground();
}
public static void onEnterForeground() {
sCocos2dSound.onEnterForeground();
sCocos2dMusic.onEnterForeground();
}
public static void terminateProcess() {
android.os.Process.killProcess(android.os.Process.myPid());
}

View File

@ -47,7 +47,8 @@ public class Cocos2dxMusic {
private MediaPlayer mBackgroundMediaPlayer;
private float mLeftVolume;
private float mRightVolume;
private boolean mPaused;
private boolean mPaused;// whether music is paused state.
private boolean mManualPaused = false;// whether music is paused manually before the program is switched to the background.
private String mCurrentPath;
// ===========================================================
@ -142,6 +143,7 @@ public class Cocos2dxMusic {
if (this.mBackgroundMediaPlayer != null && this.mBackgroundMediaPlayer.isPlaying()) {
this.mBackgroundMediaPlayer.pause();
this.mPaused = true;
this.mManualPaused = true;
}
}
@ -149,6 +151,7 @@ public class Cocos2dxMusic {
if (this.mBackgroundMediaPlayer != null && this.mPaused) {
this.mBackgroundMediaPlayer.start();
this.mPaused = false;
this.mManualPaused = false;
}
}
@ -211,6 +214,22 @@ public class Cocos2dxMusic {
}
}
public void onEnterBackground(){
if (this.mBackgroundMediaPlayer != null && this.mBackgroundMediaPlayer.isPlaying()) {
this.mBackgroundMediaPlayer.pause();
this.mPaused = true;
}
}
public void onEnterForeground(){
if(!this.mManualPaused){
if (this.mBackgroundMediaPlayer != null && this.mPaused) {
this.mBackgroundMediaPlayer.start();
this.mPaused = false;
}
}
}
private void initData() {
this.mLeftVolume = 0.5f;
this.mRightVolume = 0.5f;

View File

@ -28,6 +28,7 @@ import javax.microedition.khronos.opengles.GL10;
import android.opengl.GLSurfaceView;
import org.cocos2dx.lib.Cocos2dxHelper;
public class Cocos2dxRenderer implements GLSurfaceView.Renderer {
// ===========================================================
// Constants
@ -144,10 +145,12 @@ public class Cocos2dxRenderer implements GLSurfaceView.Renderer {
}
public void handleOnPause() {
Cocos2dxHelper.onEnterBackground();
Cocos2dxRenderer.nativeOnPause();
}
public void handleOnResume() {
Cocos2dxHelper.onEnterForeground();
Cocos2dxRenderer.nativeOnResume();
}

View File

@ -129,8 +129,8 @@ public class Cocos2dxSound {
// stop effects
final ArrayList<Integer> streamIDs = this.mPathStreamIDsMap.get(pPath);
if (streamIDs != null) {
for (final Integer pStreamID : streamIDs) {
this.mSoundPool.stop(pStreamID);
for (final Integer steamID : streamIDs) {
this.mSoundPool.stop(steamID);
}
}
this.mPathStreamIDsMap.remove(pPath);
@ -180,28 +180,36 @@ public class Cocos2dxSound {
return streamID;
}
public void stopEffect(final int pStreamID) {
this.mSoundPool.stop(pStreamID);
public void stopEffect(final int steamID) {
this.mSoundPool.stop(steamID);
// remove record
for (final String pPath : this.mPathStreamIDsMap.keySet()) {
if (this.mPathStreamIDsMap.get(pPath).contains(pStreamID)) {
this.mPathStreamIDsMap.get(pPath).remove(this.mPathStreamIDsMap.get(pPath).indexOf(pStreamID));
if (this.mPathStreamIDsMap.get(pPath).contains(steamID)) {
this.mPathStreamIDsMap.get(pPath).remove(this.mPathStreamIDsMap.get(pPath).indexOf(steamID));
break;
}
}
}
public void pauseEffect(final int pStreamID) {
this.mSoundPool.pause(pStreamID);
public void pauseEffect(final int steamID) {
this.mSoundPool.pause(steamID);
}
public void resumeEffect(final int pStreamID) {
this.mSoundPool.resume(pStreamID);
public void resumeEffect(final int steamID) {
this.mSoundPool.resume(steamID);
}
public void pauseAllEffects() {
this.mSoundPool.autoPause();
if (!this.mPathStreamIDsMap.isEmpty()) {
final Iterator<Entry<String, ArrayList<Integer>>> iter = this.mPathStreamIDsMap.entrySet().iterator();
while (iter.hasNext()) {
final Entry<String, ArrayList<Integer>> entry = iter.next();
for (final int steamID : entry.getValue()) {
this.mSoundPool.pause(steamID);
}
}
}
}
public void resumeAllEffects() {
@ -211,8 +219,8 @@ public class Cocos2dxSound {
final Iterator<Entry<String, ArrayList<Integer>>> iter = this.mPathStreamIDsMap.entrySet().iterator();
while (iter.hasNext()) {
final Entry<String, ArrayList<Integer>> entry = iter.next();
for (final int pStreamID : entry.getValue()) {
this.mSoundPool.resume(pStreamID);
for (final int steamID : entry.getValue()) {
this.mSoundPool.resume(steamID);
}
}
}
@ -225,8 +233,8 @@ public class Cocos2dxSound {
final Iterator<?> iter = this.mPathStreamIDsMap.entrySet().iterator();
while (iter.hasNext()) {
final Map.Entry<String, ArrayList<Integer>> entry = (Map.Entry<String, ArrayList<Integer>>) iter.next();
for (final int pStreamID : entry.getValue()) {
this.mSoundPool.stop(pStreamID);
for (final int steamID : entry.getValue()) {
this.mSoundPool.stop(steamID);
}
}
}
@ -255,8 +263,8 @@ public class Cocos2dxSound {
final Iterator<Entry<String, ArrayList<Integer>>> iter = this.mPathStreamIDsMap.entrySet().iterator();
while (iter.hasNext()) {
final Entry<String, ArrayList<Integer>> entry = iter.next();
for (final int pStreamID : entry.getValue()) {
this.mSoundPool.setVolume(pStreamID, this.mLeftVolume, this.mRightVolume);
for (final int steamID : entry.getValue()) {
this.mSoundPool.setVolume(steamID, this.mLeftVolume, this.mRightVolume);
}
}
}
@ -319,6 +327,14 @@ public class Cocos2dxSound {
return streamID;
}
public void onEnterBackground(){
this.mSoundPool.autoPause();
}
public void onEnterForeground(){
this.mSoundPool.autoResume();
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================

View File

@ -0,0 +1,386 @@
/****************************************************************************
Copyright (c) 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.
****************************************************************************/
package org.cocos2dx.lib;
import java.lang.ref.WeakReference;
import org.cocos2dx.lib.Cocos2dxVideoView.OnVideoEventListener;
import android.graphics.Rect;
import android.os.Handler;
import android.os.Message;
import android.util.SparseArray;
import android.view.View;
import android.widget.FrameLayout;
public class Cocos2dxVideoHelper {
private FrameLayout mLayout = null;
private Cocos2dxActivity mActivity = null;
private SparseArray<Cocos2dxVideoView> sVideoViews = null;
private static VideoHandler mVideoHandler = null;
Cocos2dxVideoHelper(Cocos2dxActivity activity,FrameLayout layout)
{
mActivity = activity;
mLayout = layout;
mVideoHandler = new VideoHandler(this);
sVideoViews = new SparseArray<Cocos2dxVideoView>();
}
private static int videoTag = 0;
private final static int VideoTaskCreate = 0;
private final static int VideoTaskRemove = 1;
private final static int VideoTaskSetSource = 2;
private final static int VideoTaskSetRect = 3;
private final static int VideoTaskStart = 4;
private final static int VideoTaskPause = 5;
private final static int VideoTaskResume = 6;
private final static int VideoTaskStop = 7;
private final static int VideoTaskSeek = 8;
private final static int VideoTaskSetVisible = 9;
private final static int VideoTaskRestart = 10;
private final static int VideoTaskKeepRatio = 11;
static class VideoHandler extends Handler{
WeakReference<Cocos2dxVideoHelper> mReference;
VideoHandler(Cocos2dxVideoHelper helper){
mReference = new WeakReference<Cocos2dxVideoHelper>(helper);
}
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case VideoTaskCreate: {
Cocos2dxVideoHelper helper = mReference.get();
helper._createVideoView(msg.arg1);
break;
}
case VideoTaskRemove: {
Cocos2dxVideoHelper helper = mReference.get();
helper._removeVideoView(msg.arg1);
break;
}
case VideoTaskSetSource: {
Cocos2dxVideoHelper helper = mReference.get();
helper._setVideoURL(msg.arg1, msg.arg2, (String)msg.obj);
break;
}
case VideoTaskStart: {
Cocos2dxVideoHelper helper = mReference.get();
helper._startVideo(msg.arg1);
break;
}
case VideoTaskSetRect: {
Cocos2dxVideoHelper helper = mReference.get();
Rect rect = (Rect)msg.obj;
helper._setVideoRect(msg.arg1, rect.left, rect.top, rect.right, rect.bottom);
break;
}
case VideoTaskPause: {
Cocos2dxVideoHelper helper = mReference.get();
helper._pauseVideo(msg.arg1);
break;
}
case VideoTaskResume: {
Cocos2dxVideoHelper helper = mReference.get();
helper._resumeVideo(msg.arg1);
break;
}
case VideoTaskStop: {
Cocos2dxVideoHelper helper = mReference.get();
helper._stopVideo(msg.arg1);
break;
}
case VideoTaskSeek: {
Cocos2dxVideoHelper helper = mReference.get();
helper._seekVideoTo(msg.arg1, msg.arg2);
break;
}
case VideoTaskSetVisible: {
Cocos2dxVideoHelper helper = mReference.get();
if (msg.arg2 == 1) {
helper._setVideoVisible(msg.arg1, true);
} else {
helper._setVideoVisible(msg.arg1, false);
}
break;
}
case VideoTaskRestart: {
Cocos2dxVideoHelper helper = mReference.get();
helper._restartVideo(msg.arg1);
break;
}
case VideoTaskKeepRatio: {
Cocos2dxVideoHelper helper = mReference.get();
if (msg.arg2 == 1) {
helper._setVideoKeepRatio(msg.arg1, true);
} else {
helper._setVideoKeepRatio(msg.arg1, false);
}
break;
}
default:
break;
}
super.handleMessage(msg);
}
}
private class VideoEventRunnable implements Runnable
{
private int mVideoTag;
private int mVideoEvent;
public VideoEventRunnable(int tag,int event) {
mVideoTag = tag;
mVideoEvent = event;
}
@Override
public void run() {
nativeExecuteVideoCallback(mVideoTag, mVideoEvent);
}
}
public static native void nativeExecuteVideoCallback(int index,int event);
OnVideoEventListener videoEventListener = new OnVideoEventListener() {
@Override
public void onVideoEvent(int tag,int event) {
mActivity.runOnGLThread(new VideoEventRunnable(tag, event));
}
};
public static int createVideoWidget() {
Message msg = new Message();
msg.what = VideoTaskCreate;
msg.arg1 = videoTag;
mVideoHandler.sendMessage(msg);
return videoTag++;
}
private void _createVideoView(int index) {
Cocos2dxVideoView videoView = new Cocos2dxVideoView(mActivity,index);
sVideoViews.put(index, videoView);
FrameLayout.LayoutParams lParams = new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT);
mLayout.addView(videoView, lParams);
videoView.setZOrderOnTop(true);
videoView.setOnCompletionListener(videoEventListener);
}
public static void removeVideoWidget(int index){
Message msg = new Message();
msg.what = VideoTaskRemove;
msg.arg1 = index;
mVideoHandler.sendMessage(msg);
}
private void _removeVideoView(int index) {
Cocos2dxVideoView view = sVideoViews.get(index);
if (view != null) {
view.stopPlayback();
sVideoViews.remove(index);
mLayout.removeView(view);
}
}
public static void setVideoUrl(int index,int videoSource,String videoUrl) {
Message msg = new Message();
msg.what = VideoTaskSetSource;
msg.arg1 = index;
msg.arg2 = videoSource;
msg.obj = videoUrl;
mVideoHandler.sendMessage(msg);
}
private void _setVideoURL(int index,int videoSource,String videoUrl) {
Cocos2dxVideoView videoView = sVideoViews.get(index);
if (videoView != null) {
switch (videoSource) {
case 0:
videoView.setVideoFileName(videoUrl);
break;
case 1:
videoView.setVideoURL(videoUrl);
break;
default:
break;
}
}
}
public static void setVideoRect(int index,int left,int top,int maxWidth,int maxHeight) {
Message msg = new Message();
msg.what = VideoTaskSetRect;
msg.arg1 = index;
msg.obj = new Rect(left, top, maxWidth, maxHeight);
mVideoHandler.sendMessage(msg);
}
private void _setVideoRect(int index,int left,int top,int maxWidth,int maxHeight) {
Cocos2dxVideoView videoView = sVideoViews.get(index);
if (videoView != null) {
videoView.setVideoRect(left,top,maxWidth,maxHeight);
}
}
public static void startVideo(int index) {
Message msg = new Message();
msg.what = VideoTaskStart;
msg.arg1 = index;
mVideoHandler.sendMessage(msg);
}
private void _startVideo(int index) {
Cocos2dxVideoView videoView = sVideoViews.get(index);
if (videoView != null) {
videoView.start();
}
}
public static void pauseVideo(int index) {
Message msg = new Message();
msg.what = VideoTaskPause;
msg.arg1 = index;
mVideoHandler.sendMessage(msg);
}
private void _pauseVideo(int index) {
Cocos2dxVideoView videoView = sVideoViews.get(index);
if (videoView != null) {
videoView.pause();
}
}
public static void resumeVideo(int index) {
Message msg = new Message();
msg.what = VideoTaskResume;
msg.arg1 = index;
mVideoHandler.sendMessage(msg);
}
private void _resumeVideo(int index) {
Cocos2dxVideoView videoView = sVideoViews.get(index);
if (videoView != null) {
videoView.resume();
}
}
public static void stopVideo(int index) {
Message msg = new Message();
msg.what = VideoTaskStop;
msg.arg1 = index;
mVideoHandler.sendMessage(msg);
}
private void _stopVideo(int index) {
Cocos2dxVideoView videoView = sVideoViews.get(index);
if (videoView != null) {
videoView.stop();
}
}
public static void restartVideo(int index) {
Message msg = new Message();
msg.what = VideoTaskRestart;
msg.arg1 = index;
mVideoHandler.sendMessage(msg);
}
private void _restartVideo(int index) {
Cocos2dxVideoView videoView = sVideoViews.get(index);
if (videoView != null) {
videoView.restart();
}
}
public static void seekVideoTo(int index,int msec) {
Message msg = new Message();
msg.what = VideoTaskSeek;
msg.arg1 = index;
msg.arg2 = msec;
mVideoHandler.sendMessage(msg);
}
private void _seekVideoTo(int index,int msec) {
Cocos2dxVideoView videoView = sVideoViews.get(index);
if (videoView != null) {
videoView.seekTo(msec);
}
}
public static void setVideoVisible(int index, boolean visible) {
Message msg = new Message();
msg.what = VideoTaskSetVisible;
msg.arg1 = index;
if (visible) {
msg.arg2 = 1;
} else {
msg.arg2 = 0;
}
mVideoHandler.sendMessage(msg);
}
private void _setVideoVisible(int index, boolean visible) {
Cocos2dxVideoView videoView = sVideoViews.get(index);
if (videoView != null) {
if (visible) {
videoView.fixSize();
videoView.setVisibility(View.VISIBLE);
} else {
videoView.setVisibility(View.INVISIBLE);
}
}
}
public static void setVideoKeepRatioEnabled(int index, boolean enable) {
Message msg = new Message();
msg.what = VideoTaskKeepRatio;
msg.arg1 = index;
if (enable) {
msg.arg2 = 1;
} else {
msg.arg2 = 0;
}
mVideoHandler.sendMessage(msg);
}
private void _setVideoKeepRatio(int index, boolean enable) {
Cocos2dxVideoView videoView = sVideoViews.get(index);
if (videoView != null) {
videoView.setKeepRatio(enable);
}
}
}

View File

@ -0,0 +1,686 @@
/*
* Copyright (C) 2006 The Android Open Source Project
* Copyright (c) 2014 Chukong Technologies Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.cocos2dx.lib;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.AssetFileDescriptor;
import android.content.res.Resources;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnErrorListener;
import android.net.Uri;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.FrameLayout;
import android.widget.MediaController.MediaPlayerControl;
import java.io.IOException;
import java.util.Map;
public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl {
private String TAG = "VideoView";
private Uri mUri;
private int mDuration;
// all possible internal states
private static final int STATE_ERROR = -1;
private static final int STATE_IDLE = 0;
private static final int STATE_PREPARING = 1;
private static final int STATE_PREPARED = 2;
private static final int STATE_PLAYING = 3;
private static final int STATE_PAUSED = 4;
private static final int STATE_PLAYBACK_COMPLETED = 5;
// mCurrentState is a VideoView object's current state.
// mTargetState is the state that a method caller intends to reach.
// For instance, regardless the VideoView object's current state,
// calling pause() intends to bring the object to a target state
// of STATE_PAUSED.
private int mCurrentState = STATE_IDLE;
private int mTargetState = STATE_IDLE;
// All the stuff we need for playing and showing a video
private SurfaceHolder mSurfaceHolder = null;
private MediaPlayer mMediaPlayer = null;
private int mVideoWidth = 0;
private int mVideoHeight = 0;
private OnVideoEventListener mOnVideoEventListener;
private MediaPlayer.OnPreparedListener mOnPreparedListener;
private int mCurrentBufferPercentage;
private OnErrorListener mOnErrorListener;
// recording the seek position while preparing
private int mSeekWhenPrepared;
protected Context mContext = null;
protected int mViewLeft = 0;
protected int mViewTop = 0;
protected int mViewWidth = 0;
protected int mViewHeight = 0;
protected int mVisibleLeft = 0;
protected int mVisibleTop = 0;
protected int mVisibleWidth = 0;
protected int mVisibleHeight = 0;
private int mViewTag = 0;
public Cocos2dxVideoView(Context context,int tag) {
super(context);
mViewTag = tag;
mContext = context;
initVideoView();
}
public Cocos2dxVideoView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
mContext = context;
initVideoView();
}
public Cocos2dxVideoView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mContext = context;
initVideoView();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mVideoWidth == 0 || mVideoHeight == 0) {
setMeasuredDimension(mViewWidth, mViewHeight);
Log.e(TAG, ""+mViewWidth+ ":" +mViewHeight);
}
else {
setMeasuredDimension(mVisibleWidth, mVisibleHeight);
Log.e(TAG, ""+mVisibleWidth+ ":" +mVisibleHeight);
}
}
public void setVideoRect(int left,int top,int maxWidth,int maxHeight) {
mViewLeft = left;
mViewTop = top;
mViewWidth = maxWidth;
mViewHeight = maxHeight;
if (mVideoWidth != 0 && mVideoHeight != 0) {
fixSize();
}
}
public int resolveAdjustedSize(int desiredSize, int measureSpec) {
int result = desiredSize;
int specMode = MeasureSpec.getMode(measureSpec);
int specSize = MeasureSpec.getSize(measureSpec);
switch (specMode) {
case MeasureSpec.UNSPECIFIED:
/* Parent says we can be as big as we want. Just don't be larger
* than max size imposed on ourselves.
*/
result = desiredSize;
break;
case MeasureSpec.AT_MOST:
/* Parent says we can be as big as we want, up to specSize.
* Don't be larger than specSize, and don't be larger than
* the max size imposed on ourselves.
*/
result = Math.min(desiredSize, specSize);
break;
case MeasureSpec.EXACTLY:
// No choice. Do what we are told.
result = specSize;
break;
}
return result;
}
private boolean mNeedResume = false;
@Override
public void setVisibility(int visibility) {
if (visibility == INVISIBLE) {
mNeedResume = isPlaying();
if (mNeedResume) {
mSeekWhenPrepared = getCurrentPosition();
}
}
else if (mNeedResume){
start();
mNeedResume = false;
}
super.setVisibility(visibility);
}
private void initVideoView() {
mVideoWidth = 0;
mVideoHeight = 0;
getHolder().addCallback(mSHCallback);
setFocusable(true);
setFocusableInTouchMode(true);
mCurrentState = STATE_IDLE;
mTargetState = STATE_IDLE;
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_UP)
{
if (isPlaying()) {
pause();
} else if(mCurrentState == STATE_PAUSED){
resume();
}
}
return true;
}
private boolean isAssetRouse = false;
private String fileName = null;
public void setVideoFileName(String path) {
if (path.startsWith("/")) {
isAssetRouse = false;
setVideoURI(Uri.parse(path),null);
}
else {
fileName = path;
isAssetRouse = true;
setVideoURI(Uri.parse(path),null);
}
}
public void setVideoURL(String url) {
isAssetRouse = false;
setVideoURI(Uri.parse(url), null);
}
/**
* @hide
*/
private void setVideoURI(Uri uri, Map<String, String> headers) {
mUri = uri;
mSeekWhenPrepared = 0;
mVideoWidth = 0;
mVideoHeight = 0;
openVideo();
requestLayout();
invalidate();
}
public void stopPlayback() {
if (mMediaPlayer != null) {
mMediaPlayer.stop();
mMediaPlayer.release();
mMediaPlayer = null;
mCurrentState = STATE_IDLE;
mTargetState = STATE_IDLE;
}
}
private void openVideo() {
if (mSurfaceHolder == null) {
// not ready for playback just yet, will try again later
return;
}
if (isAssetRouse) {
if(fileName == null)
return;
} else {
if(mUri == null)
return;
}
// Tell the music playback service to pause
// TODO: these constants need to be published somewhere in the framework.
Intent i = new Intent("com.android.music.musicservicecommand");
i.putExtra("command", "pause");
mContext.sendBroadcast(i);
// we shouldn't clear the target state, because somebody might have
// called start() previously
release(false);
try {
//if (mMediaPlayer == null) {
mMediaPlayer = new MediaPlayer();
mMediaPlayer.setOnPreparedListener(mPreparedListener);
mMediaPlayer.setOnVideoSizeChangedListener(mSizeChangedListener);
mMediaPlayer.setOnCompletionListener(mCompletionListener);
mMediaPlayer.setOnErrorListener(mErrorListener);
mMediaPlayer.setOnBufferingUpdateListener(mBufferingUpdateListener);
mMediaPlayer.setDisplay(mSurfaceHolder);
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mMediaPlayer.setScreenOnWhilePlaying(true);
//}
mDuration = -1;
mCurrentBufferPercentage = 0;
if (isAssetRouse) {
AssetFileDescriptor afd = mContext.getAssets().openFd(fileName);
mMediaPlayer.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
} else {
mMediaPlayer.setDataSource(mContext, mUri);
}
mMediaPlayer.prepareAsync();
// we don't set the target state here either, but preserve the
// target state that was there before.
mCurrentState = STATE_PREPARING;
} catch (IOException ex) {
Log.w(TAG, "Unable to open content: " + mUri, ex);
mCurrentState = STATE_ERROR;
mTargetState = STATE_ERROR;
mErrorListener.onError(mMediaPlayer, MediaPlayer.MEDIA_ERROR_UNKNOWN, 0);
return;
} catch (IllegalArgumentException ex) {
Log.w(TAG, "Unable to open content: " + mUri, ex);
mCurrentState = STATE_ERROR;
mTargetState = STATE_ERROR;
mErrorListener.onError(mMediaPlayer, MediaPlayer.MEDIA_ERROR_UNKNOWN, 0);
return;
}
}
private boolean mKeepRatio = false;
public void setKeepRatio(boolean enabled) {
mKeepRatio = enabled;
fixSize();
}
public void fixSize() {
if (mViewWidth != 0 && mViewHeight != 0) {
if (mKeepRatio) {
if ( mVideoWidth * mViewHeight > mViewWidth * mVideoHeight ) {
mVisibleWidth = mViewWidth;
mVisibleHeight = mViewWidth * mVideoHeight / mVideoWidth;
} else if ( mVideoWidth * mViewHeight < mViewWidth * mVideoHeight ) {
mVisibleWidth = mViewHeight * mVideoWidth / mVideoHeight;
mVisibleHeight = mViewHeight;
}
mVisibleLeft = mViewLeft + (mViewWidth - mVisibleWidth) / 2;
mVisibleTop = mViewTop + (mViewHeight - mVisibleHeight) / 2;
} else {
mVisibleLeft = mViewLeft;
mVisibleTop = mViewTop;
mVisibleWidth = mViewWidth;
mVisibleHeight = mViewHeight;
}
}
else {
mVisibleLeft = mViewLeft;
mVisibleTop = mViewTop;
mVisibleWidth = mVideoWidth;
mVisibleHeight = mVideoHeight;
}
getHolder().setFixedSize(mVisibleWidth, mVisibleHeight);
FrameLayout.LayoutParams lParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT);
lParams.leftMargin = mVisibleLeft;
lParams.topMargin = mVisibleTop;
setLayoutParams(lParams);
}
protected
MediaPlayer.OnVideoSizeChangedListener mSizeChangedListener =
new MediaPlayer.OnVideoSizeChangedListener() {
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
mVideoWidth = mp.getVideoWidth();
mVideoHeight = mp.getVideoHeight();
if (mVideoWidth != 0 && mVideoHeight != 0) {
getHolder().setFixedSize(mVideoWidth, mVideoHeight);
}
}
};
MediaPlayer.OnPreparedListener mPreparedListener = new MediaPlayer.OnPreparedListener() {
public void onPrepared(MediaPlayer mp) {
mCurrentState = STATE_PREPARED;
if (mOnPreparedListener != null) {
mOnPreparedListener.onPrepared(mMediaPlayer);
}
mVideoWidth = mp.getVideoWidth();
mVideoHeight = mp.getVideoHeight();
int seekToPosition = mSeekWhenPrepared; // mSeekWhenPrepared may be changed after seekTo() call
if (seekToPosition != 0) {
seekTo(seekToPosition);
}
if (mVideoWidth != 0 && mVideoHeight != 0) {
fixSize();
}
if (mTargetState == STATE_PLAYING) {
start();
}
}
};
private MediaPlayer.OnCompletionListener mCompletionListener =
new MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
mCurrentState = STATE_PLAYBACK_COMPLETED;
mTargetState = STATE_PLAYBACK_COMPLETED;
mp.release();
if (mOnVideoEventListener != null) {
mOnVideoEventListener.onVideoEvent(mViewTag,EVENT_COMPLETED);
}
}
};
private static final int EVENT_PLAYING = 0;
private static final int EVENT_PAUSED = 1;
private static final int EVENT_STOPPED = 2;
private static final int EVENT_COMPLETED = 3;
public interface OnVideoEventListener
{
void onVideoEvent(int tag,int event);
}
private MediaPlayer.OnErrorListener mErrorListener =
new MediaPlayer.OnErrorListener() {
public boolean onError(MediaPlayer mp, int framework_err, int impl_err) {
Log.d(TAG, "Error: " + framework_err + "," + impl_err);
mCurrentState = STATE_ERROR;
mTargetState = STATE_ERROR;
/* If an error handler has been supplied, use it and finish. */
if (mOnErrorListener != null) {
if (mOnErrorListener.onError(mMediaPlayer, framework_err, impl_err)) {
return true;
}
}
/* Otherwise, pop up an error dialog so the user knows that
* something bad has happened. Only try and pop up the dialog
* if we're attached to a window. When we're going away and no
* longer have a window, don't bother showing the user an error.
*/
if (getWindowToken() != null) {
Resources r = mContext.getResources();
int messageId;
if (framework_err == MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK) {
//messageId = com.android.internal.R.string.VideoView_error_text_invalid_progressive_playback;
messageId = r.getIdentifier("VideoView_error_text_invalid_progressive_playback", "string", "android");
} else {
//messageId = com.android.internal.R.string.VideoView_error_text_unknown;
messageId = r.getIdentifier("VideoView_error_text_unknown", "string", "android");
}
int titleId = r.getIdentifier("VideoView_error_title", "string", "android");
int buttonStringId = r.getIdentifier("VideoView_error_button", "string", "android");
new AlertDialog.Builder(mContext)
.setTitle(r.getString(titleId))
.setMessage(messageId)
.setPositiveButton(r.getString(buttonStringId),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
/* If we get here, there is no onError listener, so
* at least inform them that the video is over.
*/
if (mOnVideoEventListener != null) {
mOnVideoEventListener.onVideoEvent(mViewTag,EVENT_COMPLETED);
}
}
})
.setCancelable(false)
.show();
}
return true;
}
};
private MediaPlayer.OnBufferingUpdateListener mBufferingUpdateListener =
new MediaPlayer.OnBufferingUpdateListener() {
public void onBufferingUpdate(MediaPlayer mp, int percent) {
mCurrentBufferPercentage = percent;
}
};
/**
* Register a callback to be invoked when the media file
* is loaded and ready to go.
*
* @param l The callback that will be run
*/
public void setOnPreparedListener(MediaPlayer.OnPreparedListener l)
{
mOnPreparedListener = l;
}
/**
* Register a callback to be invoked when the end of a media file
* has been reached during playback.
*
* @param l The callback that will be run
*/
public void setOnCompletionListener(OnVideoEventListener l)
{
mOnVideoEventListener = l;
}
/**
* Register a callback to be invoked when an error occurs
* during playback or setup. If no listener is specified,
* or if the listener returned false, VideoView will inform
* the user of any errors.
*
* @param l The callback that will be run
*/
public void setOnErrorListener(OnErrorListener l)
{
mOnErrorListener = l;
}
SurfaceHolder.Callback mSHCallback = new SurfaceHolder.Callback()
{
public void surfaceChanged(SurfaceHolder holder, int format,
int w, int h)
{
boolean isValidState = (mTargetState == STATE_PLAYING);
boolean hasValidSize = (mVideoWidth == w && mVideoHeight == h);
if (mMediaPlayer != null && isValidState && hasValidSize) {
if (mSeekWhenPrepared != 0) {
seekTo(mSeekWhenPrepared);
}
start();
}
}
public void surfaceCreated(SurfaceHolder holder)
{
mSurfaceHolder = holder;
openVideo();
}
public void surfaceDestroyed(SurfaceHolder holder)
{
// after we return from this we can't use the surface any more
mSurfaceHolder = null;
release(true);
}
};
/*
* release the media player in any state
*/
private void release(boolean cleartargetstate) {
if (mMediaPlayer != null) {
mMediaPlayer.reset();
mMediaPlayer.release();
mMediaPlayer = null;
mCurrentState = STATE_IDLE;
if (cleartargetstate) {
mTargetState = STATE_IDLE;
}
}
}
public void start() {
if (isInPlaybackState()) {
mMediaPlayer.start();
mCurrentState = STATE_PLAYING;
if (mOnVideoEventListener != null) {
mOnVideoEventListener.onVideoEvent(mViewTag, EVENT_PLAYING);
}
}
mTargetState = STATE_PLAYING;
}
public void pause() {
if (isInPlaybackState()) {
if (mMediaPlayer.isPlaying()) {
mMediaPlayer.pause();
mCurrentState = STATE_PAUSED;
if (mOnVideoEventListener != null) {
mOnVideoEventListener.onVideoEvent(mViewTag, EVENT_PAUSED);
}
}
}
mTargetState = STATE_PAUSED;
}
public void stop() {
if (isInPlaybackState()) {
if (mMediaPlayer.isPlaying()) {
stopPlayback();
if (mOnVideoEventListener != null) {
mOnVideoEventListener.onVideoEvent(mViewTag, EVENT_STOPPED);
}
}
}
}
public void suspend() {
release(false);
}
public void resume() {
if (isInPlaybackState()) {
if (mCurrentState == STATE_PAUSED) {
mMediaPlayer.start();
mCurrentState = STATE_PLAYING;
if (mOnVideoEventListener != null) {
mOnVideoEventListener.onVideoEvent(mViewTag, EVENT_PLAYING);
}
}
}
}
public void restart() {
if (isInPlaybackState()) {
mMediaPlayer.seekTo(0);
mMediaPlayer.start();
mCurrentState = STATE_PLAYING;
mTargetState = STATE_PLAYING;
}
}
// cache duration as mDuration for faster access
public int getDuration() {
if (isInPlaybackState()) {
if (mDuration > 0) {
return mDuration;
}
mDuration = mMediaPlayer.getDuration();
return mDuration;
}
mDuration = -1;
return mDuration;
}
public int getCurrentPosition() {
if (isInPlaybackState()) {
return mMediaPlayer.getCurrentPosition();
}
return 0;
}
public void seekTo(int msec) {
if (isInPlaybackState()) {
mMediaPlayer.seekTo(msec);
mSeekWhenPrepared = 0;
} else {
mSeekWhenPrepared = msec;
}
}
public boolean isPlaying() {
return isInPlaybackState() && mMediaPlayer.isPlaying();
}
public int getBufferPercentage() {
if (mMediaPlayer != null) {
return mCurrentBufferPercentage;
}
return 0;
}
public boolean isInPlaybackState() {
return (mMediaPlayer != null &&
mCurrentState != STATE_ERROR &&
mCurrentState != STATE_IDLE &&
mCurrentState != STATE_PREPARING);
}
@Override
public boolean canPause() {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean canSeekBackward() {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean canSeekForward() {
// TODO Auto-generated method stub
return true;
}
}

View File

@ -84,6 +84,10 @@ unsigned char* CCFreeTypeFont::initWithString(const char * text, const FontDefin
m_inWidth = textDefinition._dimensions.width;
m_inHeight = textDefinition._dimensions.height;
m_fontFillColorR = textDefinition._fontFillColor.r;
m_fontFillColorG = textDefinition._fontFillColor.g;
m_fontFillColorB = textDefinition._fontFillColor.b;
#if 0
// check the cache for the font file buffer
auto ittFontNames = s_fontsNames.find(textDefinition._fontName);
@ -304,10 +308,10 @@ void CCFreeTypeFont::draw_bitmap(unsigned char* pBuffer, FT_Bitmap* bitmap, FT_
if(value > 0)
{
FT_Int index = (j * m_width * 4) + (i * 4);
pBuffer[index++] = m_fontFillColorR;
pBuffer[index++] = m_fontFillColorG;
pBuffer[index++] = m_fontFillColorB;
pBuffer[index++] = value;
pBuffer[index++] = value;
pBuffer[index++] = value;
pBuffer[index++] = 0xff;
}
}
}

View File

@ -129,6 +129,9 @@ private:
FTLineInfo* m_currentLine; // the current line object to add words to.
int m_fontFillColorR;
int m_fontFillColorG;
int m_fontFillColorB;
};
NS_CC_END

View File

@ -1113,9 +1113,9 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va
{
if (child->getPositionType() == ui::Widget::PositionType::PERCENT)
{
child->setPositionPercent(Vector2(child->getPositionPercent().x + 0.5f, child->getPositionPercent().y + 0.5f));
child->setPositionPercent(Vector2(child->getPositionPercent().x + widget->getAnchorPoint().x, child->getPositionPercent().y + widget->getAnchorPoint().y));
}
child->setPosition(Vector2(child->getPositionX() + widget->getSize().width / 2.0f, child->getPositionY() + widget->getSize().height / 2.0f));
child->setPosition(Vector2(child->getPositionX() + widget->getAnchorPointInPoints().x, child->getPositionY() + widget->getAnchorPointInPoints().y));
}
widget->addChild(child);
}

View File

@ -28,9 +28,8 @@ UIRichText.cpp \
CCProtectedNode.cpp \
UIHBox.cpp \
UIVBox.cpp \
UIRelativeBox.cpp
UIRelativeBox.cpp \
UIVideoPlayerAndroid.cpp
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../editor-support

View File

@ -45,8 +45,12 @@ THE SOFTWARE.
#include "ui/UIHBox.h"
#include "ui/UIVBox.h"
#include "ui/UIRelativeBox.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#include "ui/UIVideoPlayer.h"
#endif
#include "ui/UIDeprecated.h"
NS_CC_BEGIN
namespace ui {

113
cocos/ui/UIVideoPlayer.h Normal file
View File

@ -0,0 +1,113 @@
/****************************************************************************
Copyright (c) 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 __COCOS2D_UI_VIDEOWEIGTH_H_
#define __COCOS2D_UI_VIDEOWEIGTH_H_
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#include "ui/UIWidget.h"
NS_CC_BEGIN
namespace experimental{
namespace ui{
class VideoPlayer : public cocos2d::ui::Widget
{
public:
enum class Event
{
PLAYING = 0,
PAUSED,
STOPPED,
COMPLETED
};
typedef std::function<void(Ref*,VideoPlayer::Event)> EventCallback;
CREATE_FUNC(VideoPlayer);
//Sets local file[support assets' file on android] as a video source for VideoPlayer
virtual void setVideoFileName(const std::string& videoPath);
virtual const std::string& getVideoFileName() const { return _videoUrl;}
//Sets network link as a video source for VideoPlayer
virtual void setVideoURL(const std::string& videoUrl);
virtual const std::string& getVideoURL() const { return _videoUrl;}
virtual void startVideo();
virtual void pauseVideo();
virtual void resumeVideo();
virtual void stopVideo();
virtual void seekVideoTo(float sec);
virtual bool isPlaying() const;
virtual void setVisible(bool visible) override;
virtual void setKeepAspectRatioEnabled(bool enable);
virtual bool isKeepAspectRatioEnabled() { return _keepAspectRatioEnabled;}
virtual void setFullScreenEnabled(bool enabled);
virtual bool isFullScreenEnabled();
virtual void setEventListener(const EventCallback& callback);
virtual void onVideoEvent(VideoPlayer::Event event);
virtual void draw(Renderer *renderer, const Matrix& transform, bool transformUpdated) override;
protected:
VideoPlayer();
virtual ~VideoPlayer();
#if CC_VIDEOPLAYER_DEBUG_DRAW
CustomCommand _customDebugDrawCommand;
void VideoPlayer::drawDebugData();
#endif
enum class VideoSource
{
FILENAME = 0,
URL
};
bool _isPlaying;
bool _fullScreenDirty;
bool _fullScreenEnabled;
bool _keepAspectRatioEnabled;
std::string _videoUrl;
VideoSource _videoSource;
int _videoPlayerIndex;
EventCallback _callback;
void* _videiView;
};
}
}
NS_CC_END
#endif
#endif

View File

@ -0,0 +1,367 @@
/****************************************************************************
Copyright (c) 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 "UIVideoPlayer.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include <unordered_map>
#include <stdlib.h>
#include <jni.h>
#include <string>
#include "jni/JniHelper.h"
//-----------------------------------------------------------------------------------------------------------
#define CLASS_NAME "org/cocos2dx/lib/Cocos2dxVideoHelper"
void executeVideoCallback(int index,int event);
USING_NS_CC;
extern "C" {
void Java_org_cocos2dx_lib_Cocos2dxVideoHelper_nativeExecuteVideoCallback(JNIEnv * env, jobject obj, jint index,jint event) {
executeVideoCallback(index,event);
}
}
int createVideoWidgetJNI()
{
JniMethodInfo t;
int ret = -1;
if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "createVideoWidget", "()I")) {
ret = t.env->CallStaticIntMethod(t.classID, t.methodID);
t.env->DeleteLocalRef(t.classID);
}
return ret;
}
void callVideoNonParameterFun(int index,const char* funName)
{
JniMethodInfo t;
if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, funName, "(I)V")) {
t.env->CallStaticVoidMethod(t.classID, t.methodID, index);
t.env->DeleteLocalRef(t.classID);
}
}
void removeVideoWidgetJNI(int index)
{
callVideoNonParameterFun(index,"removeVideoWidget");
}
void setVideoRectJNI(int index,int left,int top,int width,int height)
{
JniMethodInfo t;
if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setVideoRect", "(IIIII)V")) {
t.env->CallStaticVoidMethod(t.classID, t.methodID, index, left, top, width, height);
t.env->DeleteLocalRef(t.classID);
}
}
void setVideoURLJNI(int index,int videoSource,const std::string& videoUrl)
{
JniMethodInfo t;
if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setVideoUrl", "(IILjava/lang/String;)V")) {
jstring stringArg = t.env->NewStringUTF(videoUrl.c_str());
t.env->CallStaticVoidMethod(t.classID, t.methodID, index, videoSource,stringArg);
t.env->DeleteLocalRef(t.classID);
t.env->DeleteLocalRef(stringArg);
}
}
void startVideoJNI(int index)
{
callVideoNonParameterFun(index,"startVideo");
}
void pauseVideoJNI(int index)
{
callVideoNonParameterFun(index,"pauseVideo");
}
void resumeVideoJNI(int index)
{
callVideoNonParameterFun(index,"resumeVideo");
}
void stopVideoJNI(int index)
{
callVideoNonParameterFun(index,"stopVideo");
}
void seekVideoToJNI(int index,int msec)
{
JniMethodInfo t;
if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "seekVideoTo", "(II)V")) {
t.env->CallStaticVoidMethod(t.classID, t.methodID, index, msec);
t.env->DeleteLocalRef(t.classID);
}
}
void setVideoVisible(int index,bool visible)
{
JniMethodInfo t;
if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setVideoVisible", "(IZ)V")) {
t.env->CallStaticVoidMethod(t.classID, t.methodID, index, visible);
t.env->DeleteLocalRef(t.classID);
}
}
void setVideoKeepRatioEnabled(int index,bool enabled)
{
JniMethodInfo t;
if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setVideoKeepRatioEnabled", "(IZ)V")) {
t.env->CallStaticVoidMethod(t.classID, t.methodID, index, enabled);
t.env->DeleteLocalRef(t.classID);
}
}
//-----------------------------------------------------------------------------------------------------------
using namespace cocos2d::experimental::ui;
static std::unordered_map<int, VideoPlayer*> s_allVideoPlayers;
VideoPlayer::VideoPlayer()
: _videoPlayerIndex(-1)
, _callback(nullptr)
, _fullScreenEnabled(false)
, _fullScreenDirty(false)
, _keepAspectRatioEnabled(false)
{
_videoPlayerIndex = createVideoWidgetJNI();
s_allVideoPlayers[_videoPlayerIndex] = this;
auto listener = EventListenerKeyboard::create();
listener->onKeyReleased = [&](EventKeyboard::KeyCode keycode, cocos2d::Event* event){
if (keycode == EventKeyboard::KeyCode::KEY_BACKSPACE && _fullScreenEnabled)
{
this->setFullScreenEnabled(false);
}
};
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
}
VideoPlayer::~VideoPlayer()
{
s_allVideoPlayers.erase(_videoPlayerIndex);
removeVideoWidgetJNI(_videoPlayerIndex);
}
void VideoPlayer::setVideoFileName(const std::string& fileName)
{
_videoUrl = fileName;
_videoSource = VideoPlayer::VideoSource::FILENAME;
setVideoURLJNI(_videoPlayerIndex, (int)VideoSource::FILENAME,_videoUrl);
}
void VideoPlayer::setVideoURL(const std::string& videoUrl)
{
_videoUrl = videoUrl;
_videoSource = VideoPlayer::VideoSource::URL;
setVideoURLJNI(_videoPlayerIndex,(int)VideoSource::URL,_videoUrl);
}
void VideoPlayer::draw(Renderer* renderer, const Matrix &transform, bool transformUpdated)
{
cocos2d::ui::Widget::draw(renderer,transform,transformUpdated);
if (transformUpdated || _fullScreenDirty)
{
_fullScreenDirty = false;
auto directorInstance = Director::getInstance();
auto glView = directorInstance->getOpenGLView();
auto frameSize = glView->getFrameSize();
if (_fullScreenEnabled)
{
setVideoRectJNI(_videoPlayerIndex,0,0,frameSize.width,frameSize.height);
}
else
{
auto winSize = directorInstance->getWinSize();
auto leftBottom = convertToWorldSpace(Point::ZERO);
auto rightTop = convertToWorldSpace(Point(_contentSize.width,_contentSize.height));
auto uiLeft = frameSize.width / 2 + (leftBottom.x - winSize.width / 2 ) * glView->getScaleX();
auto uiTop = frameSize.height /2 - (rightTop.y - winSize.height / 2) * glView->getScaleY();
setVideoRectJNI(_videoPlayerIndex,uiLeft,uiTop,
(rightTop.x - leftBottom.x) * glView->getScaleX(),
(rightTop.y - leftBottom.y) * glView->getScaleY());
}
}
#if CC_VIDEOPLAYER_DEBUG_DRAW
_customDebugDrawCommand.init(_globalZOrder);
_customDebugDrawCommand.func = CC_CALLBACK_0(VideoPlayer::drawDebugData, this);
renderer->addCommand(&_customDebugDrawCommand);
#endif
}
void VideoPlayer::setFullScreenEnabled(bool enabled)
{
if (_fullScreenEnabled != enabled)
{
_fullScreenEnabled = enabled;
_fullScreenDirty = true;
}
}
bool VideoPlayer::isFullScreenEnabled()
{
return _fullScreenEnabled;
}
void VideoPlayer::setKeepAspectRatioEnabled(bool enable)
{
if (_keepAspectRatioEnabled != enable)
{
_keepAspectRatioEnabled = enable;
setVideoKeepRatioEnabled(_videoPlayerIndex,enable);
}
}
#if CC_VIDEOPLAYER_DEBUG_DRAW
void VideoPlayer::drawDebugData()
{
Director* director = Director::getInstance();
CCASSERT(nullptr != director, "Director is null when seting matrix stack");
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform);
auto size = getContentSize();
Point vertices[4]=
{
Point::ZERO,
Point(size.width, 0),
Point(size.width, size.height),
Point(0, size.height)
};
DrawPrimitives::drawPoly(vertices, 4, true);
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
}
#endif
void VideoPlayer::startVideo()
{
if (! _videoUrl.empty())
{
startVideoJNI(_videoPlayerIndex);
}
}
void VideoPlayer::pauseVideo()
{
if (! _videoUrl.empty())
{
pauseVideoJNI(_videoPlayerIndex);
}
}
void VideoPlayer::resumeVideo()
{
if (! _videoUrl.empty())
{
resumeVideoJNI(_videoPlayerIndex);
}
}
void VideoPlayer::stopVideo()
{
if (! _videoUrl.empty())
{
stopVideoJNI(_videoPlayerIndex);
}
}
void VideoPlayer::seekVideoTo(float sec)
{
if (! _videoUrl.empty())
{
seekVideoToJNI(_videoPlayerIndex,int(sec * 1000));
}
}
bool VideoPlayer::isPlaying() const
{
return _isPlaying;
}
void VideoPlayer::setVisible(bool visible)
{
cocos2d::ui::Widget::setVisible(visible);
if (! _videoUrl.empty())
{
setVideoVisible(_videoPlayerIndex,visible);
}
}
void VideoPlayer::setEventListener(const EventCallback& callback)
{
_callback = callback;
}
void VideoPlayer::onVideoEvent(VideoPlayer::Event event)
{
if (event == VideoPlayer::Event::PLAYING) {
_isPlaying = true;
} else {
_isPlaying = false;
}
if (_callback)
{
_callback(this,event);
}
}
void executeVideoCallback(int index,int event)
{
auto it = s_allVideoPlayers.find(index);
if (it != s_allVideoPlayers.end())
{
s_allVideoPlayers[index]->onVideoEvent((VideoPlayer::Event)event);
}
}
#endif

View File

@ -0,0 +1,464 @@
/****************************************************************************
Copyright (c) 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 "UIVideoPlayer.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
using namespace cocos2d::experimental::ui;
//-------------------------------------------------------------------------------------
#include "CCEAGLView.h"
#import <MediaPlayer/MediaPlayer.h>
@interface UIVideoViewWrapperIos : NSObject
@property (strong,nonatomic) MPMoviePlayerController * moviePlayer;
- (void) setVideoRect:(int) left :(int) top :(int) width :(int) height;
- (void) setVideoURL:(int) videoSource :(std::string&) videoUrl;
- (void) startVideo;
- (void) pauseVideo;
- (void) resumeVideo;
- (void) stopVideo;
- (void) seekVideoTo:(float) sec;
- (void) setVideoVisible:(bool) visible;
- (void) setVideoKeepRatioEnabled:(bool) enabled;
- (void) setFullScreenEnabled:(bool) enabled;
- (bool) isFullScreenEnabled;
-(id) init:(void*) videoPlayer;
-(void) videoFinished:(NSNotification*) notification;
-(void) playStateChange;
+(NSString*) fullPathFromRelativePath:(NSString*) relPath;
@end
@implementation UIVideoViewWrapperIos
{
int _left;
int _top;
int _width;
int _height;
bool _keepRatioEnabled;
VideoPlayer* _videoPlayer;
}
-(id)init:(void*)videoPlayer
{
if (self = [super init]) {
self.moviePlayer = nullptr;
_videoPlayer = (VideoPlayer*)videoPlayer;
_keepRatioEnabled = false;
}
return self;
}
-(void) dealloc
{
if (self.moviePlayer != nullptr) {
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:self.moviePlayer];
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackStateDidChangeNotification object:self.moviePlayer];
[self.moviePlayer stop];
[self.moviePlayer.view removeFromSuperview];
self.moviePlayer = nullptr;
_videoPlayer = nullptr;
}
[super dealloc];
}
-(void) setVideoRect:(int)left :(int)top :(int)width :(int)height
{
_left = left;
_width = width;
_top = top;
_height = height;
if (self.moviePlayer != nullptr) {
[self.moviePlayer.view setFrame:CGRectMake(left, top, width, height)];
}
}
-(void) setFullScreenEnabled:(bool) enabled
{
if (self.moviePlayer != nullptr) {
[self.moviePlayer setFullscreen:enabled animated:(true)];
}
}
-(bool) isFullScreenEnabled
{
if (self.moviePlayer != nullptr) {
return [self.moviePlayer isFullscreen];
}
return false;
}
-(void) setVideoURL:(int)videoSource :(std::string &)videoUrl
{
if (self.moviePlayer != nullptr) {
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:self.moviePlayer];
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackStateDidChangeNotification object:self.moviePlayer];
[self.moviePlayer stop];
[self.moviePlayer.view removeFromSuperview];
self.moviePlayer = nullptr;
}
if (videoSource == 1) {
self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@(videoUrl.c_str())]];
self.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
} else {
NSString *path = [UIVideoViewWrapperIos fullPathFromRelativePath:@(videoUrl.c_str())];
self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:path]];
self.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
}
self.moviePlayer.allowsAirPlay = false;
self.moviePlayer.controlStyle = MPMovieControlStyleEmbedded;
self.moviePlayer.view.userInteractionEnabled = true;
auto clearColor = [UIColor clearColor];
self.moviePlayer.backgroundView.backgroundColor = clearColor;
self.moviePlayer.view.backgroundColor = clearColor;
for (UIView * subView in self.moviePlayer.view.subviews) {
subView.backgroundColor = clearColor;
}
if (_keepRatioEnabled) {
self.moviePlayer.scalingMode = MPMovieScalingModeAspectFit;
} else {
self.moviePlayer.scalingMode = MPMovieScalingModeFill;
}
auto view = cocos2d::Director::getInstance()->getOpenGLView();
auto eaglview = (CCEAGLView *) view->getEAGLView();
[eaglview addSubview:self.moviePlayer.view];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoFinished:) name:MPMoviePlayerPlaybackDidFinishNotification object:self.moviePlayer];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playStateChange) name:MPMoviePlayerPlaybackStateDidChangeNotification object:self.moviePlayer];
}
-(void) videoFinished:(NSNotification *)notification
{
if(_videoPlayer != nullptr)
{
if([self.moviePlayer playbackState] != MPMoviePlaybackStateStopped)
{
_videoPlayer->onVideoEvent(VideoPlayer::Event::COMPLETED);
}
}
}
-(void) playStateChange
{
MPMoviePlaybackState state = [self.moviePlayer playbackState];
switch (state) {
case MPMoviePlaybackStatePaused:
_videoPlayer->onVideoEvent(VideoPlayer::Event::PAUSED);
break;
case MPMoviePlaybackStateStopped:
_videoPlayer->onVideoEvent(VideoPlayer::Event::STOPPED);
break;
case MPMoviePlaybackStatePlaying:
_videoPlayer->onVideoEvent(VideoPlayer::Event::PLAYING);
break;
case MPMoviePlaybackStateInterrupted:
break;
case MPMoviePlaybackStateSeekingBackward:
break;
case MPMoviePlaybackStateSeekingForward:
break;
default:
break;
}
}
-(void) seekVideoTo:(float)sec
{
if (self.moviePlayer != NULL) {
[self.moviePlayer setCurrentPlaybackTime:(sec)];
}
}
-(void) setVideoVisible:(bool)visible
{
if (self.moviePlayer != NULL) {
[self.moviePlayer.view setHidden:visible];
}
}
-(void) setVideoKeepRatioEnabled:(bool)enabled
{
_keepRatioEnabled = enabled;
if (self.moviePlayer != NULL) {
if (enabled) {
self.moviePlayer.scalingMode = MPMovieScalingModeAspectFit;
} else {
self.moviePlayer.scalingMode = MPMovieScalingModeFill;
}
}
}
-(void) startVideo
{
if (self.moviePlayer != NULL) {
[self.moviePlayer.view setFrame:CGRectMake(_left, _top, _width, _height)];
[self.moviePlayer play];
}
}
-(void) pauseVideo
{
if (self.moviePlayer != NULL) {
[self.moviePlayer pause];
}
}
-(void) resumeVideo
{
if (self.moviePlayer != NULL) {
if([self.moviePlayer playbackState] == MPMoviePlaybackStatePaused)
{
[self.moviePlayer play];
}
}
}
-(void) stopVideo
{
if (self.moviePlayer != NULL) {
[self.moviePlayer stop];
}
}
+(NSString*) fullPathFromRelativePath:(NSString*) relPath
{
// do not convert an absolute path (starting with '/')
if(([relPath length] > 0) && ([relPath characterAtIndex:0] == '/'))
{
return relPath;
}
NSMutableArray *imagePathComponents = [NSMutableArray arrayWithArray:[relPath pathComponents]];
NSString *file = [imagePathComponents lastObject];
[imagePathComponents removeLastObject];
NSString *imageDirectory = [NSString pathWithComponents:imagePathComponents];
NSString *fullpath = [[NSBundle mainBundle] pathForResource:file ofType:nil inDirectory:imageDirectory];
if (fullpath == nil)
fullpath = relPath;
return fullpath;
}
@end
//------------------------------------------------------------------------------------------------------------
VideoPlayer::VideoPlayer()
: _videoPlayerIndex(-1)
, _callback(nullptr)
, _fullScreenEnabled(false)
, _fullScreenDirty(false)
, _keepAspectRatioEnabled(false)
, _isPlaying(false)
{
_videiView = [[UIVideoViewWrapperIos alloc] init:this];
}
VideoPlayer::~VideoPlayer()
{
if(_videiView)
{
[((UIVideoViewWrapperIos*)_videiView) dealloc];
}
}
void VideoPlayer::setVideoFileName(const std::string& fileName)
{
_videoUrl = fileName;
_videoSource = VideoPlayer::VideoSource::FILENAME;
[((UIVideoViewWrapperIos*)_videiView) setVideoURL:(int)_videoSource :_videoUrl];
}
void VideoPlayer::setVideoURL(const std::string& videoUrl)
{
_videoUrl = videoUrl;
_videoSource = VideoPlayer::VideoSource::URL;
[((UIVideoViewWrapperIos*)_videiView) setVideoURL:(int)_videoSource :_videoUrl];
}
void VideoPlayer::draw(Renderer* renderer, const Matrix &transform, bool transformUpdated)
{
cocos2d::ui::Widget::draw(renderer,transform,transformUpdated);
if (transformUpdated)
{
auto directorInstance = Director::getInstance();
auto glView = directorInstance->getOpenGLView();
auto frameSize = glView->getFrameSize();
auto scaleFactor = directorInstance->getContentScaleFactor();
auto winSize = directorInstance->getWinSize();
auto leftBottom = convertToWorldSpace(Vector2::ZERO);
auto rightTop = convertToWorldSpace(Vector2(_contentSize.width,_contentSize.height));
auto uiLeft = (frameSize.width / 2 + (leftBottom.x - winSize.width / 2 ) * glView->getScaleX()) / scaleFactor;
auto uiTop = (frameSize.height /2 - (rightTop.y - winSize.height / 2) * glView->getScaleY()) / scaleFactor;
[((UIVideoViewWrapperIos*)_videiView) setVideoRect:uiLeft :uiTop
:(rightTop.x - leftBottom.x) * glView->getScaleX() / scaleFactor
:( (rightTop.y - leftBottom.y) * glView->getScaleY()/scaleFactor)];
}
#if CC_VIDEOPLAYER_DEBUG_DRAW
_customDebugDrawCommand.init(_globalZOrder);
_customDebugDrawCommand.func = CC_CALLBACK_0(VideoPlayer::drawDebugData, this);
renderer->addCommand(&_customDebugDrawCommand);
#endif
}
bool VideoPlayer::isFullScreenEnabled()
{
return [((UIVideoViewWrapperIos*)_videiView) isFullScreenEnabled];
}
void VideoPlayer::setFullScreenEnabled(bool enabled)
{
[((UIVideoViewWrapperIos*)_videiView) setFullScreenEnabled:enabled];
}
void VideoPlayer::setKeepAspectRatioEnabled(bool enable)
{
if (_keepAspectRatioEnabled != enable)
{
_keepAspectRatioEnabled = enable;
[((UIVideoViewWrapperIos*)_videiView) setVideoKeepRatioEnabled:enable];
}
}
#if CC_VIDEOPLAYER_DEBUG_DRAW
void VideoPlayer::drawDebugData()
{
Director* director = Director::getInstance();
CCASSERT(nullptr != director, "Director is null when seting matrix stack");
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform);
auto size = getContentSize();
Point vertices[4]=
{
Point::ZERO,
Point(size.width, 0),
Point(size.width, size.height),
Point(0, size.height)
};
DrawPrimitives::drawPoly(vertices, 4, true);
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
}
#endif
void VideoPlayer::startVideo()
{
if (! _videoUrl.empty())
{
[((UIVideoViewWrapperIos*)_videiView) startVideo];
}
}
void VideoPlayer::pauseVideo()
{
if (! _videoUrl.empty())
{
[((UIVideoViewWrapperIos*)_videiView) pauseVideo];
}
}
void VideoPlayer::resumeVideo()
{
if (! _videoUrl.empty())
{
[((UIVideoViewWrapperIos*)_videiView) resumeVideo];
}
}
void VideoPlayer::stopVideo()
{
if (! _videoUrl.empty())
{
[((UIVideoViewWrapperIos*)_videiView) stopVideo];
}
}
void VideoPlayer::seekVideoTo(float sec)
{
if (! _videoUrl.empty())
{
[((UIVideoViewWrapperIos*)_videiView) seekVideoTo:sec];
}
}
bool VideoPlayer::isPlaying() const
{
return _isPlaying;
}
void VideoPlayer::setVisible(bool visible)
{
cocos2d::ui::Widget::setVisible(visible);
if (! _videoUrl.empty())
{
[((UIVideoViewWrapperIos*)_videiView) setVideoVisible:visible];
}
}
void VideoPlayer::setEventListener(const EventCallback& callback)
{
_callback = callback;
}
void VideoPlayer::onVideoEvent(VideoPlayer::Event event)
{
if (event == VideoPlayer::Event::PLAYING) {
_isPlaying = true;
} else {
_isPlaying = false;
}
if (_callback)
{
_callback(this,event);
}
}
#endif

View File

@ -186,6 +186,7 @@
<ClInclude Include="..\..\ui\UITextField.h" />
<ClInclude Include="..\..\ui\UIVBox.h" />
<ClInclude Include="..\..\ui\UIWidget.h" />
<ClInclude Include="..\UIHBox.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\ui\CCProtectedNode.cpp" />
@ -209,5 +210,6 @@
<ClCompile Include="..\..\ui\UITextField.cpp" />
<ClCompile Include="..\..\ui\UIVBox.cpp" />
<ClCompile Include="..\..\ui\UIWidget.cpp" />
<ClCompile Include="..\UIHBox.cpp" />
</ItemGroup>
</Project>

View File

@ -81,6 +81,9 @@
<ClInclude Include="..\..\ui\UIVBox.h">
<Filter>Layouts</Filter>
</ClInclude>
<ClInclude Include="..\UIHBox.h">
<Filter>UIWidgets</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\ui\UILayout.cpp">
@ -146,5 +149,8 @@
<ClCompile Include="..\..\ui\UIVBox.cpp">
<Filter>Layouts</Filter>
</ClCompile>
<ClCompile Include="..\UIHBox.cpp">
<Filter>UIWidgets</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -295,6 +295,8 @@
"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java",
"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTextInputWraper.java",
"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java",
"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoHelper.java",
"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java",
"cocos/2d/platform/android/javaactivity.cpp",
"cocos/2d/platform/android/jni/DPIJni.cpp",
"cocos/2d/platform/android/jni/DPIJni.h",
@ -946,6 +948,9 @@
"cocos/ui/UITextField.h",
"cocos/ui/UIVBox.cpp",
"cocos/ui/UIVBox.h",
"cocos/ui/UIVideoPlayer.h",
"cocos/ui/UIVideoPlayerAndroid.cpp",
"cocos/ui/UIVideoPlayerIOS.mm",
"cocos/ui/UIWidget.cpp",
"cocos/ui/UIWidget.h",
"cocos/ui/proj.win32/libGUI.vcxproj",

View File

@ -38,7 +38,9 @@ bool AppDelegate::applicationDidFinishLaunching()
auto engine = LuaEngine::getInstance();
ScriptEngineManager::getInstance()->setScriptEngine(engine);
engine->executeScriptFile("src/main.lua");
if (engine->executeScriptFile("src/main.lua")) {
return false;
}
return true;
}

View File

@ -12,6 +12,7 @@ function __G__TRACKBACK__(msg)
cclog("LUA ERROR: " .. tostring(msg) .. "\n")
cclog(debug.traceback())
cclog("----------------------------------------")
return msg
end
local function main()
@ -230,4 +231,7 @@ local function main()
end
xpcall(main, __G__TRACKBACK__)
local status, msg = xpcall(main, __G__TRACKBACK__)
if not status then
error(msg)
end

View File

@ -43,7 +43,9 @@ bool AppDelegate::applicationDidFinishLaunching()
auto engine = LuaEngine::getInstance();
ScriptEngineManager::getInstance()->setScriptEngine(engine);
engine->executeScriptFile("src/main.lua");
if (engine->executeScriptFile("src/main.lua")) {
return false;
}
return true;
}

View File

@ -12,6 +12,7 @@ function __G__TRACKBACK__(msg)
cclog("LUA ERROR: " .. tostring(msg) .. "\n")
cclog(debug.traceback())
cclog("----------------------------------------")
return msg
end
local function main()
@ -230,4 +231,7 @@ local function main()
end
xpcall(main, __G__TRACKBACK__)
local status, msg = xpcall(main, __G__TRACKBACK__)
if not status then
error(msg)
end

View File

@ -98,6 +98,7 @@ Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.cpp \
Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.cpp \
Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp \
Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp \
Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp \
Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp \
Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageViewReader.cpp \
Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp \

View File

@ -279,7 +279,20 @@ g_guisTests[] =
Director::getInstance()->replaceScene(pScene);
}
},
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
{
"gui VideoPlayerTest",
[](Ref* sender)
{
UISceneManager* pManager = UISceneManager::sharedUISceneManager();
pManager->setCurrentUISceneId(kUIVideoPlayerTest);
pManager->setMinUISceneId(kUIVideoPlayerTest);
pManager->setMaxUISceneId(kUIVideoPlayerTest);
Scene* pScene = pManager->currentUIScene();
Director::getInstance()->replaceScene(pScene);
}
}
#endif
};
static const int g_maxTests = sizeof(g_guisTests) / sizeof(g_guisTests[0]);

View File

@ -18,6 +18,9 @@
#include "UIWidgetAddNodeTest/UIWidgetAddNodeTest.h"
#include "UIRichTextTest/UIRichTextTest.h"
#include "UIFocusTest/UIFocusTest.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#include "UIVideoPlayerTest/UIVideoPlayerTest.h"
#endif
/*
#include "UISwitchTest/UISwitchTest.h"
*/
@ -114,7 +117,10 @@ static const char* s_testArray[] =
"UIFocusTest-VBox",
"UIFocusTest-NestedLayout1",
"UIFocusTest-NestedLayout2",
"UIFocusTest-NestedLayout3"
"UIFocusTest-NestedLayout3",
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
"UIVideoPlayerTest"
#endif
};
static UISceneManager *sharedInstance = NULL;
@ -375,7 +381,10 @@ Scene *UISceneManager::currentUIScene()
return UIFocusTestNestedLayout2::sceneWithTitle(s_testArray[_currentUISceneId]);
case KUIFocusTest_NestedLayout3:
return UIFocusTestNestedLayout3::sceneWithTitle(s_testArray[_currentUISceneId]);
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
case kUIVideoPlayerTest:
return VideoPlayerTest::sceneWithTitle(s_testArray[_currentUISceneId]);
#endif
}
return NULL;
}

View File

@ -106,6 +106,9 @@ enum
KUIFocusTest_NestedLayout1,
KUIFocusTest_NestedLayout2,
KUIFocusTest_NestedLayout3,
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
kUIVideoPlayerTest,
#endif
kUITestMax
};

View File

@ -0,0 +1,211 @@
#include "UIVideoPlayerTest.h"
USING_NS_CC;
using namespace cocos2d::experimental::ui;
bool VideoPlayerTest::init()
{
if ( !UIScene::init() )
{
return false;
}
_visibleRect = Director::getInstance()->getOpenGLView()->getVisibleRect();
MenuItemFont::setFontSize(16);
auto fullSwitch = MenuItemFont::create("FullScreenSwitch", CC_CALLBACK_1(VideoPlayerTest::menuFullScreenCallback, this));
fullSwitch->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT);
fullSwitch->setPosition(Vector2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 50));
auto pauseItem = MenuItemFont::create("Pause", CC_CALLBACK_1(VideoPlayerTest::menuPauseCallback, this));
pauseItem->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT);
pauseItem->setPosition(Vector2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 100));
auto resumeItem = MenuItemFont::create("Resume", CC_CALLBACK_1(VideoPlayerTest::menuResumeCallback, this));
resumeItem->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT);
resumeItem->setPosition(Vector2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 150));
auto stopItem = MenuItemFont::create("Stop", CC_CALLBACK_1(VideoPlayerTest::menuStopCallback, this));
stopItem->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT);
stopItem->setPosition(Vector2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 200));
auto hintItem = MenuItemFont::create("Hint", CC_CALLBACK_1(VideoPlayerTest::menuHintCallback, this));
hintItem->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT);
hintItem->setPosition(Vector2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 250));
//-------------------------------------------------------------------------------------------------------------------
auto resourceVideo = MenuItemFont::create("Play resource video", CC_CALLBACK_1(VideoPlayerTest::menuResourceVideoCallback, this));
resourceVideo->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT);
resourceVideo->setPosition(Vector2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 50));
auto onlineVideo = MenuItemFont::create("Play online video", CC_CALLBACK_1(VideoPlayerTest::menuOnlineVideoCallback, this));
onlineVideo->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT);
onlineVideo->setPosition(Vector2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 100));
auto ratioSwitch = MenuItemFont::create("KeepRatioSwitch", CC_CALLBACK_1(VideoPlayerTest::menuRatioCallback, this));
ratioSwitch->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT);
ratioSwitch->setPosition(Vector2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 150));
auto menu = Menu::create(resourceVideo,onlineVideo,ratioSwitch,fullSwitch,pauseItem,resumeItem,stopItem,hintItem,nullptr);
menu->setPosition(Vector2::ZERO);
_uiLayer->addChild(menu);
_videoStateLabel = Label::createWithSystemFont("IDLE","Arial",16);
_videoStateLabel->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT);
_videoStateLabel->setPosition(Vector2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 200));
_uiLayer->addChild(_videoStateLabel);
createVideo();
return true;
}
void VideoPlayerTest::menuCloseCallback(Ref* sender)
{
Director::getInstance()->end();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
exit(0);
#endif
}
void VideoPlayerTest::menuFullScreenCallback(Ref* sender)
{
if (_videoPlayer)
{
_videoPlayer->setFullScreenEnabled(! _videoPlayer->isFullScreenEnabled());
}
}
void VideoPlayerTest::menuRatioCallback(Ref* sender)
{
if (_videoPlayer)
{
_videoPlayer->setKeepAspectRatioEnabled(! _videoPlayer->isKeepAspectRatioEnabled());
}
}
void VideoPlayerTest::menuResourceVideoCallback(Ref* sender)
{
if (_videoPlayer)
{
_videoPlayer->setVideoFileName("cocosvideo.mp4");
_videoPlayer->startVideo();
}
}
void VideoPlayerTest::menuOnlineVideoCallback(Ref* sender)
{
if (_videoPlayer)
{
_videoPlayer->setVideoURL("http://video001.smgbb.cn/gslb/program/FDN/FDN1190949/HLSVodService.m3u8?_mdCode=6065719&_cdnCode=B2B_XL_TEST&_type=0&_rCode=TerOut_18865&_userId=020341000456068&_categoryCode=SMG_HUAYU&_categoryPath=SMG_1002,SMG_HUAYU,&_adPositionId=01001000&_adCategorySource=0&_flag=.m3u8&_enCode=m3u8&taskID=ysh_ps_002-ott_1397459105893_020341000456068&_client=103&_cms=ctv&_CDNToken=76C043FD4969501754DC19E54EC8DC2C");
_videoPlayer->startVideo();
}
}
void VideoPlayerTest::menuPauseCallback(Ref* sender)
{
if (_videoPlayer)
{
_videoPlayer->pauseVideo();
}
}
void VideoPlayerTest::menuResumeCallback(Ref* sender)
{
if (_videoPlayer)
{
_videoPlayer->resumeVideo();
}
}
void VideoPlayerTest::menuStopCallback(Ref* sender)
{
if (_videoPlayer)
{
_videoPlayer->stopVideo();
}
}
void VideoPlayerTest::menuHintCallback(Ref* sender)
{
if (_videoPlayer)
{
_videoPlayer->setVisible(! _videoPlayer->isVisible());
}
}
void VideoPlayerTest::createVideo()
{
auto centerPos = Vector2(_visibleRect.origin.x + _visibleRect.size.width / 2,_visibleRect.origin.y + _visibleRect.size.height /2);
auto widgetSize = _widget->getSize();
_videoPlayer = VideoPlayer::create();
_videoPlayer->setPosition(centerPos);
_videoPlayer->setAnchorPoint(Vector2::ANCHOR_MIDDLE);
_videoPlayer->setContentSize(Size(widgetSize.width * 0.4f,widgetSize.height * 0.4f));
_uiLayer->addChild(_videoPlayer);
_videoPlayer->setEventListener(CC_CALLBACK_2(VideoPlayerTest::videoEventCallback, this));
}
void VideoPlayerTest::createSlider()
{
auto centerPos = Vector2(_visibleRect.origin.x + _visibleRect.size.width / 2,_visibleRect.origin.y + _visibleRect.size.height /2);
auto hSlider = ui::Slider::create();
hSlider->setTouchEnabled(true);
hSlider->loadBarTexture("cocosui/sliderTrack.png");
hSlider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", "");
hSlider->loadProgressBarTexture("cocosui/sliderProgress.png");
hSlider->setPosition(Vector2(centerPos.x, _visibleRect.origin.y + _visibleRect.size.height * 0.15f));
hSlider->setPercent(50);
hSlider->addEventListenerSlider(this, sliderpercentchangedselector(VideoPlayerTest::sliderCallback));
_uiLayer->addChild(hSlider,0,1);
auto vSlider = ui::Slider::create();
vSlider->setTouchEnabled(true);
vSlider->loadBarTexture("cocosui/sliderTrack.png");
vSlider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", "");
vSlider->loadProgressBarTexture("cocosui/sliderProgress.png");
vSlider->setPosition(Vector2(_visibleRect.origin.x + _visibleRect.size.width * 0.15f, centerPos.y));
vSlider->setRotation(90);
vSlider->setPercent(50);
vSlider->addEventListenerSlider(this, sliderpercentchangedselector(VideoPlayerTest::sliderCallback));
_uiLayer->addChild(vSlider,0,2);
}
void VideoPlayerTest::sliderCallback(Ref *sender, ui::SliderEventType eventType)
{
if (eventType == SLIDER_PERCENTCHANGED && _videoPlayer)
{
Slider* hSlider = (Slider*)this->getChildByTag(1);
Slider* vSlider = (Slider*)this->getChildByTag(2);
auto newPosX = _visibleRect.origin.x + _visibleRect.size.width / 2 + hSlider->getPercent() - 50;
auto newPosY = _visibleRect.origin.y + _visibleRect.size.height / 2 + 50 - vSlider->getPercent();
_videoPlayer->setPosition(Vector2(newPosX,newPosY));
}
}
void VideoPlayerTest::videoEventCallback(Ref* sender, VideoPlayer::Event eventType)
{
switch (eventType) {
case VideoPlayer::Event::PLAYING:
_videoStateLabel->setString("PLAYING");
break;
case VideoPlayer::Event::PAUSED:
_videoStateLabel->setString("PAUSED");
break;
case VideoPlayer::Event::STOPPED:
_videoStateLabel->setString("STOPPED");
break;
case VideoPlayer::Event::COMPLETED:
_videoStateLabel->setString("COMPLETED");
break;
default:
break;
}
}

View File

@ -0,0 +1,44 @@
#ifndef __tests__VideoPlayerTest__
#define __tests__VideoPlayerTest__
#include "../UIScene.h"
USING_NS_CC;
class VideoPlayerTest : public UIScene
{
public:
UI_SCENE_CREATE_FUNC(VideoPlayerTest);
virtual bool init();
void menuCloseCallback(Ref* sender);
void menuRatioCallback(Ref* sender);
void menuResourceVideoCallback(Ref* sender);
void menuOnlineVideoCallback(Ref* sender);
void menuFullScreenCallback(Ref* sender);
void menuPauseCallback(Ref* sender);
void menuResumeCallback(Ref* sender);
void menuStopCallback(Ref* sender);
void menuHintCallback(Ref* sender);
void sliderCallback(Ref *sender, ui::SliderEventType eventType);
void videoEventCallback(Ref* sender, experimental::ui::VideoPlayer::Event eventType);
private:
void createVideo();
void createSlider();
MenuItemFont* _hintItem;
experimental::ui::VideoPlayer* _videoPlayer;
Label* _videoStateLabel;
Rect _visibleRect;
Layer* _rootLayer;
};
#endif // __tests__VideoPlayerTest__

Binary file not shown.

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\Resources</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\Resources</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

View File

@ -199,50 +199,6 @@
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioComponentsTest\PlayerController.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioComponentsTest\ProjectileController.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioComponentsTest\SceneController.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CocosGUIScene.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CocoStudioGUITest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomGUIScene.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomImageTest\CustomImageTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomParticleWidgetTest\CustomParticleWidgetTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomImageView.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomImageViewReader.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomParticleWidget.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomParticleWidgetReader.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomReader.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\GUIEditorTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest\UIButtonTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest\UIButtonTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest\UILayoutTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest\UILayoutTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest\UIListViewTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest\UIListViewTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIRichTextTest\UIRichTextTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScene.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISceneManager.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISceneManager_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScene_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextTest\UITextTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextTest\UITextTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioSceneTest\SceneEditorTest.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioSceneTest\TriggerCode\acts.cpp" />
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioSceneTest\TriggerCode\cons.cpp" />
@ -272,6 +228,52 @@
<ClCompile Include="..\..\Classes\ShaderTest\ShaderTest2.cpp" />
<ClCompile Include="..\..\Classes\SpineTest\SpineTest.cpp" />
<ClCompile Include="..\..\Classes\TexturePackerEncryptionTest\TextureAtlasEncryptionTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CocosGUIScene.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CocoStudioGUITest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomGUIScene.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomTest\CustomImageTest\CustomImageTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomTest\CustomParticleWidgetTest\CustomParticleWidgetTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomImageView.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomImageViewReader.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomParticleWidget.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomParticleWidgetReader.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomReader.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\GUIEditorTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIButtonTest\UIButtonTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIButtonTest\UIButtonTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIFocusTest\UIFocusTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UILayoutTest\UILayoutTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UILayoutTest\UILayoutTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIListViewTest\UIListViewTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIListViewTest\UIListViewTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIRichTextTest\UIRichTextTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIScene.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UISceneManager.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UISceneManager_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIScene_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UISliderTest\UISliderTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UISliderTest\UISliderTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextTest\UITextTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextTest\UITextTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest.cpp" />
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest_Editor.cpp" />
<ClCompile Include="..\..\Classes\UITest\UITest.cpp" />
<ClCompile Include="..\..\Classes\UnitTest\RefPtrTest.cpp" />
<ClCompile Include="..\..\Classes\UnitTest\UnitTest.cpp" />
<ClCompile Include="..\..\Classes\VisibleRect.cpp" />
@ -393,50 +395,6 @@
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioComponentsTest\PlayerController.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioComponentsTest\ProjectileController.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioComponentsTest\SceneController.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CocosGUIScene.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CocoStudioGUITest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomGUIScene.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomImageTest\CustomImageTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomParticleWidgetTest\CustomParticleWidgetTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomImageView.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomImageViewReader.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomParticleWidget.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomParticleWidgetReader.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomReader.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\GUIEditorTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest\UIButtonTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest\UIButtonTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest\UILayoutTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest\UILayoutTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest\UIListViewTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest\UIListViewTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIRichTextTest\UIRichTextTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScene.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISceneManager.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISceneManager_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScene_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextTest\UITextTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextTest\UITextTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest_Editor.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioSceneTest\SceneEditorTest.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioSceneTest\TriggerCode\acts.h" />
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioSceneTest\TriggerCode\cons.h" />
@ -467,6 +425,52 @@
<ClInclude Include="..\..\Classes\ShaderTest\ShaderTest2.h" />
<ClInclude Include="..\..\Classes\SpineTest\SpineTest.h" />
<ClInclude Include="..\..\Classes\TexturePackerEncryptionTest\TextureAtlasEncryptionTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CocosGUIScene.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CocoStudioGUITest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomGUIScene.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomTest\CustomImageTest\CustomImageTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomTest\CustomParticleWidgetTest\CustomParticleWidgetTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomImageView.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomImageViewReader.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomParticleWidget.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomParticleWidgetReader.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomReader.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\GUIEditorTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIButtonTest\UIButtonTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIButtonTest\UIButtonTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIFocusTest\UIFocusTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UILayoutTest\UILayoutTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UILayoutTest\UILayoutTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIListViewTest\UIListViewTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIListViewTest\UIListViewTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIRichTextTest\UIRichTextTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIScene.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UISceneManager.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UISceneManager_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIScene_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UISliderTest\UISliderTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UISliderTest\UISliderTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextTest\UITextTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextTest\UITextTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest.h" />
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest_Editor.h" />
<ClInclude Include="..\..\Classes\UITest\UITest.h" />
<ClInclude Include="..\..\Classes\UnitTest\RefPtrTest.h" />
<ClInclude Include="..\..\Classes\UnitTest\UnitTest.h" />
<ClInclude Include="..\..\Classes\VisibleRect.h" />

View File

@ -241,36 +241,6 @@
<Filter Include="Classes\PhysicsTest">
<UniqueIdentifier>{a83cb042-e3d6-4d3b-a4f6-30a4b3fcb3e9}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest">
<UniqueIdentifier>{9daecd38-37c6-4216-a999-86077af83beb}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest">
<UniqueIdentifier>{493fcd85-c749-482d-9404-905e99aa0103}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest">
<UniqueIdentifier>{2e08949f-bf73-4fdc-85e8-34b8c69aa978}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest">
<UniqueIdentifier>{c57c0453-a096-44d7-830b-1cf24c712cfd}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest">
<UniqueIdentifier>{01097388-e538-4081-8e16-d1ff3a86292a}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest">
<UniqueIdentifier>{fadff96e-c19a-41f5-a755-547cf1f8a5fb}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest">
<UniqueIdentifier>{73c268e8-3872-49d6-9204-1e679ff72a42}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest">
<UniqueIdentifier>{dedcabba-959c-40e3-9959-7ccf4e31c792}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest">
<UniqueIdentifier>{5caf2179-ae22-4040-8bac-17e9f22efbf7}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest">
<UniqueIdentifier>{24f044ee-09a6-406b-98d7-8d5d759e5bb1}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\KeyboardTest">
<UniqueIdentifier>{8d7d37cd-5cc2-4a7d-9bd2-7b5c928adbb5}</UniqueIdentifier>
</Filter>
@ -283,12 +253,6 @@
<Filter Include="Classes\NewRendererTest">
<UniqueIdentifier>{688e201c-77fe-4665-931e-e508a58141f5}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest">
<UniqueIdentifier>{160da6f0-a0f1-4a53-8e5e-cf0a63ee82a3}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest">
<UniqueIdentifier>{c4dbbfb3-0e91-492f-bbbf-f03fb26f3f54}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UnitTest">
<UniqueIdentifier>{1821914f-c088-4946-8c1e-19ab57b5eabc}</UniqueIdentifier>
</Filter>
@ -298,29 +262,71 @@
<Filter Include="Classes\ReleasePoolTest">
<UniqueIdentifier>{f71fab28-32be-45c9-a941-9a22b5a59e51}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest">
<UniqueIdentifier>{5a8f369e-53b7-461e-9aaf-89f0931a0046}</UniqueIdentifier>
<Filter Include="Classes\UITest">
<UniqueIdentifier>{03d9907b-2766-4d84-8e7d-bc81beafd83b}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest">
<UniqueIdentifier>{2b92a344-8fd6-493c-bc5f-423e01abbfca}</UniqueIdentifier>
<Filter Include="Classes\UITest\CocosStudioGUITest">
<UniqueIdentifier>{d6d4d2d2-5bec-4f70-8963-cd3170490d60}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UITextTest">
<UniqueIdentifier>{b9e1dc6c-3933-4dd2-b396-67f8a6a42821}</UniqueIdentifier>
<Filter Include="Classes\UITest\CocosStudioGUITest\CustomTest">
<UniqueIdentifier>{d92bf78a-a9d0-4941-b926-9442669856ff}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\CustomTest">
<UniqueIdentifier>{a2acdd59-c690-4433-919c-9438e3279cd2}</UniqueIdentifier>
<Filter Include="Classes\UITest\CocosStudioGUITest\CustomTest\CustomImageTest">
<UniqueIdentifier>{7aa77f11-45a0-4c5c-a164-09f7fe53baac}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomImageTest">
<UniqueIdentifier>{30d5188b-85c9-4877-933a-5bf0e6d2ca54}</UniqueIdentifier>
<Filter Include="Classes\UITest\CocosStudioGUITest\CustomTest\CustomParticleWidgetTest">
<UniqueIdentifier>{062dbbf6-506a-468d-9abf-0bc58c8457a2}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget">
<UniqueIdentifier>{c3353e37-e25e-4fa2-bc37-ebd7a8854efe}</UniqueIdentifier>
<Filter Include="Classes\UITest\CocosStudioGUITest\CustomWidget">
<UniqueIdentifier>{eac3cbd8-3ec9-4534-80c2-7b34eda8b28e}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIRichTextTest">
<UniqueIdentifier>{8bc33078-56ce-48a6-85fd-b9d67db67c13}</UniqueIdentifier>
<Filter Include="Classes\UITest\CocosStudioGUITest\UICheckBoxTest">
<UniqueIdentifier>{4d78bc45-32ab-442e-8f00-3b2932bacdce}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomParticleWidgetTest">
<UniqueIdentifier>{f2e15a07-0d4e-407f-b4dc-d7692afe64a4}</UniqueIdentifier>
<Filter Include="Classes\UITest\CocosStudioGUITest\UIButtonTest">
<UniqueIdentifier>{b3dba85f-4bba-408e-a979-6780946bd426}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UIFocusTest">
<UniqueIdentifier>{52d776a5-b646-43a5-b74b-bd70e7bec25b}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UIImageViewTest">
<UniqueIdentifier>{f7abc2f0-46b1-497a-9bda-c49fd485201c}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UILayoutTest">
<UniqueIdentifier>{962b7868-af67-4b6d-936c-005a461319f3}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UIListViewTest">
<UniqueIdentifier>{1007216a-5e75-40cf-a7c7-df751cb1a0ee}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UILoadingBarTest">
<UniqueIdentifier>{a675bafb-fa61-400c-ac72-6509996b1b1e}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UIPageViewTest">
<UniqueIdentifier>{609689d3-b604-4fde-8751-5f27087f6711}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UIRichTextTest">
<UniqueIdentifier>{e91c67fe-b40e-476b-b00c-d14bf63c6829}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UIScrollViewTest">
<UniqueIdentifier>{abe8f97b-a4b3-4827-82a7-98d613fcc40b}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UISliderTest">
<UniqueIdentifier>{e5f9c30b-c34e-4d83-88d9-18b5864cc760}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UITextAtlasTest">
<UniqueIdentifier>{991e53ff-12c6-45d5-85ad-84a7e52a9688}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UITextBMFontTest">
<UniqueIdentifier>{0e0f4844-37a2-43a1-9aee-36a266512419}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UITextFieldTest">
<UniqueIdentifier>{ce89f8b8-161a-4a95-9e2a-c42bccc24722}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UITextTest">
<UniqueIdentifier>{f52cefac-d258-4e9e-b1f1-ddb17b7cd9ac}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\UITest\CocosStudioGUITest\UIWidgetAddNodeTest">
<UniqueIdentifier>{085acc82-08d1-46c1-affe-74af030ce284}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
@ -636,42 +642,6 @@
<ClCompile Include="..\..\Classes\PhysicsTest\PhysicsTest.cpp">
<Filter>Classes\PhysicsTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest\UIButtonTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest\UIListViewTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CocosGUIScene.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScene.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISceneManager.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\KeyboardTest\KeyboardTest.cpp">
<Filter>Classes\KeyboardTest</Filter>
</ClCompile>
@ -684,12 +654,6 @@
<ClCompile Include="..\..\Classes\NewRendererTest\NewRendererTest.cpp">
<Filter>Classes\NewRendererTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest\UILayoutTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UnitTest\UnitTest.cpp">
<Filter>Classes\UnitTest</Filter>
</ClCompile>
@ -717,96 +681,6 @@
<ClCompile Include="..\..\Classes\PerformanceTest\PerformanceScenarioTest.cpp">
<Filter>Classes\PerformanceTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CocoStudioGUITest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomGUIScene.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\GUIEditorTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScene_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISceneManager_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest\UIButtonTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextTest\UITextTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextTest\UITextTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest\UILayoutTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest\UIListViewTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest_Editor.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomImageTest\CustomImageTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomImageTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomImageView.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomImageViewReader.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomReader.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIRichTextTest\UIRichTextTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIRichTextTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomParticleWidget.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomParticleWidgetReader.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomParticleWidgetTest\CustomParticleWidgetTest.cpp">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomParticleWidgetTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\ShaderTest\ShaderTest2.cpp">
<Filter>Classes\ShaderTest</Filter>
</ClCompile>
@ -837,6 +711,144 @@
<ClCompile Include="..\..\Classes\UnitTest\RefPtrTest.cpp">
<Filter>Classes\UnitTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\UITest.cpp">
<Filter>Classes\UITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomTest\CustomImageTest\CustomImageTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\CustomTest\CustomImageTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomTest\CustomParticleWidgetTest\CustomParticleWidgetTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\CustomTest\CustomParticleWidgetTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomImageView.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\CustomWidget</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomImageViewReader.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\CustomWidget</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomParticleWidget.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\CustomWidget</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomParticleWidgetReader.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\CustomWidget</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomReader.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\CustomWidget</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIButtonTest\UIButtonTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIButtonTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIButtonTest\UIButtonTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIButtonTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UICheckBoxTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UICheckBoxTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIFocusTest\UIFocusTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIFocusTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIImageViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIImageViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UILayoutTest\UILayoutTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UILayoutTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UILayoutTest\UILayoutTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UILayoutTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIListViewTest\UIListViewTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIListViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIListViewTest\UIListViewTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIListViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UILoadingBarTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UILoadingBarTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIPageViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIPageViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIRichTextTest\UIRichTextTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIRichTextTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIScrollViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIScrollViewTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UISliderTest\UISliderTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UISliderTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UISliderTest\UISliderTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UISliderTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UITextAtlasTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UITextAtlasTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UITextBMFontTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UITextBMFontTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UITextFieldTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UITextFieldTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextTest\UITextTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UITextTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UITextTest\UITextTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UITextTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIWidgetAddNodeTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest\UIWidgetAddNodeTest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CocosGUIScene.cpp">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CocoStudioGUITest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\CustomGUIScene.cpp">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\GUIEditorTest.cpp">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIScene.cpp">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UIScene_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UISceneManager.cpp">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClCompile>
<ClCompile Include="..\..\Classes\UITest\CocoStudioGUITest\UISceneManager_Editor.cpp">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Classes\AppDelegate.h">
@ -1331,42 +1343,6 @@
<ClInclude Include="..\..\Classes\PhysicsTest\PhysicsTest.h">
<Filter>Classes\PhysicsTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest\UIButtonTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest\UIListViewTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CocosGUIScene.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScene.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISceneManager.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\KeyboardTest\KeyboardTest.h">
<Filter>Classes\KeyboardTest</Filter>
</ClInclude>
@ -1394,12 +1370,6 @@
<ClInclude Include="..\..\Classes\NewRendererTest\NewRendererTest.h">
<Filter>Classes\NewRendererTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest\UILayoutTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UnitTest\UnitTest.h">
<Filter>Classes\UnitTest</Filter>
</ClInclude>
@ -1433,96 +1403,6 @@
<ClInclude Include="..\..\Classes\PerformanceTest\PerformanceScenarioTest.h">
<Filter>Classes\PerformanceTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CocoStudioGUITest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomGUIScene.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\GUIEditorTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScene_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISceneManager_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest\UIButtonTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextTest\UITextTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextTest\UITextTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextBMFontTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextAtlasTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest\UILayoutTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest\UIListViewTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest_Editor.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomImageTest\CustomImageTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomImageTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomImageView.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomImageViewReader.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomReader.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\UIRichTextTest\UIRichTextTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIRichTextTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomParticleWidget.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget\CustomParticleWidgetReader.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomWidget</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomParticleWidgetTest\CustomParticleWidgetTest.h">
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\CustomTest\CustomParticleWidgetTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\ShaderTest\ShaderTest2.h">
<Filter>Classes\ShaderTest</Filter>
</ClInclude>
@ -1551,6 +1431,144 @@
<ClInclude Include="..\..\Classes\UnitTest\RefPtrTest.h">
<Filter>Classes\UnitTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\UITest.h">
<Filter>Classes\UITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomTest\CustomImageTest\CustomImageTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\CustomTest\CustomImageTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomTest\CustomParticleWidgetTest\CustomParticleWidgetTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\CustomTest\CustomParticleWidgetTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomImageView.h">
<Filter>Classes\UITest\CocosStudioGUITest\CustomWidget</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomImageViewReader.h">
<Filter>Classes\UITest\CocosStudioGUITest\CustomWidget</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomParticleWidget.h">
<Filter>Classes\UITest\CocosStudioGUITest\CustomWidget</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomParticleWidgetReader.h">
<Filter>Classes\UITest\CocosStudioGUITest\CustomWidget</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomWidget\CustomReader.h">
<Filter>Classes\UITest\CocosStudioGUITest\CustomWidget</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIButtonTest\UIButtonTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIButtonTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIButtonTest\UIButtonTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIButtonTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UICheckBoxTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UICheckBoxTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIFocusTest\UIFocusTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIFocusTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIImageViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIImageViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UILayoutTest\UILayoutTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UILayoutTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UILayoutTest\UILayoutTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UILayoutTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIListViewTest\UIListViewTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIListViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIListViewTest\UIListViewTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIListViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UILoadingBarTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UILoadingBarTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIPageViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIPageViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIRichTextTest\UIRichTextTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIRichTextTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIScrollViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIScrollViewTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UISliderTest\UISliderTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UISliderTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UISliderTest\UISliderTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UISliderTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UITextAtlasTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextAtlasTest\UITextAtlasTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UITextAtlasTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UITextBMFontTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextBMFontTest\UITextBMFontTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UITextBMFontTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UITextFieldTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UITextFieldTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextTest\UITextTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UITextTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UITextTest\UITextTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UITextTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIWidgetAddNodeTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest\UIWidgetAddNodeTest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CocosGUIScene.h">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CocoStudioGUITest.h">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\CustomGUIScene.h">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\GUIEditorTest.h">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIScene.h">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UIScene_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UISceneManager.h">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClInclude>
<ClInclude Include="..\..\Classes\UITest\CocoStudioGUITest\UISceneManager_Editor.h">
<Filter>Classes\UITest\CocosStudioGUITest</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\..\external\curl\prebuilt\wp8\arm\libcurl.dll" />

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\..</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\..</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\..</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\..</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

@ -1 +1 @@
Subproject commit 4dbfa174debb2e98422510d7e0490b1ddb2a0b3d
Subproject commit 7876808788c0666d5f4510ea214e97e10eeaa9a8