diff --git a/src/raylib.nim b/src/raylib.nim index d319b2d..ce77105 100644 --- a/src/raylib.nim +++ b/src/raylib.nim @@ -2650,18 +2650,18 @@ proc `[]=`*(x: var MaterialMaps, i: MaterialMapIndex, val: MaterialMap) = checkArrayAccess(Material(x).maps, i.int, MaxMaterialMaps) Material(x).maps[i.int] = val -proc `texture=`*(x: var MaterialMap, val: Texture{lvalue}) {.nodestroy, inline.} = +proc `texture=`*(x: var MaterialMap, val: Texture) {.nodestroy, inline.} = ## Set texture for a material map type (Diffuse, Specular...) ## NOTE: Previous texture should be manually unloaded x.texture = val -template `texture=`*(x: var MaterialMap, val: Texture) = +template `texture=`*(x: var MaterialMap, val: Texture{call}) = {.error: "Cannot pass a rvalue, as `x` does not take ownership of the texture.".} -proc `shader=`*(x: var Material, val: Shader{lvalue}) {.nodestroy, inline.} = +proc `shader=`*(x: var Material, val: Shader) {.nodestroy, inline.} = x.shader = val -template `shader=`*(x: var Material, val: Shader) = +template `shader=`*(x: var Material, val: Shader{call}) = {.error: "Cannot pass a rvalue, as `x` does not take ownership of the shader.".} proc texture*(x: MaterialMap): lent Texture {.inline.} = diff --git a/tools/raylib_fields.nim b/tools/raylib_fields.nim index ea8e91d..39fb592 100644 --- a/tools/raylib_fields.nim +++ b/tools/raylib_fields.nim @@ -235,18 +235,18 @@ proc `[]=`*(x: var MaterialMaps, i: MaterialMapIndex, val: MaterialMap) = checkArrayAccess(Material(x).maps, i.int, MaxMaterialMaps) Material(x).maps[i.int] = val -proc `texture=`*(x: var MaterialMap, val: Texture{lvalue}) {.nodestroy, inline.} = +proc `texture=`*(x: var MaterialMap, val: Texture) {.nodestroy, inline.} = ## Set texture for a material map type (Diffuse, Specular...) ## NOTE: Previous texture should be manually unloaded x.texture = val -template `texture=`*(x: var MaterialMap, val: Texture) = +template `texture=`*(x: var MaterialMap, val: Texture{call}) = {.error: "Cannot pass a rvalue, as `x` does not take ownership of the texture.".} -proc `shader=`*(x: var Material, val: Shader{lvalue}) {.nodestroy, inline.} = +proc `shader=`*(x: var Material, val: Shader) {.nodestroy, inline.} = x.shader = val -template `shader=`*(x: var Material, val: Shader) = +template `shader=`*(x: var Material, val: Shader{call}) = {.error: "Cannot pass a rvalue, as `x` does not take ownership of the shader.".} proc texture*(x: MaterialMap): lent Texture {.inline.} =