Skip to content

Commit c62610f

Browse files
authored
SaveState Audit (#29)
1 parent ce84f07 commit c62610f

File tree

162 files changed

+2210
-1012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+2210
-1012
lines changed

.github/workflows/Android.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,27 @@ on:
33
workflow_dispatch:
44
push:
55
branches:
6-
- '**' # matches every branch
6+
- 'main'
77
pull_request:
88
branches:
9-
- 'main'
9+
- '**'
1010

1111
jobs:
1212
Build_Test-Linux-Android:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
1616

17+
- name: Install Android SDK
18+
run: |
19+
cd ..
20+
wget -q https://github.com/finagolfin/swift-android-sdk/releases/download/5.8/swift-5.8-android-24-sdk.tar.xz
21+
tar xf swift-5.8-android-24-sdk.tar.xz
22+
cd GateEngine
1723
- name: Swift Version
1824
run: swift --version
1925

2026
- name: Build using Swift
21-
run: swift build
27+
run: swift build --destination ../swift-5.8-android-24-sdk/usr/swiftpm-android-aarch64.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
2228
- name: Test using Swift
23-
run: swift test
29+
run: swift test --destination ../swift-5.8-android-24-sdk/usr/swiftpm-android-aarch64.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android

.github/workflows/HTML5.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
name: HTML5
2-
32
on:
43
workflow_dispatch:
54
push:
65
branches:
7-
- '**' # matches every branch
6+
- 'main'
87
pull_request:
98
branches:
10-
- 'main'
9+
- '**'
1110

1211
jobs:
13-
Build_Test-Linux-WASI:
14-
runs-on: ubuntu-latest
15-
16-
container:
17-
image: ghcr.io/swiftwasm/carton:latest
18-
12+
Build_Test-macOS-WASI:
13+
runs-on: macos-latest
14+
1915
steps:
2016
- uses: actions/checkout@v3
2117

22-
- name: Swift Version
23-
run: swift --version
18+
- name: Install Carton
19+
run: brew install swiftwasm/tap/carton
2420

25-
- name: Test
26-
run: carton test --environment node
21+
- name: Test Insecure Context
22+
run: carton test --environment defaultBrowser --host 127.0.0.1
23+
24+
#TODO: Figure out how to make chrome default without a confirmation
25+
#- name: Make Chrome Default
26+
# run: open -a "Google Chrome" --args --make-default-browser
27+
28+
#- name: Test Secure Context
29+
# run: carton test --environment defaultBrowser --host localhost

.github/workflows/Linux.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ on:
44
workflow_dispatch:
55
push:
66
branches:
7-
- '**' # matches every branch
7+
- 'main'
88
pull_request:
99
branches:
10-
- 'main'
10+
- '**'
1111

1212
jobs:
1313
Build_Test-Linux-Linux:
@@ -16,10 +16,9 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v3
19-
- name: Deps Update
20-
run: sudo apt-get update --fix-missing
21-
- name: Deps Install
22-
run: sudo apt-get install freeglut3-dev; sudo apt-get install libopenal-dev
19+
20+
- name: Install Linux Dependencies
21+
run: sudo apt-get update --fix-missing; sudo apt-get install freeglut3-dev; sudo apt-get install libopenal-dev
2322

2423
- name: Swift Version
2524
run: swift --version

.github/workflows/Windows.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
name: Windows
2-
32
on:
43
workflow_dispatch:
54
push:
65
branches:
7-
- '**' # matches every branch
6+
- 'main'
87
pull_request:
98
branches:
10-
- 'main'
9+
- '**'
1110

1211
jobs:
1312
Build_Test-Windows-Windows:
1413
runs-on: windows-latest
1514
steps:
1615
- uses: compnerd/gha-setup-swift@main
1716
with:
18-
branch: swift-5.8-release
19-
tag: 5.8-RELEASE
17+
branch: swift-5.8.1-release
18+
tag: 5.8.1-RELEASE
2019
- uses: actions/checkout@v3
2120

2221
- name: Swift Version

.github/workflows/iOS-tvOS.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ on:
33
workflow_dispatch:
44
push:
55
branches:
6-
- '**' # matches every branch
6+
- 'main'
77
pull_request:
88
branches:
9-
- 'main'
9+
- '**'
1010

1111
jobs:
1212
Build_Test-macOS-iOS:
1313
runs-on: macos-13
1414
steps:
1515
- uses: actions/checkout@v3
16+
1617
- name: Select Xcode version
1718
run: sudo xcode-select -s '/Applications/Xcode_14.3.app/Contents/Developer'
1819

.github/workflows/macOS.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ on:
33
workflow_dispatch:
44
push:
55
branches:
6-
- '**' # matches every branch
6+
- 'main'
77
pull_request:
88
branches:
9-
- 'main'
9+
- '**'
1010

1111
jobs:
1212
Build_Test-macOS-macOS:
1313
runs-on: macos-13
1414
steps:
1515
- uses: actions/checkout@v3
16+
1617
- name: Select Xcode version
1718
run: sudo xcode-select -s '/Applications/Xcode_14.3.app/Contents/Developer'
1819

Package.swift

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ let package = Package(
6262
dependencies.append(contentsOf: [
6363
.product(name: "JavaScriptEventLoop", package: "JavaScriptKit", condition: .when(platforms: [.wasi])),
6464
.product(name: "DOM", package: "WebAPIKit", condition: .when(platforms: [.wasi])),
65+
.product(name: "FileSystem", package: "WebAPIKit", condition: .when(platforms: [.wasi])),
6566
.product(name: "WebAudio", package: "WebAPIKit", condition: .when(platforms: [.wasi])),
6667
.product(name: "Gamepad", package: "WebAPIKit", condition: .when(platforms: [.wasi])),
6768
.product(name: "WebGL2", package: "WebAPIKit", condition: .when(platforms: [.wasi])),
@@ -74,7 +75,7 @@ let package = Package(
7475
.copy("_Resources/GateEngine"),
7576
],
7677
cSettings: [
77-
.define("GL_SILENCE_DEPRECATION", .when(platforms: [.macOS, .iOS, .tvOS])),
78+
.define("GL_SILENCE_DEPRECATION", .when(platforms: [.macOS])),
7879
.define("GLES_SILENCE_DEPRECATION", .when(platforms: [.iOS, .tvOS])),
7980
],
8081
swiftSettings: {
@@ -92,14 +93,20 @@ let package = Package(
9293
.define("GATEENGINE_WASI_UNSUPPORTED_HOST", .when(platforms: [.windows])),
9394
/// The host platform updates and draws from an event callback, so GateEngine won't create a game loop.
9495
.define("GATEENGINE_PLATFORM_EVENT_DRIVEN", .when(platforms: [.wasi])),
95-
/// The host pltfrom requires an intermediate task, so GateEngine won't load default systems.
96+
/// The host platform requires an intermediate task, so GateEngine won't load default systems.
9697
.define("GATEENGINE_PLATFORM_DEFERS_LAUNCH", .when(platforms: [.wasi])),
98+
/// The host platform supports file system read/write
99+
.define("GATEENGINE_PLATFORM_HAS_FILESYSTEM", .when(platforms: [.macOS, .windows, .linux, .iOS, .tvOS, .android, .wasi])),
100+
/// The host platform supports Foundation.FileManager
101+
.define("GATEENGINE_PLATFORM_SUPPORTS_FOUNDATION_FILEMANAGER", .when(platforms: [.macOS, .windows, .linux, .iOS, .tvOS, .android])),
102+
/// The host platform requires an intermediate task, so GateEngine won't load default systems.
103+
.define("GATEENGINE_ASYNCLOAD_CURRENTPLATFORM", .when(platforms: [.macOS, .windows, .linux, .iOS, .tvOS, .android])),
97104
])
98105

99106
#if false // Options for development of GateEngine. These should be commented out for tagged version releases.
100107
#warning("GateEngine development options are enabled. These can cause strange build errors on some platforms.")
101108

102-
// Options for developments of WASI platform
109+
// Options for development of WASI platform
103110
#if false
104111
settings.append(contentsOf: [
105112
/// Allows HTML5 platform to be compiled from a compatible host, such as macOS. This allows the IDE to show compile errors without targeting WASI.
@@ -110,14 +117,16 @@ let package = Package(
110117
#endif
111118

112119
settings.append(contentsOf: [
113-
/// Printers the output of generated shaders
120+
/// Prints the output of generated shaders
114121
.define("GATEENGINE_LOG_SHADERS"),
115122
/// Enables various additional checks and output for rendering
116123
.define("GATEENGINE_DEBUG_RENDERING"),
117124
/// Enables various additional checks and output for input
118125
.define("GATEENGINE_DEBUG_HID"),
126+
/// Enables varius additional, additional, checks and output for input
127+
.define("GATEENGINE_DEBUG_HID_VERBOSE"),
119128
/// Forces Apple platforms to use OpenGL for rendering
120-
.define("GATEENGINE_FORCE_OPNEGL_APPLE", .when(platforms: [.macOS, .iOS, .tvOS])),
129+
.define("GATEENGINE_FORCE_OPNEGL_APPLE", .when(platforms: [.macOS, /*.iOS, .tvOS*/])),
121130
])
122131
#endif
123132
return settings

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Gate Engine includes intuitive APIs for loading resources, handling user inputs,
77
|---------:|:---|:-------|:------|:----------|:-----|:------|:--------|
88
| [**Windows**](https://www.swift.org/getting-started/#on-windows)¹ | [![](https://img.shields.io/github/actions/workflow/status/STREGAsGate/GateEngine/Windows.yml?label=)](https://github.com/STREGAsGate/GateEngine/actions/workflows/Windows.yml) | ✔︎ || ✔︎ | ✔︎ || ✔︎ |
99
| [**macOS**](https://apps.apple.com/us/app/xcode/id497799835) | [![](https://img.shields.io/github/actions/workflow/status/STREGAsGate/GateEngine/macOS.yml?label=)](https://github.com/STREGAsGate/GateEngine/actions/workflows/macOS.yml) | ✔︎ | ✔︎ | ✔︎ | ✔︎ | ✔︎ | ✔︎ |
10-
| [**Linux**](https://www.swift.org/getting-started/#on-linux) | [![](https://img.shields.io/github/actions/workflow/status/STREGAsGate/GateEngine/Linux.yml?label=)](https://github.com/STREGAsGate/GateEngine/actions/workflows/Linux.yml) | ✔︎ | ✔︎ | ✔︎ | ✔︎ | ⛌ |
10+
| [**Linux**](https://www.swift.org/getting-started/#on-linux) | [![](https://img.shields.io/github/actions/workflow/status/STREGAsGate/GateEngine/Linux.yml?label=)](https://github.com/STREGAsGate/GateEngine/actions/workflows/Linux.yml) | ✔︎ | ✔︎ | ✔︎ | ✔︎ | ⛌ | ✔︎
1111
| [**iOS**/**tvOS**](https://apps.apple.com/us/app/xcode/id497799835) | [![](https://img.shields.io/github/actions/workflow/status/STREGAsGate/GateEngine/iOS-tvOS.yml?label=)](https://github.com/STREGAsGate/GateEngine/actions/workflows/iOS-tvOS.yml) | ✔︎ | ✔︎ | ✔︎ | ✔︎`iPad` | ✔︎ | ✔︎
1212
| **Android** | [![](https://img.shields.io/github/actions/workflow/status/STREGAsGate/GateEngine/Android.yml?label=)](https://github.com/STREGAsGate/GateEngine/actions/workflows/Android.yml) | ⛌ | ⛌ | ⛌ | ⛌ | ⛌ | ⛌
1313
| [**HTML5**](https://book.swiftwasm.org/getting-started/setup.html) | [![](https://img.shields.io/github/actions/workflow/status/STREGAsGate/GateEngine/HTML5.yml?label=)](https://github.com/STREGAsGate/GateEngine/actions/workflows/HTML5.yml) | ✔︎ | ✔︎ | ✔︎ | ✔︎ | ✔︎ | ✔︎ |

Sources/GameMath/2D Types/2D Physics/2D Colliders/BoundingCircle2D.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ public extension BoundingCircle2D {
121121
let radius2 = radius * radius
122122
if d2 > radius2 {return nil}
123123
let thc = (radius2 - d2).squareRoot()
124-
var t0 = tca - thc;
125-
var t1 = tca + thc;
124+
var t0 = tca - thc
125+
var t1 = tca + thc
126126

127127
if t0 > t1 {
128128
swap(&t0, &t1)

Sources/GameMath/2D Types/Direction2.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* http://stregasgate.com
66
*/
77

8-
import Foundation
9-
108
public struct Direction2: Vector2 {
119
public var x: Float
1210
public var y: Float

0 commit comments

Comments
 (0)