From dada2eb2449cd8384a8610ff868d6668cc37e705 Mon Sep 17 00:00:00 2001 From: leda Date: Thu, 18 Oct 2018 13:34:12 +0800 Subject: [PATCH] move "cocos2d::experimental::" to "cocos2d::" on Audio (#1549) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove “experimental” in audio dir * update audio bindings * fix "{" match error * no need "experimental" for thread pool * remove both out-of-date js api files --- native/cocos/audio/AudioEngine.cpp | 1 - native/cocos/audio/android/AssetFd.cpp | 4 +- native/cocos/audio/android/AssetFd.h | 4 +- .../cocos/audio/android/AudioBufferProvider.h | 4 +- native/cocos/audio/android/AudioDecoder.cpp | 4 +- native/cocos/audio/android/AudioDecoder.h | 4 +- .../cocos/audio/android/AudioDecoderMp3.cpp | 4 +- native/cocos/audio/android/AudioDecoderMp3.h | 4 +- .../cocos/audio/android/AudioDecoderOgg.cpp | 4 +- native/cocos/audio/android/AudioDecoderOgg.h | 4 +- .../audio/android/AudioDecoderProvider.cpp | 4 +- .../audio/android/AudioDecoderProvider.h | 4 +- .../cocos/audio/android/AudioDecoderSLES.cpp | 4 +- native/cocos/audio/android/AudioDecoderSLES.h | 4 +- .../cocos/audio/android/AudioDecoderWav.cpp | 4 +- native/cocos/audio/android/AudioDecoderWav.h | 4 +- .../cocos/audio/android/AudioEngine-inl.cpp | 1 - native/cocos/audio/android/AudioEngine-inl.h | 3 - native/cocos/audio/android/AudioMixer.cpp | 4 +- native/cocos/audio/android/AudioMixer.h | 4 +- .../audio/android/AudioMixerController.cpp | 4 +- .../audio/android/AudioMixerController.h | 4 +- native/cocos/audio/android/AudioMixerOps.h | 4 +- .../audio/android/AudioPlayerProvider.cpp | 4 +- .../cocos/audio/android/AudioPlayerProvider.h | 4 +- native/cocos/audio/android/AudioResampler.cpp | 4 +- native/cocos/audio/android/AudioResampler.h | 4 +- .../audio/android/AudioResamplerCubic.cpp | 4 +- .../cocos/audio/android/AudioResamplerCubic.h | 4 +- .../audio/android/AudioResamplerPublic.h | 4 +- native/cocos/audio/android/IAudioPlayer.h | 4 +- .../cocos/audio/android/ICallerThreadUtils.h | 4 +- native/cocos/audio/android/IVolumeProvider.h | 4 +- native/cocos/audio/android/PcmAudioPlayer.cpp | 4 +- native/cocos/audio/android/PcmAudioPlayer.h | 4 +- .../cocos/audio/android/PcmAudioService.cpp | 4 +- native/cocos/audio/android/PcmAudioService.h | 4 +- .../cocos/audio/android/PcmBufferProvider.cpp | 4 +- .../cocos/audio/android/PcmBufferProvider.h | 4 +- native/cocos/audio/android/PcmData.cpp | 4 +- native/cocos/audio/android/PcmData.h | 4 +- native/cocos/audio/android/Track.cpp | 4 +- native/cocos/audio/android/Track.h | 4 +- native/cocos/audio/android/UrlAudioPlayer.cpp | 6 +- native/cocos/audio/android/UrlAudioPlayer.h | 4 +- native/cocos/audio/android/utils/Errors.h | 4 +- native/cocos/audio/android/utils/Utils.cpp | 4 +- native/cocos/audio/android/utils/Utils.h | 4 +- native/cocos/audio/apple/AudioCache.h | 3 - native/cocos/audio/apple/AudioCache.mm | 1 - native/cocos/audio/apple/AudioDecoder.h | 4 +- native/cocos/audio/apple/AudioDecoder.mm | 4 +- native/cocos/audio/apple/AudioEngine-inl.h | 2 - native/cocos/audio/apple/AudioEngine-inl.mm | 1 - native/cocos/audio/apple/AudioPlayer.h | 3 - native/cocos/audio/apple/AudioPlayer.mm | 1 - native/cocos/audio/include/AudioEngine.h | 3 - native/cocos/audio/win32/AudioCache.cpp | 1 - native/cocos/audio/win32/AudioCache.h | 3 - native/cocos/audio/win32/AudioDecoder.cpp | 4 +- native/cocos/audio/win32/AudioDecoder.h | 4 +- .../cocos/audio/win32/AudioDecoderManager.cpp | 4 +- .../cocos/audio/win32/AudioDecoderManager.h | 4 +- native/cocos/audio/win32/AudioDecoderMp3.cpp | 4 +- native/cocos/audio/win32/AudioDecoderMp3.h | 4 +- native/cocos/audio/win32/AudioDecoderOgg.cpp | 4 +- native/cocos/audio/win32/AudioDecoderOgg.h | 4 +- .../cocos/audio/win32/AudioEngine-win32.cpp | 1 - native/cocos/audio/win32/AudioEngine-win32.h | 2 - native/cocos/audio/win32/AudioPlayer.cpp | 1 - native/cocos/audio/win32/AudioPlayer.h | 2 - native/cocos/base/CCThreadPool.cpp | 4 +- native/cocos/base/CCThreadPool.h | 4 +- .../android/CCApplication-android.cpp | 12 +- .../cocos/platform/ios/CCApplication-ios.mm | 7 +- .../cocos/platform/mac/CCApplication-mac.mm | 7 +- .../platform/win32/CCApplication-win32.cpp | 8 +- .../api/jsb_cocos2dx_audioengine_auto_api.js | 12 +- ...sb_cocos2dx_experimental_video_auto_api.js | 196 -------------- ..._cocos2dx_experimental_webView_auto_api.js | 250 ------------------ .../auto/jsb_cocos2dx_audioengine_auto.cpp | 122 ++++----- .../auto/jsb_cocos2dx_audioengine_auto.hpp | 12 +- .../manual/jsb_cocos2dx_extension_manual.cpp | 1 - .../js-bindings/manual/jsb_global.cpp | 53 ++-- 84 files changed, 232 insertions(+), 707 deletions(-) delete mode 100644 native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_video_auto_api.js delete mode 100644 native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_webView_auto_api.js diff --git a/native/cocos/audio/AudioEngine.cpp b/native/cocos/audio/AudioEngine.cpp index 1f435f3814..6dd717c8d0 100644 --- a/native/cocos/audio/AudioEngine.cpp +++ b/native/cocos/audio/AudioEngine.cpp @@ -55,7 +55,6 @@ #endif // ERROR using namespace cocos2d; -using namespace cocos2d::experimental; const int AudioEngine::INVALID_AUDIO_ID = -1; const float AudioEngine::TIME_UNKNOWN = -1.0f; diff --git a/native/cocos/audio/android/AssetFd.cpp b/native/cocos/audio/android/AssetFd.cpp index fc8303142f..fcd9360216 100644 --- a/native/cocos/audio/android/AssetFd.cpp +++ b/native/cocos/audio/android/AssetFd.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #include "audio/android/cutils/log.h" #include "audio/android/AssetFd.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { AssetFd::AssetFd(int assetFd) : _assetFd(assetFd) @@ -45,4 +45,4 @@ AssetFd::~AssetFd() } }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AssetFd.h b/native/cocos/audio/android/AssetFd.h index aedb8c8ac2..7d62ec67f2 100644 --- a/native/cocos/audio/android/AssetFd.h +++ b/native/cocos/audio/android/AssetFd.h @@ -26,7 +26,7 @@ THE SOFTWARE. #include -namespace cocos2d { namespace experimental { +namespace cocos2d { class AssetFd { @@ -39,5 +39,5 @@ private: int _assetFd; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioBufferProvider.h b/native/cocos/audio/android/AudioBufferProvider.h index a3a437936c..c682649c74 100644 --- a/native/cocos/audio/android/AudioBufferProvider.h +++ b/native/cocos/audio/android/AudioBufferProvider.h @@ -20,7 +20,7 @@ #include #include "audio/android/utils/Errors.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { // ---------------------------------------------------------------------------- class AudioBufferProvider @@ -77,4 +77,4 @@ public: }; // ---------------------------------------------------------------------------- -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioDecoder.cpp b/native/cocos/audio/android/AudioDecoder.cpp index 45377dd95a..5a9fec6f68 100644 --- a/native/cocos/audio/android/AudioDecoder.cpp +++ b/native/cocos/audio/android/AudioDecoder.cpp @@ -33,7 +33,7 @@ THE SOFTWARE. #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { size_t AudioDecoder::fileRead(void* ptr, size_t size, size_t nmemb, void* datasource) { @@ -290,4 +290,4 @@ bool AudioDecoder::interleave() return false; } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioDecoder.h b/native/cocos/audio/android/AudioDecoder.h index 46ad515b1f..0e91e5d816 100644 --- a/native/cocos/audio/android/AudioDecoder.h +++ b/native/cocos/audio/android/AudioDecoder.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include "audio/android/PcmData.h" #include "base/CCData.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { class AudioDecoder { @@ -61,4 +61,4 @@ protected: size_t _fileCurrPos; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioDecoderMp3.cpp b/native/cocos/audio/android/AudioDecoderMp3.cpp index 136c562fa7..c1a2f6f675 100644 --- a/native/cocos/audio/android/AudioDecoderMp3.cpp +++ b/native/cocos/audio/android/AudioDecoderMp3.cpp @@ -29,7 +29,7 @@ THE SOFTWARE. #include "audio/android/mp3reader.h" #include "platform/CCFileUtils.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { AudioDecoderMp3::AudioDecoderMp3() { @@ -80,4 +80,4 @@ bool AudioDecoderMp3::decodeToPcm() return false; } -}} // namespace cocos2d { namespace experimental { \ No newline at end of file +} // namespace cocos2d { \ No newline at end of file diff --git a/native/cocos/audio/android/AudioDecoderMp3.h b/native/cocos/audio/android/AudioDecoderMp3.h index 3def5a202d..1f27d07477 100644 --- a/native/cocos/audio/android/AudioDecoderMp3.h +++ b/native/cocos/audio/android/AudioDecoderMp3.h @@ -27,7 +27,7 @@ THE SOFTWARE. #include "audio/android/AudioDecoder.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { class AudioDecoderMp3 : public AudioDecoder { @@ -40,4 +40,4 @@ protected: friend class AudioDecoderProvider; }; -}} // namespace cocos2d { namespace experimental { \ No newline at end of file +} // namespace cocos2d { \ No newline at end of file diff --git a/native/cocos/audio/android/AudioDecoderOgg.cpp b/native/cocos/audio/android/AudioDecoderOgg.cpp index 15f033636b..c19630fd48 100644 --- a/native/cocos/audio/android/AudioDecoderOgg.cpp +++ b/native/cocos/audio/android/AudioDecoderOgg.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #include "audio/android/AudioDecoderOgg.h" #include "platform/CCFileUtils.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { AudioDecoderOgg::AudioDecoderOgg() { @@ -110,4 +110,4 @@ bool AudioDecoderOgg::decodeToPcm() return (curPos > 0); } -}} // namespace cocos2d { namespace experimental { \ No newline at end of file +} // namespace cocos2d { \ No newline at end of file diff --git a/native/cocos/audio/android/AudioDecoderOgg.h b/native/cocos/audio/android/AudioDecoderOgg.h index 52a59dd85a..c528a291ae 100644 --- a/native/cocos/audio/android/AudioDecoderOgg.h +++ b/native/cocos/audio/android/AudioDecoderOgg.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include "tremolo/Tremolo/ivorbisfile.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { class AudioDecoderOgg : public AudioDecoder { @@ -43,4 +43,4 @@ protected: friend class AudioDecoderProvider; }; -}} // namespace cocos2d { namespace experimental { \ No newline at end of file +} // namespace cocos2d { \ No newline at end of file diff --git a/native/cocos/audio/android/AudioDecoderProvider.cpp b/native/cocos/audio/android/AudioDecoderProvider.cpp index f19317689a..11a22e89d5 100644 --- a/native/cocos/audio/android/AudioDecoderProvider.cpp +++ b/native/cocos/audio/android/AudioDecoderProvider.cpp @@ -32,7 +32,7 @@ #include "audio/android/AudioDecoderWav.h" #include "platform/CCFileUtils.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { AudioDecoder* AudioDecoderProvider::createAudioDecoder(SLEngineItf engineItf, const std::string &url, int bufferSizeInFrames, int sampleRate, const FdGetterCallback &fdGetterCallback) { @@ -91,4 +91,4 @@ void AudioDecoderProvider::destroyAudioDecoder(AudioDecoder** decoder) } } -}} // namespace cocos2d { namespace experimental { \ No newline at end of file +} // namespace cocos2d { \ No newline at end of file diff --git a/native/cocos/audio/android/AudioDecoderProvider.h b/native/cocos/audio/android/AudioDecoderProvider.h index 9b2e7e1cb4..1cd7b39ace 100644 --- a/native/cocos/audio/android/AudioDecoderProvider.h +++ b/native/cocos/audio/android/AudioDecoderProvider.h @@ -27,7 +27,7 @@ THE SOFTWARE. #include "audio/android/OpenSLHelper.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { class AudioDecoder; @@ -38,4 +38,4 @@ public: static void destroyAudioDecoder(AudioDecoder** decoder); }; -}} // namespace cocos2d { namespace experimental { \ No newline at end of file +} // namespace cocos2d { \ No newline at end of file diff --git a/native/cocos/audio/android/AudioDecoderSLES.cpp b/native/cocos/audio/android/AudioDecoderSLES.cpp index f7a7df0bfe..c00d958aa5 100644 --- a/native/cocos/audio/android/AudioDecoderSLES.cpp +++ b/native/cocos/audio/android/AudioDecoderSLES.cpp @@ -31,7 +31,7 @@ THE SOFTWARE. #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { /* Explicitly requesting SL_IID_ANDROIDSIMPLEBUFFERQUEUE and SL_IID_PREFETCHSTATUS * on the UrlAudioPlayer object for decoding, SL_IID_METADATAEXTRACTION for retrieving the @@ -646,4 +646,4 @@ void AudioDecoderSLES::decodeToPcmCallback(SLAndroidSimpleBufferQueueItf queueIt queryAudioInfo(); } -}} // namespace cocos2d { namespace experimental { \ No newline at end of file +} // namespace cocos2d { \ No newline at end of file diff --git a/native/cocos/audio/android/AudioDecoderSLES.h b/native/cocos/audio/android/AudioDecoderSLES.h index 30795ab736..1c9c04bd27 100644 --- a/native/cocos/audio/android/AudioDecoderSLES.h +++ b/native/cocos/audio/android/AudioDecoderSLES.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { class AudioDecoderSLES : public AudioDecoder { @@ -94,4 +94,4 @@ private: friend class AudioDecoderProvider; }; -}} // namespace cocos2d { namespace experimental { \ No newline at end of file +} // namespace cocos2d { \ No newline at end of file diff --git a/native/cocos/audio/android/AudioDecoderWav.cpp b/native/cocos/audio/android/AudioDecoderWav.cpp index 285890cb8a..723aeb0ec2 100644 --- a/native/cocos/audio/android/AudioDecoderWav.cpp +++ b/native/cocos/audio/android/AudioDecoderWav.cpp @@ -31,7 +31,7 @@ THE SOFTWARE. #include -namespace cocos2d { namespace experimental { +namespace cocos2d { AudioDecoderWav::AudioDecoderWav() { @@ -112,4 +112,4 @@ bool AudioDecoderWav::decodeToPcm() return ret; } -}} // namespace cocos2d { namespace experimental { \ No newline at end of file +} // namespace cocos2d { \ No newline at end of file diff --git a/native/cocos/audio/android/AudioDecoderWav.h b/native/cocos/audio/android/AudioDecoderWav.h index 41d57e6bf0..c9d64053b9 100644 --- a/native/cocos/audio/android/AudioDecoderWav.h +++ b/native/cocos/audio/android/AudioDecoderWav.h @@ -27,7 +27,7 @@ THE SOFTWARE. #include "audio/android/AudioDecoder.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { class AudioDecoderWav : public AudioDecoder { @@ -44,4 +44,4 @@ protected: friend class AudioDecoderProvider; }; -}} // namespace cocos2d { namespace experimental { \ No newline at end of file +} // namespace cocos2d { \ No newline at end of file diff --git a/native/cocos/audio/android/AudioEngine-inl.cpp b/native/cocos/audio/android/AudioEngine-inl.cpp index 4b83c5071a..29be0c219b 100644 --- a/native/cocos/audio/android/AudioEngine-inl.cpp +++ b/native/cocos/audio/android/AudioEngine-inl.cpp @@ -56,7 +56,6 @@ #include "scripting/js-bindings/event/CustomEventTypes.h" using namespace cocos2d; -using namespace cocos2d::experimental; // Audio focus values synchronized with which in cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java static const int AUDIOFOCUS_GAIN = 0; diff --git a/native/cocos/audio/android/AudioEngine-inl.h b/native/cocos/audio/android/AudioEngine-inl.h index 48c338b704..0b60d360d6 100644 --- a/native/cocos/audio/android/AudioEngine-inl.h +++ b/native/cocos/audio/android/AudioEngine-inl.h @@ -44,8 +44,6 @@ NS_CC_BEGIN struct CustomEvent; -namespace experimental { - class IAudioPlayer; class AudioPlayerProvider; @@ -104,7 +102,6 @@ private: }; #endif // __AUDIO_ENGINE_INL_H_ - } NS_CC_END #endif diff --git a/native/cocos/audio/android/AudioMixer.cpp b/native/cocos/audio/android/AudioMixer.cpp index fc54290210..fc14299dfd 100644 --- a/native/cocos/audio/android/AudioMixer.cpp +++ b/native/cocos/audio/android/AudioMixer.cpp @@ -73,7 +73,7 @@ static const bool kUseFloat = false; // Set to default copy buffer size in frames for input processing. static const size_t kCopyBufferFrameCount = 256; -namespace cocos2d { namespace experimental { +namespace cocos2d { // ---------------------------------------------------------------------------- @@ -2098,4 +2098,4 @@ AudioMixer::process_hook_t AudioMixer::getProcessHook(int processType, uint32_t } // ---------------------------------------------------------------------------- -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioMixer.h b/native/cocos/audio/android/AudioMixer.h index 1393e2816b..26f34dc13c 100644 --- a/native/cocos/audio/android/AudioMixer.h +++ b/native/cocos/audio/android/AudioMixer.h @@ -30,7 +30,7 @@ // IDEA: This is actually unity gain, which might not be max in future, expressed in U.12 #define MAX_GAIN_INT AudioMixer::UNITY_GAIN_INT -namespace cocos2d { namespace experimental { +namespace cocos2d { // ---------------------------------------------------------------------------- @@ -386,4 +386,4 @@ private: }; // ---------------------------------------------------------------------------- -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioMixerController.cpp b/native/cocos/audio/android/AudioMixerController.cpp index a49fb28661..415f281d7a 100644 --- a/native/cocos/audio/android/AudioMixerController.cpp +++ b/native/cocos/audio/android/AudioMixerController.cpp @@ -32,7 +32,7 @@ THE SOFTWARE. #include -namespace cocos2d { namespace experimental { +namespace cocos2d { AudioMixerController::AudioMixerController(int bufferSizeInFrames, int sampleRate, int channelCount) : _bufferSizeInFrames(bufferSizeInFrames) @@ -347,4 +347,4 @@ bool AudioMixerController::hasPlayingTacks() return false; } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioMixerController.h b/native/cocos/audio/android/AudioMixerController.h index ce2097010f..8c0becaec9 100644 --- a/native/cocos/audio/android/AudioMixerController.h +++ b/native/cocos/audio/android/AudioMixerController.h @@ -33,7 +33,7 @@ THE SOFTWARE. #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { class Track; class AudioMixer; @@ -85,4 +85,4 @@ private: std::atomic_bool _isMixingFrame; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioMixerOps.h b/native/cocos/audio/android/AudioMixerOps.h index 1e74daeb26..6332ace3cd 100644 --- a/native/cocos/audio/android/AudioMixerOps.h +++ b/native/cocos/audio/android/AudioMixerOps.h @@ -18,7 +18,7 @@ #include "audio/android/cutils/log.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { /* Behavior of is_same<>::value is true if the types are identical, * false otherwise. Identical to the STL std::is_same. @@ -446,5 +446,5 @@ inline void volumeMulti(TO* out, size_t frameCount, } } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioPlayerProvider.cpp b/native/cocos/audio/android/AudioPlayerProvider.cpp index 5a855d1186..003ee90fd7 100644 --- a/native/cocos/audio/android/AudioPlayerProvider.cpp +++ b/native/cocos/audio/android/AudioPlayerProvider.cpp @@ -40,7 +40,7 @@ THE SOFTWARE. #include #include // for std::find_if -namespace cocos2d { namespace experimental { +namespace cocos2d { static int getSystemAPILevel() { @@ -516,4 +516,4 @@ void AudioPlayerProvider::resume() } } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioPlayerProvider.h b/native/cocos/audio/android/AudioPlayerProvider.h index 8b21984c30..31845d0d8f 100644 --- a/native/cocos/audio/android/AudioPlayerProvider.h +++ b/native/cocos/audio/android/AudioPlayerProvider.h @@ -33,7 +33,7 @@ THE SOFTWARE. #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { // Manage PcmAudioPlayer& UrlAudioPlayer class PcmAudioPlayer; @@ -124,5 +124,5 @@ private: ThreadPool* _threadPool; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioResampler.cpp b/native/cocos/audio/android/AudioResampler.cpp index ffe3a863e1..c23eea2cc0 100644 --- a/native/cocos/audio/android/AudioResampler.cpp +++ b/native/cocos/audio/android/AudioResampler.cpp @@ -39,7 +39,7 @@ -namespace cocos2d { namespace experimental { +namespace cocos2d { // ---------------------------------------------------------------------------- @@ -785,4 +785,4 @@ void AudioResamplerOrder1::AsmStereo16Loop(int16_t *in, int32_t* maxOutPt, int32 // ---------------------------------------------------------------------------- -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioResampler.h b/native/cocos/audio/android/AudioResampler.h index 12332544c7..bf41fdeb57 100644 --- a/native/cocos/audio/android/AudioResampler.h +++ b/native/cocos/audio/android/AudioResampler.h @@ -31,7 +31,7 @@ #include #include "audio/android/audio.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { class AudioResampler { @@ -178,4 +178,4 @@ private: }; // ---------------------------------------------------------------------------- -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioResamplerCubic.cpp b/native/cocos/audio/android/AudioResamplerCubic.cpp index 2b85321245..f0cca35c35 100644 --- a/native/cocos/audio/android/AudioResamplerCubic.cpp +++ b/native/cocos/audio/android/AudioResamplerCubic.cpp @@ -24,7 +24,7 @@ #include "audio/android/AudioResampler.h" #include "audio/android/AudioResamplerCubic.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { // ---------------------------------------------------------------------------- void AudioResamplerCubic::init() { @@ -188,4 +188,4 @@ save_state: } // ---------------------------------------------------------------------------- -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioResamplerCubic.h b/native/cocos/audio/android/AudioResamplerCubic.h index ef71b771f3..a98e107782 100644 --- a/native/cocos/audio/android/AudioResamplerCubic.h +++ b/native/cocos/audio/android/AudioResamplerCubic.h @@ -22,7 +22,7 @@ #include "audio/android/AudioResampler.h" #include "audio/android/AudioBufferProvider.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { // ---------------------------------------------------------------------------- class AudioResamplerCubic : public AudioResampler { @@ -62,4 +62,4 @@ private: }; // ---------------------------------------------------------------------------- -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/AudioResamplerPublic.h b/native/cocos/audio/android/AudioResamplerPublic.h index dd907da97b..bffb3d6e82 100644 --- a/native/cocos/audio/android/AudioResamplerPublic.h +++ b/native/cocos/audio/android/AudioResamplerPublic.h @@ -19,7 +19,7 @@ #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { // AUDIO_RESAMPLER_DOWN_RATIO_MAX is the maximum ratio between the original // audio sample rate and the target rate when downsampling, @@ -169,6 +169,6 @@ static inline bool isMusicRate(uint32_t sampleRate) { return sampleRate >= AUDIO_PROCESSING_MUSIC_RATE; } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { // --------------------------------------------------------------------------- diff --git a/native/cocos/audio/android/IAudioPlayer.h b/native/cocos/audio/android/IAudioPlayer.h index c1e58c0203..69da0d96cb 100644 --- a/native/cocos/audio/android/IAudioPlayer.h +++ b/native/cocos/audio/android/IAudioPlayer.h @@ -27,7 +27,7 @@ THE SOFTWARE. #include -namespace cocos2d { namespace experimental { +namespace cocos2d { class IAudioPlayer { @@ -86,4 +86,4 @@ public: virtual void setPlayEventCallback(const PlayEventCallback &playEventCallback) = 0; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/ICallerThreadUtils.h b/native/cocos/audio/android/ICallerThreadUtils.h index 54ac681799..f7a3febdd0 100644 --- a/native/cocos/audio/android/ICallerThreadUtils.h +++ b/native/cocos/audio/android/ICallerThreadUtils.h @@ -27,7 +27,7 @@ THE SOFTWARE. #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { class ICallerThreadUtils { @@ -39,4 +39,4 @@ public: virtual std::thread::id getCallerThreadId() = 0; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/IVolumeProvider.h b/native/cocos/audio/android/IVolumeProvider.h index 076ac65b26..04817e2828 100644 --- a/native/cocos/audio/android/IVolumeProvider.h +++ b/native/cocos/audio/android/IVolumeProvider.h @@ -26,7 +26,7 @@ THE SOFTWARE. #include "audio/android/audio_utils/include/audio_utils/minifloat.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { class IVolumeProvider { @@ -42,4 +42,4 @@ protected: { } }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/PcmAudioPlayer.cpp b/native/cocos/audio/android/PcmAudioPlayer.cpp index 2fbba41b0d..291a8933e1 100644 --- a/native/cocos/audio/android/PcmAudioPlayer.cpp +++ b/native/cocos/audio/android/PcmAudioPlayer.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. #include "audio/android/AudioMixerController.h" #include "audio/android/ICallerThreadUtils.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { PcmAudioPlayer::PcmAudioPlayer(AudioMixerController * controller, ICallerThreadUtils* callerThreadUtils) : _id(-1) @@ -223,4 +223,4 @@ IAudioPlayer::State PcmAudioPlayer::getState() const return state; } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/PcmAudioPlayer.h b/native/cocos/audio/android/PcmAudioPlayer.h index aaacefc5a0..55ffbfe752 100644 --- a/native/cocos/audio/android/PcmAudioPlayer.h +++ b/native/cocos/audio/android/PcmAudioPlayer.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include "audio/android/PcmData.h" #include "audio/android/Track.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { class ICallerThreadUtils; class AudioMixerController; @@ -95,4 +95,4 @@ private: friend class AudioPlayerProvider; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/PcmAudioService.cpp b/native/cocos/audio/android/PcmAudioService.cpp index 7434bc86c7..7a1a5754b0 100644 --- a/native/cocos/audio/android/PcmAudioService.cpp +++ b/native/cocos/audio/android/PcmAudioService.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #include "audio/android/PcmAudioService.h" #include "audio/android/AudioMixerController.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { static std::vector __silenceData; @@ -190,4 +190,4 @@ void PcmAudioService::resume() SL_RETURN_IF_FAILED(r, "PcmAudioService::resume failed"); } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/PcmAudioService.h b/native/cocos/audio/android/PcmAudioService.h index ff9038bc99..17c9d945ef 100644 --- a/native/cocos/audio/android/PcmAudioService.h +++ b/native/cocos/audio/android/PcmAudioService.h @@ -32,7 +32,7 @@ THE SOFTWARE. #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { class AudioMixerController; @@ -78,4 +78,4 @@ private: friend class AudioPlayerProvider; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/PcmBufferProvider.cpp b/native/cocos/audio/android/PcmBufferProvider.cpp index 4ed2011c1a..617728f2f0 100644 --- a/native/cocos/audio/android/PcmBufferProvider.cpp +++ b/native/cocos/audio/android/PcmBufferProvider.cpp @@ -35,7 +35,7 @@ THE SOFTWARE. #define ALOGVV(a...) do { } while (0) #endif -namespace cocos2d { namespace experimental { +namespace cocos2d { PcmBufferProvider::PcmBufferProvider() : _addr(nullptr) @@ -99,4 +99,4 @@ void PcmBufferProvider::reset() { _nextFrame = 0; } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/PcmBufferProvider.h b/native/cocos/audio/android/PcmBufferProvider.h index e5f5a2a7d5..9054b3c991 100644 --- a/native/cocos/audio/android/PcmBufferProvider.h +++ b/native/cocos/audio/android/PcmBufferProvider.h @@ -30,7 +30,7 @@ THE SOFTWARE. #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { class PcmBufferProvider : public AudioBufferProvider { @@ -49,4 +49,4 @@ protected: size_t _unrel; // number of frames not yet released }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/PcmData.cpp b/native/cocos/audio/android/PcmData.cpp index a3bd8ddaa3..200dee0d98 100644 --- a/native/cocos/audio/android/PcmData.cpp +++ b/native/cocos/audio/android/PcmData.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #include "audio/android/OpenSLHelper.h" #include "audio/android/PcmData.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { PcmData::PcmData() { @@ -136,4 +136,4 @@ std::string PcmData::toString() const return ret; } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/PcmData.h b/native/cocos/audio/android/PcmData.h index d0445e0cc0..e3959cac1d 100644 --- a/native/cocos/audio/android/PcmData.h +++ b/native/cocos/audio/android/PcmData.h @@ -30,7 +30,7 @@ THE SOFTWARE. #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { struct PcmData { @@ -63,4 +63,4 @@ struct PcmData std::string toString() const; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/Track.cpp b/native/cocos/audio/android/Track.cpp index d2f7c9be4d..847d1a442f 100644 --- a/native/cocos/audio/android/Track.cpp +++ b/native/cocos/audio/android/Track.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. #include -namespace cocos2d { namespace experimental { +namespace cocos2d { Track::Track(const PcmData &pcmData) : onStateChanged(nullptr) @@ -103,4 +103,4 @@ void Track::setState(State state) } }; -}} // namespace cocos2d { namespace experimental { \ No newline at end of file +} // namespace cocos2d { \ No newline at end of file diff --git a/native/cocos/audio/android/Track.h b/native/cocos/audio/android/Track.h index 09b8e2eb2f..191c154276 100644 --- a/native/cocos/audio/android/Track.h +++ b/native/cocos/audio/android/Track.h @@ -32,7 +32,7 @@ THE SOFTWARE. #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { class Track : public PcmBufferProvider, public IVolumeProvider { @@ -104,4 +104,4 @@ private: friend class AudioMixerController; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/UrlAudioPlayer.cpp b/native/cocos/audio/android/UrlAudioPlayer.cpp index ef073691c5..cb90841440 100644 --- a/native/cocos/audio/android/UrlAudioPlayer.cpp +++ b/native/cocos/audio/android/UrlAudioPlayer.cpp @@ -34,12 +34,12 @@ THE SOFTWARE. namespace { std::mutex __playerContainerMutex; -std::vector __playerContainer; +std::vector __playerContainer; std::once_flag __onceFlag; } -namespace cocos2d { namespace experimental { +namespace cocos2d { class SLUrlAudioPlayerCallbackProxy { @@ -421,4 +421,4 @@ void UrlAudioPlayer::destroy() } } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/UrlAudioPlayer.h b/native/cocos/audio/android/UrlAudioPlayer.h index 16885effa8..9f23c2b453 100644 --- a/native/cocos/audio/android/UrlAudioPlayer.h +++ b/native/cocos/audio/android/UrlAudioPlayer.h @@ -33,7 +33,7 @@ THE SOFTWARE. #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { class ICallerThreadUtils; class AssetFd; @@ -132,4 +132,4 @@ private: friend class AudioPlayerProvider; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/android/utils/Errors.h b/native/cocos/audio/android/utils/Errors.h index a305cf5205..5c18a78397 100644 --- a/native/cocos/audio/android/utils/Errors.h +++ b/native/cocos/audio/android/utils/Errors.h @@ -20,7 +20,7 @@ #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { // use this type to return error codes #ifdef _WIN32 @@ -81,7 +81,7 @@ enum { # define NO_ERROR 0L #endif -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { // --------------------------------------------------------------------------- diff --git a/native/cocos/audio/android/utils/Utils.cpp b/native/cocos/audio/android/utils/Utils.cpp index 94a88ef787..3f4fab41c1 100644 --- a/native/cocos/audio/android/utils/Utils.cpp +++ b/native/cocos/audio/android/utils/Utils.cpp @@ -29,11 +29,11 @@ THE SOFTWARE. #define JCLS_HELPER "org/cocos2dx/lib/Cocos2dxHelper" #endif -namespace cocos2d { namespace experimental { +namespace cocos2d { int getSDKVersion() { return JniHelper::callStaticIntMethod(JCLS_HELPER, "getSDKVersion"); } -}} // end of namespace cocos2d { namespace experimental +} // end of namespace cocos2d diff --git a/native/cocos/audio/android/utils/Utils.h b/native/cocos/audio/android/utils/Utils.h index 90ae035a4d..b48558bc1e 100644 --- a/native/cocos/audio/android/utils/Utils.h +++ b/native/cocos/audio/android/utils/Utils.h @@ -25,6 +25,6 @@ THE SOFTWARE. #include -namespace cocos2d { namespace experimental { +namespace cocos2d { extern int getSDKVersion(); -}} +} diff --git a/native/cocos/audio/apple/AudioCache.h b/native/cocos/audio/apple/AudioCache.h index 0a9127aa01..43b911ae93 100644 --- a/native/cocos/audio/apple/AudioCache.h +++ b/native/cocos/audio/apple/AudioCache.h @@ -38,8 +38,6 @@ #include "audio/apple/AudioMacros.h" NS_CC_BEGIN -namespace experimental{ - class AudioEngineImpl; class AudioPlayer; @@ -110,7 +108,6 @@ protected: friend class AudioPlayer; }; -} NS_CC_END #endif diff --git a/native/cocos/audio/apple/AudioCache.mm b/native/cocos/audio/apple/AudioCache.mm index bbeae547dd..49a88daf85 100644 --- a/native/cocos/audio/apple/AudioCache.mm +++ b/native/cocos/audio/apple/AudioCache.mm @@ -110,7 +110,6 @@ static void setTimeout(double seconds, const std::function& cb) } using namespace cocos2d; -using namespace cocos2d::experimental; AudioCache::AudioCache() : _format(-1) diff --git a/native/cocos/audio/apple/AudioDecoder.h b/native/cocos/audio/apple/AudioDecoder.h index 42fcf5e2ca..bb000c20a5 100644 --- a/native/cocos/audio/apple/AudioDecoder.h +++ b/native/cocos/audio/apple/AudioDecoder.h @@ -28,7 +28,7 @@ #include #import -namespace cocos2d { namespace experimental { +namespace cocos2d { /** * @brief The class for decoding compressed audio file to PCM buffer. @@ -117,4 +117,4 @@ private: AudioStreamBasicDescription _outputFormat; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/apple/AudioDecoder.mm b/native/cocos/audio/apple/AudioDecoder.mm index b5f3870bf1..21285648f4 100644 --- a/native/cocos/audio/apple/AudioDecoder.mm +++ b/native/cocos/audio/apple/AudioDecoder.mm @@ -30,7 +30,7 @@ #define LOG_TAG "AudioDecoder" -namespace cocos2d { namespace experimental { +namespace cocos2d { AudioDecoder::AudioDecoder() : _isOpened(false) @@ -226,4 +226,4 @@ namespace cocos2d { namespace experimental { return _isOpened; } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/apple/AudioEngine-inl.h b/native/cocos/audio/apple/AudioEngine-inl.h index 5acf14073d..b7a8c839ec 100644 --- a/native/cocos/audio/apple/AudioEngine-inl.h +++ b/native/cocos/audio/apple/AudioEngine-inl.h @@ -38,7 +38,6 @@ NS_CC_BEGIN class Scheduler; -namespace experimental{ #define MAX_AUDIOINSTANCES 24 class AudioEngineImpl : public cocos2d::Ref @@ -88,7 +87,6 @@ private: int _currentAudioID; Scheduler* _scheduler; }; -} NS_CC_END #endif // __AUDIO_ENGINE_INL_H_ #endif diff --git a/native/cocos/audio/apple/AudioEngine-inl.mm b/native/cocos/audio/apple/AudioEngine-inl.mm index d5d5c00a8a..7ee96e3843 100644 --- a/native/cocos/audio/apple/AudioEngine-inl.mm +++ b/native/cocos/audio/apple/AudioEngine-inl.mm @@ -40,7 +40,6 @@ #include "base/ccUtils.h" using namespace cocos2d; -using namespace cocos2d::experimental; static ALCdevice* s_ALDevice = nullptr; static ALCcontext* s_ALContext = nullptr; diff --git a/native/cocos/audio/apple/AudioPlayer.h b/native/cocos/audio/apple/AudioPlayer.h index 9c108ac7ed..3edd4d1fec 100644 --- a/native/cocos/audio/apple/AudioPlayer.h +++ b/native/cocos/audio/apple/AudioPlayer.h @@ -38,8 +38,6 @@ #include NS_CC_BEGIN -namespace experimental{ - class AudioCache; class AudioEngineImpl; @@ -91,7 +89,6 @@ protected: friend class AudioEngineImpl; }; -} NS_CC_END #endif diff --git a/native/cocos/audio/apple/AudioPlayer.mm b/native/cocos/audio/apple/AudioPlayer.mm index 28e7f3d0ae..140485a8cf 100644 --- a/native/cocos/audio/apple/AudioPlayer.mm +++ b/native/cocos/audio/apple/AudioPlayer.mm @@ -42,7 +42,6 @@ #endif using namespace cocos2d; -using namespace cocos2d::experimental; namespace { unsigned int __idIndex = 0; diff --git a/native/cocos/audio/include/AudioEngine.h b/native/cocos/audio/include/AudioEngine.h index 3ab436cb21..e2e632b19b 100644 --- a/native/cocos/audio/include/AudioEngine.h +++ b/native/cocos/audio/include/AudioEngine.h @@ -44,8 +44,6 @@ */ NS_CC_BEGIN -namespace experimental { - /** * @class AudioProfile * @@ -369,7 +367,6 @@ protected: friend class AudioEngineImpl; }; -} // namespace experimental { NS_CC_END // end group diff --git a/native/cocos/audio/win32/AudioCache.cpp b/native/cocos/audio/win32/AudioCache.cpp index d4c5344fac..ca5712a858 100644 --- a/native/cocos/audio/win32/AudioCache.cpp +++ b/native/cocos/audio/win32/AudioCache.cpp @@ -52,7 +52,6 @@ unsigned int __idIndex = 0; #define PCMDATA_CACHEMAXSIZE 1048576 using namespace cocos2d; -using namespace cocos2d::experimental; AudioCache::AudioCache() : _totalFrames(0) diff --git a/native/cocos/audio/win32/AudioCache.h b/native/cocos/audio/win32/AudioCache.h index 2414efe4db..78e0061bac 100644 --- a/native/cocos/audio/win32/AudioCache.h +++ b/native/cocos/audio/win32/AudioCache.h @@ -42,8 +42,6 @@ #include "audio/win32/AudioMacros.h" NS_CC_BEGIN -namespace experimental{ - class AudioEngineImpl; class AudioPlayer; @@ -114,7 +112,6 @@ protected: friend class AudioPlayer; }; -} NS_CC_END #endif diff --git a/native/cocos/audio/win32/AudioDecoder.cpp b/native/cocos/audio/win32/AudioDecoder.cpp index 77d507777d..bc1c813d40 100644 --- a/native/cocos/audio/win32/AudioDecoder.cpp +++ b/native/cocos/audio/win32/AudioDecoder.cpp @@ -29,7 +29,7 @@ #define LOG_TAG "AudioDecoder" -namespace cocos2d { namespace experimental { +namespace cocos2d { AudioDecoder::AudioDecoder() : _isOpened(false) @@ -89,4 +89,4 @@ AudioDecoder::AudioDecoder() return _channelCount; } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/win32/AudioDecoder.h b/native/cocos/audio/win32/AudioDecoder.h index c7f321b8cd..ab3d03097e 100644 --- a/native/cocos/audio/win32/AudioDecoder.h +++ b/native/cocos/audio/win32/AudioDecoder.h @@ -29,7 +29,7 @@ #include "vorbis/vorbisfile.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { /** * @brief The class for decoding compressed audio file to PCM buffer. @@ -117,4 +117,4 @@ protected: friend class AudioDecoderManager; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/win32/AudioDecoderManager.cpp b/native/cocos/audio/win32/AudioDecoderManager.cpp index 6df0cfcacf..fc814e13d6 100644 --- a/native/cocos/audio/win32/AudioDecoderManager.cpp +++ b/native/cocos/audio/win32/AudioDecoderManager.cpp @@ -32,7 +32,7 @@ THE SOFTWARE. #include "platform/CCFileUtils.h" #include "mpg123/mpg123.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { static bool __mp3Inited = false; @@ -66,5 +66,5 @@ void AudioDecoderManager::destroyDecoder(AudioDecoder* decoder) delete decoder; } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/win32/AudioDecoderManager.h b/native/cocos/audio/win32/AudioDecoderManager.h index ce80bdf1ff..89fbc3c19c 100644 --- a/native/cocos/audio/win32/AudioDecoderManager.h +++ b/native/cocos/audio/win32/AudioDecoderManager.h @@ -25,7 +25,7 @@ THE SOFTWARE. #pragma once -namespace cocos2d { namespace experimental { +namespace cocos2d { class AudioDecoder; @@ -38,5 +38,5 @@ public: static void destroyDecoder(AudioDecoder* decoder); }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/win32/AudioDecoderMp3.cpp b/native/cocos/audio/win32/AudioDecoderMp3.cpp index 03697be0ce..b4da842822 100644 --- a/native/cocos/audio/win32/AudioDecoderMp3.cpp +++ b/native/cocos/audio/win32/AudioDecoderMp3.cpp @@ -31,7 +31,7 @@ #define LOG_TAG "AudioDecoderMp3" -namespace cocos2d { namespace experimental { +namespace cocos2d { static bool __mp3Inited = false; @@ -180,4 +180,4 @@ namespace cocos2d { namespace experimental { return static_cast(mpg123_tell(_mpg123handle)); } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/win32/AudioDecoderMp3.h b/native/cocos/audio/win32/AudioDecoderMp3.h index a11db607f3..e23f40f273 100644 --- a/native/cocos/audio/win32/AudioDecoderMp3.h +++ b/native/cocos/audio/win32/AudioDecoderMp3.h @@ -29,7 +29,7 @@ struct mpg123_handle_struct; -namespace cocos2d { namespace experimental { +namespace cocos2d { /** * @brief The class for decoding compressed audio file to PCM buffer. @@ -83,4 +83,4 @@ protected: friend class AudioDecoderManager; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/win32/AudioDecoderOgg.cpp b/native/cocos/audio/win32/AudioDecoderOgg.cpp index fc20453229..60d32b84bc 100644 --- a/native/cocos/audio/win32/AudioDecoderOgg.cpp +++ b/native/cocos/audio/win32/AudioDecoderOgg.cpp @@ -29,7 +29,7 @@ #define LOG_TAG "AudioDecoderOgg" -namespace cocos2d { namespace experimental { +namespace cocos2d { AudioDecoderOgg::AudioDecoderOgg() { @@ -84,4 +84,4 @@ namespace cocos2d { namespace experimental { return static_cast(ov_pcm_tell(const_cast(&_vf))); } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/win32/AudioDecoderOgg.h b/native/cocos/audio/win32/AudioDecoderOgg.h index 4c9ce9113c..6f5b55db06 100644 --- a/native/cocos/audio/win32/AudioDecoderOgg.h +++ b/native/cocos/audio/win32/AudioDecoderOgg.h @@ -29,7 +29,7 @@ #include "vorbis/vorbisfile.h" -namespace cocos2d { namespace experimental { +namespace cocos2d { /** * @brief The class for decoding compressed audio file to PCM buffer. @@ -79,4 +79,4 @@ protected: friend class AudioDecoderManager; }; -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/audio/win32/AudioEngine-win32.cpp b/native/cocos/audio/win32/AudioEngine-win32.cpp index 6c3e8f30b8..bc021b2cf4 100644 --- a/native/cocos/audio/win32/AudioEngine-win32.cpp +++ b/native/cocos/audio/win32/AudioEngine-win32.cpp @@ -105,7 +105,6 @@ void audioLog(const char * format, ...) } using namespace cocos2d; -using namespace cocos2d::experimental; static ALCdevice *s_ALDevice = nullptr; static ALCcontext *s_ALContext = nullptr; diff --git a/native/cocos/audio/win32/AudioEngine-win32.h b/native/cocos/audio/win32/AudioEngine-win32.h index 132c662662..ff44a05029 100644 --- a/native/cocos/audio/win32/AudioEngine-win32.h +++ b/native/cocos/audio/win32/AudioEngine-win32.h @@ -39,7 +39,6 @@ NS_CC_BEGIN class Scheduler; -namespace experimental { #define MAX_AUDIOINSTANCES 32 class CC_DLL AudioEngineImpl : public cocos2d::Ref @@ -86,7 +85,6 @@ private: int _currentAudioID; Scheduler* _scheduler; }; -} NS_CC_END #endif // __AUDIO_ENGINE_INL_H_ #endif diff --git a/native/cocos/audio/win32/AudioPlayer.cpp b/native/cocos/audio/win32/AudioPlayer.cpp index 4c3e512877..35273eba6a 100644 --- a/native/cocos/audio/win32/AudioPlayer.cpp +++ b/native/cocos/audio/win32/AudioPlayer.cpp @@ -42,7 +42,6 @@ #endif using namespace cocos2d; -using namespace cocos2d::experimental; namespace { unsigned int __idIndex = 0; diff --git a/native/cocos/audio/win32/AudioPlayer.h b/native/cocos/audio/win32/AudioPlayer.h index 60cfec91c0..6b0f860082 100644 --- a/native/cocos/audio/win32/AudioPlayer.h +++ b/native/cocos/audio/win32/AudioPlayer.h @@ -41,7 +41,6 @@ #include "base/ccMacros.h" NS_CC_BEGIN -namespace experimental{ class AudioCache; class AudioEngineImpl; @@ -92,7 +91,6 @@ protected: friend class AudioEngineImpl; }; -} NS_CC_END #endif //CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 diff --git a/native/cocos/base/CCThreadPool.cpp b/native/cocos/base/CCThreadPool.cpp index d51ed50c82..487c621a34 100644 --- a/native/cocos/base/CCThreadPool.cpp +++ b/native/cocos/base/CCThreadPool.cpp @@ -36,7 +36,7 @@ #define LOGD(...) printf(__VA_ARGS__) #endif -namespace cocos2d { namespace experimental { +namespace cocos2d { #define DEFAULT_THREAD_POOL_MIN_NUM (4) #define DEFAULT_THREAD_POOL_MAX_NUM (20) @@ -438,4 +438,4 @@ void ThreadPool::setThread(int tid) new(std::nothrow) std::thread(f)); // compiler may not support std::make_unique() } -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/base/CCThreadPool.h b/native/cocos/base/CCThreadPool.h index 6eb025e29a..683919fac2 100644 --- a/native/cocos/base/CCThreadPool.h +++ b/native/cocos/base/CCThreadPool.h @@ -39,7 +39,7 @@ #include #include -namespace cocos2d { namespace experimental { +namespace cocos2d { /** * @addtogroup base @@ -235,4 +235,4 @@ private: // end of base group /// @} -}} // namespace cocos2d { namespace experimental { +} // namespace cocos2d { diff --git a/native/cocos/platform/android/CCApplication-android.cpp b/native/cocos/platform/android/CCApplication-android.cpp index f64627ef25..ec5b4044aa 100644 --- a/native/cocos/platform/android/CCApplication-android.cpp +++ b/native/cocos/platform/android/CCApplication-android.cpp @@ -34,13 +34,13 @@ THE SOFTWARE. #include "scripting/js-bindings/jswrapper/SeApi.h" #include "scripting/js-bindings/event/EventDispatcher.h" -#define LOG_TAG "CCApplication_android Debug" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) +#define LOG_APP_TAG "CCApplication_android Debug" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_APP_TAG,__VA_ARGS__) // IDEA: using ndk-r10c will cause the next function could not be found. It may be a bug of ndk-r10c. // Here is the workaround method to fix the problem. #ifdef __aarch64__ -extern "C" size_t __ctype_get_mb_cur_max(void) +extern "C" size_t __ctype_get_mb_cur_max(void) { return (size_t) sizeof(wchar_t); } @@ -77,9 +77,9 @@ Application::~Application() _renderTexture = nullptr; #if USE_AUDIO // close audio device - cocos2d::experimental::AudioEngine::end(); + AudioEngine::end(); #endif - + Application::_instance = nullptr; } @@ -119,7 +119,7 @@ void Application::applicationWillEnterForeground() } -void Application::setPreferredFramesPerSecond(int fps) +void Application::setPreferredFramesPerSecond(int fps) { _fps = fps; setPreferredFramesPerSecondJNI(_fps); diff --git a/native/cocos/platform/ios/CCApplication-ios.mm b/native/cocos/platform/ios/CCApplication-ios.mm index c1b815aad8..1a55a8772b 100644 --- a/native/cocos/platform/ios/CCApplication-ios.mm +++ b/native/cocos/platform/ios/CCApplication-ios.mm @@ -228,9 +228,6 @@ Application::~Application() EventDispatcher::destroy(); se::ScriptEngine::destroyInstance(); - - // close audio device - cocos2d::experimental::AudioEngine::end(); // stop main loop [(MainLoop*)_delegate stopMainLoop]; @@ -240,6 +237,10 @@ Application::~Application() delete _renderTexture; _renderTexture = nullptr; +#if USE_AUDIO // close audio device + AudioEngine::end(); +#endif + Application::_instance = nullptr; } diff --git a/native/cocos/platform/mac/CCApplication-mac.mm b/native/cocos/platform/mac/CCApplication-mac.mm index b857e6cbca..e9b41c6423 100644 --- a/native/cocos/platform/mac/CCApplication-mac.mm +++ b/native/cocos/platform/mac/CCApplication-mac.mm @@ -85,9 +85,6 @@ Application::~Application() { EventDispatcher::destroy(); se::ScriptEngine::destroyInstance(); - - // close audio device - cocos2d::experimental::AudioEngine::end(); delete CAST_VIEW(_view); _view = nullptr; @@ -95,6 +92,10 @@ Application::~Application() delete _renderTexture; _renderTexture = nullptr; +#if USE_AUDIO // close audio device + AudioEngine::end(); +#endif + Application::_instance = nullptr; } diff --git a/native/cocos/platform/win32/CCApplication-win32.cpp b/native/cocos/platform/win32/CCApplication-win32.cpp index 40df508338..1feb6392c9 100644 --- a/native/cocos/platform/win32/CCApplication-win32.cpp +++ b/native/cocos/platform/win32/CCApplication-win32.cpp @@ -120,16 +120,16 @@ Application::~Application() EventDispatcher::destroy(); se::ScriptEngine::destroyInstance(); - //close audio device - cocos2d::experimental::AudioEngine::end(); - - delete CAST_VIEW(_view); _view = nullptr; delete _renderTexture; _renderTexture = nullptr; +#if USE_AUDIO // close audio device + AudioEngine::end(); +#endif + Application::_instance = nullptr; } diff --git a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_audioengine_auto_api.js b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_audioengine_auto_api.js index 59f09910aa..ce68f35160 100644 --- a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_audioengine_auto_api.js +++ b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_audioengine_auto_api.js @@ -215,7 +215,7 @@ bool * @param {String} arg0 * @param {bool} arg1 * @param {float} arg2 - * @param {cc.experimental::AudioProfile} arg3 + * @param {cc.AudioProfile} arg3 * @return {int} */ play2d : function ( @@ -231,7 +231,7 @@ audioprofile /** * @method getState * @param {int} arg0 - * @return {cc.experimental::AudioEngine::AudioState} + * @return {cc.AudioEngine::AudioState} */ getState : function ( int @@ -286,12 +286,12 @@ bool /** * @method getDefaultProfile - * @return {cc.experimental::AudioProfile} + * @return {cc.AudioProfile} */ getDefaultProfile : function ( ) { - return cc.experimental::AudioProfile; + return cc.AudioProfile; }, /** @@ -309,13 +309,13 @@ func /** * @method getProfile * @param {String|int} str -* @return {cc.experimental::AudioProfile|cc.experimental::AudioProfile} +* @return {cc.AudioProfile|cc.AudioProfile} */ getProfile : function( int ) { - return cc.experimental::AudioProfile; + return cc.AudioProfile; }, /** diff --git a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_video_auto_api.js b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_video_auto_api.js deleted file mode 100644 index 8a4c8b065a..0000000000 --- a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_video_auto_api.js +++ /dev/null @@ -1,196 +0,0 @@ -/** - * @module cocos2dx_experimental_video - */ -var ccui = ccui || {}; - -/** - * @class VideoPlayer - */ -ccui.VideoPlayer = { - -/** - * @method getFileName - * @return {String} - */ -getFileName : function ( -) -{ - return ; -}, - -/** - * @method getURL - * @return {String} - */ -getURL : function ( -) -{ - return ; -}, - -/** - * @method play - */ -play : function ( -) -{ -}, - -/** - * @method setKeepAspectRatioEnabled - * @param {bool} arg0 - */ -setKeepAspectRatioEnabled : function ( -bool -) -{ -}, - -/** - * @method currentTime - * @return {float} - */ -currentTime : function ( -) -{ - return 0; -}, - -/** - * @method stop - */ -stop : function ( -) -{ -}, - -/** - * @method setFullScreenEnabled - * @param {bool} arg0 - */ -setFullScreenEnabled : function ( -bool -) -{ -}, - -/** - * @method setFileName - * @param {String} arg0 - */ -setFileName : function ( -str -) -{ -}, - -/** - * @method setURL - * @param {String} arg0 - */ -setURL : function ( -str -) -{ -}, - -/** - * @method isKeepAspectRatioEnabled - * @return {bool} - */ -isKeepAspectRatioEnabled : function ( -) -{ - return false; -}, - -/** - * @method onPlayEvent - * @param {int} arg0 - */ -onPlayEvent : function ( -int -) -{ -}, - -/** - * @method isFullScreenEnabled - * @return {bool} - */ -isFullScreenEnabled : function ( -) -{ - return false; -}, - -/** - * @method addEventListener - * @param {function} arg0 - */ -addEventListener : function ( -func -) -{ -}, - -/** - * @method duration - * @return {float} - */ -duration : function ( -) -{ - return 0; -}, - -/** - * @method isPlaying - * @return {bool} - */ -isPlaying : function ( -) -{ - return false; -}, - -/** - * @method seekTo - * @param {float} arg0 - */ -seekTo : function ( -float -) -{ -}, - -/** - * @method setVolume - * @param {float} arg0 - */ -setVolume : function ( -float -) -{ -}, - -/** - * @method create - * @return {cc.experimental::ui::VideoPlayer} - */ -create : function ( -) -{ - return cc.experimental::ui::VideoPlayer; -}, - -/** - * @method VideoPlayer - * @constructor - */ -VideoPlayer : function ( -) -{ -}, - -}; diff --git a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_webView_auto_api.js b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_webView_auto_api.js deleted file mode 100644 index f57f38450c..0000000000 --- a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_webView_auto_api.js +++ /dev/null @@ -1,250 +0,0 @@ -/** - * @module cocos2dx_experimental_webView - */ -var ccui = ccui || {}; - -/** - * @class WebView - */ -ccui.WebView = { - -/** - * @method setOnShouldStartLoading - * @param {function} arg0 - */ -setOnShouldStartLoading : function ( -func -) -{ -}, - -/** - * @method setOnDidFailLoading - * @param {function} arg0 - */ -setOnDidFailLoading : function ( -func -) -{ -}, - -/** - * @method canGoBack - * @return {bool} - */ -canGoBack : function ( -) -{ - return false; -}, - -/** - * @method loadHTMLString - * @param {String} arg0 - * @param {String} arg1 - */ -loadHTMLString : function ( -str, -str -) -{ -}, - -/** - * @method goForward - */ -goForward : function ( -) -{ -}, - -/** - * @method goBack - */ -goBack : function ( -) -{ -}, - -/** - * @method setScalesPageToFit - * @param {bool} arg0 - */ -setScalesPageToFit : function ( -bool -) -{ -}, - -/** - * @method getOnDidFailLoading - * @return {function} - */ -getOnDidFailLoading : function ( -) -{ - return std::function &)>; -}, - -/** - * @method loadFile - * @param {String} arg0 - */ -loadFile : function ( -str -) -{ -}, - -/** - * @method loadURL - * @param {String} arg0 - */ -loadURL : function ( -str -) -{ -}, - -/** - * @method setBounces - * @param {bool} arg0 - */ -setBounces : function ( -bool -) -{ -}, - -/** - * @method evaluateJS - * @param {String} arg0 - */ -evaluateJS : function ( -str -) -{ -}, - -/** - * @method setOnJSCallback - * @param {function} arg0 - */ -setOnJSCallback : function ( -func -) -{ -}, - -/** - * @method getOnJSCallback - * @return {function} - */ -getOnJSCallback : function ( -) -{ - return std::function &)>; -}, - -/** - * @method canGoForward - * @return {bool} - */ -canGoForward : function ( -) -{ - return false; -}, - -/** - * @method getOnShouldStartLoading - * @return {function} - */ -getOnShouldStartLoading : function ( -) -{ - return std::function &)>; -}, - -/** - * @method stopLoading - */ -stopLoading : function ( -) -{ -}, - -/** - * @method reload - */ -reload : function ( -) -{ -}, - -/** - * @method loadData - * @param {cc.Data} arg0 - * @param {String} arg1 - * @param {String} arg2 - * @param {String} arg3 - */ -loadData : function ( -data, -str, -str, -str -) -{ -}, - -/** - * @method setJavascriptInterfaceScheme - * @param {String} arg0 - */ -setJavascriptInterfaceScheme : function ( -str -) -{ -}, - -/** - * @method setOnDidFinishLoading - * @param {function} arg0 - */ -setOnDidFinishLoading : function ( -func -) -{ -}, - -/** - * @method getOnDidFinishLoading - * @return {function} - */ -getOnDidFinishLoading : function ( -) -{ - return std::function &)>; -}, - -/** - * @method create - * @return {cc.experimental::ui::WebView} - */ -create : function ( -) -{ - return cc.experimental::ui::WebView; -}, - -/** - * @method WebView - * @constructor - */ -WebView : function ( -) -{ -}, - -}; diff --git a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp index ced4f32b39..f81fe5149a 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp @@ -4,12 +4,12 @@ #include "scripting/js-bindings/manual/jsb_global.h" #include "audio/include/AudioEngine.h" -se::Object* __jsb_cocos2d_experimental_AudioProfile_proto = nullptr; -se::Class* __jsb_cocos2d_experimental_AudioProfile_class = nullptr; +se::Object* __jsb_cocos2d_AudioProfile_proto = nullptr; +se::Class* __jsb_cocos2d_AudioProfile_class = nullptr; static bool js_audioengine_AudioProfile_get_name(se::State& s) { - cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject(); + cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_audioengine_AudioProfile_get_name : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -23,7 +23,7 @@ SE_BIND_PROP_GET(js_audioengine_AudioProfile_get_name) static bool js_audioengine_AudioProfile_set_name(se::State& s) { const auto& args = s.args(); - cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject(); + cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_audioengine_AudioProfile_set_name : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -37,7 +37,7 @@ SE_BIND_PROP_SET(js_audioengine_AudioProfile_set_name) static bool js_audioengine_AudioProfile_get_maxInstances(se::State& s) { - cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject(); + cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_audioengine_AudioProfile_get_maxInstances : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -51,7 +51,7 @@ SE_BIND_PROP_GET(js_audioengine_AudioProfile_get_maxInstances) static bool js_audioengine_AudioProfile_set_maxInstances(se::State& s) { const auto& args = s.args(); - cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject(); + cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_audioengine_AudioProfile_set_maxInstances : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -65,7 +65,7 @@ SE_BIND_PROP_SET(js_audioengine_AudioProfile_set_maxInstances) static bool js_audioengine_AudioProfile_get_minDelay(se::State& s) { - cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject(); + cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_audioengine_AudioProfile_get_minDelay : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -79,7 +79,7 @@ SE_BIND_PROP_GET(js_audioengine_AudioProfile_get_minDelay) static bool js_audioengine_AudioProfile_set_minDelay(se::State& s) { const auto& args = s.args(); - cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject(); + cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject(); SE_PRECONDITION2(cobj, false, "js_audioengine_AudioProfile_set_minDelay : Invalid Native Object"); CC_UNUSED bool ok = true; @@ -91,33 +91,33 @@ static bool js_audioengine_AudioProfile_set_minDelay(se::State& s) } SE_BIND_PROP_SET(js_audioengine_AudioProfile_set_minDelay) -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_experimental_AudioProfile_finalize) +SE_DECLARE_FINALIZE_FUNC(js_cocos2d_AudioProfile_finalize) static bool js_audioengine_AudioProfile_constructor(se::State& s) { - cocos2d::experimental::AudioProfile* cobj = new (std::nothrow) cocos2d::experimental::AudioProfile(); + cocos2d::AudioProfile* cobj = new (std::nothrow) cocos2d::AudioProfile(); s.thisObject()->setPrivateData(cobj); se::NonRefNativePtrCreatedByCtorMap::emplace(cobj); return true; } -SE_BIND_CTOR(js_audioengine_AudioProfile_constructor, __jsb_cocos2d_experimental_AudioProfile_class, js_cocos2d_experimental_AudioProfile_finalize) +SE_BIND_CTOR(js_audioengine_AudioProfile_constructor, __jsb_cocos2d_AudioProfile_class, js_cocos2d_AudioProfile_finalize) -static bool js_cocos2d_experimental_AudioProfile_finalize(se::State& s) +static bool js_cocos2d_AudioProfile_finalize(se::State& s) { - CCLOGINFO("jsbindings: finalizing JS object %p (cocos2d::experimental::AudioProfile)", s.nativeThisObject()); + CCLOGINFO("jsbindings: finalizing JS object %p (cocos2d::AudioProfile)", s.nativeThisObject()); auto iter = se::NonRefNativePtrCreatedByCtorMap::find(s.nativeThisObject()); if (iter != se::NonRefNativePtrCreatedByCtorMap::end()) { se::NonRefNativePtrCreatedByCtorMap::erase(iter); - cocos2d::experimental::AudioProfile* cobj = (cocos2d::experimental::AudioProfile*)s.nativeThisObject(); + cocos2d::AudioProfile* cobj = (cocos2d::AudioProfile*)s.nativeThisObject(); delete cobj; } return true; } -SE_BIND_FINALIZE_FUNC(js_cocos2d_experimental_AudioProfile_finalize) +SE_BIND_FINALIZE_FUNC(js_cocos2d_AudioProfile_finalize) bool js_register_audioengine_AudioProfile(se::Object* obj) { @@ -126,19 +126,19 @@ bool js_register_audioengine_AudioProfile(se::Object* obj) cls->defineProperty("name", _SE(js_audioengine_AudioProfile_get_name), _SE(js_audioengine_AudioProfile_set_name)); cls->defineProperty("maxInstances", _SE(js_audioengine_AudioProfile_get_maxInstances), _SE(js_audioengine_AudioProfile_set_maxInstances)); cls->defineProperty("minDelay", _SE(js_audioengine_AudioProfile_get_minDelay), _SE(js_audioengine_AudioProfile_set_minDelay)); - cls->defineFinalizeFunction(_SE(js_cocos2d_experimental_AudioProfile_finalize)); + cls->defineFinalizeFunction(_SE(js_cocos2d_AudioProfile_finalize)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cocos2d_experimental_AudioProfile_proto = cls->getProto(); - __jsb_cocos2d_experimental_AudioProfile_class = cls; + __jsb_cocos2d_AudioProfile_proto = cls->getProto(); + __jsb_cocos2d_AudioProfile_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; } -se::Object* __jsb_cocos2d_experimental_AudioEngine_proto = nullptr; -se::Class* __jsb_cocos2d_experimental_AudioEngine_class = nullptr; +se::Object* __jsb_cocos2d_AudioEngine_proto = nullptr; +se::Class* __jsb_cocos2d_AudioEngine_class = nullptr; static bool js_audioengine_AudioEngine_lazyInit(se::State& s) { @@ -146,7 +146,7 @@ static bool js_audioengine_AudioEngine_lazyInit(se::State& s) size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - bool result = cocos2d::experimental::AudioEngine::lazyInit(); + bool result = cocos2d::AudioEngine::lazyInit(); ok &= boolean_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_lazyInit : Error processing arguments"); return true; @@ -167,7 +167,7 @@ static bool js_audioengine_AudioEngine_setCurrentTime(se::State& s) do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); ok &= seval_to_float(args[1], &arg1); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setCurrentTime : Error processing arguments"); - bool result = cocos2d::experimental::AudioEngine::setCurrentTime(arg0, arg1); + bool result = cocos2d::AudioEngine::setCurrentTime(arg0, arg1); ok &= boolean_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setCurrentTime : Error processing arguments"); return true; @@ -186,7 +186,7 @@ static bool js_audioengine_AudioEngine_getVolume(se::State& s) int arg0 = 0; do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getVolume : Error processing arguments"); - float result = cocos2d::experimental::AudioEngine::getVolume(arg0); + float result = cocos2d::AudioEngine::getVolume(arg0); ok &= float_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getVolume : Error processing arguments"); return true; @@ -205,7 +205,7 @@ static bool js_audioengine_AudioEngine_uncache(se::State& s) std::string arg0; ok &= seval_to_std_string(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_uncache : Error processing arguments"); - cocos2d::experimental::AudioEngine::uncache(arg0); + cocos2d::AudioEngine::uncache(arg0); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); @@ -218,7 +218,7 @@ static bool js_audioengine_AudioEngine_resumeAll(se::State& s) const auto& args = s.args(); size_t argc = args.size(); if (argc == 0) { - cocos2d::experimental::AudioEngine::resumeAll(); + cocos2d::AudioEngine::resumeAll(); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); @@ -231,7 +231,7 @@ static bool js_audioengine_AudioEngine_stopAll(se::State& s) const auto& args = s.args(); size_t argc = args.size(); if (argc == 0) { - cocos2d::experimental::AudioEngine::stopAll(); + cocos2d::AudioEngine::stopAll(); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); @@ -248,7 +248,7 @@ static bool js_audioengine_AudioEngine_pause(se::State& s) int arg0 = 0; do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_pause : Error processing arguments"); - cocos2d::experimental::AudioEngine::pause(arg0); + cocos2d::AudioEngine::pause(arg0); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); @@ -261,7 +261,7 @@ static bool js_audioengine_AudioEngine_end(se::State& s) const auto& args = s.args(); size_t argc = args.size(); if (argc == 0) { - cocos2d::experimental::AudioEngine::end(); + cocos2d::AudioEngine::end(); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); @@ -275,7 +275,7 @@ static bool js_audioengine_AudioEngine_getMaxAudioInstance(se::State& s) size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - int result = cocos2d::experimental::AudioEngine::getMaxAudioInstance(); + int result = cocos2d::AudioEngine::getMaxAudioInstance(); ok &= int32_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getMaxAudioInstance : Error processing arguments"); return true; @@ -291,7 +291,7 @@ static bool js_audioengine_AudioEngine_isEnabled(se::State& s) size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - bool result = cocos2d::experimental::AudioEngine::isEnabled(); + bool result = cocos2d::AudioEngine::isEnabled(); ok &= boolean_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_isEnabled : Error processing arguments"); return true; @@ -310,7 +310,7 @@ static bool js_audioengine_AudioEngine_getCurrentTime(se::State& s) int arg0 = 0; do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getCurrentTime : Error processing arguments"); - float result = cocos2d::experimental::AudioEngine::getCurrentTime(arg0); + float result = cocos2d::AudioEngine::getCurrentTime(arg0); ok &= float_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getCurrentTime : Error processing arguments"); return true; @@ -329,7 +329,7 @@ static bool js_audioengine_AudioEngine_setMaxAudioInstance(se::State& s) int arg0 = 0; do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setMaxAudioInstance : Error processing arguments"); - bool result = cocos2d::experimental::AudioEngine::setMaxAudioInstance(arg0); + bool result = cocos2d::AudioEngine::setMaxAudioInstance(arg0); ok &= boolean_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setMaxAudioInstance : Error processing arguments"); return true; @@ -348,7 +348,7 @@ static bool js_audioengine_AudioEngine_isLoop(se::State& s) int arg0 = 0; do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_isLoop : Error processing arguments"); - bool result = cocos2d::experimental::AudioEngine::isLoop(arg0); + bool result = cocos2d::AudioEngine::isLoop(arg0); ok &= boolean_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_isLoop : Error processing arguments"); return true; @@ -363,7 +363,7 @@ static bool js_audioengine_AudioEngine_pauseAll(se::State& s) const auto& args = s.args(); size_t argc = args.size(); if (argc == 0) { - cocos2d::experimental::AudioEngine::pauseAll(); + cocos2d::AudioEngine::pauseAll(); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); @@ -376,7 +376,7 @@ static bool js_audioengine_AudioEngine_uncacheAll(se::State& s) const auto& args = s.args(); size_t argc = args.size(); if (argc == 0) { - cocos2d::experimental::AudioEngine::uncacheAll(); + cocos2d::AudioEngine::uncacheAll(); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); @@ -395,7 +395,7 @@ static bool js_audioengine_AudioEngine_setVolume(se::State& s) do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); ok &= seval_to_float(args[1], &arg1); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setVolume : Error processing arguments"); - cocos2d::experimental::AudioEngine::setVolume(arg0, arg1); + cocos2d::AudioEngine::setVolume(arg0, arg1); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); @@ -445,7 +445,7 @@ static bool js_audioengine_AudioEngine_preload(se::State& s) } while(false) ; if (!ok) { ok = true; break; } - cocos2d::experimental::AudioEngine::preload(arg0, arg1); + cocos2d::AudioEngine::preload(arg0, arg1); return true; } } while (false); @@ -454,7 +454,7 @@ static bool js_audioengine_AudioEngine_preload(se::State& s) std::string arg0; ok &= seval_to_std_string(args[0], &arg0); if (!ok) { ok = true; break; } - cocos2d::experimental::AudioEngine::preload(arg0); + cocos2d::AudioEngine::preload(arg0); return true; } } while (false); @@ -472,7 +472,7 @@ static bool js_audioengine_AudioEngine_setEnabled(se::State& s) bool arg0; ok &= seval_to_boolean(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setEnabled : Error processing arguments"); - cocos2d::experimental::AudioEngine::setEnabled(arg0); + cocos2d::AudioEngine::setEnabled(arg0); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); @@ -489,7 +489,7 @@ static bool js_audioengine_AudioEngine_play2d(se::State& s) std::string arg0; ok &= seval_to_std_string(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments"); - int result = cocos2d::experimental::AudioEngine::play2d(arg0); + int result = cocos2d::AudioEngine::play2d(arg0); ok &= int32_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments"); return true; @@ -500,7 +500,7 @@ static bool js_audioengine_AudioEngine_play2d(se::State& s) ok &= seval_to_std_string(args[0], &arg0); ok &= seval_to_boolean(args[1], &arg1); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments"); - int result = cocos2d::experimental::AudioEngine::play2d(arg0, arg1); + int result = cocos2d::AudioEngine::play2d(arg0, arg1); ok &= int32_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments"); return true; @@ -513,7 +513,7 @@ static bool js_audioengine_AudioEngine_play2d(se::State& s) ok &= seval_to_boolean(args[1], &arg1); ok &= seval_to_float(args[2], &arg2); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments"); - int result = cocos2d::experimental::AudioEngine::play2d(arg0, arg1, arg2); + int result = cocos2d::AudioEngine::play2d(arg0, arg1, arg2); ok &= int32_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments"); return true; @@ -522,13 +522,13 @@ static bool js_audioengine_AudioEngine_play2d(se::State& s) std::string arg0; bool arg1; float arg2 = 0; - const cocos2d::experimental::AudioProfile* arg3 = nullptr; + const cocos2d::AudioProfile* arg3 = nullptr; ok &= seval_to_std_string(args[0], &arg0); ok &= seval_to_boolean(args[1], &arg1); ok &= seval_to_float(args[2], &arg2); ok &= seval_to_native_ptr(args[3], &arg3); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments"); - int result = cocos2d::experimental::AudioEngine::play2d(arg0, arg1, arg2, arg3); + int result = cocos2d::AudioEngine::play2d(arg0, arg1, arg2, arg3); ok &= int32_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_play2d : Error processing arguments"); return true; @@ -547,7 +547,7 @@ static bool js_audioengine_AudioEngine_getState(se::State& s) int arg0 = 0; do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getState : Error processing arguments"); - int result = (int)cocos2d::experimental::AudioEngine::getState(arg0); + int result = (int)cocos2d::AudioEngine::getState(arg0); ok &= int32_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getState : Error processing arguments"); return true; @@ -566,7 +566,7 @@ static bool js_audioengine_AudioEngine_resume(se::State& s) int arg0 = 0; do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_resume : Error processing arguments"); - cocos2d::experimental::AudioEngine::resume(arg0); + cocos2d::AudioEngine::resume(arg0); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); @@ -583,7 +583,7 @@ static bool js_audioengine_AudioEngine_stop(se::State& s) int arg0 = 0; do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_stop : Error processing arguments"); - cocos2d::experimental::AudioEngine::stop(arg0); + cocos2d::AudioEngine::stop(arg0); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); @@ -600,7 +600,7 @@ static bool js_audioengine_AudioEngine_getDuration(se::State& s) int arg0 = 0; do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getDuration : Error processing arguments"); - float result = cocos2d::experimental::AudioEngine::getDuration(arg0); + float result = cocos2d::AudioEngine::getDuration(arg0); ok &= float_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getDuration : Error processing arguments"); return true; @@ -621,7 +621,7 @@ static bool js_audioengine_AudioEngine_setLoop(se::State& s) do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); ok &= seval_to_boolean(args[1], &arg1); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setLoop : Error processing arguments"); - cocos2d::experimental::AudioEngine::setLoop(arg0, arg1); + cocos2d::AudioEngine::setLoop(arg0, arg1); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); @@ -635,8 +635,8 @@ static bool js_audioengine_AudioEngine_getDefaultProfile(se::State& s) size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - cocos2d::experimental::AudioProfile* result = cocos2d::experimental::AudioEngine::getDefaultProfile(); - ok &= native_ptr_to_seval((cocos2d::experimental::AudioProfile*)result, &s.rval()); + cocos2d::AudioProfile* result = cocos2d::AudioEngine::getDefaultProfile(); + ok &= native_ptr_to_seval((cocos2d::AudioProfile*)result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getDefaultProfile : Error processing arguments"); return true; } @@ -686,7 +686,7 @@ static bool js_audioengine_AudioEngine_setFinishCallback(se::State& s) } while(false) ; SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_setFinishCallback : Error processing arguments"); - cocos2d::experimental::AudioEngine::setFinishCallback(arg0, arg1); + cocos2d::AudioEngine::setFinishCallback(arg0, arg1); return true; } SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); @@ -704,8 +704,8 @@ static bool js_audioengine_AudioEngine_getProfile(se::State& s) std::string arg0; ok &= seval_to_std_string(args[0], &arg0); if (!ok) { ok = true; break; } - cocos2d::experimental::AudioProfile* result = cocos2d::experimental::AudioEngine::getProfile(arg0); - ok &= native_ptr_to_seval((cocos2d::experimental::AudioProfile*)result, &s.rval()); + cocos2d::AudioProfile* result = cocos2d::AudioEngine::getProfile(arg0); + ok &= native_ptr_to_seval((cocos2d::AudioProfile*)result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getProfile : Error processing arguments"); return true; } @@ -715,8 +715,8 @@ static bool js_audioengine_AudioEngine_getProfile(se::State& s) int arg0 = 0; do { int32_t tmp = 0; ok &= seval_to_int32(args[0], &tmp); arg0 = (int)tmp; } while(false); if (!ok) { ok = true; break; } - cocos2d::experimental::AudioProfile* result = cocos2d::experimental::AudioEngine::getProfile(arg0); - ok &= native_ptr_to_seval((cocos2d::experimental::AudioProfile*)result, &s.rval()); + cocos2d::AudioProfile* result = cocos2d::AudioEngine::getProfile(arg0); + ok &= native_ptr_to_seval((cocos2d::AudioProfile*)result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getProfile : Error processing arguments"); return true; } @@ -732,7 +732,7 @@ static bool js_audioengine_AudioEngine_getPlayingAudioCount(se::State& s) size_t argc = args.size(); CC_UNUSED bool ok = true; if (argc == 0) { - int result = cocos2d::experimental::AudioEngine::getPlayingAudioCount(); + int result = cocos2d::AudioEngine::getPlayingAudioCount(); ok &= int32_to_seval(result, &s.rval()); SE_PRECONDITION2(ok, false, "js_audioengine_AudioEngine_getPlayingAudioCount : Error processing arguments"); return true; @@ -778,10 +778,10 @@ bool js_register_audioengine_AudioEngine(se::Object* obj) cls->defineStaticFunction("getProfile", _SE(js_audioengine_AudioEngine_getProfile)); cls->defineStaticFunction("getPlayingAudioCount", _SE(js_audioengine_AudioEngine_getPlayingAudioCount)); cls->install(); - JSBClassType::registerClass(cls); + JSBClassType::registerClass(cls); - __jsb_cocos2d_experimental_AudioEngine_proto = cls->getProto(); - __jsb_cocos2d_experimental_AudioEngine_class = cls; + __jsb_cocos2d_AudioEngine_proto = cls->getProto(); + __jsb_cocos2d_AudioEngine_class = cls; se::ScriptEngine::getInstance()->clearException(); return true; diff --git a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.hpp index fad86ba8fd..5dd4bdec5d 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.hpp @@ -4,17 +4,17 @@ #include "cocos/scripting/js-bindings/jswrapper/SeApi.h" -extern se::Object* __jsb_cocos2d_experimental_AudioProfile_proto; -extern se::Class* __jsb_cocos2d_experimental_AudioProfile_class; +extern se::Object* __jsb_cocos2d_AudioProfile_proto; +extern se::Class* __jsb_cocos2d_AudioProfile_class; -bool js_register_cocos2d_experimental_AudioProfile(se::Object* obj); +bool js_register_cocos2d_AudioProfile(se::Object* obj); bool register_all_audioengine(se::Object* obj); SE_DECLARE_FUNC(js_audioengine_AudioProfile_AudioProfile); -extern se::Object* __jsb_cocos2d_experimental_AudioEngine_proto; -extern se::Class* __jsb_cocos2d_experimental_AudioEngine_class; +extern se::Object* __jsb_cocos2d_AudioEngine_proto; +extern se::Class* __jsb_cocos2d_AudioEngine_class; -bool js_register_cocos2d_experimental_AudioEngine(se::Object* obj); +bool js_register_cocos2d_AudioEngine(se::Object* obj); bool register_all_audioengine(se::Object* obj); SE_DECLARE_FUNC(js_audioengine_AudioEngine_lazyInit); SE_DECLARE_FUNC(js_audioengine_AudioEngine_setCurrentTime); diff --git a/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_extension_manual.cpp b/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_extension_manual.cpp index 81d43ee741..c605fe719b 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_extension_manual.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_extension_manual.cpp @@ -35,7 +35,6 @@ using namespace cocos2d; using namespace cocos2d::extension; -using namespace cocos2d::experimental; static bool js_cocos2dx_extension_loadRemoteImage(se::State& s) { diff --git a/native/cocos/scripting/js-bindings/manual/jsb_global.cpp b/native/cocos/scripting/js-bindings/manual/jsb_global.cpp index 5d1fdd91bd..a551361d75 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_global.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_global.cpp @@ -40,7 +40,6 @@ #include using namespace cocos2d; -using namespace cocos2d::experimental; se::Object* __jsbObj = nullptr; se::Object* __glObj = nullptr; @@ -86,7 +85,7 @@ void jsb_init_file_operation_delegate() SE_REPORT_ERROR("Can't decrypt code for %s", byteCodePath.c_str()); return; } - + if (ZipUtils::isGZipBuffer(data,dataLen)) { uint8_t* unpackedData; ssize_t unpackedLen = ZipUtils::inflateMemory(data, dataLen,&unpackedData); @@ -95,7 +94,7 @@ void jsb_init_file_operation_delegate() SE_REPORT_ERROR("Can't decrypt code for %s", byteCodePath.c_str()); return; } - + readCallback(unpackedData, unpackedLen); free(data); free(unpackedData); @@ -121,12 +120,12 @@ void jsb_init_file_operation_delegate() uint32_t dataLen; uint8_t* data = xxtea_decrypt((uint8_t*)fileData.getBytes(), (uint32_t)fileData.getSize(), (uint8_t*)xxteaKey.c_str(), (uint32_t)xxteaKey.size(), &dataLen); - + if (data == nullptr) { SE_REPORT_ERROR("Can't decrypt code for %s", byteCodePath.c_str()); return ""; } - + if (ZipUtils::isGZipBuffer(data,dataLen)) { uint8_t* unpackedData; ssize_t unpackedLen = ZipUtils::inflateMemory(data, dataLen,&unpackedData); @@ -134,11 +133,11 @@ void jsb_init_file_operation_delegate() SE_REPORT_ERROR("Can't decrypt code for %s", byteCodePath.c_str()); return ""; } - + std::string ret(reinterpret_cast(unpackedData), unpackedLen); free(unpackedData); free(data); - + return ret; } else { @@ -642,7 +641,7 @@ namespace if (freeData) delete [] data; } - + uint32_t length = 0; uint32_t width = 0; uint32_t height = 0; @@ -655,10 +654,10 @@ namespace bool hasAlpha = false; bool hasPremultipliedAlpha = false; bool compressed = false; - + bool freeData = false; }; - + struct ImageInfo* createImageInfo(const Image* img) { struct ImageInfo* imgInfo = new struct ImageInfo(); @@ -666,18 +665,18 @@ namespace imgInfo->width = img->getWidth(); imgInfo->height = img->getHeight(); imgInfo->data = img->getData(); - + const auto& pixelFormatInfo = img->getPixelFormatInfo(); imgInfo->glFormat = pixelFormatInfo.format; imgInfo->glInternalFormat = pixelFormatInfo.internalFormat; imgInfo->type = pixelFormatInfo.type; - + imgInfo->bpp = img->getBitPerPixel(); imgInfo->numberOfMipmaps = img->getNumberOfMipmaps(); imgInfo->hasAlpha = img->hasAlpha(); imgInfo->hasPremultipliedAlpha = img->hasPremultipliedAlpha(); imgInfo->compressed = img->isCompressed(); - + // Convert to RGBA888 because standard web api will return only RGBA888. // If not, then it may have issue in glTexSubImage. For example, engine // will create a big texture, and update its content with small pictures. @@ -702,7 +701,7 @@ namespace imgInfo->glInternalFormat = GL_RGBA; imgInfo->freeData = true; } - + return imgInfo; } } @@ -840,7 +839,7 @@ bool jsb_global_load_image(const std::string& path, const se::Value& callbackVal std::string fullPath(FileUtils::getInstance()->fullPathForFilename(path)); if (0 == path.find("file://")) fullPath = FileUtils::getInstance()->fullPathForFilename(path.substr(strlen("file://"))); - + if (fullPath.empty()) { SE_REPORT_ERROR("File (%s) doesn't exist!", path.c_str()); @@ -992,22 +991,22 @@ static bool JSB_showInputBox(se::State& s) bool ok; se::Value tmp; const auto& obj = args[0].toObject(); - + cocos2d::EditBox::ShowInfo showInfo; - + ok = obj->getProperty("defaultValue", &tmp); SE_PRECONDITION2(ok && tmp.isString(), false, "defaultValue is invalid!"); showInfo.defaultValue = tmp.toString(); - - + + ok = obj->getProperty("maxLength", &tmp); SE_PRECONDITION2(ok && tmp.isNumber(), false, "maxLength is invalid!"); showInfo.maxLength = tmp.toInt32(); - + ok = obj->getProperty("multiple", &tmp); SE_PRECONDITION2(ok && tmp.isBoolean(), false, "multiple is invalid!"); showInfo.isMultiline = tmp.toBoolean(); - + if (obj->getProperty("confirmHold", &tmp)) { SE_PRECONDITION2(tmp.isBoolean(), false, "confirmHold is invalid!"); @@ -1015,14 +1014,14 @@ static bool JSB_showInputBox(se::State& s) showInfo.confirmHold = tmp.toBoolean(); } - + if (obj->getProperty("confirmType", &tmp)) { SE_PRECONDITION2(tmp.isString(), false, "confirmType is invalid!"); if (!tmp.isUndefined()) showInfo.confirmType = tmp.toString(); } - + if (obj->getProperty("inputType", &tmp)) { SE_PRECONDITION2(tmp.isString(), false, "inputType is invalid!"); @@ -1030,7 +1029,7 @@ static bool JSB_showInputBox(se::State& s) showInfo.inputType = tmp.toString(); } - + if (obj->getProperty("originX", &tmp)) { SE_PRECONDITION2(tmp.isNumber(), false, "originX is invalid!"); @@ -1058,12 +1057,12 @@ static bool JSB_showInputBox(se::State& s) if (! tmp.isUndefined()) showInfo.height = tmp.toInt32(); } - + EditBox::show(showInfo); - + return true; } - + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); return false; }