1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Fixed lots of warnings.

Disabled the following (for MSVC only) that couldn't (or shouldn't) be fixed.

4003: not enough actual parameters for macro 'identifier'
4250: 'class1' : inherits 'class2::member' via dominance
4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
This commit is contained in:
John Bolton
2020-10-01 01:38:06 -07:00
parent ff471af3de
commit a05ae78e67
142 changed files with 854 additions and 839 deletions

View File

@@ -77,7 +77,7 @@ void CAudioBase::setVolume(ui32 percent)
void CSoundHandler::onVolumeChange(const JsonNode &volumeNode)
{
setVolume(volumeNode.Float());
setVolume((ui32)volumeNode.Float());
}
CSoundHandler::CSoundHandler():
@@ -114,7 +114,7 @@ void CSoundHandler::init()
{
CAudioBase::init();
if(ambientConfig["allocateChannels"].isNumber())
Mix_AllocateChannels(ambientConfig["allocateChannels"].Integer());
Mix_AllocateChannels((int)ambientConfig["allocateChannels"].Integer());
if (initialized)
{
@@ -148,7 +148,7 @@ Mix_Chunk *CSoundHandler::GetSoundChunk(std::string &sound, bool cache)
return soundChunks[sound].first;
auto data = CResourceHandler::get()->load(ResourceID(std::string("SOUNDS/") + sound, EResType::SOUND))->readAll();
SDL_RWops *ops = SDL_RWFromMem(data.first.get(), data.second);
SDL_RWops *ops = SDL_RWFromMem(data.first.get(), (int)data.second);
Mix_Chunk *chunk = Mix_LoadWAV_RW(ops, 1); // will free ops
if (cache)
@@ -168,8 +168,8 @@ int CSoundHandler::ambientDistToVolume(int distance) const
if(distance >= ambientConfig["distances"].Vector().size())
return 0;
int volume = ambientConfig["distances"].Vector()[distance].Integer();
return volume * ambientConfig["volume"].Integer() * getVolume() / 10000;
int volume = static_cast<int>(ambientConfig["distances"].Vector()[distance].Integer());
return volume * (int)ambientConfig["volume"].Integer() * getVolume() / 10000;
}
void CSoundHandler::ambientStopSound(std::string soundId)
@@ -270,7 +270,7 @@ void CSoundHandler::soundFinishedCallback(int channel)
int CSoundHandler::ambientGetRange() const
{
return ambientConfig["range"].Integer();
return static_cast<int>(ambientConfig["range"].Integer());
}
bool CSoundHandler::ambientCheckVisitable() const
@@ -322,7 +322,7 @@ void CSoundHandler::ambientStopAllChannels()
void CMusicHandler::onVolumeChange(const JsonNode &volumeNode)
{
setVolume(volumeNode.Float());
setVolume((ui32)volumeNode.Float());
}
CMusicHandler::CMusicHandler():