Skip to content

Commit

Permalink
Cast to double the float parameters before marshaling them: #83; Gene…
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldeicaza committed Jun 8, 2023
1 parent 43ac41b commit 85fc24a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Generator/Generator/Arguments.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,12 @@ func generateCopies (_ args: [JGodotArgument]) -> String {

for arg in args {
//if !isCoreType (name: arg.type) {
let reference = godotArgumentToSwift (arg.name)
var reference = godotArgumentToSwift (arg.name)

if isStructMap [arg.type] ?? false {
if arg.type == "float" {
reference = "Double (\(reference))"
}
body += "var copy_\(arg.name) = \(reference)\n"
} else if arg.type == "String" && mapStringToSwift {
body += "var gstr_\(arg.name) = GString (\(reference))\n"
Expand Down

0 comments on commit 85fc24a

Please sign in to comment.