2 * pmd parser extensin 2
4 * License : The MIT License
5 * Copyright(c) 2010 MikuToga Partners
8 package jp.sfjp.mikutoga.pmd.parser;
10 import java.io.IOException;
11 import java.io.InputStream;
12 import jp.sfjp.mikutoga.bin.parser.MmdFormatException;
13 import jp.sfjp.mikutoga.pmd.PmdLimits;
16 * PMDモデルファイルのパーサ拡張その2。
17 * <p>※ 独自トゥーンテクスチャファイル名対応
19 public class PmdParserExt2 extends PmdParserExt1 {
21 private PmdToonHandler toonHandler = PmdUnifiedHandler.EMPTY;
27 public PmdParserExt2(InputStream source){
33 * トゥーンテクスチャファイルハンドラを登録する。
36 public void setToonHandler(PmdToonHandler handler){
38 this.toonHandler = PmdUnifiedHandler.EMPTY;
40 this.toonHandler = handler;
47 * @throws IOException {@inheritDoc}
48 * @throws MmdFormatException {@inheritDoc}
51 protected void parseBody()
52 throws IOException, MmdFormatException{
63 * 独自トゥーンテクスチャファイル名のパースと通知。
64 * @throws IOException IOエラー
65 * @throws MmdFormatException フォーマットエラー
67 private void parseToonName() throws IOException, MmdFormatException{
68 this.toonHandler.loopStart(PmdToonHandler.TOON_LIST,
69 PmdLimits.TOON_FIXEDNUM );
71 for(int ct = 0; ct < PmdLimits.TOON_FIXEDNUM; ct++){
73 parsePmdText(PmdLimits.MAXBYTES_TOONFILENAME);
74 this.toonHandler.pmdToonFileInfo(toonName);
76 this.toonHandler.loopNext(PmdToonHandler.TOON_LIST);
79 this.toonHandler.loopEnd(PmdToonHandler.TOON_LIST);