mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-18 20:39:10 +00:00
separated sprite export settings
This commit is contained in:
@@ -28,6 +28,7 @@ import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.modes.FrameExportMode;
|
||||
import com.jpexs.decompiler.flash.exporters.settings.ButtonExportSettings;
|
||||
import com.jpexs.decompiler.flash.exporters.settings.FrameExportSettings;
|
||||
import com.jpexs.decompiler.flash.exporters.settings.SpriteExportSettings;
|
||||
import com.jpexs.decompiler.flash.exporters.shape.CanvasShapeExporter;
|
||||
import com.jpexs.decompiler.flash.helpers.BMPFile;
|
||||
import com.jpexs.decompiler.flash.helpers.ImageHelper;
|
||||
@@ -110,6 +111,38 @@ public class FrameExporter {
|
||||
return exportFrames(handler, outdir, swf, containerId, frames, fes, evl);
|
||||
}
|
||||
|
||||
public List<File> exportFrames(AbortRetryIgnoreHandler handler, String outdir, SWF swf, int containerId, List<Integer> frames, SpriteExportSettings settings, EventListener evl) throws IOException {
|
||||
FrameExportMode fem;
|
||||
switch (settings.mode) {
|
||||
case PNG:
|
||||
fem = FrameExportMode.PNG;
|
||||
break;
|
||||
case GIF:
|
||||
fem = FrameExportMode.GIF;
|
||||
break;
|
||||
case AVI:
|
||||
fem = FrameExportMode.AVI;
|
||||
break;
|
||||
case SVG:
|
||||
fem = FrameExportMode.SVG;
|
||||
break;
|
||||
case CANVAS:
|
||||
fem = FrameExportMode.CANVAS;
|
||||
break;
|
||||
case PDF:
|
||||
fem = FrameExportMode.PDF;
|
||||
break;
|
||||
case BMP:
|
||||
fem = FrameExportMode.BMP;
|
||||
break;
|
||||
default:
|
||||
throw new Error("Unsupported sprite export mode");
|
||||
}
|
||||
|
||||
FrameExportSettings fes = new FrameExportSettings(fem, settings.zoom);
|
||||
return exportFrames(handler, outdir, swf, containerId, frames, fes, evl);
|
||||
}
|
||||
|
||||
public List<File> exportFrames(AbortRetryIgnoreHandler handler, String outdir, final SWF swf, int containerId, List<Integer> frames, final FrameExportSettings settings, final EventListener evl) throws IOException {
|
||||
final List<File> ret = new ArrayList<>();
|
||||
if (swf.tags.isEmpty()) {
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.exporters.modes;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public enum SpriteExportMode {
|
||||
|
||||
PNG,
|
||||
GIF,
|
||||
AVI,
|
||||
SVG,
|
||||
CANVAS,
|
||||
PDF,
|
||||
BMP
|
||||
}
|
||||
@@ -26,8 +26,6 @@ public class FrameExportSettings {
|
||||
|
||||
public static final String EXPORT_FOLDER_NAME = "frames";
|
||||
|
||||
public static final String EXPORT_FOLDER_NAME_SPRITE = "sprites";
|
||||
|
||||
public FrameExportMode mode;
|
||||
|
||||
public double zoom;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.exporters.settings;
|
||||
|
||||
import com.jpexs.decompiler.flash.exporters.modes.SpriteExportMode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class SpriteExportSettings {
|
||||
|
||||
public static final String EXPORT_FOLDER_NAME = "sprites";
|
||||
|
||||
public SpriteExportMode mode;
|
||||
|
||||
public double zoom;
|
||||
|
||||
public SpriteExportSettings(SpriteExportMode mode, double zoom) {
|
||||
this.mode = mode;
|
||||
this.zoom = zoom;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user