From 03b4d86e47d356d667964b7cc0b70e0cbcb2e0ed Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Sun, 3 Aug 2025 16:13:03 -0700 Subject: [PATCH] require embedded filenames --- splubp.p8 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/splubp.p8 b/splubp.p8 index 40f5162..5550d61 100644 --- a/splubp.p8 +++ b/splubp.p8 @@ -137,13 +137,19 @@ function splubp:wnx(...) return self["write_"..self:op()](self, ...) end -function splubp:emit_item(obj, filename) +-- write an object of a known type. +-- item must have a field named +-- _file, containing a filename +-- with a correct extension +-- to save the file under. +function splubp:emit_item(obj) if DEBUG then --[[global]] splubp_last_emit = obj end - filename = filename or obj._file + -- todo: should _addr skip the + -- filename, instead? obj._addr = self.ptr - self:write_s(filename) + self:write_s(obj._file) for row in all(self.fmts[split(filename, ".")[2]]) do local alt = self.wdirectives[row[1]] if alt then