Linux: Fixed crash on startup when show game timer option is enabled
This commit is contained in:
parent
982d0e0010
commit
7e854b4376
2 changed files with 3 additions and 2 deletions
|
@ -147,7 +147,8 @@ void BaseRenderer::ShowFpsCounter(int lineNumber)
|
|||
void BaseRenderer::ShowGameTimer(int lineNumber)
|
||||
{
|
||||
int yPos = 13 + 24 * lineNumber;
|
||||
double frameCount = _console->GetPpu()->GetFrameCount();
|
||||
shared_ptr<Ppu> ppu = _console->GetPpu();
|
||||
double frameCount = ppu ? ppu->GetFrameCount() : 0;
|
||||
bool isPal = _console->GetRegion() == ConsoleRegion::Pal;
|
||||
double frameRate = isPal ? 50.006977968268290848936010226333 : 60.098811862348404716732985230828;
|
||||
uint32_t seconds = (uint32_t)(frameCount / frameRate) % 60;
|
||||
|
|
|
@ -182,7 +182,7 @@ void SdlRenderer::Render()
|
|||
SDL_Rect dest = {0, 0, (int)_screenWidth, (int)_screenHeight };
|
||||
SDL_RenderCopy(_sdlRenderer, _sdlTexture, &source, &dest);
|
||||
|
||||
if(_console->GetVideoDecoder()->IsRunning()) {
|
||||
if(_console->IsRunning()) {
|
||||
if(paused) {
|
||||
DrawPauseScreen();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue