예제 #1
0
// Установка размера шрифта (8, 12 или 16 сконлиний на символ) или гр. режима
void SetVideoMode(TVideoMode vm)
{
if (vm==vmVideoMode) return;
TVideoMode vmOldVM=vmVideoMode;
vmVideoMode=vm;
switch (vmVideoMode)
  {
  case vmText30:
    nLinesPerSymbol=16;
    nTextLines=30;
    break;
  case vmText40:
    nLinesPerSymbol=12;
    nTextLines=40;
    break;
  case vmText60:
    nLinesPerSymbol=8;
    nTextLines=60;
  case vmGraph512:
    nLinesPerSymbol=12;
    nTextLines=32;
    break;
  case vmGraph800:
    nLinesPerSymbol=16;
    nTextLines=30;
    break;
  }
if ((!IsGraphMode(vmOldVM) && IsGraphMode(vmVideoMode)) ||
   (IsGraphMode(vmOldVM) && !IsGraphMode(vmVideoMode)) ||
   (IsGraphMode(vmOldVM) && IsGraphMode(vmVideoMode) && vmOldVM!=vmVideoMode) ||
    vmOldVM==vmNone)
  ChangeResolution();
//if (vmOldVM!=vmVideoMode /*|| IsGraphMode(vmVideoMode)*/)
//  DrawScreen();
}
예제 #2
0
void PS3Graphics::SwitchResolution(uint32_t resId, uint16_t pal60Hz)
{
	if(CheckResolution(resId))
	{
		ChangeResolution(resId, pal60Hz);
	}
}
예제 #3
0
void CWinSystemWin32::RestoreDesktopResolution(int screen)
{
  int resIdx = RES_DESKTOP;
  for (int idx = RES_DESKTOP; idx < RES_DESKTOP + GetNumScreens(); idx++)
  {
    if (CDisplaySettings::Get().GetResolutionInfo(idx).iScreen == screen)
    {
      resIdx = idx;
      break;
    }
  }
  ChangeResolution(CDisplaySettings::Get().GetResolutionInfo(resIdx));
}
예제 #4
0
void CWinSystemWin32::RestoreDesktopResolution(int screen)
{
  int resIdx = RES_DESKTOP;
  for (int idx = RES_DESKTOP; idx < RES_DESKTOP + GetNumScreens(); idx++)
  {
    if (g_settings.m_ResInfo[idx].iScreen == screen)
    {
      resIdx = idx;
      break;
    }
  }
  ChangeResolution(g_settings.m_ResInfo[resIdx]);
}
예제 #5
0
bool CWinSystemWin32::SetFullScreenEx(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays, bool forceResChange)
{
    m_IsAlteringWindow = true;

    CLog::Log(LOGDEBUG, "%s (%s) on screen %d with size %dx%d, refresh %f%s", __FUNCTION__, !fullScreen ? "windowed" : (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOSCREEN_FAKEFULLSCREEN) ? "windowed fullscreen" : "true fullscreen"), res.iScreen, res.iWidth, res.iHeight, res.fRefreshRate, (res.dwFlags & D3DPRESENTFLAG_INTERLACED) ? "i" : "");

    bool forceResize = false;

    if (m_nScreen != res.iScreen)
    {
        forceResize = true;
        RestoreDesktopResolution(m_nScreen);
    }

    if(m_hWnd && !m_bFullScreen && fullScreen)
    {
        // save position of windowed mode
        WINDOWINFO wi;
        wi.cbSize = sizeof(WINDOWINFO);
        if(GetWindowInfo(m_hWnd, &wi))
        {
            m_nLeft = wi.rcClient.left;
            m_nTop = wi.rcClient.top;
            m_ValidWindowedPosition = true;
        }
        else
            CLog::Log(LOGERROR, "%s : GetWindowInfo failed with %d", __FUNCTION__, GetLastError());
    }

    m_bFullScreen = fullScreen;
    m_nScreen = res.iScreen;
    m_nWidth  = res.iWidth;
    m_nHeight = res.iHeight;
    m_bBlankOtherDisplay = blankOtherDisplays;

    if (fullScreen && CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOSCREEN_FAKEFULLSCREEN))
        ChangeResolution(res, forceResChange);

    ResizeInternal(forceResize);

    BlankNonActiveMonitors(m_bBlankOtherDisplay);

    m_IsAlteringWindow = false;

    return true;
}
예제 #6
0
bool CWinSystemWin32::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays)
{
  m_IsAlteringWindow = true;

  CLog::Log(LOGDEBUG, "%s (%s) on screen %d with size %dx%d, refresh %f%s", __FUNCTION__, !fullScreen ? "windowed" : (g_guiSettings.GetBool("videoscreen.fakefullscreen") ? "windowed fullscreen" : "true fullscreen"), res.iScreen, res.iWidth, res.iHeight, res.fRefreshRate, (res.dwFlags & D3DPRESENTFLAG_INTERLACED) ? "i" : "");

  bool forceResize = false;

  if (m_nScreen != res.iScreen)
  {
    forceResize = true;
    RestoreDesktopResolution(m_nScreen);
  }

  if(!m_bFullScreen && fullScreen)
  {
    // save position of windowed mode
    WINDOWINFO wi;
    wi.cbSize = sizeof(WINDOWINFO);
    GetWindowInfo(m_hWnd, &wi);
    m_nLeft = wi.rcClient.left;
    m_nTop = wi.rcClient.top;
    m_ValidWindowedPosition = true;
  }

  m_bFullScreen = fullScreen;
  m_nScreen = res.iScreen;
  m_nWidth  = res.iWidth;
  m_nHeight = res.iHeight;
  m_bBlankOtherDisplay = blankOtherDisplays;

  if (fullScreen && g_guiSettings.GetBool("videoscreen.fakefullscreen"))
    ChangeResolution(res);

  ResizeInternal(forceResize);

  BlankNonActiveMonitors(m_bBlankOtherDisplay);

  m_IsAlteringWindow = false;

  return true;
}
예제 #7
0
void ToggleFullScreen()
{
bFullScreen=!bFullScreen;
ChangeResolution();
}
예제 #8
0
BOOL CCustomPlayer::Process(int iConfig)
{
	// just to be sure we check the player is ready and playing
	if (!m_CKContext || !m_CKContext->IsPlaying()) {
		Sleep(10);
		return TRUE;
	}

	float beforeRender	= 0;
	float beforeProcess	= 0;
	// retrieve the time to wait in milliseconds to perfom a rendering or a process loop
	// so that the time manager limits are respected.
	m_TimeManager->GetTimeToWaitForLimits(beforeRender,beforeProcess);

	if (beforeProcess<=0) {
		// ok to process
		m_TimeManager->ResetChronos(FALSE,TRUE);
		m_CKContext->Process();
	}

	if (beforeRender<=0) {
		// ok to render
		m_TimeManager->ResetChronos(TRUE,FALSE);
		if (GetPlayer().GetPAppStyle()->IsRenderering())
			m_RenderContext->Render();
	}

	// now we check if the composition has not change the state of a "control" attribute

	// quit has been set
	if (m_Level->HasAttribute(m_QuitAttType)) {
		// we remove it (so it is not "here" the next frame)
		m_Level->RemoveAttribute(m_QuitAttType);
//		MessageBox(NULL,"","a",1);
		// and return FALSE to quit
		return FALSE;
	}

	// switch fullscreen has been set
	if (m_Level->HasAttribute(m_SwitchFullscreenAttType)) 
	{
		//bool goFS;// = vtTools::AttributeTools::GetValueFromAttribute<bool>(m_Level,m_SwitchFullscreenAttType);
		/*CKParameterOut* pout = m_Level->GetAttributeParameter(m_SwitchFullscreenAttType);
		if (!pout) {
			return FALSE;
		}*/
		// we remove it (so it is not "here" the next frame)
		m_Level->RemoveAttribute(m_SwitchFullscreenAttType);
		// and switch fullscreen (ie goes from fullscreen to windowed
		// or to windowed from fullscreen)
//		if(goFS)
		if (GetPlayer().GetPAppStyle()->IsRenderering())
			SwitchFullscreen();

	}

	// switch resolution has been set
	if (m_Level->HasAttribute(m_SwitchResolutionAttType)) {
		// we remove it (so it is not "here" the next frame)
		m_Level->RemoveAttribute(m_SwitchResolutionAttType);
		// and we change the resolution
		ChangeResolution();
	}

	// switch resolution has been set
	if (m_Level->HasAttribute(m_SwitchMouseClippingAttType)) {
		// we remove it (so it is not "here" the next frame)
		m_Level->RemoveAttribute(m_SwitchMouseClippingAttType);
		m_MouseClipped = !m_MouseClipped;
		ClipMouse(m_MouseClipped);
	}

	return TRUE;
}