2 * pmd parser extensin 2
\r
4 * License : The MIT License
\r
5 * Copyright(c) 2010 MikuToga Partners
\r
8 package jp.sourceforge.mikutoga.parser.pmd;
\r
10 import java.io.IOException;
\r
11 import jp.sourceforge.mikutoga.parser.MmdFormatException;
\r
12 import jp.sourceforge.mikutoga.parser.MmdSource;
\r
15 * PMDモデルファイルのパーサ拡張その2。
\r
16 * ※独自トゥーンテクスチャファイル名対応
\r
18 public class PmdParserExt2 extends PmdParserExt1 {
\r
20 private PmdToonHandler toonHandler = null;
\r
24 * @param source 入力ソース
\r
26 public PmdParserExt2(MmdSource source){
\r
32 * トゥーンテクスチャファイルハンドラを登録する。
\r
33 * @param handler ハンドラ
\r
35 public void setToonHandler(PmdToonHandler handler){
\r
36 this.toonHandler = handler;
\r
42 * @throws IOException {@inheritDoc}
\r
43 * @throws MmdFormatException {@inheritDoc}
\r
46 protected void parseBody()
\r
47 throws IOException, MmdFormatException{
\r
58 * 独自トゥーンテクスチャファイル名のパースと通知。
\r
59 * @throws IOException IOエラー
\r
60 * @throws MmdFormatException フォーマットエラー
\r
62 private void parseToonName() throws IOException, MmdFormatException{
\r
63 if(this.toonHandler == null){
\r
64 skip(PmdLimits.MAXBYTES_TOONFILENAME * PmdLimits.TOON_FIXEDNUM);
\r
68 this.toonHandler.loopStart(PmdToonHandler.TOON_LIST,
\r
69 PmdLimits.TOON_FIXEDNUM );
\r
71 for(int ct = 0; ct < PmdLimits.TOON_FIXEDNUM; ct++){
\r
73 parseZeroTermString(PmdLimits.MAXBYTES_TOONFILENAME);
\r
74 this.toonHandler.pmdToonFileInfo(toonName);
\r
76 this.toonHandler.loopNext(PmdToonHandler.TOON_LIST);
\r
79 this.toonHandler.loopEnd(PmdToonHandler.TOON_LIST);
\r