forked from teamnwah/openmw-tes3coop
[General] Use separate variables for video & music filenames in packets
This commit is contained in:
parent
509882b5f6
commit
3ed9d89280
4 changed files with 11 additions and 9 deletions
|
@ -735,9 +735,9 @@ void ObjectList::playMusic()
|
||||||
{
|
{
|
||||||
for (const auto &baseObject : baseObjects)
|
for (const auto &baseObject : baseObjects)
|
||||||
{
|
{
|
||||||
LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s", baseObject.filename.c_str());
|
LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s", baseObject.musicFilename.c_str());
|
||||||
|
|
||||||
MWBase::Environment::get().getSoundManager()->streamMusic(baseObject.filename);
|
MWBase::Environment::get().getSoundManager()->streamMusic(baseObject.musicFilename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -745,10 +745,10 @@ void ObjectList::playVideo()
|
||||||
{
|
{
|
||||||
for (const auto &baseObject : baseObjects)
|
for (const auto &baseObject : baseObjects)
|
||||||
{
|
{
|
||||||
LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s, allowSkipping: %s", baseObject.filename.c_str(),
|
LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s, allowSkipping: %s", baseObject.videoFilename.c_str(),
|
||||||
baseObject.allowSkipping ? "true" : "false");
|
baseObject.allowSkipping ? "true" : "false");
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->playVideo(baseObject.filename, baseObject.allowSkipping);
|
MWBase::Environment::get().getWindowManager()->playVideo(baseObject.videoFilename, baseObject.allowSkipping);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -956,14 +956,14 @@ void ObjectList::addDoorState(const MWWorld::Ptr& ptr, int state)
|
||||||
void ObjectList::addMusicPlay(std::string filename)
|
void ObjectList::addMusicPlay(std::string filename)
|
||||||
{
|
{
|
||||||
mwmp::BaseObject baseObject;
|
mwmp::BaseObject baseObject;
|
||||||
baseObject.filename = filename;
|
baseObject.musicFilename = filename;
|
||||||
addObject(baseObject);
|
addObject(baseObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectList::addVideoPlay(std::string filename, bool allowSkipping)
|
void ObjectList::addVideoPlay(std::string filename, bool allowSkipping)
|
||||||
{
|
{
|
||||||
mwmp::BaseObject baseObject;
|
mwmp::BaseObject baseObject;
|
||||||
baseObject.filename = filename;
|
baseObject.videoFilename = filename;
|
||||||
baseObject.allowSkipping = allowSkipping;
|
baseObject.allowSkipping = allowSkipping;
|
||||||
addObject(baseObject);
|
addObject(baseObject);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,9 @@ namespace mwmp
|
||||||
ESM::Cell destinationCell;
|
ESM::Cell destinationCell;
|
||||||
ESM::Position destinationPosition;
|
ESM::Position destinationPosition;
|
||||||
|
|
||||||
std::string filename;
|
std::string musicFilename;
|
||||||
|
|
||||||
|
std::string videoFilename;
|
||||||
bool allowSkipping;
|
bool allowSkipping;
|
||||||
|
|
||||||
std::string animGroup;
|
std::string animGroup;
|
||||||
|
|
|
@ -10,5 +10,5 @@ PacketMusicPlay::PacketMusicPlay(RakNet::RakPeerInterface *peer) : ObjectPacket(
|
||||||
|
|
||||||
void PacketMusicPlay::Object(BaseObject &baseObject, bool send)
|
void PacketMusicPlay::Object(BaseObject &baseObject, bool send)
|
||||||
{
|
{
|
||||||
RW(baseObject.filename, send);
|
RW(baseObject.musicFilename, send);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,6 @@ PacketVideoPlay::PacketVideoPlay(RakNet::RakPeerInterface *peer) : ObjectPacket(
|
||||||
|
|
||||||
void PacketVideoPlay::Object(BaseObject &baseObject, bool send)
|
void PacketVideoPlay::Object(BaseObject &baseObject, bool send)
|
||||||
{
|
{
|
||||||
RW(baseObject.filename, send);
|
RW(baseObject.videoFilename, send);
|
||||||
RW(baseObject.allowSkipping, send);
|
RW(baseObject.allowSkipping, send);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue