forked from DizzyThermal/TKViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Export Frames button to ViewFrame
- Loading branch information
1 parent
b76962f
commit f63069f
Showing
4 changed files
with
105 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.gamemode.tkviewer; | ||
|
||
import com.gamemode.tkviewer.file_handlers.DatFileHandler; | ||
import com.gamemode.tkviewer.file_handlers.EpfFileHandler; | ||
import com.gamemode.tkviewer.file_handlers.PalFileHandler; | ||
import com.gamemode.tkviewer.render.TileRenderer; | ||
import com.gamemode.tkviewer.resources.Resources; | ||
import com.gamemode.tkviewer.utilities.FileUtils; | ||
|
||
import java.io.File; | ||
import java.nio.file.Paths; | ||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
|
||
public class TKItems { | ||
|
||
public static void main(String[] args) { | ||
File outputDirectory = new File("C:\\NTK_Items"); | ||
|
||
if (!outputDirectory.exists()) { | ||
outputDirectory.mkdirs(); | ||
} | ||
|
||
DatFileHandler charDat = new DatFileHandler(Resources.NTK_DATA_DIRECTORY + File.separator + "char.dat"); | ||
DatFileHandler miscDat = new DatFileHandler(Resources.NTK_DATA_DIRECTORY + File.separator + "misc.dat"); | ||
|
||
EpfFileHandler itemEpf = new EpfFileHandler(miscDat.getFile("ITEM.EPF")); | ||
PalFileHandler itemPal = new PalFileHandler(charDat.getFile("ITEM.PAL")); | ||
|
||
TileRenderer tileRenderer = new TileRenderer(new ArrayList<EpfFileHandler>(Arrays.asList(itemEpf)), itemPal, 0); | ||
|
||
for (int i = 0; i < itemEpf.frameCount; i++) { | ||
FileUtils.writeBufferedImageToFile(tileRenderer.renderTile(i), Paths.get(outputDirectory.toString(), "item-" + i + ".png").toString()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.