import java.io.InputStream;
import jp.sfjp.mikutoga.bin.parser.CommonParser;
import jp.sfjp.mikutoga.bin.parser.MmdFormatException;
-import jp.sourceforge.mikutoga.vmd.VmdConst;
/**
* VMDモーションファイルのライティング情報パーサ。
*/
class VmdLightingParser extends CommonParser {
- private VmdLightingHandler handler = null;
+ private VmdLightingHandler handler = VmdUnifiedHandler.EMPTY;
/**
* @param lightingHandler ハンドラ
*/
void setLightingHandler(VmdLightingHandler lightingHandler){
- this.handler = lightingHandler;
+ if(lightingHandler == null){
+ this.handler = VmdUnifiedHandler.EMPTY;
+ }else{
+ this.handler = lightingHandler;
+ }
+
return;
}
private void parseVmdLighting() throws IOException, MmdFormatException{
int lightMotionNo = parseLeInt();
- if(this.handler == null){
- skip(VmdConst.LUMINOUS_DATA_SZ * lightMotionNo);
- return;
- }
-
this.handler.loopStart(VmdLightingHandler.LUMINOUS_LIST,
lightMotionNo);
private void parseVmdShadow() throws IOException, MmdFormatException{
int shadowMotionNo = parseLeInt();
- if(this.handler == null){
- skip(VmdConst.SHADOW_DATA_SZ * shadowMotionNo);
- return;
- }
-
this.handler.loopStart(VmdLightingHandler.SHADOW_LIST,
shadowMotionNo);