Commit Graph

1069 Commits

Author SHA1 Message Date
Deal 32250c8355
Fix #1838
Change parameter 'sharedRT' of RenderTexture::create to false
2024-04-27 10:27:44 +08:00
RH f20be6ab95
Ensure the window size is correct (#1855) 2024-04-27 03:09:52 +08:00
RH d69f0c0d91
Adjust media control positioning if video aspect ratio is maintained (#1851) 2024-04-26 02:06:02 +08:00
RH 1fd770c5bf
[Apple] Fix media controls not appearing (#1848)
* Create media controls in onEnter to work around issue with Metal renderer when creating a RenderTexture

* Add support for setting timeline bar height in media player controller

* Use consistent positions for fullscreen enter and exit controls

* Update core/ui/UIMediaPlayer.cpp

* Create media controls on the next update cycle to work around RenderTexture creation issue with Metal renderer backend

* Add event notification for when video player full screen state changes

* Add full screen switching event to normal media player event handler
2024-04-25 23:20:41 +08:00
Deal aed58e6c28
Cleanup cc stubs (#1847)
* Cleanup cc stubs

1. Rename ax::ccMessageBox to ax::messageBox
2. Remove unused API: ax::LuaLog
3. Move ax::ccNextPOT to ax::utils::nextPOT

* Improve code style [skip ci]
2024-04-25 00:51:00 +08:00
RH 3916a2367b
Cross-platform media controller for video playback (#1845)
* Initial work on media controller

* Media player controller for WMF media engine

* Add getDuration and getCurrentTime methods to media engines

* Fix compilation

* Fix Android media timeline issues

* Fix compilation issue

* Fix WinRT compilation issue

* Fix compilation issue

* Add missing header include

* Make it simpler to create a custom media controller

* Ensure the basic media controller widget size is the same size as the media player on initialization

* Add dark media control underlay to give more contrast to the controls
ADd copyright notices

* Removing existing media controller from parent if required

* Adjust for view scaling since embedded resources are created for a scale of 1.

* Scale central media controls if required on content size change

* Remove pointless fast forward and fast reverse buttons
Ensure media controller correctly resizes on full-screen media playback

* Allow enable vlc on windows

* Improve media macro detect

* Add media controls drawn by DrawNode into single texture
Add fullscreen enter and exit controls
setUserInputEnabled and isUserInputEnabled replaced by setMediaControllerEnabled and isMediaControllerEnabled

* Update function calls to new names

* Revert back to setUserInputEnabled and isUserInputEnabled

* Remove embedded circle image and create it with DrawNode

* Change radius of drawn circle to half the total image size

---------

Co-authored-by: halx99 <halx99@live.com>
2024-04-24 22:28:59 +08:00
halx99 9d3eeded39 Update axmol version in cmake [skip ci] 2024-04-24 02:44:25 +08:00
tkzcfc 16cb4b5e9d
When loading csb files, prevent repeated loading of plist files (#1844)
* When loading csb files, prevent repeated loading of plist files

* Add more feature

* Rename function

* Use isSpriteFramesWithFileLoaded to determine whether the atlas is loaded

* use string_view instead of string

* Update SpriteFrameCache.cpp

* Fix compilation error
2024-04-23 21:21:53 +08:00
Deal 6f8e07167b
Revert "Fix failed assertion and memory leak with event listeners (#1837)" (#1841)
This reverts commit d9a95c6a8d.
2024-04-21 05:51:22 +08:00
Deal 74612ef296
Remove deprecated pixel formats L8, A8, LA8 (#1839)
* Remove deprecated pixel formats

* Fix ci

* Fixup [skip ci]

* Fixup [skip ci]

* Update tests [skip ci]
2024-04-20 22:29:16 +08:00
Tyelor D. Klein d9a95c6a8d
Fix failed assertion and memory leak with event listeners (#1837)
* Fix failed assertion and memory leak with event listeners

This solves an issue that was fixed for Cocos2d-x v3.16 and then reverted afterwards for "backwards compatibility".

I don't think we need this backwards compatibility anymore, and the benefits to cleaning up this memory outweigh the potential for some developers to need to refactor their code.

Specifically this also solves an ASSERT that fails when quitting the game on a scene which has nodes with Event Listeners that I experienced without this change, and with the Config.h setting AX_NODE_DEBUG_VERIFY_EVENT_LISTENERS enabled.

* Fixed typo
2024-04-19 09:42:43 +08:00
halx99 a22e56b0ea Update android media3 to 1.2.1 2024-04-18 23:33:39 +08:00
Tyelor D. Klein 8e37464d67
Fixed an issue where ProgressTimer didn't properly set or cascade its opacity (#1830)
This fixes a long standing bug from the Cocos2d-x  3.x days that I fixed in our source code for our games with it. I never made a pull request to Cocos2d-x since they stopped development and maintenance, but thought it might be useful for Axmol!
2024-04-18 09:28:55 +08:00
Tyelor D. Klein 332eb9afd3
Fixed ClippingNode stencil needing global z set manually (#1831)
This bug has existed since the Cocos2d-x 3.x days. If you set the global z order of a ClippingNode to anything other than the default value, then the ClippingNode fails to clip anything unless the global z order is also set for the Stencil of that ClippingNode. This change makes the ClippingNode._stencil's global z order to follow the ClippingNode's. (Note: you could still manually set the global z order of the stencil as desired to break the clipping. But now the default behavior works correctly and the way one would expect.)
2024-04-18 04:07:52 +08:00
Deal 1cfe6fcb3f
Improve MediaPlayer: handle video rotation properly (#1823)
* Improve MediaPlayer: handle video rotation properly

* Fix nativeHandleVideoSample prototype

* Fixup

* Fixup
2024-04-18 04:06:53 +08:00
smilediver 37d9a0db0b
Fix FileUtilsApple::getPathForDirectory() checking wrong path (#1828) 2024-04-17 22:36:51 +08:00
Tyelor D. Klein 4f343c44ab
Fixed issue where UIWidget couldn't be reselected (#1827)
If a UIWidget gets focus, and then loses focus (but another UIWidget doesn't gain focus when it does so). Then that original UIWidget cannot be re-focused until a different UIWidget gets focus first.
2024-04-17 09:34:12 +08:00
Tyelor D. Klein 7a9dea4f6f
[Improvement] Add Borderless Windowed Mode (#1826)
This PR adds borderless windowed mode support to the GLViewImpl class. For backwards compatibility the setWindowed function uses a default parameter of 'false' for borderless.
2024-04-17 09:33:55 +08:00
Tyelor D. Klein 20e7b1738c
Add CC_USE_CULLING Alias to cocos2d.h (#1825)
* Add CC_USE_CULLING Alias to cocos2d.h

Spine runtimes check for CC_USE_CULLING, but Axmol never defines an alias for CC_USE_CULLING to point to the config definition for AX_USE_CULLING. This solves that issue.
2024-04-17 09:22:19 +08:00
halx99 629e387411 Fix video player crash on apple platforms 2024-04-14 22:49:02 +08:00
smilediver 74c6a4a417
Fix same uniforms in fragment and vertex shaders not working in Metal (#1808)
* Fix same uniforms in fragment and vertex shaders not working in Metal

* Add missing copyright

* Fix lua bindings for UniformLocation conversion

* Fix uniform mismatch in positionNormalTexture.vert and colorNormalTexture.frag

* Enable ProgramState::setFragmentUniform() only for Metal
2024-04-12 23:12:51 +08:00
halx99 a0f2c4e489 Add cmake option: `AX_EXT_HINT` to set default extensions state 2024-04-11 22:23:02 +08:00
halx99 9872818890 Fix typo: BLEND_CLOLOR ==> BLEND_COLOR 2024-04-10 21:47:00 +08:00
halx99 2ccdb3dbcd Fix typo: RESERVE_SUBTRACT ==> REVERSE_SUBTRACT 2024-04-10 21:45:48 +08:00
halx99 68a5c250cd Fix build android with axmol cmdline arch not working 2024-04-09 01:37:04 +08:00
halx99 b2d2f98525 Remove unnecessary include statments 2024-04-08 22:01:02 +08:00
halx99 5ff87acdfe Add fallback ttf render support 2024-04-08 01:55:41 +08:00
halx99 95fe4d35bf Fix ax::print missing '\n' 2024-04-06 23:46:04 +08:00
halx99 6d8eda761a Fix compile warnings 2024-04-06 23:42:51 +08:00
halx99 195d0e7984 Make FileStream open file for write share flags same with cstd 2024-04-06 22:47:00 +08:00
halx99 ba734bc3e5 Fix some compiling warnings 2024-04-06 18:05:42 +08:00
Deal bf7635fe63
Add CMake option to remove Console from builds (#1788)
* Add CMake option to remove Console from builds

- option: AX_ENABLE_CONSOLE

* Fix ci
2024-04-05 14:25:22 +08:00
halx99 a6867f3c28 Improve feature dependencies control 2024-04-05 11:07:47 +08:00
halx99 c80fc1a8be Avoid dead loop when enable enableRetina 2024-04-05 01:55:19 +08:00
halx99 9b25809898 Improve code style 2024-04-05 01:44:41 +08:00
halx99 3bcb13f22a Fix #1787 2024-04-05 01:20:44 +08:00
halx99 4d89b04850 Move Logging APIs from Console.h/Console.cpp to Logging.h/Logging.cpp 2024-04-03 21:03:40 +08:00
RH 690e16df30
Use single macro to control each feature (#1776)
* Use single macro to control each feature

* Allow Physics module to be enabled or disabled via cmake option
2024-03-30 08:56:32 +08:00
halx99 9a10407d7d Improve build system 2024-03-30 01:08:55 +08:00
RH 4fb845244f
Allow certain code modules to be removed from build process (#1769)
* Add support for disabling code sections from build process

* Add support for disabling built-in audio

* No need to add definition here

* Remove extra blank lines

* Add required copyright notice

* Document new options
2024-03-28 10:45:20 +08:00
halx99 5797e355a3 Remove unused rpath 2024-03-27 22:59:35 +08:00
RH f0c0c75979
Add support for verbose trace level logging (#1764)
* Add support for verbose trace level logging

* Set trace log color to white and debug log color to cyan
2024-03-25 12:56:22 +08:00
halx99 3555f97a7b Fix ci 2024-03-24 05:20:59 +08:00
smilediver db057444b9
Fix texture recreation when GL context is lost (#1763)
* Fix texture recreation when GL context is lost

* Add missing copyright
2024-03-23 09:15:36 +08:00
宾晓皎 f211ba248c
[wasm] Fix frame rate control (#1762) 2024-03-22 18:10:59 +08:00
halx99 2701bd1088 Fix #1759 2024-03-21 00:41:11 +08:00
halx99 fe29f50aa7 Improve wasm EditBox 2024-03-19 23:45:51 +08:00
halx99 d1ec623bb5 Rename folder thirdparty ==> 3rdparty 2024-03-19 21:33:02 +08:00
宾晓皎 6caa3f895a
fix EditBox error (#1755)
1.fix fontsize in inputbox on wasm
2.fix fontname , fontsize in EditBox
2024-03-17 12:11:08 +08:00
aismann 06d4c3f255
Update Console.cpp (removed the '\n' which creates an second (empty) line) (#1746) 2024-03-15 19:50:22 +08:00