|
@@ -372,20 +372,8 @@ bool ShapeBaseImageData::onAdd()
|
|
s.shapeSequenceScale = stateScaleShapeSequence[i];
|
|
s.shapeSequenceScale = stateScaleShapeSequence[i];
|
|
|
|
|
|
//_setstateSound(getstateSound(i),i);
|
|
//_setstateSound(getstateSound(i),i);
|
|
- s.sound = getstateSoundAsset(i);
|
|
|
|
- if (s.sound == NULL && mstateSoundName[i] != StringTable->EmptyString())
|
|
|
|
- {
|
|
|
|
- //ok, so we've got some sort of special-case here like a fallback or SFXPlaylist. So do the hook-up now
|
|
|
|
- SFXTrack* sndTrack;
|
|
|
|
- if (!Sim::findObject(mstateSoundName[i], sndTrack))
|
|
|
|
- {
|
|
|
|
- Con::errorf("ShapeBaseImageData::onAdd() - attempted to find sound %s but failed!", mstateSoundName[i]);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- s.soundTrack = sndTrack;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ handleStateSoundTrack(i);
|
|
|
|
+
|
|
s.script = stateScript[i];
|
|
s.script = stateScript[i];
|
|
s.emitter = stateEmitter[i];
|
|
s.emitter = stateEmitter[i];
|
|
s.emitterTime = stateEmitterTime[i];
|
|
s.emitterTime = stateEmitterTime[i];
|
|
@@ -591,6 +579,30 @@ bool ShapeBaseImageData::preload(bool server, String &errorStr)
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void ShapeBaseImageData::handleStateSoundTrack(const U32& stateId)
|
|
|
|
+{
|
|
|
|
+ if (stateId > MaxStates)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ StateData& s = state[stateId];
|
|
|
|
+
|
|
|
|
+ s.sound = getstateSoundAsset(stateId);
|
|
|
|
+
|
|
|
|
+ if (s.sound == NULL && mstateSoundName[stateId] != StringTable->EmptyString())
|
|
|
|
+ {
|
|
|
|
+ //ok, so we've got some sort of special-case here like a fallback or SFXPlaylist. So do the hook-up now
|
|
|
|
+ SFXTrack* sndTrack;
|
|
|
|
+ if (!Sim::findObject(mstateSoundName[stateId], sndTrack))
|
|
|
|
+ {
|
|
|
|
+ Con::errorf("ShapeBaseImageData::onAdd() - attempted to find sound %s but failed!", mstateSoundName[stateId]);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ s.soundTrack = sndTrack;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
S32 ShapeBaseImageData::lookupState(const char* name)
|
|
S32 ShapeBaseImageData::lookupState(const char* name)
|
|
{
|
|
{
|
|
if (!name || !name[0])
|
|
if (!name || !name[0])
|
|
@@ -1366,6 +1378,7 @@ void ShapeBaseImageData::unpackData(BitStream* stream)
|
|
s.emitter = 0;
|
|
s.emitter = 0;
|
|
|
|
|
|
UNPACKDATA_ASSET_ARRAY(stateSound, i);
|
|
UNPACKDATA_ASSET_ARRAY(stateSound, i);
|
|
|
|
+ handleStateSoundTrack(i);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|