Commit Graph

387 Commits

Author SHA1 Message Date
AlexandreK38 aacfa570a0
Count run action finish to call final finish when two run actions are… (#1946)
* Count run action finish to call final finish when two run actions are performed

* change logic to use wait count
2024-06-08 23:14:16 +08:00
halx99 8eeed46cfc
Add JobSystem support (#1968) 2024-06-07 00:33:01 +08:00
AlexandreK38 79aabfd6af
Sprite and TextureCache from ax::Data (#1967) [skip ci]
* Add Sprite and TextureCache way to use image from Data

* add Sprite cpp tests

* Apply suggestions from code review

---------

Co-authored-by: halx99 <halx99@live.com>
2024-06-07 00:30:55 +08:00
Purple 22ecef1c77
just addressing some compiler warnings on windows (#1954)
* fixed UIWebViewImpl-win32 warning C4244 while changing LPWSTR to string

* use direct `socket_native_type`

* directly use HMENU instead of int

* not sure why it wasn't auto converted but msvc spitted warnings

* we're moving it, it doesn't need to be constant, using ntcvt::from_chars

* ignore it to reduce one more warning

* add some missing `noexcept`

* reverted some const removal didn't realize it was used for rvalues
2024-06-03 23:16:54 +08:00
RH 66ca90cf41
Apply child stencils correctly to the clipping node (#1957)
* Child stencils are now applied correctly to the clipping node
Fix incorrect reference count for original program states stored in collection

* Add test for unique child stencils

* Fix comment
2024-06-03 23:15:57 +08:00
AlexandreK38 1639861dc5
Fix Callback and store Renderer Image type (#1945) 2024-05-31 13:01:42 +08:00
RH 741472398f
Do image processing to reverse premultiplied alpha in separate thread (#1929)
* Add missing parameter names

* Move processing intensive operation to a separate thread

* FileUtils instance may not be thread safe
2024-05-26 09:26:06 +08:00
Turky Mohammed ef3f14c2d7
[BUG] Fix system font blurring (#1907)
* Update Label.cpp

* Update core/2d/Label.cpp

---------

Co-authored-by: halx99 <halx99@live.com>
2024-05-21 21:49:06 +08:00
RH 49bd2bc7de
Add support for ensuring sprite content size does not change on new texture (#1897)
* Add support for ensuring sprite content size does not change on new texture

* Use better method name for enabling sprite dynamic sizing
2024-05-16 19:33:09 +08:00
Tyelor D. Klein 99866d9462
Retain _debugDrawNode in Label (#1890)
* Retain _debugDrawNode in Label

This fixes a memory corruption bug and resulting crash in the TextFieldTTF (and likely other TextField classes) where the _debugDrawNode wasn't being retained, and the label isn't added to the scene for a TextField, but is maintained by the TextField. This caused _debugDrawNode in the Label class to get cleaned up, even though Label still thought it had a valid reference to a DrawNode.

* Added missing Axmol copyright

* Changed Label to use visit for _debugDrawNode
2024-05-16 19:32:53 +08:00
halx99 1baf5cde3b Fixup 2024-05-11 01:22:27 +08:00
Deal 004065a054
Rename ax::Ref ==> ax::Object (#1877)
* Rename ax::Ref ==> ax::Object

* Update Object.h [skip ci]
2024-05-03 22:15:08 +08:00
Deal 32250c8355
Fix #1838
Change parameter 'sharedRT' of RenderTexture::create to false
2024-04-27 10:27:44 +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
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
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
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 6d8eda761a Fix compile warnings 2024-04-06 23:42:51 +08:00
halx99 ba734bc3e5 Fix some compiling warnings 2024-04-06 18:05:42 +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
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
Turky Mohammed 28f3915445
Node World Space Positioning (#1743)
* node set world position

* Adapt tests
2024-03-15 09:33:38 +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
aismann 1d7d84f58b
Update ActionInterval.h (#1702) 2024-02-19 18:29:41 +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
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
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
Lich 0c77e45fb7
Add fixedUpdate method to Scene (#1607) 2024-01-13 01:08:01 +08:00
aismann 99cf951902
Fix issue of UILayout (correctness of fix -> was on the wrong method) (#1566) 2024-01-02 07:20:09 +08:00
aismann c389118571
Fix issue #1546 of UILayout(#1549) and small performance boost (#1559)
* Fix issue #1546 of UILayout(#1549) and small performance boost

* add test

* Committing genbindings changes

---------

Co-authored-by: aismann <aismann@users.noreply.github.com>
2023-12-31 11:33:49 +08:00
Lich c43dbfff95
Get TMXTilesetInfo by name (#1522) 2023-12-16 07:13:34 +08:00
halx99 a6107139b6 Fix Device::getPixelRatio for win32,android 2023-12-13 01:56:53 +08:00
Turky Mohammed 26024d1eeb
Fix TMX Camera Culling (#1501) 2023-12-12 09:42:53 +08:00
Deal 213f788f75
Merge backend Device, DeviceInfo to DriverBase (#1499)
* backend::Device ==> backend::DriverBase
* backend::DeviceInfo ==> backend::DriverBase
* code style: remove unnecessary virtual function marks
2023-12-11 21:59:25 +08:00
aismann f19c8f89ae
Replace 'CCAssert' with 'AXASSERT' (#1485) 2023-12-08 16:30:34 +08:00
Lich 0f114baf8c
Improve ActionCoroutine callback style (#1481) 2023-12-08 12:46:46 +08:00
halx99 affcf05b69 Prepare 2.1.0 release
* Update copyright notice
* Remove prebuilt libs from SCM
* Remove optional thirdparty sources/repo from SCM
* Remove tests resources  folder 'Content' from SCM
2023-12-08 01:04:43 +08:00
Lich 669f864a4d Fix tilemap multiline property (#1476) 2023-12-05 20:53:31 +08:00
aismann 41c65eb28e Add DrawNode::drawPie (#1474) 2023-12-05 17:20:31 +08:00
halx99 49706d72b3 Fix windll build 2023-12-05 01:16:14 +08:00
Lich d84d527362 Add support for ActionCoroutine like Unity (#1473) 2023-12-05 00:28:50 +08:00
Paulo Coutinho 0aab228acc Rename glview to correct representative name (#1467) 2023-12-01 09:04:51 +08:00