Commit Graph

436 Commits

Author SHA1 Message Date
halx99 9eeeb151a1 Committing clang-format changes 2021-12-28 03:00:34 +00:00
halx99 460498fdbb string_view for osx 2021-12-28 10:49:14 +08:00
halx99 0076283252 Huge changes for all string_view 2021-12-26 23:26:34 +08:00
halx99 2ba77a42fb Committing clang-format changes 2021-12-25 02:04:45 +00:00
halx99 b459acbcf7 Remove all unnecessary nothrow 2021-12-08 00:11:53 +08:00
halx99 92890788f8 Update copyright notice [skip ci] 2021-10-06 18:47:07 +08:00
halx99 52dff7c19b Fix #518 2021-10-06 18:45:58 +08:00
rh101 4d1ff40736 Usage of long and unsigned long changed to platform independent fixed-sized types where appropriate. 2021-09-02 15:39:28 +10:00
RH d17e7b442a
FileStream::size() implemented (#365)
* Add FileStream::size()
Add ZipFile::zfsize()

* Use FileStream::size()
2021-05-31 15:08:44 +08:00
RH 4d020f20ca
Cache stream size because Apple audio decoder requests the value too often (#364)
* Use FileStream to handle file operations for audio files on Apple platforms

* Audio callbacks are now static methods of AudioDecoderEXT class

* Track AudioFileID and close it explicitly in case it is required

* Remove unused code

* Improve performance by caching stream size since Apple audio decoder requests the size constantly during playback
2021-05-31 12:37:28 +08:00
RH 36968c206e
Add Apple audio virtual file system support by using FileStream (#363)
* Use FileStream to handle file operations for audio files on Apple platforms

* Audio callbacks are now static methods of AudioDecoderEXT class

* Track AudioFileID and close it explicitly in case it is required

* Remove unused code
2021-05-29 16:15:16 +08:00
rh101 c7aa1d4f00 Let the OGG function overrides handle freeing memory of the FileStream pointer. 2021-04-26 17:30:18 +10:00
rh101 6f47d44b81 Clear unique_ptr with reset(). 2021-04-26 15:46:59 +10:00
rh101 b865d9e18e Use reset() to clear unique_ptr.
Use value initialization for unique_ptr.
Change AudioDecoderOgg override functions to use FileStream* instead of unique_ptr.
Remove redundant code.
2021-04-26 15:43:33 +10:00
rh101 ef6bedd069 Use unique_ptr for FileUtils::openFileStream
Fix OGG audio playback due to incorrect tell() method
Fix unzip close() override method not deleting FileStream pointer.
2021-04-26 14:21:56 +10:00
rh101 bcafad58ea Ensure code uses FileStream::tell() to get size if required after using FileStream::seek(0, SET_END) 2021-04-26 10:28:33 +10:00
rh101 434d2730d6 Initialise member variable 2021-04-26 01:05:06 +10:00
rh101 e1a9141a00 openFileStream now returns a nullptr if it fails 2021-04-24 09:22:27 +10:00
rh101 8de1099614 Add support for virtual file system via custom FileStream and FileUtils implementations. 2021-04-22 03:15:49 +10:00
halx99 1735517112 Improve win dll support 2020-10-06 16:46:38 +08:00
HALX99 235f09f635
Refactor pixel format manipulate (#217)
* PixelFormat use table

* Correct PixelFormat name to match 'GL_LUMINANCE'

* Up

* fix cube update texture enum

* linux build

* Refine ci

* fix linux build

* Remove unused function, match mtl framebuffer pixel format

* readPixels always RGBA format

* fix ci for linux

* fix linux build

* Remove unused functions

* fix travis

* fix android ci

* Update config.json

* linux glad

* Update CCGLViewImpl-desktop.cpp

* fix linux build

* Fix linux build

* Link issue [skip appveyor][skip travis]

* Update CMakeLists.txt

* Refine GL enums use

* Update test case name [skip appveyor][skip travis]

* fix linux link issue

* for mtl

* fix ci

* Tidy pixelformat enums

* fix ci

* fix rgba8 to abgr4 error

* fix ci

* fix ci for GLES

* Fix linux build, require glibc-2.27+

* Use properly dist for travis [skip appveyor]

* fix linux build [skip appveyor]

* Update install-deps-linux.sh

* Remove unused members for pixel block info, update external to v73

* Sync from compile linux warnings

* Remove unused check, and PixelFormat::A8 is ordinary format, not compressed format

* metal doesn't support rgb8 (#3)

* Update CCTexture2D.cpp

* Refine code

* Pixel Format Descriptor Table

* fix ci

* BGR5A1

* Simplfy texture format convert function name

* Update

* rgba4 match mtl render format

* Add note about RGBA4

* Remove unused function

* fix osx

* Already converted at texture2d

* Clearly comment

* fixup
2020-09-25 11:07:56 +08:00
halx99 d401cbfd75 fix mac compile error 2020-09-05 22:33:18 +08:00
halx99 c3b823586b Refine code style 2020-08-27 10:19:21 +08:00
halx99 26471dc766 fix ci compile 2020-08-27 00:49:07 +08:00
halx99 fe4d26cea1 Rename PXFileStream to CCFileStream 2020-08-27 00:21:44 +08:00
halx99 ccc4bcac63 Update al format enum 2020-08-24 19:04:08 +08:00
halx99 4ecc8c7a02 Print al vender and version after initialized 2020-08-20 22:37:34 +08:00
halx99 a8a9040322 Use CC0-1.0 licensed decoder 'minimp3' to replace LGPL licensed decoder 'mpg123' 2020-08-17 14:56:53 +08:00
halx99 25cf91cb14 More clearly check supported pcm format by alsoft extends 2020-08-15 17:48:57 +08:00
halx99 acca2eff1b Add ios framework required by SDL2, check whether SDL2 support strip it later 2020-08-15 17:47:40 +08:00
halx99 b179975add Adapte zlib licensed AL library: mojoal 2020-08-14 18:58:44 +08:00
halx99 a0ca3487ed Cleanup unused code for min support iOS 2020-08-13 23:03:55 +08:00
halx99 b4f0ade233 fix-157 2020-08-13 22:35:41 +08:00
HALX99 d4eea74a85
fix compile issue without alsoft 2020-08-13 00:41:30 +08:00
halx99 79dc84e3d7 fix ci android build issue. 2020-08-12 18:53:33 +08:00
halx99 1d35bd9d0a Tidy code 2020-08-12 18:40:04 +08:00
halx99 3e2161ea01 Simplify audio source again, merge audio sources 2020-08-12 17:00:07 +08:00
halx99 7ecb85019a fix #127 2020-07-31 17:23:03 +08:00
halx99 82314c2972 Add alconfig.h to choose whether use openal-soft 2020-07-31 17:03:58 +08:00
halx99 2163f9c440 Add missing detect macro CC_USE_ALSOFT_ON_APPLE on apple platform 2020-07-31 16:36:45 +08:00
halx99 95cae56768 Update comment [skip appveyor] [skip travis] 2020-07-31 15:49:50 +08:00
halx99 786eaafe56 Tidy audio source, unify headers: AudioEngineImpl.h AudioPlayer.h 2020-07-31 14:32:08 +08:00
halx99 ccc5cde3d9 Refine message output [skip travis] [skip appveyor] 2020-07-31 11:35:52 +08:00
halx99 005ec45f0a fix option order 2020-07-31 11:22:42 +08:00
halx99 589225f2e7 [Audio] Use apple system decoder for non .ogg audio files 2020-07-31 00:31:39 +08:00
halx99 594767290d Add CMAKE option CC_USE_ALSOFT_ON_APPLE to use kcat openal-soft on apple platform, by default currently OFF 2020-07-31 00:06:59 +08:00
halx99 0d8457e9af Use std::vector<char> to manage pcmData buffer on AudioCache, remove unused source from AudioCache.mm 2020-07-30 18:09:50 +08:00
halx99 e250fe3707 Fix dead-lock when play/stopAll immidiately 2020-07-30 17:26:54 +08:00
halx99 dda5628876 Sync missing fixs from v3, see: https://github.com/cocos2d/cocos2d-x/pull/19240 2020-07-30 17:07:38 +08:00
halx99 484e4be579 [Audio] Improve mutex use 2020-06-04 23:11:24 +08:00