2 * pmd parser extensin 2
4 * License : The MIT License
5 * Copyright(c) 2010 MikuToga Partners
8 package jp.sourceforge.mikutoga.pmd.parser;
10 import java.io.IOException;
11 import java.io.InputStream;
12 import jp.sfjp.mikutoga.bin.parser.MmdFormatException;
15 * PMDモデルファイルのパーサ拡張その2。
16 * <p>※ 独自トゥーンテクスチャファイル名対応
18 public class PmdParserExt2 extends PmdParserExt1 {
20 private PmdToonHandler toonHandler = NullHandler.HANDLER;
26 public PmdParserExt2(InputStream source){
32 * トゥーンテクスチャファイルハンドラを登録する。
35 public void setToonHandler(PmdToonHandler handler){
37 this.toonHandler = NullHandler.HANDLER;
39 this.toonHandler = handler;
46 * @throws IOException {@inheritDoc}
47 * @throws MmdFormatException {@inheritDoc}
50 protected void parseBody()
51 throws IOException, MmdFormatException{
62 * 独自トゥーンテクスチャファイル名のパースと通知。
63 * @throws IOException IOエラー
64 * @throws MmdFormatException フォーマットエラー
66 private void parseToonName() throws IOException, MmdFormatException{
67 this.toonHandler.loopStart(PmdToonHandler.TOON_LIST,
68 PmdLimits.TOON_FIXEDNUM );
70 for(int ct = 0; ct < PmdLimits.TOON_FIXEDNUM; ct++){
72 parsePmdText(PmdLimits.MAXBYTES_TOONFILENAME);
73 this.toonHandler.pmdToonFileInfo(toonName);
75 this.toonHandler.loopNext(PmdToonHandler.TOON_LIST);
78 this.toonHandler.loopEnd(PmdToonHandler.TOON_LIST);