Added optimized device builds and harden the Embedded toolchain setup in both the PlayDate bindings and HelloPlayDate example targets.

This commit is contained in:
2026-07-25 10:53:44 +02:00
parent dfeadabfb6
commit 19af75cf7b
6 changed files with 47 additions and 7 deletions
+4 -1
View File
@@ -60,7 +60,10 @@ extension Graphics {
/// Renders frame `frame` into the current context.
public func renderFrame(_ frame: Int) throws(PlaydateError) {
guard videoAPI.pointee.renderFrame.unsafelyUnwrapped(pointer, Int32(frame)) != 0 else {
throw PlaydateError(message: error ?? "unable to render frame \(frame)")
// Static message: the caller knows the frame it passed, and
// interpolating it would pull integer formatting machinery
// into the device binary.
throw PlaydateError(message: error ?? "unable to render frame")
}
}
+3 -1
View File
@@ -170,8 +170,10 @@ extension JSON {
return try decode(file: file)
}
// Static message: interpolating the line number would pull integer
// formatting machinery into every device binary that decodes JSON.
private static func decodeError(_ context: DecodeContext) -> PlaydateError {
PlaydateError(message: "\(context.errorMessage ?? "JSON decode failed") (line \(context.errorLine))")
PlaydateError(message: context.errorMessage ?? "JSON decode failed")
}
// MARK: - Encoding