mirror of
https://git.planet-casio.com/Lephenixnoir/fxsdk.git
synced 2024-12-28 04:23:37 +01:00
fxconv: don't require py param to be set in manual calls
This commit is contained in:
parent
ccbe0e594a
commit
a443fa59e1
1 changed files with 4 additions and 4 deletions
|
@ -513,7 +513,7 @@ def convert_bopti_fx(input, params):
|
||||||
data[n] = layer[4 * longword + i]
|
data[n] = layer[4 * longword + i]
|
||||||
n += 1
|
n += 1
|
||||||
|
|
||||||
if params["py"]["enabled"]:
|
if "py" in params and params["py"]["enabled"]:
|
||||||
w, h = img.size
|
w, h = img.size
|
||||||
return ["import gint\n",
|
return ["import gint\n",
|
||||||
f"{params['name']} = gint.image({p.id}, {w}, {h}, ", data, ")\n"]
|
f"{params['name']} = gint.image({p.id}, {w}, {h}, ", data, ")\n"]
|
||||||
|
@ -602,7 +602,7 @@ def convert_image_cg(input, params):
|
||||||
|
|
||||||
data, stride, palette, color_count = image_encode(img, format)
|
data, stride, palette, color_count = image_encode(img, format)
|
||||||
|
|
||||||
if params["py"]["enabled"]:
|
if "py" in params and params["py"]["enabled"]:
|
||||||
w, h = img.size
|
w, h = img.size
|
||||||
return [
|
return [
|
||||||
"import gint\n",
|
"import gint\n",
|
||||||
|
@ -807,7 +807,7 @@ def convert_topti(input, params):
|
||||||
# Object file generation
|
# Object file generation
|
||||||
#---
|
#---
|
||||||
|
|
||||||
if params["py"]["enabled"]:
|
if "py" in params and params["py"]["enabled"]:
|
||||||
l = [ "import gint\n",
|
l = [ "import gint\n",
|
||||||
f"{params['name']} = gint.font({title or None}, {flags}, ",
|
f"{params['name']} = gint.font({title or None}, {flags}, ",
|
||||||
f"{line_height}, {grid.h}, {len(blocks)}, {glyph_count}, ",
|
f"{line_height}, {grid.h}, {len(blocks)}, {glyph_count}, ",
|
||||||
|
@ -1185,7 +1185,7 @@ def convert(input, params, target, output=None, model=None, custom=None):
|
||||||
raise FxconvError(f'unknown resource type \'{t}\'')
|
raise FxconvError(f'unknown resource type \'{t}\'')
|
||||||
|
|
||||||
# PythonExtra conversion: output a file
|
# PythonExtra conversion: output a file
|
||||||
if params["py"]["enabled"]:
|
if "py" in params and params["py"]["enabled"]:
|
||||||
if isinstance(o, ObjectData):
|
if isinstance(o, ObjectData):
|
||||||
raise FxconvError(f'conversion doe not support Python output')
|
raise FxconvError(f'conversion doe not support Python output')
|
||||||
pyout(o, output, params)
|
pyout(o, output, params)
|
||||||
|
|
Loading…
Reference in a new issue