Commit Graph

1117 Commits

Author SHA1 Message Date
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
Turky Mohammed 28f3915445
Node World Space Positioning (#1743)
* node set world position

* Adapt tests
2024-03-15 09:33:38 +08:00
Deal 76db9007b0
Move color types to math/Color.h (#1741)
* Move color types to math/Color.h

* Use V3F_C4F

* Fix ci
2024-03-14 23:38:45 +08:00
halx99 79b6b8c7af Fix #1726 2024-03-14 01:10:56 +08:00
RH cdf69d159a
Removing EditBox should not result in logging an error message (#1740)
* Removing EditBox should not result in logging an error message

* Add copyright notice
2024-03-13 12:37:33 +08:00
halx99 cb12cbc366 Initial implement wasm EditBox 2024-03-13 01:20:37 +08:00
halx99 601434965a Fix wasm error 2024-03-12 21:50:14 +08:00
halx99 7c7d3beb02 Improve wasm logging color style 2024-03-11 23:32:34 +08:00
halx99 6a57a020da Strip ansi color escape for wasm 2024-03-11 01:22:48 +08:00
halx99 c1718fee9b Fix linux crash 2024-03-10 01:24:32 +08:00
Deal 729718134f
Improve logging color style (#1739)
* Improve logging color style

* Improve code style

* Fix ci

* Fix ci

* Fix ci

* Fixup

* Fix ci
2024-03-09 09:23:39 +08:00
halx99 1297642416 Fix #1737 2024-03-08 20:42:05 +08:00
halx99 0972191e89 Reset console text color on non-win32 platforms 2024-03-08 01:55:10 +08:00
Deal 931ca91c71
Logging colorful support (#1735)
* Add logging colorful support

* Enable full log fmt style in cpp-tests
2024-03-08 01:15:26 +08:00
Deal 5d2c42e73f
Implement new axmol log system based on fmtlib (#1732)
* Implement new log macros based on fmtlib

* Fix ci

* Fix ci

* Fix android ci

* Fix warnings

* Replace more ax::log by AXLOGX

* Fix ci

* Fix linux build

* Use stack memory for log prefix

* Fix linux build

* Fix warning

* Add ILogOutput support

* Replace old log calls with new log macros

* Fixup

* Fixup

* Fixup

* Update ci msvc to 14.39

* Update Console.h [skip ci]

* Pass log level to ILogOutput
2024-03-07 08:47:00 +08:00
smilediver d3a0357e84
HttpClient: add support for PATCH method (#1722)
* HttpClient: add support for PATCH method
2024-02-29 11:43:41 +08:00
smilediver fcf18f8fc5
Android build fixes (#1723)
* Try default macOS Android SDK location if SDK is not specified or found

* Fix Android Studio project sync failing if NDK is not installed
2024-02-28 23:50:15 +08:00
Deal 6da5d7b059
Bump version to 2.1.3 2024-02-27 01:45:09 +08:00
halx99 8b33156e65 Update glfw to 3.4 2024-02-24 14:17:31 +08:00
halx99 5e6b865215 Update cppwinrt: 2.0.230706.1 ==> 2.0.240111.5 2024-02-22 20:03:16 +08:00
RH 184e0dcc74
Allow overriding defines without modifying engine source (#1710) 2024-02-21 09:40:04 +08:00
Deal f22cc4be68
Don't use fmt header only (#1707) 2024-02-20 05:37:28 +08:00
Deal 31da0f2917
Improve dll support (#1706)
* Improve dll support

* Tidy header include path

* Fix android build & symbol dup issue

* Fix android compile error

* Fixup
2024-02-20 05:37:12 +08:00
Deal adbffdf4a2
Fix #1704, control android cmake options by engine axutils.gradle (#1705) 2024-02-20 00:58:47 +08:00
aismann 1d7d84f58b
Update ActionInterval.h (#1702) 2024-02-19 18:29:41 +08:00
j-jorge 628574c905
Remove the Enhance API. (#1690)
We don't have the source for it anyway.
2024-02-19 10:39:26 +08:00
RH 978d15db78
RichText and ScrollView enhancements (#1696)
* Add id tag to several RichText elements to allow locating the nodes in RichText
Add font related styling to paragraph tags

* Move functionality out of ListView and into ScrollView to allow scrolling to a specific child node within a ScrollView

* Add function to allow finding protected child node by name

* Example of anchor tags to local RichText content in a ScrollView

* Fix string storage type
2024-02-18 20:09:54 +08:00
Lich 8e2e577e2f
Add support for window close button calback (#1697) 2024-02-18 16:08:53 +08:00
halx99 6477a8fdb4 Improve naming style 2024-02-18 10:30:11 +08:00
Deal 2d9c6dbf90
Fix view size incorrect when frameZoomFactor not 1.0 (#1694)
* Fix view size incorrect when frameZoomFactor not 1.0

* Tidy code
2024-02-18 09:25:28 +08:00
Deal cd5a39ee3b
Fix screen size incorrect in retina display (#1692) 2024-02-17 13:38:27 +08:00
RH bee2d6222d
Trim leading and trailing whitespace characters for the HTML parsing option (#1687) 2024-02-15 14:51:42 +08:00
RH 8c23d32235
RichText enhancements (#1683)
* Add paragraph tag support
Add HTML header tags support
Add multi-new line rich text element
Add support for end of tag action
General code clean up

* Remove redundant additions

* Fix compilation issue on platforms other than Windows

* Remove redundant constructors and destructors.
Initialize member variables.
Remove explicit inline specifier since all member class functions are implicitly inlined.
2024-02-15 08:33:38 +08:00
RH d117232769
Ensure correct video mode is set when creating view to avoid incorrect refresh rate being applied (#1678) 2024-02-13 21:10:41 +08:00
RH 9899a97e0d
Fix crash during scene transition due to invalid camera (#1676)
* Remove final specifier on Node::visit() to allow Scene to override it
Scene can now be visited correctly with valid cameras being set for child nodes when rendering outside of normal render loop.

* Add required copyright notice
2024-02-13 13:14:59 +08:00
RH d8df9fbc26
Fix cross fade transition (#1664)
* Cross fade transition cannot use shared render target

* [skip ci] Add copyright line
2024-02-10 22:27:34 +08:00
RH a1a444384e
Ability to disable default implementations of HTTP and WebSocket clients (#1656)
* Allow HttpClient and Websocket implementations to be excluded from build

* Allow LLHTTP to be excluded from build

* Add descriptions of new options

* Rename options based on current convention of AX_ENABLE_XXX
2024-02-06 22:19:03 +08:00
j-jorge 583dcdc111
Use different global names and #undef the #defines to stay unity build friendly. (#1653) 2024-02-06 07:39:54 +08:00
Deal 14761bf906
Bump 2.1.2 [skip ci][skip appveyor] 2024-02-03 10:10:02 +08:00
RH 9f8962d47d
Change extension folder structure to reduce file name conflicts (#1647)
* Restructure extension folder structure to reduce conflicts with project source files

* Do not include SDFGen headers for Android builds

* Ensure correct paths are included for the relevant targets

* ImGui is not be enabled for WinUWP, tvOS and iOS

* Fix LUA auto binding generator to work with updated extension folder structure

* Fix path and linker issues for yasio when using prebuilt option
Set correct paths to extensions for prebuilt option
2024-02-03 10:08:22 +08:00
halx99 e278e45ab8 Fix ci 2024-02-02 00:42:42 +08:00
halx99 df165fec4b Prepare release v2.1.1 2024-02-02 00:00:06 +08:00
halx99 fb9977328d Fix #1635, can't generate lua bindings for set/get Node localZOrder
---------------------------

reporeted by @bintester
2024-01-29 22:33:23 +08:00
Deal 9774d4751c
Fix memory leaks refreshed (#1638)
* Fix memory leaks when axmol apps exit on non-embed systems

    1. DriverBase no destroyInstance
    2. Every object inherited from ax::Ref shoud destory before ScriptEngineManager, otherwise will trigger it's reinit and leak
    3.  QuadCommand always leak isolated indices
    4. static singleton should'nt inhert from ax::Ref due to destory it before ScriptEngineManager impossible
    5. Make Director don't inherit from ax::Ref due to it also cause ScriptEngineManager re-init, because we destroy ScriptEngineManger in destructor of Director
    6. Explicit Director managed by Application and don't delete self at purgeDirector, since it will release at mainLoop and re-init in glView->pollEvents then leak
    7. Rename ApplicationProtocol to ApplicationBase
    8. Rename purgeDirector since we don't delete director self at it, maye rename to cleanup
    9. Change ShaderCache to new/delete singleton, managed by ProgramManager

---------

Co-authored-by: lich426 <lich426@gmail.com>
2024-01-29 22:30:14 +08:00
halx99 c06bed508b Rename cocos_android_app_init to axmol_android_app_init and othre code cleanup 2024-01-29 08:51:35 +08:00
RH 6543931e3f
Ensure scissor state is set to the correct value prior to a buffer clear (#1632) 2024-01-25 13:26:35 +08:00
halx99 31207e8bdf Bump version to 2.1.1 2024-01-24 22:12:24 +08:00
Deal 01d4ad60c7
Fix #1630 2024-01-24 22:00:01 +08:00
BinTester 3cf419a35c
add some utils functions and lua support (#1629)
* UIButton bugfix

* add utils lua support

* add utils lua support
2024-01-24 21:42:39 +08:00
tree 1f0a9526c9
After call setTime,the decoder seek to the wrong frame, need multiplied by channel count (#1618) 2024-01-17 15:24:46 +08:00
smilediver 729cc80351
Allow to override AX_USE_COMPAT_GL from user's CMakeLists.txt (#1610) 2024-01-15 23:45:37 +08:00
halx99 4600c961cd Update astcenc to 4.7.0 2024-01-15 23:44:36 +08:00
aismann 991e63ab8b
Set DrawNodeEx default to 'OFF" (#1613)
* Set DrawNodeEx default to 'OFF"

* Update controller.cpp

* Update CMakeOptions.md
2024-01-14 15:56:08 +08:00