Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
东方怂天
Quick-Cocos2dx-Community
提交
4333961b
Q
Quick-Cocos2dx-Community
项目概览
东方怂天
/
Quick-Cocos2dx-Community
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
Quick-Cocos2dx-Community
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4333961b
编写于
12月 19, 2018
作者:
U
u0u0
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
VideoPlayer 改进,tolua_pushcppstring(x,y) 改进。
上级
5c145330
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
207 addition
and
84 deletion
+207
-84
cocos/2d/CCClippingRectangleNode.cpp
cocos/2d/CCClippingRectangleNode.cpp
+2
-2
cocos/ui/UIVideoPlayer-android.cpp
cocos/ui/UIVideoPlayer-android.cpp
+27
-23
cocos/ui/UIVideoPlayer-ios.mm
cocos/ui/UIVideoPlayer-ios.mm
+60
-41
cocos/ui/UIVideoPlayer.h
cocos/ui/UIVideoPlayer.h
+109
-9
external/lua/tolua/tolua++.h
external/lua/tolua/tolua++.h
+1
-1
quick/lib/quick-src/extra/luabinding/cocos2dx_extra_luabinding.cpp
.../quick-src/extra/luabinding/cocos2dx_extra_luabinding.cpp
+8
-8
未找到文件。
cocos/2d/CCClippingRectangleNode.cpp
浏览文件 @
4333961b
...
...
@@ -35,8 +35,8 @@ void ClippingRectangleNode::onBeforeVisitScissor()
float
py
=
pos1
.
y
;
float
width
=
pos2
.
x
-
pos1
.
x
;
float
height
=
pos2
.
y
-
pos1
.
y
;
assert
(
width
>
0
,
"ClippingRectangle should not be rotated"
);
assert
(
height
>
0
,
"ClippingRectangle should not be rotated"
);
assert
(
width
>
0
);
//ClippingRectangle should not be rotated
assert
(
height
>
0
);
//ClippingRectangle should not be rotated
// record old ClipRegion
GLView
*
glView
=
Director
::
getInstance
()
->
getOpenGLView
();
...
...
cocos/ui/UIVideoPlayer-android.cpp
浏览文件 @
4333961b
...
...
@@ -32,6 +32,8 @@
#include "jni/JniHelper.h"
#include "base/CCDirector.h"
#include "base/CCEventListenerKeyboard.h"
#include "platform/CCFileUtils.h"
#include "ui/UIHelper.h"
//-----------------------------------------------------------------------------------------------------------
#define CLASS_NAME "org/cocos2dx/lib/Cocos2dxVideoHelper"
...
...
@@ -170,18 +172,18 @@ using namespace cocos2d::experimental::ui;
static
std
::
unordered_map
<
int
,
VideoPlayer
*>
s_allVideoPlayers
;
VideoPlayer
::
VideoPlayer
()
:
_videoPlayerIndex
(
-
1
)
,
_eventCallback
(
nullptr
)
:
_fullScreenDirty
(
false
)
,
_fullScreenEnabled
(
false
)
,
_fullScreenDirty
(
false
)
,
_keepAspectRatioEnabled
(
false
)
,
_videoPlayerIndex
(
-
1
)
,
_eventCallback
(
nullptr
)
{
_videoPlayerIndex
=
createVideoWidgetJNI
();
s_allVideoPlayers
[
_videoPlayerIndex
]
=
this
;
#if CC_VIDEOPLAYER_DEBUG_DRAW
_debugDrawNode
=
DrawNode
::
create
();
add
c
hild
(
_debugDrawNode
);
add
C
hild
(
_debugDrawNode
);
#endif
}
...
...
@@ -193,7 +195,7 @@ VideoPlayer::~VideoPlayer()
void
VideoPlayer
::
setFileName
(
const
std
::
string
&
fileName
)
{
_videoURL
=
fileName
;
_videoURL
=
FileUtils
::
getInstance
()
->
fullPathForFilename
(
fileName
)
;
_videoSource
=
VideoPlayer
::
Source
::
FILENAME
;
setVideoURLJNI
(
_videoPlayerIndex
,
(
int
)
Source
::
FILENAME
,
_videoURL
);
}
...
...
@@ -211,21 +213,8 @@ void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, uint32_t flags
if
(
flags
&
FLAGS_TRANSFORM_DIRTY
)
{
auto
directorInstance
=
Director
::
getInstance
();
auto
glView
=
directorInstance
->
getOpenGLView
();
auto
frameSize
=
glView
->
getFrameSize
();
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
());
auto
uiRect
=
cocos2d
::
ui
::
Helper
::
convertBoundingBoxToScreen
(
this
);
setVideoRectJNI
(
_videoPlayerIndex
,
uiRect
.
origin
.
x
,
uiRect
.
origin
.
y
,
uiRect
.
size
.
width
,
uiRect
.
size
.
height
);
}
#if CC_VIDEOPLAYER_DEBUG_DRAW
...
...
@@ -271,7 +260,7 @@ void VideoPlayer::setKeepAspectRatioEnabled(bool enable)
void
VideoPlayer
::
drawDebugData
()
{
Director
*
director
=
Director
::
getInstance
();
CCASSERT
(
nullptr
!=
director
,
"Director is null when seting matrix stack"
);
CCASSERT
(
nullptr
!=
director
,
"Director is null when set
t
ing matrix stack"
);
director
->
pushMatrix
(
MATRIX_STACK_TYPE
::
MATRIX_STACK_MODELVIEW
);
director
->
loadMatrix
(
MATRIX_STACK_TYPE
::
MATRIX_STACK_MODELVIEW
,
_modelViewTransform
);
...
...
@@ -341,10 +330,25 @@ void VideoPlayer::setVisible(bool visible)
{
cocos2d
::
ui
::
Widget
::
setVisible
(
visible
);
if
(
!
_videoURL
.
empty
())
if
(
!
visible
||
isRunning
())
{
setVideoVisible
(
_videoPlayerIndex
,
visible
);
}
}
}
void
VideoPlayer
::
onEnter
()
{
Widget
::
onEnter
();
if
(
isVisible
()
&&
!
_videoURL
.
empty
())
{
setVideoVisible
(
_videoPlayerIndex
,
true
);
}
}
void
VideoPlayer
::
onExit
()
{
Widget
::
onExit
();
setVideoVisible
(
_videoPlayerIndex
,
false
);
}
void
VideoPlayer
::
addEventListener
(
const
VideoPlayer
::
ccVideoPlayerCallback
&
callback
)
...
...
cocos/ui/UIVideoPlayer-ios.mm
浏览文件 @
4333961b
...
...
@@ -45,17 +45,16 @@ using namespace cocos2d::experimental::ui;
-
(
void
)
resume
;
-
(
void
)
stop
;
-
(
void
)
seekTo
:(
float
)
sec
;
-
(
void
)
setVisible
:(
bool
)
visible
;
-
(
void
)
setKeepRatioEnabled
:(
bool
)
enabled
;
-
(
void
)
setFullScreenEnabled
:(
bool
)
enabled
;
-
(
bool
)
isFullScreenEnabled
;
-
(
void
)
setVisible
:(
BOOL
)
visible
;
-
(
void
)
setKeepRatioEnabled
:(
BOOL
)
enabled
;
-
(
void
)
setFullScreenEnabled
:(
BOOL
)
enabled
;
-
(
BOOL
)
isFullScreenEnabled
;
-
(
id
)
init
:(
void
*
)
videoPlayer
;
-
(
void
)
videoFinished
:(
NSNotification
*
)
notification
;
-
(
void
)
playStateChange
;
+
(
NSString
*
)
fullPathFromRelativePath
:(
NSString
*
)
relPath
;
@end
...
...
@@ -66,7 +65,7 @@ using namespace cocos2d::experimental::ui;
int
_width
;
int
_height
;
bool
_keepRatioEnabled
;
VideoPlayer
*
_videoPlayer
;
}
...
...
@@ -77,7 +76,7 @@ using namespace cocos2d::experimental::ui;
_videoPlayer
=
(
VideoPlayer
*
)
videoPlayer
;
_keepRatioEnabled
=
false
;
}
return
self
;
}
...
...
@@ -86,7 +85,7 @@ using namespace cocos2d::experimental::ui;
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
;
...
...
@@ -106,19 +105,19 @@ using namespace cocos2d::experimental::ui;
}
}
-
(
void
)
setFullScreenEnabled
:(
bool
)
enabled
-
(
void
)
setFullScreenEnabled
:(
BOOL
)
enabled
{
if
(
self
.
moviePlayer
!=
nullptr
)
{
[
self
.
moviePlayer
setFullscreen
:
enabled
animated
:(
true
)];
}
}
-
(
bool
)
isFullScreenEnabled
-
(
BOOL
)
isFullScreenEnabled
{
if
(
self
.
moviePlayer
!=
nullptr
)
{
return
[
self
.
moviePlayer
isFullscreen
];
}
return
false
;
}
...
...
@@ -127,41 +126,41 @@ using namespace cocos2d::experimental::ui;
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
]
init
WithContentURL
:[
NSURL
URLWithString
:
@
(
videoUrl
.
c_str
())]
]
autorelease
];
self
.
moviePlayer
=
[[[
MPMoviePlayerController
alloc
]
init
]
autorelease
];
self
.
moviePlayer
.
movieSourceType
=
MPMovieSourceTypeStreaming
;
[
self
.
moviePlayer
setContentURL
:[
NSURL
URLWithString
:
@
(
videoUrl
.
c_str
())]];
}
else
{
NSString
*
path
=
[
UIVideoViewWrapperIos
fullPathFromRelativePath
:
@
(
videoUrl
.
c_str
())];
self
.
moviePlayer
=
[[[
MPMoviePlayerController
alloc
]
initWithContentURL
:[
NSURL
fileURLWithPath
:
path
]]
autorelease
];
self
.
moviePlayer
=
[[[
MPMoviePlayerController
alloc
]
initWithContentURL
:[
NSURL
fileURLWithPath
:
@
(
videoUrl
.
c_str
())]]
autorelease
];
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
];
}
...
...
@@ -170,6 +169,11 @@ using namespace cocos2d::experimental::ui;
{
if
(
_videoPlayer
!=
nullptr
)
{
//fix : ios 11.3 sends wrong notificaiton, ignore it
if
([
self
.
moviePlayer
playbackState
]
==
MPMoviePlaybackStatePlaying
)
{
return
;
}
if
([
self
.
moviePlayer
playbackState
]
!=
MPMoviePlaybackStateStopped
)
{
_videoPlayer
->
onPlayEvent
((
int
)
VideoPlayer
::
EventType
::
COMPLETED
);
...
...
@@ -208,14 +212,14 @@ using namespace cocos2d::experimental::ui;
}
}
-
(
void
)
setVisible
:(
bool
)
visible
-
(
void
)
setVisible
:(
BOOL
)
visible
{
if
(
self
.
moviePlayer
!=
NULL
)
{
[
self
.
moviePlayer
.
view
setHidden
:
!
visible
];
}
}
-
(
void
)
setKeepRatioEnabled
:(
bool
)
enabled
-
(
void
)
setKeepRatioEnabled
:(
BOOL
)
enabled
{
_keepRatioEnabled
=
enabled
;
if
(
self
.
moviePlayer
!=
NULL
)
{
...
...
@@ -259,20 +263,16 @@ using namespace cocos2d::experimental::ui;
}
}
+
(
NSString
*
)
fullPathFromRelativePath
:(
NSString
*
)
relPath
{
return
[
NSString
stringWithCString
:
cocos2d
:
:
FileUtils
::
getInstance
()
->
fullPathForFilename
(
std
::
string
([
relPath
UTF8String
])).
c_str
()
encoding
:
[
NSString
defaultCStringEncoding
]];
}
@end
//------------------------------------------------------------------------------------------------------------
VideoPlayer
::
VideoPlayer
()
:
_videoPlayerIndex
(
-
1
)
,
_eventCallback
(
nullptr
)
,
_fullScreenEnabled
(
false
)
:
_isPlaying
(
false
)
,
_fullScreenDirty
(
false
)
,
_fullScreenEnabled
(
false
)
,
_keepAspectRatioEnabled
(
false
)
,
_isPlaying
(
false
)
,
_videoPlayerIndex
(
-
1
)
,
_eventCallback
(
nullptr
)
{
_videoView
=
[[
UIVideoViewWrapperIos
alloc
]
init
:
this
];
...
...
@@ -292,7 +292,7 @@ VideoPlayer::~VideoPlayer()
void
VideoPlayer
::
setFileName
(
const
std
::
string
&
fileName
)
{
_videoURL
=
fileName
;
_videoURL
=
FileUtils
::
getInstance
()
->
fullPathForFilename
(
fileName
)
;
_videoSource
=
VideoPlayer
::
Source
::
FILENAME
;
[((
UIVideoViewWrapperIos
*
)
_videoView
)
setURL
:(
int
)
_videoSource
:
_videoURL
];
}
...
...
@@ -307,27 +307,27 @@ void VideoPlayer::setURL(const std::string& videoUrl)
void
VideoPlayer
::
draw
(
Renderer
*
renderer
,
const
Mat4
&
transform
,
uint32_t
flags
)
{
cocos2d
::
ui
::
Widget
::
draw
(
renderer
,
transform
,
flags
);
if
(
flags
&
FLAGS_TRANSFORM_DIRTY
)
{
auto
directorInstance
=
Director
::
getInstance
();
auto
glView
=
directorInstance
->
getOpenGLView
();
auto
frameSize
=
glView
->
getFrameSize
();
auto
scaleFactor
=
[
static_cast
<
CCEAGLView
*>
(
glView
->
getEAGLView
())
contentScaleFactor
];
auto
winSize
=
directorInstance
->
getWinSize
();
auto
leftBottom
=
convertToWorldSpace
(
Vec2
::
ZERO
);
auto
rightTop
=
convertToWorldSpace
(
Vec2
(
_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
*
)
_videoView
)
setFrame
:
uiLeft
:
uiTop
:
(
rightTop
.
x
-
leftBottom
.
x
)
*
glView
->
getScaleX
()
/
scaleFactor
:
(
(
rightTop
.
y
-
leftBottom
.
y
)
*
glView
->
getScaleY
()
/
scaleFactor
)];
}
#if CC_VIDEOPLAYER_DEBUG_DRAW
_debugDrawNode
->
clear
();
auto
size
=
getContentSize
();
...
...
@@ -409,13 +409,32 @@ bool VideoPlayer::isPlaying() const
void
VideoPlayer
::
setVisible
(
bool
visible
)
{
cocos2d
::
ui
::
Widget
::
setVisible
(
visible
);
if
(
!
_videoURL
.
empty
())
if
(
!
visible
)
{
[((
UIVideoViewWrapperIos
*
)
_videoView
)
setVisible
:
NO
];
}
else
if
(
isRunning
())
{
[((
UIVideoViewWrapperIos
*
)
_videoView
)
setVisible
:
visible
];
[((
UIVideoViewWrapperIos
*
)
_videoView
)
setVisible
:
YES
];
}
}
void
VideoPlayer
::
onEnter
()
{
Widget
::
onEnter
();
if
(
isVisible
())
{
[((
UIVideoViewWrapperIos
*
)
_videoView
)
setVisible
:
YES
];
}
}
void
VideoPlayer
::
onExit
()
{
Widget
::
onExit
();
[((
UIVideoViewWrapperIos
*
)
_videoView
)
setVisible
:
NO
];
}
void
VideoPlayer
::
addEventListener
(
const
VideoPlayer
::
ccVideoPlayerCallback
&
callback
)
{
_eventCallback
=
callback
;
...
...
@@ -428,7 +447,7 @@ void VideoPlayer::onPlayEvent(int event)
}
else
{
_isPlaying
=
false
;
}
if
(
_eventCallback
)
{
_eventCallback
(
this
,
(
VideoPlayer
::
EventType
)
event
);
...
...
cocos/ui/UIVideoPlayer.h
浏览文件 @
4333961b
...
...
@@ -29,13 +29,29 @@
#include "ui/UIWidget.h"
/**
* @addtogroup ui
* @{
*/
NS_CC_BEGIN
namespace
experimental
{
namespace
ui
{
/**
* @class VideoPlayer
* @brief Displays a video file.
*
* @note VideoPlayer displays a video file base on system widget.
* It's mean VideoPlayer displays a video file above all graphical elements of cocos2d-x.
* @js NA
*/
class
VideoPlayer
:
public
cocos2d
::
ui
::
Widget
{
public:
/**
* Videoplayer play event type.
*/
enum
class
EventType
{
PLAYING
=
0
,
...
...
@@ -43,38 +59,121 @@ namespace experimental{
STOPPED
,
COMPLETED
};
/**
* A callback which will be called after specific VideoPlayer event happens.
*/
typedef
std
::
function
<
void
(
Ref
*
,
VideoPlayer
::
EventType
)
>
ccVideoPlayerCallback
;
/**
*Static create method for instancing a VideoPlayer.
*/
CREATE_FUNC
(
VideoPlayer
);
//Sets local file[support assets' file on android] as a video source for VideoPlayer
/**
* Sets a file path as a video source for VideoPlayer.
*/
virtual
void
setFileName
(
const
std
::
string
&
videoPath
);
/**
* @brief Get the local video file name.
*
* @return The video file name.
*/
virtual
const
std
::
string
&
getFileName
()
const
{
return
_videoURL
;}
//Sets network link as a video source for VideoPlayer
/**
* Sets a URL as a video source for VideoPlayer.
*/
virtual
void
setURL
(
const
std
::
string
&
_videoURL
);
/**
* @brief Get the URL of remoting video source.
*
* @return A remoting URL address.
*/
virtual
const
std
::
string
&
getURL
()
const
{
return
_videoURL
;}
/**
* Starts playback.
*/
virtual
void
play
();
virtual
void
pause
()
override
;
virtual
void
resume
()
override
;
/**
* Pauses playback.
*/
virtual
void
pause
()
override
;
/**
* Resumes playback.
*/
virtual
void
resume
()
override
;
/**
* Stops playback.
*/
virtual
void
stop
();
/**
* Seeks to specified time position.
*
* @param sec The offset in seconds from the start to seek to.
*/
virtual
void
seekTo
(
float
sec
);
virtual
bool
isPlaying
()
const
;
virtual
void
setVisible
(
bool
visible
)
override
;
/**
* Checks whether the VideoPlayer is playing.
*
* @return True if currently playing, false otherwise.
*/
virtual
bool
isPlaying
()
const
;
/**
* Causes the video player to keep aspect ratio or no when displaying the video.
*
* @param enable Specify true to keep aspect ratio or false to scale the video until
* both dimensions fit the visible bounds of the view exactly.
*/
virtual
void
setKeepAspectRatioEnabled
(
bool
enable
);
/**
* Indicates whether the video player keep aspect ratio when displaying the video.
*/
virtual
bool
isKeepAspectRatioEnabled
()
const
{
return
_keepAspectRatioEnabled
;}
virtual
void
setFullScreenEnabled
(
bool
enabled
);
/**
* Causes the video player to enter or exit full-screen mode.
*
* @param fullscreen Specify true to enter full-screen mode or false to exit full-screen mode.
*/
virtual
void
setFullScreenEnabled
(
bool
fullscreen
);
/**
* Indicates whether the video player is in full-screen mode.
*
* @return True if the video player is in full-screen mode, false otherwise.
*/
virtual
bool
isFullScreenEnabled
()
const
;
/**
* Register a callback to be invoked when the video state is updated.
*
* @param callback The callback that will be run.
*/
virtual
void
addEventListener
(
const
VideoPlayer
::
ccVideoPlayerCallback
&
callback
);
/**
* @brief A function which will be called when video is playing.
*
* @param event @see VideoPlayer::EventType.
*/
virtual
void
onPlayEvent
(
int
event
);
virtual
void
setVisible
(
bool
visible
)
override
;
virtual
void
draw
(
Renderer
*
renderer
,
const
Mat4
&
transform
,
uint32_t
flags
)
override
;
virtual
void
onEnter
()
override
;
virtual
void
onExit
()
override
;
protected:
virtual
cocos2d
::
ui
::
Widget
*
createCloneInstance
()
override
;
...
...
@@ -112,6 +211,7 @@ namespace experimental{
}
NS_CC_END
// end group
/// @}
#endif
#endif
external/lua/tolua/tolua++.h
浏览文件 @
4333961b
...
...
@@ -26,7 +26,7 @@
extern
"C"
{
#endif
#define tolua_pushcppstring(x,y)
tolua_pushstring(x,y.c_str
())
#define tolua_pushcppstring(x,y)
lua_pushlstring(x, y.c_str(), y.length
())
#define tolua_iscppstring tolua_isstring
#define tolua_iscppstringarray tolua_isstringarray
...
...
quick/lib/quick-src/extra/luabinding/cocos2dx_extra_luabinding.cpp
浏览文件 @
4333961b
...
...
@@ -522,7 +522,7 @@ static int tolua_cocos2dx_extra_luabinding_Native_getOpenUDID00(lua_State* tolua
{
{
string
tolua_ret
=
(
string
)
Native
::
getOpenUDID
();
tolua_pushcppstring
(
tolua_S
,
(
const
char
*
)
tolua_ret
);
tolua_pushcppstring
(
tolua_S
,
tolua_ret
);
}
}
return
1
;
...
...
@@ -585,7 +585,7 @@ static int tolua_cocos2dx_extra_luabinding_Native_getInputText00(lua_State* tolu
const
char
*
defaultValue
=
((
const
char
*
)
tolua_tostring
(
tolua_S
,
4
,
0
));
{
string
tolua_ret
=
(
string
)
Native
::
getInputText
(
title
,
message
,
defaultValue
);
tolua_pushcppstring
(
tolua_S
,
(
const
char
*
)
tolua_ret
);
tolua_pushcppstring
(
tolua_S
,
tolua_ret
);
}
}
return
1
;
...
...
@@ -613,7 +613,7 @@ static int tolua_cocos2dx_extra_luabinding_Native_getDeviceName00(lua_State* tol
{
{
const
string
tolua_ret
=
(
const
string
)
Native
::
getDeviceName
();
tolua_pushcppstring
(
tolua_S
,
(
const
char
*
)
tolua_ret
);
tolua_pushcppstring
(
tolua_S
,
tolua_ret
);
}
}
return
1
;
...
...
@@ -739,7 +739,7 @@ static int tolua_cocos2dx_extra_luabinding_HTTPRequest_getRequestUrl00(lua_State
#endif
{
string
tolua_ret
=
(
string
)
self
->
getRequestUrl
();
tolua_pushcppstring
(
tolua_S
,
(
const
char
*
)
tolua_ret
);
tolua_pushcppstring
(
tolua_S
,
tolua_ret
);
}
}
return
1
;
...
...
@@ -979,7 +979,7 @@ static int tolua_cocos2dx_extra_luabinding_HTTPRequest_getCookieString00(lua_Sta
#endif
{
string
tolua_ret
=
(
string
)
self
->
getCookieString
();
tolua_pushcppstring
(
tolua_S
,
(
const
char
*
)
tolua_ret
);
tolua_pushcppstring
(
tolua_S
,
tolua_ret
);
}
}
return
1
;
...
...
@@ -1204,7 +1204,7 @@ static int tolua_cocos2dx_extra_luabinding_HTTPRequest_getResponseHeadersString0
#endif
{
string
tolua_ret
=
(
string
)
self
->
getResponseHeadersString
();
tolua_pushcppstring
(
tolua_S
,
(
const
char
*
)
tolua_ret
);
tolua_pushcppstring
(
tolua_S
,
tolua_ret
);
}
}
return
1
;
...
...
@@ -1236,7 +1236,7 @@ static int tolua_cocos2dx_extra_luabinding_HTTPRequest_getResponseString00(lua_S
#endif
{
string
tolua_ret
=
(
string
)
self
->
getResponseString
();
tolua_pushcppstring
(
tolua_S
,
(
const
char
*
)
tolua_ret
);
tolua_pushcppstring
(
tolua_S
,
tolua_ret
);
}
}
return
1
;
...
...
@@ -1398,7 +1398,7 @@ static int tolua_cocos2dx_extra_luabinding_HTTPRequest_getErrorMessage00(lua_Sta
#endif
{
string
tolua_ret
=
(
string
)
self
->
getErrorMessage
();
tolua_pushcppstring
(
tolua_S
,
(
const
char
*
)
tolua_ret
);
tolua_pushcppstring
(
tolua_S
,
tolua_ret
);
}
}
return
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录