Added optimized device builds and harden the Embedded toolchain setup in both the PlayDate bindings and HelloPlayDate example targets.
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user