Merge branch 'develop' into 8.3.0-Dev
This commit is contained in:
10
.github/workflows/main.yml
vendored
10
.github/workflows/main.yml
vendored
@@ -93,7 +93,7 @@ jobs:
|
|||||||
lime build SimpleAudio linux -release -verbose -nocolor
|
lime build SimpleAudio linux -release -verbose -nocolor
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
runs-on: macos-12
|
runs-on: macos-13
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -353,7 +353,7 @@ jobs:
|
|||||||
lime create SimpleAudio -verbose -nocolor -eval
|
lime create SimpleAudio -verbose -nocolor -eval
|
||||||
lime build SimpleAudio android -release -verbose -nocolor -eval
|
lime build SimpleAudio android -release -verbose -nocolor -eval
|
||||||
ios:
|
ios:
|
||||||
runs-on: macos-12
|
runs-on: macos-13
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -659,7 +659,7 @@ jobs:
|
|||||||
needs: package-haxelib
|
needs: package-haxelib
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, ubuntu-20.04, macos-12]
|
os: [windows-latest, ubuntu-20.04, macos-13]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
@@ -709,7 +709,7 @@ jobs:
|
|||||||
needs: package-haxelib
|
needs: package-haxelib
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, ubuntu-20.04, macos-12]
|
os: [windows-latest, ubuntu-20.04, macos-13]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
@@ -816,7 +816,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
haxe-version: [3.4.7, 4.2.5]
|
haxe-version: [3.4.7, 4.2.5]
|
||||||
os: [windows-latest, ubuntu-20.04, macos-12]
|
os: [windows-latest, ubuntu-20.04, macos-13]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
|||||||
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,6 +1,27 @@
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
8.2.2 (12/19/2024)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
* Fixed broken breakpoints in HTML5 debug builds.
|
||||||
|
* Fixed unecessary operations in `Promise` by inlining some getter functions.
|
||||||
|
* Fixed failure to read `gradle-plugin` attribute in `<config:android>` tag.
|
||||||
|
* Fixed failed installation of app on iOS Simulator by choosing only simulators that are considered available.
|
||||||
|
* Fixed `lime test ios` to install and launch on a device when using Xcode 16 or newer.
|
||||||
|
* Fixed reported version of OpenAL library.
|
||||||
|
* Fixed memory cleanup when encoding PNG and JPEG images.
|
||||||
|
* Fixed error reporting `@rpath/libhl.dylib` not found on macOS when using HashLink nightly build.
|
||||||
|
* Fixed building HashLink on macOS that required cleaning between compiles.
|
||||||
|
* Fixed `embedBytes()` macro incorrectly running when `embedByteArray()` macro was also running.
|
||||||
|
* Fixed `ImageDataUtil.copyPixels()` causing crash on HashLink.
|
||||||
|
* Fixed missing `neko` target flag when cross-compiling to Windows without `-mingw` or `-cpp` flags.
|
||||||
|
* Fixed occasional failure running Lime tools by switching certain paths from relative to absolute.
|
||||||
|
* Fixed missing warning when `lime rebuild` commands fail because C++ source is not available from Haxelib.
|
||||||
|
* Fixed command instructions to specify requirement for absolute paths when setting up a platform.
|
||||||
|
* Added detection of `-cpp` flag when cross-compiling to Windows, which works like `-mingw`.
|
||||||
|
* Updated FreeType submodule to version 2.12.1 again. Resolved issues encountered when using this version in Lime 8.2.0.
|
||||||
|
|
||||||
8.2.1 (11/01/2024)
|
8.2.1 (11/01/2024)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,12 @@
|
|||||||
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/freetype/include" />
|
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/freetype/include" />
|
||||||
<compilerflag value="-DLIME_FREETYPE" />
|
<compilerflag value="-DLIME_FREETYPE" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
prefer FreeType's font metrics algorithm from 2.9.1
|
||||||
|
it behaves more like SWF than the new algorithm
|
||||||
|
-->
|
||||||
|
<compilerflag value="-DLIME_FREETYPE_LEGACY_METRICS" />
|
||||||
|
|
||||||
<file name="src/text/Font.cpp" />
|
<file name="src/text/Font.cpp" />
|
||||||
|
|
||||||
<section if="LIME_HARFBUZZ">
|
<section if="LIME_HARFBUZZ">
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/* Define to the library version */
|
/* Define to the library version */
|
||||||
#define ALSOFT_VERSION "1.19.0"
|
#define ALSOFT_VERSION "1.20.1"
|
||||||
|
|
||||||
/* Define the branch being built */
|
/* Define the branch being built */
|
||||||
#define ALSOFT_GIT_BRANCH "master"
|
#define ALSOFT_GIT_BRANCH "master"
|
||||||
|
|
||||||
/* Define the hash of the head commit */
|
/* Define the hash of the head commit */
|
||||||
#define ALSOFT_GIT_COMMIT_HASH "96aacac"
|
#define ALSOFT_GIT_COMMIT_HASH "f5e0eef3"
|
||||||
|
|||||||
Submodule project/lib/freetype updated: 86bc8a9505...e8ebfe988b
@@ -110,13 +110,7 @@
|
|||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/bdf/bdf.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/bdf/bdf.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/bzip2/ftbzip2.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/bzip2/ftbzip2.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/cache/ftcache.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/cache/ftcache.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/cff/cffcmap.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/cff/cff.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/cff/cffdrivr.c" />
|
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/cff/cffgload.c" />
|
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/cff/cffload.c" />
|
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/cff/cffobjs.c" />
|
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/cff/cffparse.c" />
|
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/cff/cffpic.c" />
|
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/cid/type1cid.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/cid/type1cid.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/gzip/ftgzip.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/gzip/ftgzip.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/lzw/ftlzw.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/lzw/ftlzw.c" />
|
||||||
@@ -126,8 +120,13 @@
|
|||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/pshinter/pshinter.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/pshinter/pshinter.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/psnames/psmodule.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/psnames/psmodule.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/raster/raster.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/raster/raster.c" />
|
||||||
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/sdf/ftbsdf.c" />
|
||||||
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/sdf/ftsdf.c" />
|
||||||
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/sdf/ftsdfcommon.c" />
|
||||||
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/sdf/ftsdfrend.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/sfnt/sfnt.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/sfnt/sfnt.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/smooth/smooth.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/smooth/smooth.c" />
|
||||||
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/svg/ftsvg.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/truetype/truetype.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/truetype/truetype.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/type1/type1.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/type1/type1.c" />
|
||||||
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/type42/type42.c" />
|
<file name="${NATIVE_TOOLKIT_PATH}/freetype/src/type42/type42.c" />
|
||||||
|
|||||||
@@ -2050,6 +2050,14 @@ namespace lime {
|
|||||||
|
|
||||||
ImageDataUtil::CopyPixels (image, sourceImage, sourceRect, destPoint, NULL, NULL, mergeAlpha);
|
ImageDataUtil::CopyPixels (image, sourceImage, sourceRect, destPoint, NULL, NULL, mergeAlpha);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (!alphaPoint) {
|
||||||
|
|
||||||
|
Vector2 _alphaPoint = Vector2 (0, 0);
|
||||||
|
|
||||||
|
ImageDataUtil::CopyPixels (image, sourceImage, sourceRect, destPoint, alphaImage, &_alphaPoint, mergeAlpha);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
ImageDataUtil::CopyPixels (image, sourceImage, sourceRect, destPoint, alphaImage, alphaPoint, mergeAlpha);
|
ImageDataUtil::CopyPixels (image, sourceImage, sourceRect, destPoint, alphaImage, alphaPoint, mergeAlpha);
|
||||||
@@ -2058,6 +2066,8 @@ namespace lime {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void lime_image_data_util_fill_rect (value image, value rect, int rg, int ba) {
|
void lime_image_data_util_fill_rect (value image, value rect, int rg, int ba) {
|
||||||
|
|
||||||
|
|||||||
@@ -487,6 +487,8 @@ namespace lime {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jpeg_destroy_compress (&cinfo);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,6 +237,8 @@ namespace lime {
|
|||||||
|
|
||||||
if (!info_ptr) {
|
if (!info_ptr) {
|
||||||
|
|
||||||
|
png_destroy_write_struct (&png_ptr, NULL);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -310,6 +312,8 @@ namespace lime {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
png_destroy_write_struct (&png_ptr, &info_ptr);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include FT_BITMAP_H
|
#include FT_BITMAP_H
|
||||||
#include FT_SFNT_NAMES_H
|
#include FT_SFNT_NAMES_H
|
||||||
#include FT_TRUETYPE_IDS_H
|
#include FT_TRUETYPE_IDS_H
|
||||||
|
#include FT_TRUETYPE_TABLES_H
|
||||||
#include FT_GLYPH_H
|
#include FT_GLYPH_H
|
||||||
#include FT_OUTLINE_H
|
#include FT_OUTLINE_H
|
||||||
#endif
|
#endif
|
||||||
@@ -536,6 +537,98 @@ namespace lime {
|
|||||||
|
|
||||||
wchar_t* family_name = GetFamilyName ();
|
wchar_t* family_name = GetFamilyName ();
|
||||||
|
|
||||||
|
#ifdef LIME_FREETYPE_SWF_METRICS
|
||||||
|
|
||||||
|
// this should more closely match how [Embed] works in AS3 when
|
||||||
|
// embedding a font in a SWF
|
||||||
|
|
||||||
|
int calculatedAscender = 0;
|
||||||
|
int calculatedDescender = 0;
|
||||||
|
int calculatedHeight = 0;
|
||||||
|
|
||||||
|
TT_OS2* os2 = (TT_OS2*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_os2);
|
||||||
|
TT_HoriHeader* hhea = (TT_HoriHeader*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_hhea);
|
||||||
|
|
||||||
|
if (os2 && os2->version != 0xFFFFU) {
|
||||||
|
|
||||||
|
calculatedAscender = (FT_Short)os2->usWinAscent;
|
||||||
|
calculatedDescender = -(FT_Short)os2->usWinDescent;
|
||||||
|
calculatedHeight = calculatedAscender - calculatedDescender;
|
||||||
|
|
||||||
|
} else if (hhea) {
|
||||||
|
|
||||||
|
calculatedAscender = hhea->Ascender;
|
||||||
|
calculatedDescender = hhea->Descender;
|
||||||
|
calculatedHeight = calculatedAscender - calculatedDescender + hhea->Line_Gap;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// should never happen, but let's have a fallback to be safe
|
||||||
|
calculatedAscender = ((FT_Face)face)->ascender;
|
||||||
|
calculatedDescender = ((FT_Face)face)->descender;
|
||||||
|
calculatedHeight = ((FT_Face)face)->height;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif defined(LIME_FREETYPE_LEGACY_METRICS)
|
||||||
|
|
||||||
|
// this is FreeType's font metrics algorithm from 2.9.1
|
||||||
|
// it behaves more like SWF than the new algorithm
|
||||||
|
|
||||||
|
TT_OS2* os2 = (TT_OS2*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_os2);
|
||||||
|
TT_HoriHeader* hhea = (TT_HoriHeader*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_hhea);
|
||||||
|
|
||||||
|
int calculatedAscender = 0;
|
||||||
|
int calculatedDescender = 0;
|
||||||
|
int calculatedHeight = 0;
|
||||||
|
|
||||||
|
if (hhea) {
|
||||||
|
|
||||||
|
calculatedAscender = hhea->Ascender;
|
||||||
|
calculatedDescender = hhea->Descender;
|
||||||
|
calculatedHeight = calculatedAscender - calculatedDescender + hhea->Line_Gap;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!( calculatedAscender || calculatedDescender ))
|
||||||
|
{
|
||||||
|
if (os2 && os2->version != 0xFFFFU)
|
||||||
|
{
|
||||||
|
if (os2->sTypoAscender || os2->sTypoDescender)
|
||||||
|
{
|
||||||
|
|
||||||
|
calculatedAscender = os2->sTypoAscender;
|
||||||
|
calculatedDescender = os2->sTypoDescender;
|
||||||
|
calculatedHeight = calculatedAscender - calculatedDescender + os2->sTypoLineGap;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
calculatedAscender = (FT_Short)os2->usWinAscent;
|
||||||
|
calculatedDescender = -(FT_Short)os2->usWinDescent;
|
||||||
|
calculatedHeight = calculatedAscender - calculatedDescender;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!calculatedAscender || !calculatedDescender) {
|
||||||
|
|
||||||
|
calculatedAscender = ((FT_Face)face)->ascender;
|
||||||
|
calculatedDescender = ((FT_Face)face)->descender;
|
||||||
|
calculatedHeight = ((FT_Face)face)->height;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
int calculatedAscender = ((FT_Face)face)->ascender;
|
||||||
|
int calculatedDescender = ((FT_Face)face)->descender;
|
||||||
|
int calculatedHeight = ((FT_Face)face)->height;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
if (useCFFIValue) {
|
if (useCFFIValue) {
|
||||||
|
|
||||||
value ret = alloc_empty_object ();
|
value ret = alloc_empty_object ();
|
||||||
@@ -548,9 +641,9 @@ namespace lime {
|
|||||||
alloc_field (ret, val_id ("family_name"), family_name == NULL ? alloc_string (((FT_Face)face)->family_name) : alloc_wstring (family_name));
|
alloc_field (ret, val_id ("family_name"), family_name == NULL ? alloc_string (((FT_Face)face)->family_name) : alloc_wstring (family_name));
|
||||||
alloc_field (ret, val_id ("style_name"), alloc_string (((FT_Face)face)->style_name));
|
alloc_field (ret, val_id ("style_name"), alloc_string (((FT_Face)face)->style_name));
|
||||||
alloc_field (ret, val_id ("em_size"), alloc_int (((FT_Face)face)->units_per_EM));
|
alloc_field (ret, val_id ("em_size"), alloc_int (((FT_Face)face)->units_per_EM));
|
||||||
alloc_field (ret, val_id ("ascend"), alloc_int (((FT_Face)face)->ascender));
|
alloc_field (ret, val_id ("ascend"), alloc_int (calculatedAscender));
|
||||||
alloc_field (ret, val_id ("descend"), alloc_int (((FT_Face)face)->descender));
|
alloc_field (ret, val_id ("descend"), alloc_int (calculatedDescender));
|
||||||
alloc_field (ret, val_id ("height"), alloc_int (((FT_Face)face)->height));
|
alloc_field (ret, val_id ("height"), alloc_int (calculatedHeight));
|
||||||
|
|
||||||
delete family_name;
|
delete family_name;
|
||||||
|
|
||||||
@@ -647,9 +740,9 @@ namespace lime {
|
|||||||
hl_dyn_setp (ret, hl_hash_utf8 ("family_name"), &hlt_bytes, _family_name);
|
hl_dyn_setp (ret, hl_hash_utf8 ("family_name"), &hlt_bytes, _family_name);
|
||||||
hl_dyn_setp (ret, hl_hash_utf8 ("style_name"), &hlt_bytes, style_name);
|
hl_dyn_setp (ret, hl_hash_utf8 ("style_name"), &hlt_bytes, style_name);
|
||||||
hl_dyn_seti (ret, hl_hash_utf8 ("em_size"), &hlt_i32, ((FT_Face)face)->units_per_EM);
|
hl_dyn_seti (ret, hl_hash_utf8 ("em_size"), &hlt_i32, ((FT_Face)face)->units_per_EM);
|
||||||
hl_dyn_seti (ret, hl_hash_utf8 ("ascend"), &hlt_i32, ((FT_Face)face)->ascender);
|
hl_dyn_seti (ret, hl_hash_utf8 ("ascend"), &hlt_i32, calculatedAscender);
|
||||||
hl_dyn_seti (ret, hl_hash_utf8 ("descend"), &hlt_i32, ((FT_Face)face)->descender);
|
hl_dyn_seti (ret, hl_hash_utf8 ("descend"), &hlt_i32, calculatedDescender);
|
||||||
hl_dyn_seti (ret, hl_hash_utf8 ("height"), &hlt_i32, ((FT_Face)face)->height);
|
hl_dyn_seti (ret, hl_hash_utf8 ("height"), &hlt_i32, calculatedHeight);
|
||||||
|
|
||||||
// 'glyphs' field
|
// 'glyphs' field
|
||||||
hl_varray* _glyphs = (hl_varray*)hl_alloc_array (&hlt_dynobj, num_glyphs);
|
hl_varray* _glyphs = (hl_varray*)hl_alloc_array (&hlt_dynobj, num_glyphs);
|
||||||
@@ -721,15 +814,161 @@ namespace lime {
|
|||||||
|
|
||||||
int Font::GetAscender () {
|
int Font::GetAscender () {
|
||||||
|
|
||||||
|
#ifdef LIME_FREETYPE_SWF_METRICS
|
||||||
|
|
||||||
|
// this should more closely match how [Embed] works in AS3 when
|
||||||
|
// embedding a font in a SWF
|
||||||
|
|
||||||
|
TT_OS2* os2 = (TT_OS2*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_os2);
|
||||||
|
TT_HoriHeader* hhea = (TT_HoriHeader*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_hhea);
|
||||||
|
|
||||||
|
if (os2 && os2->version != 0xFFFFU) {
|
||||||
|
|
||||||
|
return (FT_Short)os2->usWinAscent;
|
||||||
|
|
||||||
|
} else if (hhea) {
|
||||||
|
|
||||||
|
return hhea->Ascender;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// should never happen, but let's have a fallback to be safe
|
||||||
return ((FT_Face)face)->ascender;
|
return ((FT_Face)face)->ascender;
|
||||||
|
|
||||||
|
#elif defined(LIME_FREETYPE_LEGACY_METRICS)
|
||||||
|
|
||||||
|
// this is FreeType's font metrics algorithm from 2.9.1
|
||||||
|
// it behaves more like SWF than the new algorithm
|
||||||
|
|
||||||
|
TT_OS2* os2 = (TT_OS2*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_os2);
|
||||||
|
TT_HoriHeader* hhea = (TT_HoriHeader*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_hhea);
|
||||||
|
|
||||||
|
int calculatedAscender = 0;
|
||||||
|
int calculatedDescender = 0;
|
||||||
|
|
||||||
|
if (hhea) {
|
||||||
|
|
||||||
|
calculatedAscender = hhea->Ascender;
|
||||||
|
calculatedDescender = hhea->Descender;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!( calculatedAscender || calculatedDescender ))
|
||||||
|
{
|
||||||
|
if (os2 && os2->version != 0xFFFFU)
|
||||||
|
{
|
||||||
|
if (os2->sTypoAscender || os2->sTypoDescender)
|
||||||
|
{
|
||||||
|
|
||||||
|
calculatedAscender = os2->sTypoAscender;
|
||||||
|
calculatedDescender = os2->sTypoDescender;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
calculatedAscender = (FT_Short)os2->usWinAscent;
|
||||||
|
calculatedDescender = -(FT_Short)os2->usWinDescent;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!calculatedAscender || !calculatedDescender) {
|
||||||
|
|
||||||
|
calculatedAscender = ((FT_Face)face)->ascender;
|
||||||
|
calculatedDescender = ((FT_Face)face)->descender;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return calculatedAscender;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
return ((FT_Face)face)->ascender;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Font::GetDescender () {
|
int Font::GetDescender () {
|
||||||
|
|
||||||
|
#ifdef LIME_FREETYPE_SWF_METRICS
|
||||||
|
|
||||||
|
// this should more closely match how [Embed] works in AS3 when
|
||||||
|
// embedding a font in a SWF
|
||||||
|
|
||||||
|
TT_OS2* os2 = (TT_OS2*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_os2);
|
||||||
|
TT_HoriHeader* hhea = (TT_HoriHeader*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_hhea);
|
||||||
|
|
||||||
|
if (os2 && os2->version != 0xFFFFU) {
|
||||||
|
|
||||||
|
return -(FT_Short)os2->usWinDescent;
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (hhea) {
|
||||||
|
|
||||||
|
return hhea->Descender;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// should never happen, but let's have a fallback to be safe
|
||||||
return ((FT_Face)face)->descender;
|
return ((FT_Face)face)->descender;
|
||||||
|
|
||||||
|
#elif defined(LIME_FREETYPE_LEGACY_METRICS)
|
||||||
|
|
||||||
|
// this is FreeType's font metrics algorithm from 2.9.1
|
||||||
|
// it behaves more like SWF than the new algorithm
|
||||||
|
|
||||||
|
TT_OS2* os2 = (TT_OS2*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_os2);
|
||||||
|
TT_HoriHeader* hhea = (TT_HoriHeader*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_hhea);
|
||||||
|
|
||||||
|
int calculatedAscender = 0;
|
||||||
|
int calculatedDescender = 0;
|
||||||
|
|
||||||
|
if (hhea) {
|
||||||
|
|
||||||
|
calculatedAscender = hhea->Ascender;
|
||||||
|
calculatedDescender = hhea->Descender;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!( calculatedAscender || calculatedDescender ))
|
||||||
|
{
|
||||||
|
if (os2 && os2->version != 0xFFFFU)
|
||||||
|
{
|
||||||
|
if (os2->sTypoAscender || os2->sTypoDescender)
|
||||||
|
{
|
||||||
|
|
||||||
|
calculatedAscender = os2->sTypoAscender;
|
||||||
|
calculatedDescender = os2->sTypoDescender;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
calculatedAscender = (FT_Short)os2->usWinAscent;
|
||||||
|
calculatedDescender = -(FT_Short)os2->usWinDescent;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!calculatedAscender || !calculatedDescender) {
|
||||||
|
|
||||||
|
calculatedAscender = ((FT_Face)face)->ascender;
|
||||||
|
calculatedDescender = ((FT_Face)face)->descender;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return calculatedDescender;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
return ((FT_Face)face)->descender;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -911,8 +1150,88 @@ namespace lime {
|
|||||||
|
|
||||||
int Font::GetHeight () {
|
int Font::GetHeight () {
|
||||||
|
|
||||||
|
#ifdef LIME_FREETYPE_SWF_METRICS
|
||||||
|
|
||||||
|
// this should more closely match how [Embed] works in AS3 when
|
||||||
|
// embedding a font in a SWF
|
||||||
|
|
||||||
|
TT_OS2* os2 = (TT_OS2*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_os2);
|
||||||
|
TT_HoriHeader* hhea = (TT_HoriHeader*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_hhea);
|
||||||
|
|
||||||
|
if (os2 && os2->version != 0xFFFFU) {
|
||||||
|
|
||||||
|
int calculatedAscender = (FT_Short)os2->usWinAscent;
|
||||||
|
int calculatedDescender = -(FT_Short)os2->usWinDescent;
|
||||||
|
return calculatedAscender - calculatedDescender;
|
||||||
|
|
||||||
|
} else if (hhea) {
|
||||||
|
|
||||||
|
int calculatedAscender = hhea->Ascender;
|
||||||
|
int calculatedDescender = hhea->Descender;
|
||||||
|
return calculatedAscender - calculatedDescender + hhea->Line_Gap;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// should never happen, but let's have a fallback to be safe
|
||||||
return ((FT_Face)face)->height;
|
return ((FT_Face)face)->height;
|
||||||
|
|
||||||
|
#elif defined(LIME_FREETYPE_LEGACY_METRICS)
|
||||||
|
|
||||||
|
// this is FreeType's font metrics algorithm from 2.9.1
|
||||||
|
// it behaves more like SWF than the new algorithm
|
||||||
|
|
||||||
|
TT_OS2* os2 = (TT_OS2*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_os2);
|
||||||
|
TT_HoriHeader* hhea = (TT_HoriHeader*)FT_Get_Sfnt_Table(((FT_Face)face), ft_sfnt_hhea);
|
||||||
|
|
||||||
|
int calculatedAscender = 0;
|
||||||
|
int calculatedDescender = 0;
|
||||||
|
int calculatedHeight = 0;
|
||||||
|
|
||||||
|
if (hhea) {
|
||||||
|
|
||||||
|
calculatedAscender = hhea->Ascender;
|
||||||
|
calculatedDescender = hhea->Descender;
|
||||||
|
calculatedHeight = calculatedAscender - calculatedDescender + hhea->Line_Gap;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!( calculatedAscender || calculatedDescender ))
|
||||||
|
{
|
||||||
|
if (os2 && os2->version != 0xFFFFU)
|
||||||
|
{
|
||||||
|
if (os2->sTypoAscender || os2->sTypoDescender)
|
||||||
|
{
|
||||||
|
|
||||||
|
calculatedAscender = os2->sTypoAscender;
|
||||||
|
calculatedDescender = os2->sTypoDescender;
|
||||||
|
calculatedHeight = calculatedAscender - calculatedDescender + os2->sTypoLineGap;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
calculatedAscender = (FT_Short)os2->usWinAscent;
|
||||||
|
calculatedDescender = -(FT_Short)os2->usWinDescent;
|
||||||
|
calculatedHeight = calculatedAscender - calculatedDescender;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!calculatedHeight) {
|
||||||
|
|
||||||
|
calculatedHeight = ((FT_Face)face)->height;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return calculatedHeight;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
return ((FT_Face)face)->height;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,16 @@ class AssetsMacro
|
|||||||
var fields = embedData(":file");
|
var fields = embedData(":file");
|
||||||
if (fields == null) return null;
|
if (fields == null) return null;
|
||||||
|
|
||||||
|
for (autoBuild in Context.getLocalClass().get().meta.extract(":autoBuild"))
|
||||||
|
{
|
||||||
|
switch (autoBuild.params[0])
|
||||||
|
{
|
||||||
|
case macro lime._internal.macros.AssetsMacro.embedByteArray():
|
||||||
|
return null;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var superCall = Context.defined("html5") ? macro super(bytes.b.buffer)
|
var superCall = Context.defined("html5") ? macro super(bytes.b.buffer)
|
||||||
: Context.defined("hl") ? macro super(bytes.b, bytes.length)
|
: Context.defined("hl") ? macro super(bytes.b, bytes.length)
|
||||||
: macro super(bytes.length, bytes.b);
|
: macro super(bytes.length, bytes.b);
|
||||||
|
|||||||
@@ -61,13 +61,13 @@ class Promise<T>
|
|||||||
Whether the `Promise` (and related `Future`) has finished with a completion state.
|
Whether the `Promise` (and related `Future`) has finished with a completion state.
|
||||||
This will be `false` if the `Promise` has not been resolved with a completion or error state.
|
This will be `false` if the `Promise` has not been resolved with a completion or error state.
|
||||||
**/
|
**/
|
||||||
public var isComplete(get, null):Bool;
|
public var isComplete(get, never):Bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Whether the `Promise` (and related `Future`) has finished with an error state.
|
Whether the `Promise` (and related `Future`) has finished with an error state.
|
||||||
This will be `false` if the `Promise` has not been resolved with a completion or error state.
|
This will be `false` if the `Promise` has not been resolved with a completion or error state.
|
||||||
**/
|
**/
|
||||||
public var isError(get, null):Bool;
|
public var isError(get, never):Bool;
|
||||||
|
|
||||||
#if commonjs
|
#if commonjs
|
||||||
private static function __init__()
|
private static function __init__()
|
||||||
@@ -179,12 +179,12 @@ class Promise<T>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get & Set Methods
|
// Get & Set Methods
|
||||||
@:noCompletion private function get_isComplete():Bool
|
@:noCompletion private inline function get_isComplete():Bool
|
||||||
{
|
{
|
||||||
return future.isComplete;
|
return future.isComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
@:noCompletion private function get_isError():Bool
|
@:noCompletion private inline function get_isError():Bool
|
||||||
{
|
{
|
||||||
return future.isError;
|
return future.isError;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,11 +201,17 @@ class CPPHelper
|
|||||||
path = project.config.get("project.rebuild.path");
|
path = project.config.get("project.rebuild.path");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (path == null || !FileSystem.exists(path))
|
if (path == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!FileSystem.exists(path))
|
||||||
|
{
|
||||||
|
Log.warn("Skipping rebuild. Path not found: " + path + "\nIf you are using a release from Haxelib, source code for native binaries may not be bundled. To rebuild, you may need to check out the full repository.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (buildFile == null && project.config.exists("project.rebuild.file"))
|
if (buildFile == null && project.config.exists("project.rebuild.file"))
|
||||||
{
|
{
|
||||||
buildFile = project.config.get("project.rebuild.file");
|
buildFile = project.config.get("project.rebuild.file");
|
||||||
@@ -215,6 +221,7 @@ class CPPHelper
|
|||||||
|
|
||||||
if (!FileSystem.exists(Path.combine(path, buildFile)))
|
if (!FileSystem.exists(Path.combine(path, buildFile)))
|
||||||
{
|
{
|
||||||
|
Log.warn("Skipping rebuild. Path not found: " + path + "\nIf you are using a release from Haxelib, source code for native binaries may not be bundled. To rebuild, you may need to check out the full repository.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -765,7 +765,7 @@ class HXProject extends Script
|
|||||||
defines.set("targetType", "cpp");
|
defines.set("targetType", "cpp");
|
||||||
defines.set("cpp", "1");
|
defines.set("cpp", "1");
|
||||||
}
|
}
|
||||||
else if (target == Platform.WINDOWS && targetFlags.exists("mingw"))
|
else if (target == Platform.WINDOWS && (targetFlags.exists("cpp") || targetFlags.exists("mingw")))
|
||||||
{
|
{
|
||||||
defines.set("targetType", "cpp");
|
defines.set("targetType", "cpp");
|
||||||
defines.set("cpp", "1");
|
defines.set("cpp", "1");
|
||||||
@@ -773,6 +773,8 @@ class HXProject extends Script
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
targetFlags.set("neko", "1");
|
||||||
|
|
||||||
defines.set("targetType", "neko");
|
defines.set("targetType", "neko");
|
||||||
defines.set("neko", "1");
|
defines.set("neko", "1");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class HashlinkHelper
|
|||||||
case MAC: "Mac";
|
case MAC: "Mac";
|
||||||
case WINDOWS: "Windows";
|
case WINDOWS: "Windows";
|
||||||
default:
|
default:
|
||||||
Log.error('Hashlink is not supported on ${project.target} (Supported: Windows, Mac and Linux)');
|
Log.error('HashLink is not supported on ${project.target} (Supported: Windows, Mac and Linux)');
|
||||||
Sys.exit(1);
|
Sys.exit(1);
|
||||||
"";
|
"";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -324,6 +324,12 @@ class IOSHelper
|
|||||||
|
|
||||||
var currentDeviceID = XCodeHelper.getSimulatorID(project);
|
var currentDeviceID = XCodeHelper.getSimulatorID(project);
|
||||||
|
|
||||||
|
if (Log.verbose)
|
||||||
|
{
|
||||||
|
var currentSimulatorName = XCodeHelper.getSimulatorName(project);
|
||||||
|
Log.info("Using iOS simulator: " + currentSimulatorName);
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
System.runProcess("", "open", ["-Ra", "iOS Simulator"], true, false);
|
System.runProcess("", "open", ["-Ra", "iOS Simulator"], true, false);
|
||||||
@@ -353,14 +359,36 @@ class IOSHelper
|
|||||||
applicationPath = workingDirectory + "/build/" + configuration + "-iphoneos/" + project.app.file + ".app";
|
applicationPath = workingDirectory + "/build/" + configuration + "-iphoneos/" + project.app.file + ".app";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var xcodeVersion = Std.parseFloat(getXcodeVersion());
|
||||||
|
if (!Math.isNaN(xcodeVersion) && xcodeVersion >= 16) {
|
||||||
|
// ios-deploy doesn't work with newer iOS SDKs where it can't
|
||||||
|
// find DeveloperDiskImage.dmg. however, Xcode 16 adds new
|
||||||
|
// commands for installing and launching apps on connected
|
||||||
|
// devices, so we'll prefer those, if available.
|
||||||
|
var listDevicesOutput = System.runProcess("", "xcrun", ["devicectl", "list", "devices", "--hide-default-columns", "--columns", "Identifier", "--filter", "Platform == 'iOS' AND State == 'connected'"]);
|
||||||
|
var deviceUUID:String = null;
|
||||||
|
var ready = false;
|
||||||
|
for (line in listDevicesOutput.split("\n")) {
|
||||||
|
if (!ready) {
|
||||||
|
ready = StringTools.startsWith(line, "----");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
deviceUUID = line;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (deviceUUID == null || deviceUUID.length == 0) {
|
||||||
|
Log.error("No device connected");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
System.runCommand("", "xcrun", ["devicectl", "device", "install", "app", "--device", deviceUUID, FileSystem.fullPath(applicationPath)]);
|
||||||
|
System.runCommand("", "xcrun", ["devicectl", "device", "process", "launch", "--console", "--device", deviceUUID, project.meta.packageName]);
|
||||||
|
} else {
|
||||||
var templatePaths = [
|
var templatePaths = [
|
||||||
Path.combine(Haxelib.getPath(new Haxelib(#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end)
|
Path.combine(Haxelib.getPath(new Haxelib(#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end)
|
||||||
].concat(project.templatePaths);
|
].concat(project.templatePaths);
|
||||||
var launcher = System.findTemplate(templatePaths, "bin/ios-deploy");
|
var launcher = System.findTemplate(templatePaths, "bin/ios-deploy");
|
||||||
Sys.command("chmod", ["+x", launcher]);
|
Sys.command("chmod", ["+x", launcher]);
|
||||||
|
|
||||||
// var xcodeVersion = getXcodeVersion ();
|
|
||||||
|
|
||||||
System.runCommand("", launcher, [
|
System.runCommand("", launcher, [
|
||||||
"install",
|
"install",
|
||||||
"--noninteractive",
|
"--noninteractive",
|
||||||
@@ -370,6 +398,7 @@ class IOSHelper
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function sign(project:HXProject, workingDirectory:String):Void
|
public static function sign(project:HXProject, workingDirectory:String):Void
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1739,6 +1739,9 @@ class ProjectXMLParser extends HXProject
|
|||||||
case "gradle-version":
|
case "gradle-version":
|
||||||
config.set("android.gradle-version", value);
|
config.set("android.gradle-version", value);
|
||||||
|
|
||||||
|
case "gradle-plugin":
|
||||||
|
config.set("android.gradle-plugin", value);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
name = formatAttributeName(attribute);
|
name = formatAttributeName(attribute);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,11 @@ class XCodeHelper
|
|||||||
{
|
{
|
||||||
if (StringTools.startsWith(line, "--"))
|
if (StringTools.startsWith(line, "--"))
|
||||||
{
|
{
|
||||||
if (line.indexOf("iOS") > -1)
|
if (line.indexOf("Unavailable") > -1)
|
||||||
|
{
|
||||||
|
foundSection = false;
|
||||||
|
}
|
||||||
|
else if (line.indexOf("iOS") > -1)
|
||||||
{
|
{
|
||||||
foundSection = true;
|
foundSection = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
var $lime_init = (function ($hx_exports, $global) {
|
var $lime_init = (function ($hx_exports, $global) { "use strict"; var $hx_script = (function (exports, global) { ::SOURCE_FILE::
|
||||||
"use strict";
|
});::if false::
|
||||||
|
/*
|
||||||
|
Don't insert or remove any line breaks in the code above this line!
|
||||||
|
|
||||||
var $hx_script = (function (exports, global) {
|
::SOURCE_FILE:: must start on the first line.
|
||||||
::SOURCE_FILE::
|
|
||||||
});
|
|
||||||
|
|
||||||
|
Breakpoints in debug builds won't work if this file's line numbers don't
|
||||||
|
match the .js.map file's expected line numbers exactly.
|
||||||
|
|
||||||
|
Additionally, the }); after ::SOURCE_FILE:: must appear on the next line
|
||||||
|
to avoid it getting ignored in a // comment at the end of ::SOURCE_FILE::.
|
||||||
|
*/
|
||||||
|
::end::
|
||||||
if (typeof self !== "undefined" && self.constructor.name.includes("Worker")) {
|
if (typeof self !== "undefined" && self.constructor.name.includes("Worker")) {
|
||||||
// No need for exports in a worker context, just initialize statics.
|
// No need for exports in a worker context, just initialize statics.
|
||||||
$hx_script({}, $global);
|
$hx_script({}, $global);
|
||||||
|
|||||||
@@ -7,16 +7,8 @@ import sys.FileSystem;
|
|||||||
|
|
||||||
class RunScript
|
class RunScript
|
||||||
{
|
{
|
||||||
private static function rebuildTools(rebuildBinaries = true):Void
|
private static function rebuildTools(limeDirectory:String, toolsDirectory:String, rebuildBinaries = true):Void
|
||||||
{
|
{
|
||||||
var limeDirectory = Haxelib.getPath(new Haxelib("lime"), true);
|
|
||||||
var toolsDirectory = Path.combine(limeDirectory, "tools");
|
|
||||||
|
|
||||||
if (!FileSystem.exists(toolsDirectory))
|
|
||||||
{
|
|
||||||
toolsDirectory = Path.combine(limeDirectory, "../tools");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*var extendedToolsDirectory = Haxelib.getPath (new Haxelib ("lime-extended"), false);
|
/*var extendedToolsDirectory = Haxelib.getPath (new Haxelib ("lime-extended"), false);
|
||||||
|
|
||||||
if (extendedToolsDirectory != null && extendedToolsDirectory != "") {
|
if (extendedToolsDirectory != null && extendedToolsDirectory != "") {
|
||||||
@@ -135,6 +127,15 @@ class RunScript
|
|||||||
{
|
{
|
||||||
var args = Sys.args();
|
var args = Sys.args();
|
||||||
|
|
||||||
|
var limeDirectory = Haxelib.getPath(new Haxelib("lime"), true);
|
||||||
|
var toolsDirectory = Path.combine(limeDirectory, "tools");
|
||||||
|
|
||||||
|
if (!FileSystem.exists(toolsDirectory))
|
||||||
|
{
|
||||||
|
limeDirectory = Path.combine(limeDirectory, "..");
|
||||||
|
toolsDirectory = Path.combine(limeDirectory, "tools");
|
||||||
|
}
|
||||||
|
|
||||||
if (args.length > 2 && args[0] == "rebuild" && args[1] == "tools")
|
if (args.length > 2 && args[0] == "rebuild" && args[1] == "tools")
|
||||||
{
|
{
|
||||||
var lastArgument = new Path(args[args.length - 1]).toString();
|
var lastArgument = new Path(args[args.length - 1]).toString();
|
||||||
@@ -187,7 +188,7 @@ class RunScript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rebuildTools(rebuildBinaries);
|
rebuildTools(limeDirectory, toolsDirectory, rebuildBinaries);
|
||||||
|
|
||||||
if (args.indexOf("-openfl") > -1)
|
if (args.indexOf("-openfl") > -1)
|
||||||
{
|
{
|
||||||
@@ -207,8 +208,8 @@ class RunScript
|
|||||||
|
|
||||||
var args = [
|
var args = [
|
||||||
"-D", "lime",
|
"-D", "lime",
|
||||||
"-cp", "tools",
|
"-cp", toolsDirectory,
|
||||||
"-cp", "tools/platforms",
|
"-cp", Path.combine(toolsDirectory, "platforms"),
|
||||||
"-cp", "src",
|
"-cp", "src",
|
||||||
"-lib", "format",
|
"-lib", "format",
|
||||||
"-lib", "hxp",
|
"-lib", "hxp",
|
||||||
@@ -216,12 +217,13 @@ class RunScript
|
|||||||
Sys.exit(runCommand("", "haxe", args));
|
Sys.exit(runCommand("", "haxe", args));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!FileSystem.exists("tools/tools.n") || args.indexOf("-rebuild") > -1)
|
var tools_n = Path.combine(toolsDirectory, "tools.n");
|
||||||
|
if (!FileSystem.exists(tools_n) || args.indexOf("-rebuild") > -1)
|
||||||
{
|
{
|
||||||
rebuildTools();
|
rebuildTools(limeDirectory, toolsDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
var args = ["tools/tools.n"].concat(args);
|
var args = [tools_n].concat(args);
|
||||||
Sys.exit(runCommand("", "neko", args));
|
Sys.exit(runCommand("", "neko", args));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,6 +203,9 @@ class MacPlatform extends PlatformTarget
|
|||||||
|
|
||||||
if (noOutput) return;
|
if (noOutput) return;
|
||||||
|
|
||||||
|
// ensure that the shell script is replaced by the template executable
|
||||||
|
System.deleteFile(executablePath);
|
||||||
|
|
||||||
HashlinkHelper.copyHashlink(project, targetDirectory, executableDirectory, executablePath, true);
|
HashlinkHelper.copyHashlink(project, targetDirectory, executableDirectory, executablePath, true);
|
||||||
|
|
||||||
if (project.targetFlags.exists("hlc"))
|
if (project.targetFlags.exists("hlc"))
|
||||||
@@ -214,7 +217,7 @@ class MacPlatform extends PlatformTarget
|
|||||||
// compiler command with the `arch -x86_64` command.
|
// compiler command with the `arch -x86_64` command.
|
||||||
// if we ever support ARM or Universal binaries, this will
|
// if we ever support ARM or Universal binaries, this will
|
||||||
// need to be handled differently.
|
// need to be handled differently.
|
||||||
var command = ["arch", "-x86_64", compiler, "-O3", "-o", executablePath, "-std=c11", "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c")];
|
var command = ["arch", "-x86_64", compiler, "-O3", "-o", executablePath, "-std=c11", "-Wl,-rpath,@executable_path", "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c")];
|
||||||
for (file in System.readDirectory(executableDirectory))
|
for (file in System.readDirectory(executableDirectory))
|
||||||
{
|
{
|
||||||
switch Path.extension(file)
|
switch Path.extension(file)
|
||||||
|
|||||||
@@ -580,7 +580,7 @@ class WindowsPlatform extends PlatformTarget
|
|||||||
|
|
||||||
System.copyFile(targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : "") + ".exe", executablePath);
|
System.copyFile(targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : "") + ".exe", executablePath);
|
||||||
|
|
||||||
if (project.targetFlags.exists("mingw"))
|
if (project.defines.exists("mingw"))
|
||||||
{
|
{
|
||||||
var libraries = ["libwinpthread-1.dll", "libstdc++-6.dll"];
|
var libraries = ["libwinpthread-1.dll", "libstdc++-6.dll"];
|
||||||
if (is64)
|
if (is64)
|
||||||
|
|||||||
@@ -578,7 +578,7 @@ class PlatformSetup
|
|||||||
Log.println("download and extract the Adobe AIR SDK.");
|
Log.println("download and extract the Adobe AIR SDK.");
|
||||||
Log.println("");
|
Log.println("");
|
||||||
|
|
||||||
getDefineValue("AIR_SDK", "Path to AIR SDK");
|
getDefineValue("AIR_SDK", "Absolute path to AIR SDK");
|
||||||
|
|
||||||
Log.println("");
|
Log.println("");
|
||||||
Log.println("Setup complete.");
|
Log.println("Setup complete.");
|
||||||
@@ -593,12 +593,12 @@ class PlatformSetup
|
|||||||
Log.println("the SDK manager from Android Studio.\x1b[0m");
|
Log.println("the SDK manager from Android Studio.\x1b[0m");
|
||||||
Log.println("");
|
Log.println("");
|
||||||
|
|
||||||
getDefineValue("ANDROID_SDK", "Path to Android SDK");
|
getDefineValue("ANDROID_SDK", "Absolute path to Android SDK");
|
||||||
getDefineValue("ANDROID_NDK_ROOT", "Path to Android NDK");
|
getDefineValue("ANDROID_NDK_ROOT", "Absolute path to Android NDK");
|
||||||
|
|
||||||
if (System.hostPlatform != MAC)
|
if (System.hostPlatform != MAC)
|
||||||
{
|
{
|
||||||
getDefineValue("JAVA_HOME", "Path to Java JDK");
|
getDefineValue("JAVA_HOME", "Absolute path to Java JDK");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ConfigHelper.getConfigValue("ANDROID_SETUP") == null)
|
if (ConfigHelper.getConfigValue("ANDROID_SETUP") == null)
|
||||||
@@ -616,7 +616,7 @@ class PlatformSetup
|
|||||||
Log.println("and extract the Electron runtime on your system.");
|
Log.println("and extract the Electron runtime on your system.");
|
||||||
Log.println("");
|
Log.println("");
|
||||||
|
|
||||||
getDefineValue("ELECTRON_PATH", "Path to Electron runtime");
|
getDefineValue("ELECTRON_PATH", "Absolute path to Electron runtime");
|
||||||
|
|
||||||
Log.println("");
|
Log.println("");
|
||||||
Haxelib.runCommand("", ["install", "electron"], true, true);
|
Haxelib.runCommand("", ["install", "electron"], true, true);
|
||||||
@@ -1213,7 +1213,7 @@ class PlatformSetup
|
|||||||
Log.println("After install, the SDK path may be at \"emsdk/upstream/emscripten\"");
|
Log.println("After install, the SDK path may be at \"emsdk/upstream/emscripten\"");
|
||||||
Log.println("");
|
Log.println("");
|
||||||
|
|
||||||
getDefineValue("EMSCRIPTEN_SDK", "Path to Emscripten SDK");
|
getDefineValue("EMSCRIPTEN_SDK", "Absolute path to Emscripten SDK");
|
||||||
|
|
||||||
Log.println("");
|
Log.println("");
|
||||||
Log.println("Setup complete.");
|
Log.println("Setup complete.");
|
||||||
@@ -1239,13 +1239,17 @@ class PlatformSetup
|
|||||||
|
|
||||||
public static function setupHL():Void
|
public static function setupHL():Void
|
||||||
{
|
{
|
||||||
getDefineValue("HL_PATH", "Path to a custom version of Hashlink. Leave empty to use lime's default version.");
|
var message = "Absolute path to a custom version of HashLink.";
|
||||||
|
if (ConfigHelper.getConfigValue("HL_PATH") == null) {
|
||||||
|
message += " Leave empty to use Lime's default bundled version.";
|
||||||
|
}
|
||||||
|
getDefineValue("HL_PATH", message);
|
||||||
if (System.hostPlatform == MAC)
|
if (System.hostPlatform == MAC)
|
||||||
{
|
{
|
||||||
Log.println("To use the hashlink debugger on macOS, the hl executable needs to be signed.");
|
Log.println("To use the HashLink debugger on macOS, the hl executable needs to be signed.");
|
||||||
if (ConfigHelper.getConfigValue("HL_PATH") != null)
|
if (ConfigHelper.getConfigValue("HL_PATH") != null)
|
||||||
{
|
{
|
||||||
Log.println("When building HL from source, make sure to have run `make codesign_osx` before installing.");
|
Log.println("When building HashLink from source, you must run `make codesign_osx` before installing.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user