Commit Graph

398 Commits

Author SHA1 Message Date
smilediver 3f8d47dc36
Trim trailing whitespace for files in `core` folder (#2089) 2024-08-15 12:14:02 +08:00
smilediver ad94765c09
Remove some bad warnings (#2088) 2024-08-15 12:13:42 +08:00
halx99 b25b702d97 Release 2.1.5 (#2076)
* Fix  unexpected libpng used

* Fix string format incorrect for tests

* Fix #1751, use coroutine control AutoTest flow

* Update CHANGELOG.md

* Added OpenType font (.otf) to the noCompress list. (#2077)

* Update 1k & copyright notice in some sources

* Move doctest to axmol 3rdparty

* Fix ci

* Update 1kdist to v90

* Update 1kiss.ps1

* DrawNodeV2 0.95.1 (#2079)

* Rename remaining legacy engine related spells and improve code style

* Update 3rdparty README.md

* Fix checkReallySupportsASTC does not work on ios device

reported by @BIGCATDOG in https://github.com/axmolengine/axmol/issues/2078

* Fix ci

* FastRNG: add missing include for AXASSERT (#2081)

* Delete unused files

* Improve FileUtils

- Rename FileUtils::createDirectory to FileUtils::createDirectories
- Use splitpath_cb to optimize FileUtils::createDirectories
- Rename FileUtils::getFileShortName to FileUtils::getPathBaseName
- Rename FileUtils::getFileExtension to FileUtils::getPathExtension
- Add FileUtils::getPathDirName
- Add FileUtils::getPathBaseNameNoExtension
- Mark all renamed FileUtils stubs old name deprecated
- Mark all FileUtils offthread APIs deprecated

* Update box2d to v2.4.2

* Disable /sdl checks explicitly for winuwp

For axmol deprecated policy, we need disable /sdl checks explicitly to avoid compiler traits invoking deprecated functions as error

* Update cppwinrt to 2.0.240405.15

* Update simdjson to 3.10.0

* Fix box2d testbed compile error

* Improve file path to url

* Fix FileUtils::createDirectories unix logic

* axmol-cmdline: remove arch suffix for host build output directory

* Update CHANGELOG.md

* Update lua bindings

---------

Co-authored-by: Dani Alias <danielgutierrezalias@gmail.com>
Co-authored-by: aismann <icesoft@freenet.de>
Co-authored-by: smilediver <smilediver@outlook.com>
2024-08-11 23:51:35 +08:00
Turky Mohammed 4c80b80ff7
Improve FastRNG implementation (#2056)
* Update FastRNG and improve particle system and tests

* Update FastRNG.h

* remove unnecessary includes

* Adapt unit_tests

* unit test rotL too
2024-07-27 23:44:25 +08:00
halx99 11b8d28fd7
Mark StringUtils::format deprecated, use fmt::format instead (#2029) 2024-07-13 22:53:14 +08:00
aismann fe0adcbb1f
Rename all AXLOG/printf to AXLOGD (without .\core, .\3rdparty) (#2020) 2024-07-11 23:28:31 +08:00
RH 7a5c45a75b
Ensure the RenderTexture reference is valid on threaded task completion (#2024) 2024-07-11 09:07:53 +08:00
RH e590b9d146
Set several log messages to verbose level (#2021) 2024-07-05 22:17:00 +08:00
halx99 a3a5203fb5
Mark AXLOG, AXLOGINFO, AXLOGWARN, AXLOGERROR deprecated (#2017)
* Mark AXLOG, AXLOGINFO, AXLOGWARN, AXLOGERROR deprecated

* Fix winuwp build
2024-07-05 07:51:36 +08:00
smilediver d79a202e6e
Renderer fixes (#1996)
* Backend: remove RenderTargetFlag and refactor depth/stencil state setup

* Fix Z-test and Z-write being enabled by default for main queue

* GL: fix framebuffer attachment not being cleared

* Use dirtyFlags for RenderTarget update

---------

Co-authored-by: halx99 <halx99@live.com>
2024-06-29 00:20:32 +08:00
halx99 ad051f353f
Update TLD to axmol.dev in sources (#1977) 2024-06-10 02:25:43 +08:00
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