Fix error in start/stop music
This commit is contained in:
parent
eb24d6776e
commit
cb1848d48d
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#include <framework/core/clock.h>
|
#include <framework/core/clock.h>
|
||||||
#include <framework/core/eventdispatcher.h>
|
#include <framework/core/eventdispatcher.h>
|
||||||
|
#include <framework/core/resourcemanager.h>
|
||||||
|
|
||||||
SoundManager g_sounds;
|
SoundManager g_sounds;
|
||||||
|
|
||||||
|
@ -163,7 +164,7 @@ void SoundManager::playMusic(const std::string& filename, float fadetime)
|
||||||
{
|
{
|
||||||
if(m_currentMusic == filename && m_musicSource)
|
if(m_currentMusic == filename && m_musicSource)
|
||||||
return;
|
return;
|
||||||
m_currentMusic = filename;
|
m_currentMusic = g_resources.resolvePath(filename);
|
||||||
|
|
||||||
if(!m_musicEnabled)
|
if(!m_musicEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -47,6 +47,7 @@ private:
|
||||||
Boolean<false> m_loaded;
|
Boolean<false> m_loaded;
|
||||||
uint32 m_signature;
|
uint32 m_signature;
|
||||||
int m_spritesCount;
|
int m_spritesCount;
|
||||||
|
int m_spritesOffset;
|
||||||
FileStreamPtr m_spritesFile;
|
FileStreamPtr m_spritesFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -47,11 +47,6 @@ void ThingTypeDat::unserialize(uint16 clientId, DatCategory category, const File
|
||||||
m_id = clientId;
|
m_id = clientId;
|
||||||
m_category = category;
|
m_category = category;
|
||||||
|
|
||||||
|
|
||||||
static int datVersion;
|
|
||||||
if(clientId == 100 && category == DatItemCategory)
|
|
||||||
datVersion = 2;
|
|
||||||
|
|
||||||
bool done = false;
|
bool done = false;
|
||||||
for(int i = 0 ; i < DatLastAttrib;++i) {
|
for(int i = 0 ; i < DatLastAttrib;++i) {
|
||||||
int attrib = fin->getU8();
|
int attrib = fin->getU8();
|
||||||
|
@ -60,12 +55,7 @@ void ThingTypeDat::unserialize(uint16 clientId, DatCategory category, const File
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// hacky way to detect if is older dat version or not
|
if(g_game.getFeature(Otc::GameChargeableItems)) {
|
||||||
if(clientId == 100 && category == DatItemCategory && datVersion != 1 &&
|
|
||||||
(attrib == DatAttribNotPathable || attrib == DatAttribDontHide || attrib == DatAttribIgnoreLook)) {
|
|
||||||
datVersion = 1;
|
|
||||||
}
|
|
||||||
if(datVersion <= 1) {
|
|
||||||
if(attrib == DatAttribWritable) {
|
if(attrib == DatAttribWritable) {
|
||||||
m_attribs.set(DatAttribChargeable, true);
|
m_attribs.set(DatAttribChargeable, true);
|
||||||
continue;
|
continue;
|
||||||
|
@ -135,7 +125,7 @@ void ThingTypeDat::unserialize(uint16 clientId, DatCategory category, const File
|
||||||
|
|
||||||
m_spritesIndex.resize(totalSprites);
|
m_spritesIndex.resize(totalSprites);
|
||||||
for(int i = 0; i < totalSprites; i++)
|
for(int i = 0; i < totalSprites; i++)
|
||||||
m_spritesIndex[i] = fin->getU16();
|
m_spritesIndex[i] = g_game.getFeature(Otc::GameSpritesU32) ? fin->getU32() : fin->getU16();
|
||||||
|
|
||||||
m_textures.resize(m_animationPhases);
|
m_textures.resize(m_animationPhases);
|
||||||
m_texturesFramesRects.resize(m_animationPhases);
|
m_texturesFramesRects.resize(m_animationPhases);
|
||||||
|
|
Loading…
Reference in New Issue