Skip to content

Commit

Permalink
Entity rework (#74)
Browse files Browse the repository at this point in the history
* Splitting Node into Entity/Node.

* Updates to `=destroy` hooks with new Nim version.

* Fixed test imports.
  • Loading branch information
avahe-kellenberger authored Dec 22, 2023
1 parent bef84d0 commit 2ed57c6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/shadepkg/game/ui/textbox.nim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type

TextBox* = ref TextBoxObj

proc `=destroy`(this: var TextBoxObj)
proc `=destroy`(this: TextBoxObj)

proc initTextBox*(
textBox: TextBox,
Expand Down Expand Up @@ -81,7 +81,7 @@ TextBox.renderAsEntityChild:
this.scale.y
)

proc `=destroy`(this: var TextBoxObj) =
proc `=destroy`(this: TextBoxObj) =
if this.imageOfText != nil:
freeImage(this.imageOfText)

2 changes: 1 addition & 1 deletion src/shadepkg/ui/ui_image.nim
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type
proc `scale=`*(this: UIImage, scale: Vector)
method getImageViewport*(this: UIImage): Rect {.base.}

proc `=destroy`(this: var UIImageObj) =
proc `=destroy`(this: UIImageObj) =
if this.image != nil:
freeImage(this.image)

Expand Down
2 changes: 1 addition & 1 deletion src/shadepkg/ui/ui_text.nim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type
UITextComponent* = ref UITextComponentObj

proc determineWidthAndHeight*(this: UITextComponent)
proc `=destroy`(this: var UITextComponentObj) =
proc `=destroy`(this: UITextComponentObj) =
if this.imageOfText != nil:
freeImage(this.imageOfText)

Expand Down
4 changes: 1 addition & 3 deletions tests/shade/collisionshape_test.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import
nimtest,
shade
import ../../src/shade, nimtest

describe "CollisionShape tests":

Expand Down
4 changes: 1 addition & 3 deletions tests/shade/math/aabb_test.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import
shade,
nimtest
import ../../../src/shade, nimtest

describe "AABB":

Expand Down

0 comments on commit 2ed57c6

Please sign in to comment.