aboutsummaryrefslogtreecommitdiffstats
path: root/alv-lib
diff options
context:
space:
mode:
Diffstat (limited to 'alv-lib')
-rw-r--r--alv-lib/glsl-view.moon10
1 files changed, 7 insertions, 3 deletions
diff --git a/alv-lib/glsl-view.moon b/alv-lib/glsl-view.moon
index 4c27be0..c2d57ee 100644
--- a/alv-lib/glsl-view.moon
+++ b/alv-lib/glsl-view.moon
@@ -58,11 +58,13 @@ video = Constant.meta
setup: (inputs, scope) =>
{ socket, name, filename, type } = pattern\match inputs
+ @prefix = COPILOT.active_module.file\match'(.*/)[^/]*$'
+
super
socket: Input.hot socket or scope\get '*oscout*'
- name: Input.hot name
- filename: Input.hot filename
- type: Input.hot type or Constant.str "2D"
+ name: Input.cold name
+ filename: Input.cold filename
+ type: Input.cold type or Constant.str "2D"
samplertype = assert GLSL_SAMPLER_TYPES[@inputs.type!]
@setup_out '=', (Struct type: T.str, val: T.str), type: samplertype, val: @inputs.name!
@@ -71,6 +73,8 @@ video = Constant.meta
{ :socket, :name, :type, :filename } = @unwrap_all!
with @inputs.socket!
+ if @prefix and not (filename\match '^/') or (filename\match '^%w:\\')
+ filename = @prefix .. filename
\send Message.pack { address: "/texture/#{name}/video", types: "ss", "TEXTURE_#{type}", filename }
-- destroy: =>