Skip to content

Commit

Permalink
Updated to work with nim 0.20
Browse files Browse the repository at this point in the history
- Attempt to fix deprecated this:self pragma by injecting self to methods and properties (needs more testing)
- Changed import headers to use / (slash) instead of . (period)
- Fixed object branch in godotapigen.nim
- Fixed deprecated nimNode.ident with nimNode.strVal

Fix toGodotName function

Consider procCall calls as special cases, otherwise it gives problems in _init function

Fix infinite recursive call in Godot 3.2
  • Loading branch information
Dwana Games authored and endragor committed Sep 15, 2019
1 parent 34fda99 commit 0fecfdb
Show file tree
Hide file tree
Showing 23 changed files with 294 additions and 211 deletions.
2 changes: 1 addition & 1 deletion godot/core/aabb.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import hashes

import vector3
import internal.godotinternaltypes, internal.godotstrings
import internal/godotinternaltypes, internal/godotstrings
import godotcoretypes, gdnativeapi

proc initAABB*(pos, size: Vector3): AABB {.inline.} =
Expand Down
2 changes: 1 addition & 1 deletion godot/core/arrays.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2018 Xored Software, Inc.

import hashes
import internal.godotinternaltypes, internal.godotarrays
import internal/godotinternaltypes, internal/godotarrays

type
Array* = ref object
Expand Down
4 changes: 2 additions & 2 deletions godot/core/dictionaries.nim
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright 2018 Xored Software, Inc.

import hashes
import internal.godotinternaltypes, internal.godotdictionaries,
internal.godotvariants, internal.godotstrings
import internal/godotinternaltypes, internal/godotdictionaries,
internal/godotvariants, internal/godotstrings

type
Dictionary* = ref object
Expand Down
4 changes: 2 additions & 2 deletions godot/core/nodepaths.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import hashes

import internal.godotinternaltypes, internal.godotnodepaths,
internal.godotstrings
import internal/godotinternaltypes, internal/godotnodepaths,
internal/godotstrings

type
NodePath* = ref object
Expand Down
2 changes: 1 addition & 1 deletion godot/core/planes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import hashes

import vector3

import internal.godotinternaltypes, internal.godotstrings
import internal/godotinternaltypes, internal/godotstrings
import godotcoretypes, gdnativeapi

proc initPlane*(a, b, c, d: float32): Plane {.inline.} =
Expand Down
4 changes: 2 additions & 2 deletions godot/core/poolarrays.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import hashes

import godotcoretypes
import internal.godotinternaltypes, internal.godotpoolarrays,
internal.godotstrings
import internal/godotinternaltypes, internal/godotpoolarrays,
internal/godotstrings
import vector2, vector3, colors

template definePoolArrayBase(T, GodotT, DataT, fieldName, newProcName,
Expand Down
2 changes: 1 addition & 1 deletion godot/core/quats.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import hashes

import internal.godotinternaltypes, internal.godotstrings
import internal/godotinternaltypes, internal/godotstrings
import godotcoretypes, gdnativeapi

proc initQuat*(x, y, z, w: float32): Quat {.inline.} =
Expand Down
2 changes: 1 addition & 1 deletion godot/core/rect2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import hashes

import vector2
import internal.godotinternaltypes, internal.godotstrings
import internal/godotinternaltypes, internal/godotstrings
import godotcoretypes, gdnativeapi

{.push stackTrace: off.}
Expand Down
2 changes: 1 addition & 1 deletion godot/core/rids.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import hashes

import godotcoretypes, internal.godotinternaltypes, gdnativeapi
import godotcoretypes, internal/godotinternaltypes, gdnativeapi

proc initRID*(): RID {.inline.} =
getGDNativeAPI().ridNew(result)
Expand Down
2 changes: 1 addition & 1 deletion godot/core/transform2d.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import hashes, vector2

import internal.godotinternaltypes, internal.godotstrings
import internal/godotinternaltypes, internal/godotstrings
import godotcoretypes, gdnativeapi

proc initTransform2D*(): Transform2D {.inline.} =
Expand Down
2 changes: 1 addition & 1 deletion godot/core/transforms.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import hashes

import internal.godotinternaltypes, internal.godotstrings
import internal/godotinternaltypes, internal/godotstrings
import godotcoretypes, gdnativeapi
import basis, vector3

Expand Down
6 changes: 3 additions & 3 deletions godot/core/variants.nim
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import tables, hashes

import godotcoretypes
import internal.godotinternaltypes, internal.godotvariants,
internal.godotstrings, internal.godotdictionaries,
internal.godotarrays
import internal/godotinternaltypes, internal/godotvariants,
internal/godotstrings, internal/godotdictionaries,
internal/godotarrays

type
Variant* = ref object
Expand Down
2 changes: 1 addition & 1 deletion godot/core/vector2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import math, godotbase, hashes

import internal.godotinternaltypes, internal.godotstrings
import internal/godotinternaltypes, internal/godotstrings
import godotcoretypes, gdnativeapi

{.push stackTrace: off.}
Expand Down
4 changes: 2 additions & 2 deletions godot/gdnativeapi.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2018 Xored Software, Inc.

import internal.godotinternaltypes, core.godotcoretypes, macros
import internal/godotinternaltypes, core/godotcoretypes, macros

type
ColorData* {.byref.} = object
Expand Down Expand Up @@ -3593,7 +3593,7 @@ proc setGDNativeAPIInternal(apiStruct: pointer, initOptions: ptr GDNativeInitOpt
# Not used
discard

if not header.next.isNil:
if not header.next.isNil and header != header.next:
setGDNativeAPIInternal(header.next, initOptions,
foundCoreApi, foundNativeScriptApi)

Expand Down
16 changes: 8 additions & 8 deletions godot/godot.nim
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Copyright 2018 Xored Software, Inc.

import core.godotbase, godotinternal
import core.godotcoretypes
import core.vector2, core.rect2, core.vector3, core.transform2d, core.planes,
core.quats
import core.aabb, core.basis, core.transforms, core.colors, core.nodepaths,
core.rids
import core.dictionaries, core.arrays, core.poolarrays, core.variants
import core/godotbase, godotinternal
import core/godotcoretypes
import core/vector2, core/rect2, core/vector3, core/transform2d, core/planes,
core/quats
import core/aabb, core/basis, core/transforms, core/colors, core/nodepaths,
core/rids
import core/dictionaries, core/arrays, core/poolarrays, core/variants

import nim.godotmacros, nim.godotnim
import nim/godotmacros, nim/godotnim

export godotbase, godotcoretypes, vector2, rect2, vector3, transform2d, planes,
quats, aabb, basis, transforms, colors, nodepaths, rids, dictionaries,
Expand Down
Loading

0 comments on commit 0fecfdb

Please sign in to comment.