Browse Source

Apply code suggestions from rarified

tickets/38/38/1
rarified 3 years ago committed by ZarothYe
parent
commit
64323c6073
  1. 4
      Sources/Plasma/NucleusLib/inc/plCreatableIndex.h
  2. 15
      Sources/Plasma/PubUtilLib/plAudioCore/plSoundBuffer.cpp

4
Sources/Plasma/NucleusLib/inc/plCreatableIndex.h

@ -949,7 +949,7 @@ CLASS_INDEX_LIST_START
CLASS_INDEX(plAngularVelocityMsg), CLASS_INDEX(plAngularVelocityMsg),
CLASS_INDEX(plRideAnimatedPhysMsg), CLASS_INDEX(plRideAnimatedPhysMsg),
CLASS_INDEX(plAvBrainRideAnimatedPhysical), CLASS_INDEX(plAvBrainRideAnimatedPhysical),
CLASS_INDEX(pfGameScoreMsg), CLASS_INDEX(pfGameScoreMsg), // This index and below are unused currently and placed for indexing plSubtitleMsg consistently with H'uru
CLASS_INDEX(pfGameScoreListMsg), CLASS_INDEX(pfGameScoreListMsg),
CLASS_INDEX(pfGameScoreTransferMsg), CLASS_INDEX(pfGameScoreTransferMsg),
CLASS_INDEX(pfGameScoreUpdateMsg), CLASS_INDEX(pfGameScoreUpdateMsg),
@ -958,7 +958,7 @@ CLASS_INDEX_LIST_START
CLASS_INDEX(plGLPipeline), CLASS_INDEX(plGLPipeline),
CLASS_INDEX(plSDLModifierStateMsg), CLASS_INDEX(plSDLModifierStateMsg),
CLASS_INDEX(plConfirmationMsg), CLASS_INDEX(plConfirmationMsg),
CLASS_INDEX(plLocalizedConfirmationMsg), CLASS_INDEX(plLocalizedConfirmationMsg), // This index and above are unused currently and placed for indexing plSubtitleMsg consistently with H'uru
CLASS_INDEX(plSubtitleMsg), CLASS_INDEX(plSubtitleMsg),
CLASS_INDEX_LIST_END CLASS_INDEX_LIST_END

15
Sources/Plasma/PubUtilLib/plAudioCore/plSoundBuffer.cpp

@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsStream.h" #include "hsStream.h"
#include "hsUtils.h" #include "hsUtils.h"
#include <cstring>
#include "plgDispatch.h" #include "plgDispatch.h"
#include "hsResMgr.h" #include "hsResMgr.h"
@ -134,13 +135,13 @@ static void LoadCallback(void *)
buffer->SetAudioReader(reader); // give sound buffer reader, since we may need it later buffer->SetAudioReader(reader); // give sound buffer reader, since we may need it later
plSrtFileReader* srtReader = buffer->GetSrtReader(); plSrtFileReader* srtReader = buffer->GetSrtReader();
if (srtReader != nullptr && srtReader->GetCurrentAudioFileName() == srcFilename) { if (srtReader != nullptr && (strcmp(srtReader->GetCurrentAudioFileName(), srcFilename) == 0)) {
// same file we were playing before, so start the SRT feed over instead of deleting and reloading // same file we were playing before, so start the SRT feed over instead of deleting and reloading
srtReader->StartOver(); srtReader->StartOver();
} else { } else {
std::unique_ptr<plSrtFileReader> newSrtFileReader(new plSrtFileReader(srcFilename)); std::unique_ptr<plSrtFileReader> newSrtFileReader(new plSrtFileReader(srcFilename));
if (newSrtFileReader->ReadFile()) if (newSrtFileReader->ReadFile())
buffer->SetSrtReader(newSrtFileReader.release()); buffer->SetSrtReader(newSrtFileReader.release());
} }
} }
else else

Loading…
Cancel
Save