Commit Graph

420 Commits

Author SHA1 Message Date
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
Deal b062eb3dc2 Improve linux deps (#1441) 2023-11-19 09:38:12 +08:00
aismann c7be9816d9 Fix/enhancement for issue #1319 (#1434)
Fix/enhancement for issue #1319 (draw filled complex polygons (concave/convex)

Co-authored-by: eismpesd <peter.eismann@siemens-healthineers.com>
2023-11-16 12:06:39 +08:00
Deal c2847f892e Use std containers instead uthash (#1379) 2023-10-12 22:00:46 +08:00
halx99 b9042aeb20 Add a dedicated class for easy load padded string for simdjson parser 2023-10-12 00:02:48 +08:00
aismann 525c53b0b5 Update FastTMXLayer.cpp (see issue #1283) (#1285)
* Update FastTMXLayer.cpp

fix #1283

* Using local variable rather than doing two calls

* Fix #1336

* Fix ci

---------

Co-authored-by: eismpesd <peter.eismann@siemens-healthineers.com>
2023-10-07 20:36:48 +08:00
halx99 8dbdce55c3 Avoid unexpected behaivor when compile optimized 2023-10-01 22:39:46 +08:00
halx99 b19e5eb9f7 Fix ci 2023-10-01 22:30:18 +08:00
halx99 57492b203c Update yasio, improve pod_vector
a. now the pod_vector more reusable, byte_buffer, array_buffer aka dynamic_array
b. change pod_vector resize, assign allocate memory exactly/fit and +=, append, insert operations trigger msvc capacity growth strategy
2023-10-01 22:04:47 +08:00
halx99 4065b90039 Preferred use byte_buffer as APIs 2023-09-29 01:57:41 +08:00
halx99 96e60b9e19 Fix #1306 2023-09-27 11:38:10 +08:00
halx99 2f1efe5a51 Add preload ttf SDF font atlas support
A extension SDFGen tool also available, see ImGuiTest
2023-09-26 01:33:06 +08:00
Turky Mohammed 87313eb043 Update Label.cpp (#1353) 2023-09-25 20:23:28 +08:00
halx99 9d69966938 Fix non-SDF label outline incorrect for metal 2023-09-20 23:05:21 +08:00
halx99 079586d060 Fix #1336 2023-09-19 22:00:17 +08:00
halx99 5f2a7be391 Improve code style 2023-09-19 21:42:14 +08:00
halx99 bd95aead71 Improve SDF font scale 2023-09-19 01:40:09 +08:00
halx99 ac8a7ac14c Improve SDF, limit baseFontSize max to fontSize 2023-09-18 19:39:46 +08:00
halx99 92b730085e Update docs 2023-09-18 13:34:26 +08:00
halx99 ae9f5c4c99 Always apply content scale factor 2023-09-18 10:27:40 +08:00
Deal 4f4f07ddc4 Add enable global TTF SDF rendering support (#1333) 2023-09-18 07:18:57 +08:00
halx99 54db10874f Fix #1326 2023-09-13 19:34:50 +08:00
halx99 c7ab6a227e Processing wasm touch events properly 2023-09-07 19:32:06 +08:00
Deal e8f88ea395 Remove unnecessary preprocessor check 2023-09-04 11:26:56 +08:00
halx99 c67cd64ffc Use axmol embeded freetype for wasm 2023-09-03 13:12:59 +08:00
halx99 c66ac9dedc Merge: 41714a04fd 2631c8405b
Merge branch '1.x' into dev
2023-09-02 19:56:50 +08:00
halx99 b21fcb0272 Fix gendocs.ps1 2023-09-02 19:56:33 +08:00
halx99 8f8418c15d Merge: c8bfa8cdf1 062b510c38
Merge 1.x WASM support into 'dev'
2023-09-02 19:47:18 +08:00
nowasm 03f007fdbe Add webgl aka wasm build support (#1315) 2023-09-01 16:31:14 +08:00
halx99 4c0c328b80 Merge: 6d82d3a76c 5e3cba78a6
Merge branch '1.x' into dev
2023-09-01 16:29:02 +08:00
halx99 396313de47 consle-next: Looking both powershell 7.x and 5.x 2023-09-01 16:28:34 +08:00
iAndyHD3 ed39cf3996 Update AXBuildHelpers.cmake (#1316)
fix find_program call
2023-09-01 16:09:58 +08:00
halx99 b1ddb2fcce Sync #1316 2023-09-01 16:09:27 +08:00
halx99 a000ccbab5 Update site build 2023-09-01 14:49:03 +08:00
halx99 ada7deb002 Sync docs [skip ci] 2023-09-01 14:48:42 +08:00
halx99 310c5868ec Merge: 8f8814532d bdbbc55909
Merge branch '1.x' into dev
2023-09-01 13:36:38 +08:00
halx99 e5d984a4f8 Auto deploy wasm demo to gh pages 2023-09-01 13:36:23 +08:00
halx99 5fe4e6d61f Merge: 89955d901a 279ea746cc
Merge branch '1.x' into dev
2023-09-01 10:37:57 +08:00
halx99 e565645443 Auto get release list for doc build 2023-09-01 10:31:34 +08:00
halx99 f3f91147a3 Merge: 2a6e84aa15 2969a5b4ff
Merge branch '1.x' into dev
2023-09-01 03:35:30 +08:00
halx99 fe60bf0a1b Fix cmake setup for linux 2023-09-01 01:17:49 +08:00
halx99 ec9b7f6e42 Merge: 1d4deae63a 7399ac41a6
Merge branch '1.x' into dev
2023-09-01 01:07:15 +08:00
halx99 0094c6bbb2 keep files for site build [skip ci] 2023-08-31 22:08:50 +08:00
halx99 2566feff5a Merge: 6e1be139bd 1d26aa28a5
Merge branch '1.x' into dev
2023-08-31 21:20:23 +08:00
halx99 12bb1eb62a Improve axmol site build 2023-08-31 21:20:01 +08:00
halx99 b50c629307 Merge: bdf976681e 82679fca74
Merge branch '1.x' into dev
2023-08-31 19:56:21 +08:00
Deal c8d0fb85ea Fix linux build 2023-08-31 18:59:12 +08:00
halx99 0952acea6a Merge: 4fe5dd55e7 cc826cb6ae
Merge branch '1.x' into dev
2023-08-31 18:14:46 +08:00
halx99 b97b1a5630 Fix ci 2023-08-31 18:14:26 +08:00
halx99 06d51ac961 Merge: d3f55e0472 8e723b0cc9
Merge branch '1.x' into dev
2023-08-31 18:09:23 +08:00
halx99 4a52c781a2 Fix ci 2023-08-31 18:07:23 +08:00
halx99 09db3594f2 Merge: 3d97d1bcc1 0a63a8e364
Merge branch '1.x' into dev
2023-08-31 17:57:36 +08:00
halx99 a3a117ad2d Update script permision 2023-08-31 17:57:19 +08:00
halx99 449a596f3e Merge: fd2cbdc331 a816a8ac64
Merge branch '1.x' into dev

# Conflicts:
#       README.md
#       README_CN.md
#       install-pwsh.sh
#       tools/console/axmol
2023-08-31 17:56:09 +08:00
halx99 c2e55c4cdc Merge console-next from dev into 1.x 2023-08-31 17:48:39 +08:00
halx99 5183995a36 Merge: f9b6553e57 94be720d3f
Merge branch '1.x' into dev
2023-08-25 16:57:54 +08:00
halx99 2bf41d7d31 Fix ci 2023-08-25 16:57:38 +08:00
halx99 46f668b01b Remove render backend setLineWidth [skip ci]
Due to not all of GL and Metal support it, so remove it unify behavior
developers shouldn't relay on it
2023-08-25 16:49:08 +08:00
halx99 f525d6c726 Update docs 2023-08-25 16:46:32 +08:00
halx99 66d68707f1 Improve GLES2 compatibility 2023-08-22 19:34:28 +08:00
halx99 bfe167121e Add cmake option AX_GLES_PROFILE
Valid value of AX_GLES_PROFILE: 0, 200, 300

By default, the AX_GLES_PROFILE is:

- android: 200, allow axmol apps runs on: API 17 Android 4.2+ devices
- winuwp: 300
- Win32/linux/osx/ios/tvos: 0

For ios/tvos, will forcing AX_GLES_PROFILE to 300 if AX_GLES_PROFILE not 0
2023-08-14 20:40:05 +08:00
Deal 9dc9e9adc7 Update android.yml 2023-08-13 23:58:18 +08:00
halx99 bd0e1fef4b Fix compile error 2023-08-13 22:09:02 +08:00
Deal 572bb2f700 Test use glad on android 2023-08-13 00:24:35 +08:00
halx99 cdc8bb0b4c Refactor FileStream implementation 2023-08-11 14:42:41 +08:00
halx99 cc9cbcbff9 Merge: eba7fc17ba 6bbdc273f8
Merge branch 'main' into dev
2023-08-10 18:53:35 +08:00
halx99 46ed10dac3 Update yasio to v4.1.0 2023-08-10 18:36:45 +08:00
halx99 f63932bb91 Update ios GLES to GLES3 2023-08-09 22:25:15 +08:00