Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Examples/FlappySwift/Sources/FlappySwift/Game.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ final class TestScene: Scene {}

// MARK: - Game

@PlaydateMain
final class Game: PlaydateGame {
var highScore = 0

Expand Down
18 changes: 18 additions & 0 deletions Examples/FlappySwift/Sources/FlappySwift/entry.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import PlaydateKit

/// Boilerplate entry code
nonisolated(unsafe) var game: Game!
@_cdecl("eventHandler") func eventHandler(
pointer: UnsafeMutablePointer<PlaydateAPI>!,
event: System.Event,
arg _: CUnsignedInt
) -> CInt {
switch event {
case .initialize:
Playdate.initialize(with: pointer)
game = Game()
System.updateCallback = game.update
default: game.handle(event)
}
return 0
}
1 change: 0 additions & 1 deletion Examples/Pong/Sources/Pong/Game.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import PlaydateKit

// MARK: - Game

@PlaydateMain
final class Game: PlaydateGame {
// MARK: Lifecycle

Expand Down
18 changes: 18 additions & 0 deletions Examples/Pong/Sources/Pong/entry.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import PlaydateKit

/// Boilerplate entry code
nonisolated(unsafe) var game: Game!
@_cdecl("eventHandler") func eventHandler(
pointer: UnsafeMutablePointer<PlaydateAPI>!,
event: System.Event,
arg _: CUnsignedInt
) -> CInt {
switch event {
case .initialize:
Playdate.initialize(with: pointer)
game = Game()
System.updateCallback = game.update
default: game.handle(event)
}
return 0
}
1 change: 0 additions & 1 deletion Examples/Xkpd/Sources/Xkpd/Game.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import PlaydateKit

// MARK: - Game

@PlaydateMain
final class Game: PlaydateGame {
// MARK: Lifecycle

Expand Down
18 changes: 18 additions & 0 deletions Examples/Xkpd/Sources/Xkpd/entry.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import PlaydateKit

/// Boilerplate entry code
nonisolated(unsafe) var game: Game!
@_cdecl("eventHandler") func eventHandler(
pointer: UnsafeMutablePointer<PlaydateAPI>!,
event: System.Event,
arg _: CUnsignedInt
) -> CInt {
switch event {
case .initialize:
Playdate.initialize(with: pointer)
game = Game.instance
System.updateCallback = game.update
default: game.handle(event)
}
return 0
}
15 changes: 0 additions & 15 deletions Package.resolved

This file was deleted.

13 changes: 1 addition & 12 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// swift-tools-version: 6.1

import PackageDescription
import CompilerPluginSupport

let armToolchainPath: String = if let path = Context.environment["ARM_NONE_EABI_GCC_PATH"] {
path
Expand Down Expand Up @@ -38,20 +37,10 @@ let package = Package(
.plugin(name: "PDCPlugin", targets: ["PDCPlugin"]),
.plugin(name: "RenamePlugin", targets: ["RenamePlugin"])
],
dependencies: [
.package(url: "https://github.com/swiftlang/swift-syntax.git", from: "601.0.1"),
],
targets: [
.macro(
name: "PlaydateKitMacros",
dependencies: [
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax")
]
),
.target(
name: "PlaydateKit",
dependencies: ["CPlaydate", "PlaydateKitMacros"],
dependencies: ["CPlaydate"],
swiftSettings: [
.enableExperimentalFeature("Embedded"),
.unsafeFlags([
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Your `PlaydateGame` object manages the game lifecycle, receiving events such as
```swift
import PlaydateKit

@PlaydateMain
final class Game: PlaydateGame {
init() {
System.addCheckmarkMenuItem(title: "check me") { isChecked in
Expand Down
7 changes: 0 additions & 7 deletions Sources/PlaydateKit/PlaydateMain.swift

This file was deleted.

58 changes: 0 additions & 58 deletions Sources/PlaydateKitMacros/PlaydateMainMacro.swift

This file was deleted.