Commit Graph

5711 Commits

Author SHA1 Message Date
Josh Tynjala
951d5510c2 GameActivity: check for VIBRATE permission on Android
While we add this permission by default, if a developer sets custom permissions, we want to avoid crashing when we try to access an API that we don't have permission to use
2025-01-07 12:47:30 -08:00
Josh Tynjala
44dd331801 libjpeg: fix rendering on 32-bit platforms
Fixes SIZEOF_SIZE_T on 32-bit platforms that should be 4 instead of 8

Tested on Windows x86_32 and Android armv7
2025-01-07 09:43:21 -08:00
Josh Tynjala
57cf88b02d CommandLineTools: set macos define when using cpp target on macOS (closes #1878)
It should behave the same as mac or macos target.
2025-01-06 10:07:12 -08:00
Tobiasz Laskowski
37e7580720 Fix module paths for haxe 5
Haxe 5 will no longer support module resolution like this. See:
https://github.com/HaxeFoundation/haxe/issues/9150
2025-01-06 09:44:13 -08:00
Joshua Granick
69086df206 Update NOTICE.md 2025-01-02 09:32:18 -08:00
Joshua Granick
39af23f0ce Update LICENSE.md 2025-01-02 09:29:50 -08:00
Josh Tynjala
cad525da56 8.2.2 8.2.2 2024-12-19 10:32:15 -08:00
Tobiasz Laskowski
d2129bbd64 Respect -cpp flag for windows cross compile 2024-12-18 08:48:18 -08:00
Tobiasz Laskowski
988a0e836f Add missing neko target flag on cross compile
Otherwise, we end up with a cpp build instead.
For cross compiling with mingw, this breaks the build since no mingw
flag is set.
2024-12-18 08:48:18 -08:00
ACrazyTown
45505f433a Fix ImageDataUtil.copyPixels crash on Hashlink (#1875)
* Fix copyPixels crash on Hashlink

* Move nullcheck to C++

* Simplify further

* Avoid unneccessary object allocation

* Formatting

* Simplify by using an if statement
2024-12-16 07:41:37 -08:00
Josh Tynjala
9c4fa35361 Font: a little extra null safety for hhea and os2 font data, just to be safe
Followup to 62ab8eb6fc
2024-12-13 14:46:58 -08:00
Josh Tynjala
0db3c7c095 Font: experimental LIME_FREETYPE_SWF_METRICS define that more closely matches SWF behavior for font metrics like ascent/descent
We're currently using freetype 2.9.1's algorithm for choosing font metrics, but it's not exactly the same as SWF (but it is closer than freetype 2.10's new algorithm).

This algorithm should more closely match the font metrics used by AS3 compilers when embedding fonts with [Embed] metadata in AS3.
2024-12-13 14:26:38 -08:00
Josh Tynjala
62ab8eb6fc Font: fall back to using freetype's 2.9.1 algorithm for calculating font metrics like ascent/descent
This allows us to upgrade freetype beyond 2.9.1 (actually, 2.8.1 due to a bug in freetype 2.9) without wildly different font metrics. The reason that we don't want to change font metrics algorithms is that freetype's new algorithm is very different than the algorithm used for SWF fonts. The older freetype algorithm is closer to SWF, so we want to stick with it.

Thankfully, freetype supports accessing various metrics stored in font files in a more raw form, so we can provide our own custom algorithm in a way that is fully supported by freetype. I just copied the existing algorithm straight from 2.9.1 to restore our preferred behavior.

I confirmed that, after this change, OpenFL renders metrics like Lime 8.1.3. But we have the same upgraded freetype as Lime 8.2.0 that we had to revert for 8.2.1.

I plan to experiment with a mode that matches SWF even more closely, now that I have a better understanding of how fonts and freetype work.
2024-12-13 13:47:19 -08:00
Josh Tynjala
27d1d8b9d4 Revert "freetype: roll back to freetype version 2.9.1"
This reverts commit c4faf58ff0.
2024-12-13 13:37:16 -08:00
Josh Tynjala
90b2b1fa80 Revert "freetype: roll back to 2.8.1 to fix issues with character spacing"
This reverts commit ac3040c1ed.
2024-12-13 13:36:56 -08:00
Josh Tynjala
ac3040c1ed freetype: roll back to 2.8.1 to fix issues with character spacing 2024-12-12 10:41:08 -08:00
player-03
0b08e7fa61 Merge pull request #1873 from player-03/RunScript_absolute_paths
Use absolute paths when running Lime.
2024-12-10 20:38:40 -05:00
player-03
8a1083be25 Use absolute paths when running Lime. 2024-12-09 12:39:09 -05:00
Josh Tynjala
c81ad95ae5 output.js: fix broken breakpoints in debug builds (closes #1872)
::SOURCE_FILE:: must appear on the first line so that the .js.map line numbers match with our generated .js file line numbers

Added a comment to explain why that part of the file isn't formatted nicely with line breaks like the rest of the file.

This partially reverts bbcb8bea07
2024-12-09 09:23:12 -08:00
player-03
d6e20eb987 Don't run embedBytes() if embedByteArray() is also running. (#1871)
* Don't run `embedBytes()` if `embedByteArray()` is also running.

Both functions insert a constructor, and one class can't have two constructors, much less call `super()` with two different signatures.

I can only assume a bug in Haxe that prevented this from being an issue until now, and that Haxe 5 is fixing the bug.

* Check for `@:autoBuild` only after checking for embed data.

If we ever decide to handle the case of the embed functions being called for non-classes (meaning `getLocalClass()` would return null), we'd handle it in `embedData()`. Therefore `embedData()` should happen first.
2024-12-06 16:14:58 -05:00
Josh Tynjala
5905e7cc6f CPPHelper: warn when rebuild command cannot find C++ project source files
Typically, you can't run rebuild with Haxelib releases and need to check out from Git
2024-12-04 08:48:25 -08:00
Josh Tynjala
5db8f1de4e actions: macos-12 is no longer supported, so bump to macos-13 2024-12-03 10:26:50 -08:00
player-03
71e45e3258 Merge pull request #1836 from player-03/Promise_unnecessary_operations
Remove unnecessary operations in `Promise`.
2024-12-03 11:21:04 -05:00
Josh Tynjala
837534c05d IOSHelper: fix lime test ios with Xcode 16 or newer
The ios-deploy tool no longer works with new iOS SDKs that don't have DeveloperDiskImage.dmg, but Xcode added new commands that can be used in the terminal to install and launch on connected devices.
2024-12-02 11:24:45 -08:00
Josh Tynjala
c3b749b415 MacPlatform: fix duplicate shell scripts when building without -clean and copyIfNewer decides the HL executable isn't newer 2024-12-02 10:29:11 -08:00
Josh Tynjala
4812f6a1dd MacPlatform: fix error that says @rpath/libhl.dylib is not found when using HashLink nightly builds for HL/C
Added `@executable_path` to the rpath.
2024-11-20 15:44:08 -08:00
Josh Tynjala
61ec7d0913 PlatformSetup: for lime setup hashlink, display the "leave empty to use default" message only when a custom version is not configured yet
If a custom version is configured, users will think that just pressing enter will clear it, but it won't. It'll just keep the current value. To actually clear the value, they need to run lime config remove HL_PATH instead.
2024-11-20 09:35:57 -08:00
Joseph Cloutier
a03c0c31f3 Fix whitespace. 2024-11-19 20:09:22 -05:00
win11
c0e1a1b4a4 Clean up PNG and JPEG encoding properly 2024-11-19 14:45:25 -08:00
Chris Speciale
1b6a884692 Update scripts 2024-11-14 09:11:11 -05:00
Josh Tynjala
3d10ea7eb6 PlatformSetup: improve HL_PATH message with capital L in Lime and add bundled descriptor 2024-11-13 11:16:20 -08:00
Josh Tynjala
5388c47a8b PlatformSetup: more formal grammar 2024-11-13 11:15:06 -08:00
Josh Tynjala
19b571d8c2 HashlinkHelper, PlatformSetup: proper casing in user-facing messages for HashLink name 2024-11-13 11:13:16 -08:00
Josh Tynjala
4e56bd9bf2 PlatformSetup: specify that absolute path is required for config values 2024-11-13 11:11:07 -08:00
Josh Tynjala
68f531eaba openal: custom version.h was not updated when switching to new version 2024-11-11 14:20:55 -08:00
Josh Tynjala
de665a5fe5 IOSHelper: when -verbose is specified, print the name of the selected iOS simulator
This can be useful for debugging when the way that we select a simulator needs to be tweaked. For instance, I recently fixed an issue where "Unavailable" simulators could be automatically selected, but I saw only a UUID instead of the device name in the output, so it was hard to figure out which simulator had been selected.
2024-11-11 08:57:49 -08:00
Josh Tynjala
35d23c6ced XCodeHelper: fix issue where lime test ios -simulator may try to install app on unavailable iOS simulators 2024-11-11 08:50:32 -08:00
player-03
051f4d5f00 Merge pull request #1858 from giuppe/patch-1
Fix: attribute "gradle-plugin" of android config is never read
2024-11-07 19:51:12 -05:00
Giuppe
b52223e360 Fix: attribute "gradle-plugin" in Project.xml <android> tag is never read 2024-11-08 01:34:50 +01:00
Josh Tynjala
36b14e9469 prepare for 8.2.1 8.2.1 2024-10-31 15:22:56 -07:00
Chris Speciale
6de4b67620 CFFI fix
Accept 3 values instead of 2. Incidentally, I thought this was going to be a rather simple straightforward change, but I suppose not.
2024-10-30 13:23:37 -04:00
Chris Speciale
c6165350c6 Font: renderGlyphs should use the internal __setSize() 2024-10-30 13:17:50 -04:00
Chris Speciale
d2562997bf Update CairoBindings to use a default of 72 dpi for fonts
We use a default of 72 for now to ensure text is formatted correctly. Not entirely sure why we are stuck on 72 but that is an investigation for the future.
2024-10-30 13:14:32 -04:00
Chris Speciale
17bd36ac29 Fix compilation for cpp 2024-10-30 13:08:21 -04:00
Chris Speciale
fa77a6b370 Font: Make sure we pass dpi value 2024-10-30 13:04:06 -04:00
Chris Speciale
2f99776336 Font: Set 72 as default dpi for backwards compatibility 2024-10-30 12:56:16 -04:00
Chris Speciale
579efa5351 Font: Allow setting dpi internally
This fixes some unexpected changes in text rendering for OpenFL which rely on a private function in Lime. Previously we defaulted at 72 dpi, which apparently is expected to layout the text properly. Most displays are 96 dpi or higher today, so we should probably look into this. For RenderGlyph, which was previously broken over several versions, we will now use a dpi of 96 for now. In the next version of lime, we absolutely should alter the function signature to allow for renderGlyph to accept a dpi argument.
2024-10-30 12:49:30 -04:00
Chris Speciale
dbfd6615c0 Merge branch 'develop' of https://github.com/openfl/lime into develop 2024-10-30 12:20:14 -04:00
Chris Speciale
e6fa4e73d4 Revert "SetSize should use 96 dpi for now"
This reverts commit 9cbdc83605.
2024-10-30 12:12:58 -04:00
Josh Tynjala
c4faf58ff0 freetype: roll back to freetype version 2.9.1
tag VER-2-9-1

Starting with freetype 2.10.0, the sum of the ascent and descent values seem to be more likely to be less than the baseline-to-baseline measurement (called the font's height), which is the font designer's recommend distance between baselines. However, OpenFL doesn't account for the full baseline-to-baseline height at all, so with smaller ascent and descent values, lines render with smaller gaps between them. OpenFL needs to update its TextEngine algorithm to use the height of the line instead of adding ascent and descent together alone, and then we can update freetype. Updating TextEngine is not a trivial change, and may likely require time to discover bugs and stabilize, so it's better to roll back the freetype update for now, and apply it again later after OpenFL can handle it properly.
2024-10-29 15:48:38 -07:00