2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

Apply code suggestions from rarified

This commit is contained in:
rarified
2022-02-26 11:57:56 -06:00
committed by ZarothYe
parent 8a2534dff6
commit 64323c6073
2 changed files with 10 additions and 9 deletions

View File

@ -949,7 +949,7 @@ CLASS_INDEX_LIST_START
CLASS_INDEX(plAngularVelocityMsg),
CLASS_INDEX(plRideAnimatedPhysMsg),
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(pfGameScoreTransferMsg),
CLASS_INDEX(pfGameScoreUpdateMsg),
@ -958,7 +958,7 @@ CLASS_INDEX_LIST_START
CLASS_INDEX(plGLPipeline),
CLASS_INDEX(plSDLModifierStateMsg),
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_LIST_END

View File

@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsStream.h"
#include "hsUtils.h"
#include <cstring>
#include "plgDispatch.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
plSrtFileReader* srtReader = buffer->GetSrtReader();
if (srtReader != nullptr && srtReader->GetCurrentAudioFileName() == srcFilename) {
// same file we were playing before, so start the SRT feed over instead of deleting and reloading
srtReader->StartOver();
} else {
std::unique_ptr<plSrtFileReader> newSrtFileReader(new plSrtFileReader(srcFilename));
if (newSrtFileReader->ReadFile())
buffer->SetSrtReader(newSrtFileReader.release());
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
srtReader->StartOver();
} else {
std::unique_ptr<plSrtFileReader> newSrtFileReader(new plSrtFileReader(srcFilename));
if (newSrtFileReader->ReadFile())
buffer->SetSrtReader(newSrtFileReader.release());
}
}
else