1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-01 00:45:26 +02:00

preparation

This commit is contained in:
Michael
2023-08-26 19:53:36 +02:00
committed by GitHub
parent 3b06abd0d7
commit bd0f9bb280
6 changed files with 36 additions and 4 deletions

View File

@ -14,12 +14,13 @@
#include "CMusicHandler.h"
#include "CGameInfo.h"
#include "renderSDL/SDLRWwrapper.h"
#include "eventsSDL/InputHandler.h"
#include "gui/CGuiHandler.h"
#include "../lib/JsonNode.h"
#include "../lib/GameConstants.h"
#include "../lib/filesystem/Filesystem.h"
#include "../lib/constants/StringConstants.h"
#include "../lib/StringConstants.h"
#include "../lib/CRandomGenerator.h"
#include "../lib/VCMIDirs.h"
#include "../lib/TerrainHandler.h"
@ -629,7 +630,8 @@ bool MusicEntry::play()
}
}
startTime = SDL_GetTicks();
startTime = GH.input().getTicks();
playing = true;
return true;
}
@ -640,7 +642,7 @@ bool MusicEntry::stop(int fade_ms)
{
playing = false;
loop = 0;
uint32_t endTime = SDL_GetTicks();
uint32_t endTime = GH.input().getTicks();
assert(startTime != uint32_t(-1));
float playDuration = (endTime - startTime + startPosition) / 1000.f;
owner->trackPositions[currentName] = playDuration;