| 1 |
#include "stdafx.h" |
| 2 |
#include "CCustomizerMover.h" |
| 3 |
#include "CCustomizerMisc.h" |
| 4 |
#include "CModelSwitch.h" |
| 5 |
|
| 6 |
// static メンバ |
| 7 |
//CNamedObject *CCustomizerBase::ms_CurrentObject; // 現在のオブジェクト |
| 8 |
|
| 9 |
//////////////////////////////////////////////////////////////////////////////// |
| 10 |
//////////////////////////////////////////////////////////////////////////////// |
| 11 |
|
| 12 |
/* |
| 13 |
* コンストラクタ |
| 14 |
*/ |
| 15 |
CCustomizerContainer::CCustomizerContainer(){ |
| 16 |
m_Customizer = NULL; |
| 17 |
} |
| 18 |
|
| 19 |
/* |
| 20 |
* コピーコンストラクタ |
| 21 |
*/ |
| 22 |
CCustomizerContainer::CCustomizerContainer( |
| 23 |
const CCustomizerContainer &src // コピー元 |
| 24 |
){ |
| 25 |
m_Customizer = src.m_Customizer->Duplicate(); |
| 26 |
} |
| 27 |
|
| 28 |
/* |
| 29 |
* デストラクタ |
| 30 |
*/ |
| 31 |
CCustomizerContainer::~CCustomizerContainer(){ |
| 32 |
DELETE_V(m_Customizer); |
| 33 |
} |
| 34 |
|
| 35 |
/* |
| 36 |
* 読込 |
| 37 |
*/ |
| 38 |
char *CCustomizerContainer::Read( |
| 39 |
char *str, // 対象文字列 |
| 40 |
CModelPlugin *mpi // モデルプラグイン |
| 41 |
){ |
| 42 |
char *tmp; |
| 43 |
DELETE_V(m_Customizer); |
| 44 |
CModelChanger modelchanger; |
| 45 |
CStaticRotator staticrotator; |
| 46 |
CStaticMover staticmover; |
| 47 |
CDynamicRotator dynamicrotator; |
| 48 |
CWindTracker windtracker; |
| 49 |
CWindmill windmill; |
| 50 |
CAnalogClock analogclock; |
| 51 |
CShadowInhibitor shadowinhibitor; |
| 52 |
CEnvMapper envmapper; |
| 53 |
CAlphaTester alphatester; |
| 54 |
CTextureChanger texturechanger; |
| 55 |
CTextureTransformer texturetransformer; |
| 56 |
CAnimationApplier animationapplier; |
| 57 |
CAlphaChanger alphachanger; |
| 58 |
CMaterialChanger materialchanger; |
| 59 |
CCustomizerSwitchApplier customizerswitchapplier; |
| 60 |
if(tmp = modelchanger.Read(str)){ |
| 61 |
str = tmp; |
| 62 |
m_Customizer = new CModelChanger(modelchanger); |
| 63 |
}else if(tmp = staticrotator.Read(str, mpi)){ |
| 64 |
str = tmp; |
| 65 |
m_Customizer = new CStaticRotator(staticrotator); |
| 66 |
}else if(tmp = staticmover.Read(str, mpi)){ |
| 67 |
str = tmp; |
| 68 |
m_Customizer = new CStaticMover(staticmover); |
| 69 |
}else if(tmp = dynamicrotator.Read(str, mpi)){ |
| 70 |
str = tmp; |
| 71 |
m_Customizer = new CDynamicRotator(dynamicrotator); |
| 72 |
}else if(tmp = windtracker.Read(str, mpi)){ |
| 73 |
str = tmp; |
| 74 |
m_Customizer = new CWindTracker(windtracker); |
| 75 |
}else if(tmp = windmill.Read(str, mpi)){ |
| 76 |
str = tmp; |
| 77 |
m_Customizer = new CWindmill(windmill); |
| 78 |
}else if(tmp = analogclock.Read(str)){ |
| 79 |
str = tmp; |
| 80 |
m_Customizer = new CAnalogClock(analogclock); |
| 81 |
}else if(tmp = shadowinhibitor.Read(str)){ |
| 82 |
str = tmp; |
| 83 |
m_Customizer = new CShadowInhibitor(shadowinhibitor); |
| 84 |
}else if(tmp = envmapper.Read(str)){ |
| 85 |
str = tmp; |
| 86 |
m_Customizer = new CEnvMapper(envmapper); |
| 87 |
}else if(tmp = alphatester.Read(str)){ |
| 88 |
str = tmp; |
| 89 |
m_Customizer = new CAlphaTester(alphatester); |
| 90 |
}else if(tmp = texturechanger.Read(str)){ |
| 91 |
str = tmp; |
| 92 |
m_Customizer = new CTextureChanger(texturechanger); |
| 93 |
}else if(tmp = texturetransformer.Read(str, true)){ |
| 94 |
str = tmp; |
| 95 |
m_Customizer = new CTextureTransformer(texturetransformer); |
| 96 |
}else if(tmp = animationapplier.Read(str, mpi)){ |
| 97 |
str = tmp; |
| 98 |
m_Customizer = new CAnimationApplier(animationapplier); |
| 99 |
}else if(tmp = alphachanger.Read(str)){ |
| 100 |
str = tmp; |
| 101 |
m_Customizer = new CAlphaChanger(alphachanger); |
| 102 |
}else if(tmp = materialchanger.Read(str)){ |
| 103 |
str = tmp; |
| 104 |
m_Customizer = new CMaterialChanger(materialchanger); |
| 105 |
}else if(tmp = customizerswitchapplier.Read(str, mpi)){ |
| 106 |
str = tmp; |
| 107 |
m_Customizer = new CCustomizerSwitchApplier(customizerswitchapplier); |
| 108 |
}else{ |
| 109 |
str = NULL; |
| 110 |
} |
| 111 |
return str; |
| 112 |
} |