Example #1
0
int osd_display_loading_rom_message(const char* name, int current, int total)
{
    int retval;
    
    if (name != NULL)
        retval = UpdateLoadProgress(name, current - 1, total);
    else
        retval = UpdateLoadProgress("", total, total);
    
    return retval;
}
Example #2
0
/**
**  Show load progress.
**
**  @param fmt  printf format string.
*/
void ShowLoadProgress(const char *fmt, ...)
{
	static unsigned int lastProgressUpdate = SDL_GetTicks();
	if (SDL_GetTicks() < lastProgressUpdate + 16) {
		// Only show progress updates every c. 1/60th of a second, otherwise we're waiting for the screen too much
		return;
	}
	lastProgressUpdate = SDL_GetTicks();

	UpdateLoadProgress();
	
	va_list va;
	char temp[4096];

	va_start(va, fmt);
	vsnprintf(temp, sizeof(temp) - 1, fmt, va);
	temp[sizeof(temp) - 1] = '\0';
	va_end(va);

	if (Video.Depth && IsGameFontReady() && GetGameFont().IsLoaded()) {
		// Remove non printable chars
		for (unsigned char *s = (unsigned char *)temp; *s; ++s) {
			if (*s < 32) {
				*s = ' ';
			}
		}
		//Wyrmgus start
//		Video.FillRectangle(ColorBlack, 5, Video.Height - 18, Video.Width - 10, 18);
		if (loadingBackground == nullptr) {
			Video.FillRectangle(ColorBlack, 0, Video.Height - 18, Video.Width, 18);
		}
		//Wyrmgus end
		CLabel(GetGameFont()).DrawCentered(Video.Width / 2, Video.Height - 16, temp);
		//Wyrmgus start
//		InvalidateArea(5, Video.Height - 18, Video.Width - 10, 18);
		if (loadingBackground == nullptr) {
			InvalidateArea(0, Video.Height - 18, Video.Width, 18);
		} else {
			InvalidateArea(0, 0, Video.Width, Video.Height);
		}
		//Wyrmgus end

		RealizeVideoMemory();
	} else {
		DebugPrint("!!!!%s\n" _C_ temp);
	}

	PollEvents();
}
Example #3
0
void CaptureContext::LoadCapture(const rdcstr &captureFile, const rdcstr &origFilename,
                                 bool temporary, bool local)
{
  m_LoadInProgress = true;

  if(local)
    m_Config.CrashReport_LastOpenedCapture = origFilename;

  bool newCapture = (!temporary && !Config().RecentCaptureFiles.contains(origFilename));

  LambdaThread *thread = new LambdaThread([this, captureFile, origFilename, temporary, local]() {
    LoadCaptureThreaded(captureFile, origFilename, temporary, local);
  });
  thread->selfDelete(true);
  thread->start();

  QElapsedTimer loadTimer;
  loadTimer.start();

  ShowProgressDialog(m_MainWindow, tr("Loading Capture: %1").arg(origFilename),
                     [this]() { return !m_LoadInProgress; },
                     [this]() { return UpdateLoadProgress(); });

  ANALYTIC_ADDAVG(Performance.LoadTime, double(loadTimer.nsecsElapsed() * 1.0e-9));

  ANALYTIC_SET(CaptureFeatures.ShaderLinkage, m_APIProps.ShaderLinkage);
  ANALYTIC_SET(CaptureFeatures.YUVTextures, m_APIProps.YUVTextures);
  ANALYTIC_SET(CaptureFeatures.SparseResources, m_APIProps.SparseResources);
  ANALYTIC_SET(CaptureFeatures.MultiGPU, m_APIProps.MultiGPU);
  ANALYTIC_SET(CaptureFeatures.D3D12Bundle, m_APIProps.D3D12Bundle);

  m_MainWindow->setProgress(-1.0f);

  if(m_CaptureLoaded)
  {
    m_CaptureTemporary = temporary;

    m_CaptureMods = CaptureModifications::NoModifications;

    rdcarray<ICaptureViewer *> viewers(m_CaptureViewers);

    // make sure we're on a consistent event before invoking viewer forms
    if(m_LastDrawcall)
      SetEventID(viewers, m_LastDrawcall->eventId, true);
    else if(!m_Drawcalls.empty())
      SetEventID(viewers, m_Drawcalls.back().eventId, true);

    GUIInvoke::blockcall([&viewers]() {
      // notify all the registers viewers that a capture has been loaded
      for(ICaptureViewer *viewer : viewers)
      {
        if(viewer)
          viewer->OnCaptureLoaded();
      }
    });

    if(newCapture && m_Notes.contains(lit("comments")))
    {
      if(!HasCommentView())
        ShowCommentView();
      RaiseDockWindow(GetCommentView()->Widget());
    }
  }
}