quick question : copies or references?

BlitzMax Forums/BlitzMax Programming/quick question : copies or references?

SoggyP(Posted 2006) [#1]
Hello.

Consider the following code:
incbin "Tree01.bmp"
global tree_im = loadimage("incbin::Tree01.bmp")

type TreeType
  field id:int
  field im:Timage

  method CreateTree()
    local tree:Treetype = new treetype
    tree.id = 1
    tree.im = tree_im
  end method
end type


Am I creating a new image or do I just have a reference to tree_im?

Goodbye.


N(Posted 2006) [#2]
It's a reference to tree_im.


SoggyP(Posted 2006) [#3]
Hello.

Ta, oh noodle of knowledge :o)

Goodbye.


tonyg(Posted 2006) [#4]
You might need tree_im to be TImage as well.