Skip to content

Commit

Permalink
Release 2.1.5 (#2076)
Browse files Browse the repository at this point in the history
* 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 #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 [skip ci]

---------

Co-authored-by: Dani Alias <danielgutierrezalias@gmail.com>
Co-authored-by: aismann <icesoft@freenet.de>
Co-authored-by: smilediver <smilediver@outlook.com>
  • Loading branch information
4 people authored Aug 11, 2024
1 parent 869b413 commit 3471594
Show file tree
Hide file tree
Showing 153 changed files with 4,631 additions and 2,941 deletions.
20 changes: 17 additions & 3 deletions 1k/1kiss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ function devtool_url($filename) {
function version_eq($ver1, $ver2) {
return $ver1 -eq $ver2
}
function version_like($ver1, $ver2) {
return $ver1 -like $ver2
}

# $ver2: accept x.y.z-rc1
function version_ge($ver1, $ver2) {
Expand Down Expand Up @@ -569,6 +572,7 @@ function find_prog($name, $path = $null, $mode = 'ONLY', $cmd = $null, $params =
$checkVerCond = $null
$minimalVer = ''
$preferredVer = ''
$wildcardVer = ''
$requiredVer = $manifest[$name]
if ($requiredVer) {
$preferredVer = $null
Expand All @@ -591,7 +595,13 @@ function find_prog($name, $path = $null, $mode = 'ONLY', $cmd = $null, $params =
$checkVerCond = '$(version_in_range $foundVer $minimalVer $preferredVer)'
}
else {
$checkVerCond = '$(version_eq $foundVer $preferredVer)'
if (!$preferredVer.Contains('*')) {
$checkVerCond = '$(version_eq $foundVer $preferredVer)'
} else {
$wildcardVer = $preferredVer
$preferredVer = $wildcardVer.TrimEnd('.*')
$checkVerCond = '$(version_like $foundVer $wildcardVer)'
}
}
}
}
Expand Down Expand Up @@ -645,7 +655,6 @@ function find_prog($name, $path = $null, $mode = 'ONLY', $cmd = $null, $params =
}
else {
if ($preferredVer) {
# if (!$silent) { $1k.println("Not found $name, needs install: $preferredVer") }
$found_rets = $null, $preferredVer
}
else {
Expand Down Expand Up @@ -1593,14 +1602,19 @@ elseif ($Global:is_wasm) {
}

$is_host_target = $Global:is_win32 -or $Global:is_linux -or $Global:is_mac
$is_host_cpu = $HOST_CPU -eq $TARGET_CPU

if (!$setupOnly) {
$BUILD_DIR = $null
$SOURCE_DIR = $null

function resolve_out_dir($prefix) {
if ($is_host_target) {
$out_dir = "${prefix}${TARGET_CPU}"
if (!$is_host_cpu) {
$out_dir = "${prefix}${TARGET_CPU}"
} else {
$out_dir = $prefix.TrimEnd("_")
}
}
else {
$out_dir = "${prefix}${TARGET_OS}"
Expand Down
21 changes: 18 additions & 3 deletions 1k/fetch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ function fetch_repo($url, $name, $dest, $ext) {
if ($ext -eq '.zip') {
Expand-Archive -Path $out -DestinationPath $prefix -Force
}
elseif ($ext -match '\.tar(\..*)?$'){
tar xf "$out" -C $prefix
elseif ($ext -match '\.tar(\..*)?$') {
tar xvf "$out" -C $prefix
}
}
catch {
Expand All @@ -62,7 +62,22 @@ function fetch_repo($url, $name, $dest, $ext) {
if (!(Test-Path $dest -PathType Container)) {
$original_lib_src = Join-Path $prefix $Script:url_pkg_name
if (Test-Path $original_lib_src -PathType Container) {
Rename-Item $original_lib_src $dest -Force
$tries = 0
do {
try {
Rename-Item $original_lib_src $dest -Force
if ($?) {
break
}
}
catch {

}

println "fetch.ps1: rename $original_lib_src to $dest failed, try after 1 seconds"
$tries += 1
Start-Sleep -Seconds 1
} while ($tries -lt 10)
}
else {
throw "fetch.ps1: the package name mismatch for $out"
Expand Down
4 changes: 2 additions & 2 deletions 1k/manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
if ($Global:is_axmol_app -or $Global:is_axmol_engine) {
$manifest['nuget'] = '5.5.1' # since 5.6.0, requires .net 4.0
$manifest['glslcc'] = '1.9.5+'
$manifest['cmake'] = '3.29.3~3.30.1+'
$manifest['cmake'] = '3.29.3~3.30.2+'
$manifest['emsdk'] = '3.1.63+'
$manifest['jdk'] = '17.0.10~17.0.11+'
$manifest['jdk'] = '17.0.10~17.0.12+'
}

# android sdk tools
Expand Down
14 changes: 9 additions & 5 deletions 1k/setup-msvc.ps1
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
param(
$ver = '14.39'
$ver = '14.39',
$arch = 'x64'
)
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs_installs = ConvertFrom-Json "$(&$vswhere -version '17.0' -format 'json')"
$vs_installs
$vs_installer = '${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe'
$vs_installer = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe"
$vs_path = $vs_installs[0].installationPath
$msvc_comp_id = "Microsoft.VisualStudio.Component.VC.$ver.17.9.x86.x64" # refer to: https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022

$vs_arch = @{x64 = 'x86.x64'; x86 = 'x86.x64'; arm64 = 'ARM64'; arm = 'ARM' }[$arch]
$msvc_comp_id = "Microsoft.VisualStudio.Component.VC.$ver.17.9.$vs_arch" # refer to: https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022
echo "Installing $msvc_comp_id ..."
&$vs_installer modify --quiet --installPath $vs_path --add $msvc_comp_id | Out-Host

if($?) {
if ($?) {
echo 'setup msvc success.'
} else {
}
else {
echo 'setup msvc fail'
}

Expand Down
41 changes: 26 additions & 15 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,23 @@ option(AX_WITH_WEBP "Build with internal webp support" ON)
option(AX_WITH_CLIPPER2 "Build with internal Clipper2 support" ON)
option(AX_WITH_POLY2TRI "Build with internal poly2tri support" ON)
option(AX_WITH_FASTLZ "Build with internal fastlz support" ON)
option(AX_WITH_LZ4 "Build with internal lz4 support" OFF)

option(AX_WITH_CURL "Build with internal curl support" ON)
option(AX_WITH_UNZIP "Build with internal unzip support" ON)
option(AX_WITH_ASTCENC "Build with internal ASTCENC support" ON)
option(AX_WITH_CARES "Build with internal c-ares support" OFF)
option(AX_WITH_YAML_CPP "Build with yaml-cpp support" OFF)
option(AX_WITH_KCP "Build with internal kcp support" OFF)
option(AX_WITH_OBOE "Build with oboe support" OFF)
option(AX_WITH_LLHTTP "Build with internal LLHTTP support" ON)

# some libs not depended by axmol
option(AX_WITH_LZ4 "Build with internal lz4 support" OFF)
option(AX_WITH_YAML_CPP "Build with yaml-cpp support" OFF)

if(LINUX OR MACOSX OR WINDOWS)
option(AX_WITH_DOCTEST "Build with doctest support" ON)
endif()

# by default, enable ios,macOS openal-soft framework for legal license LGPL-2.1
option(ALSOFT_OSX_FRAMEWORK "" ON)

Expand Down Expand Up @@ -319,19 +326,6 @@ if (AX_WITH_FASTLZ)
ax_add_3rd(fastlz)
endif()

if(AX_WITH_LZ4)
if (NOT BUILD_SHARED_LIBS)
set(lz4_tgt lz4_static)
else()
set(lz4_tgt lz4_shared)
endif()
_1kfetch(lz4)
ax_add_3rd(${lz4_SOURCE_DIR}/build/cmake TARGETS ${lz4_tgt} OPTIONS
"LZ4_BUILD_CLI OFF"
"LZ4_BUILD_LEGACY_LZ4C OFF"
)
endif()

if(AX_WITH_CLIPPER2)
ax_add_3rd(clipper2)
endif()
Expand Down Expand Up @@ -470,6 +464,23 @@ if(AX_WITH_YAML_CPP)
)
endif()

if(AX_WITH_LZ4)
if (NOT BUILD_SHARED_LIBS)
set(lz4_tgt lz4_static)
else()
set(lz4_tgt lz4_shared)
endif()
_1kfetch(lz4)
ax_add_3rd(${lz4_SOURCE_DIR}/build/cmake NO_LINK TARGETS ${lz4_tgt} OPTIONS
"LZ4_BUILD_CLI OFF"
"LZ4_BUILD_LEGACY_LZ4C OFF"
)
endif()

if(AX_WITH_DOCTEST)
ax_add_3rd(doctest NO_LINK)
endif()

# kcp
if(AX_WITH_KCP)
_1kfetch(kcp)
Expand Down
15 changes: 10 additions & 5 deletions 3rdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## Box2D
- [![Upstream](https://img.shields.io/github/v/release/erincatto/box2d?label=Upstream)](https://github.com/erincatto/box2d)
- Version: 2.4.1
- Version: 2.4.2
- License: MIT

## Bullet
Expand All @@ -22,7 +22,7 @@

## c-ares
- [![Upstream](https://img.shields.io/github/v/release/c-ares/c-ares?label=Upstream)](https://github.com/c-ares/c-ares)
- Version: 1.32.2
- Version: 1.33.0
- License: MIT

## Chipmunk2D
Expand All @@ -47,9 +47,14 @@

## curl
- [![Upstream](https://img.shields.io/github/v/release/curl/curl?label=Upstream)](https://github.com/curl/curl)
- Version: 8.8.0
- Version: 8.9.1
- License: Curl (MIT/X)

## doctest
- [![Upstream](https://img.shields.io/github/v/release/doctest/doctest?label=Upstream)](https://github.com/doctest/doctest)
- Version: 2.4.11
- License: MIT

## FastLZ
- Upstream: https://github.com/ariya/FastLZ
- Version: git 344eb40 (121)
Expand Down Expand Up @@ -118,7 +123,7 @@

- luajit
- Upstream: https://github.com/LuaJIT/LuaJIT
- Version: 2.1-5790d25
- Version: 2.1-04dca79
- License: MIT

- tolua
Expand Down Expand Up @@ -213,7 +218,7 @@

## simdjson
- [![Upstream](https://img.shields.io/github/v/tag/simdjson/simdjson?label=Upstream)](https://github.com/simdjson/simdjson)
- Version: 3.9.5
- Version: 3.10.0
- License: Apache-2.0

## stb (stb_image)
Expand Down
19 changes: 13 additions & 6 deletions 3rdparty/box2d/include/box2d/b2_body.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class B2_API b2Body

/// Get the mass data of the body.
/// @return a struct containing the mass, inertia and center of the body.
void GetMassData(b2MassData* data) const;
b2MassData GetMassData() const;

/// Set the mass properties to override the mass properties of the fixtures.
/// Note that this changes the center of mass position.
Expand Down Expand Up @@ -377,6 +377,7 @@ class B2_API b2Body

/// Get the user data pointer that was provided in the body definition.
b2BodyUserData& GetUserData();
const b2BodyUserData& GetUserData() const;

/// Get the parent world of this body.
b2World* GetWorld();
Expand All @@ -401,7 +402,6 @@ class B2_API b2Body
friend class b2PrismaticJoint;
friend class b2PulleyJoint;
friend class b2RevoluteJoint;
friend class b2RopeJoint;
friend class b2WeldJoint;
friend class b2WheelJoint;

Expand Down Expand Up @@ -548,11 +548,13 @@ inline float b2Body::GetInertia() const
return m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter);
}

inline void b2Body::GetMassData(b2MassData* data) const
inline b2MassData b2Body::GetMassData() const
{
data->mass = m_mass;
data->I = m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter);
data->center = m_sweep.localCenter;
b2MassData data;
data.mass = m_mass;
data.I = m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter);
data.center = m_sweep.localCenter;
return data;
}

inline b2Vec2 b2Body::GetWorldPoint(const b2Vec2& localPoint) const
Expand Down Expand Up @@ -733,6 +735,11 @@ inline b2BodyUserData& b2Body::GetUserData()
return m_userData;
}

inline const b2BodyUserData& b2Body::GetUserData() const
{
return m_userData;
}

inline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point, bool wake)
{
if (m_type != b2_dynamicBody)
Expand Down
25 changes: 24 additions & 1 deletion 3rdparty/box2d/include/box2d/b2_collision.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ B2_API void b2CollideEdgeAndCircle(b2Manifold* manifold,
/// Compute the collision manifold between an edge and a polygon.
B2_API void b2CollideEdgeAndPolygon(b2Manifold* manifold,
const b2EdgeShape* edgeA, const b2Transform& xfA,
const b2PolygonShape* circleB, const b2Transform& xfB);
const b2PolygonShape* polygonB, const b2Transform& xfB);

/// Clipping for contact manifolds.
B2_API int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2],
Expand All @@ -255,6 +255,29 @@ B2_API bool b2TestOverlap( const b2Shape* shapeA, int32 indexA,
const b2Shape* shapeB, int32 indexB,
const b2Transform& xfA, const b2Transform& xfB);

/// Convex hull used for polygon collision
struct b2Hull
{
b2Vec2 points[b2_maxPolygonVertices];
int32 count;
};

/// Compute the convex hull of a set of points. Returns an empty hull if it fails.
/// Some failure cases:
/// - all points very close together
/// - all points on a line
/// - less than 3 points
/// - more than b2_maxPolygonVertices points
/// This welds close points and removes collinear points.
b2Hull b2ComputeHull(const b2Vec2* points, int32 count);

/// This determines if a hull is valid. Checks for:
/// - convexity
/// - collinear points
/// This is expensive and should not be called at runtime.
bool b2ValidateHull(const b2Hull& hull);


// ---------------- Inline Functions ------------------------------------------

inline bool b2AABB::IsValid() const
Expand Down
6 changes: 6 additions & 0 deletions 3rdparty/box2d/include/box2d/b2_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class B2_API b2Fixture
/// Get the user data that was assigned in the fixture definition. Use this to
/// store your application specific data.
b2FixtureUserData& GetUserData();
const b2FixtureUserData& GetUserData() const;

/// Test a point for containment in this fixture.
/// @param p a point in world coordinates.
Expand Down Expand Up @@ -280,6 +281,11 @@ inline b2FixtureUserData& b2Fixture::GetUserData()
return m_userData;
}

inline const b2FixtureUserData& b2Fixture::GetUserData() const
{
return m_userData;
}

inline b2Body* b2Fixture::GetBody()
{
return m_body;
Expand Down
1 change: 1 addition & 0 deletions 3rdparty/box2d/include/box2d/b2_gear_joint.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class B2_API b2GearJoint : public b2Joint

float m_constant;
float m_ratio;
float m_tolerance;

float m_impulse;

Expand Down
Loading

0 comments on commit 3471594

Please sign in to comment.