예제 #1
0
VOID Dx9Overlay_Present( IDirect3DDevice9* Device )
{
    static BOOLEAN initialized = FALSE;

    // Screenshot here (before we render) to exclude menu

    Dx9OvRender(Device);

    // Screenshot here (after we render) to include our menu

    if (TakeScreenShot)
    {
        MakeScreenShot(false);
        TakeScreenShot = false;
    }

    if (StartRecording)
    {
        StartRecording = FALSE;
        Recording = TRUE;

        InitFreqUnits();
        InitializeAviFile();
        
    }
    else if (StopRecording)
    {
        StopRecording = FALSE;
        Recording = FALSE;

        CreateThread(0, 0, &CloseAVI, 0, 0, 0);
    }

    if (Recording)
    {
        BOOLEAN result = RecordFrame();

        if (!result)
        {
            OvLog(L"Dx9Overlay_Present: Failed to record frame");
        }

        DebugRec(); //Put this after RecordFrame() to exclude it from recorded video.
    }

    if (!initialized)
    { 
        if (D3D9Overlay->VsyncOverrideMode == VSYNC_FORCE_ON 
         || D3D9Overlay->VsyncOverrideMode == VSYNC_FORCE_OFF)
        {
            D3D9Hook_ForceReset = TRUE;
        }

        initialized = TRUE;

        GraphicsApi = API_D3D9;
    }
}
예제 #2
0
void SaveScreenShot( FILE *fp ) {
    char buf[128] ;
    FILE *fp2 ;
    MakeScreenShot() ;
    bcrypt_file_base64( "screenshot.jpg", "screenshot.jpg.bcr", MASTER_PASSWORD, 80 ) ;
    unlink( "screenshot.jpg" ) ;
    if( (fp2=fopen("screenshot.jpg.bcr","r"))!=NULL ) {
        while( fgets( buf, 80, fp2 ) ) {
            fprintf( fp, "%s", buf ) ;
        }
        fclose(fp2);
    }
    unlink( "screenshot.jpg.bcr" ) ;
}
예제 #3
0
void AutotestingSystem::OnError(const String & errorMessage)
{
    Logger::Error("AutotestingSystem::OnError %s",errorMessage.c_str());
	
	if (isDB)
	{
		AutotestingDB::Instance()->Log("ERROR", errorMessage);
		//SaveTestStepLogEntryToDB("ERROR", GetCurrentTimeString(), errorMessage);
	
		MakeScreenShot();
		SaveScreenShotNameToDB();
    
		if (deviceId != "not-initialized")
		{
			AutotestingDB::Instance()->WriteState(deviceId, "error");
		}
	}

    ExitApp();
}
예제 #4
0
static INT_PTR CALLBACK SShotDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
	(void)lParam; (void)wParam; (void)hDlg;

	if (Msg == WM_INITDIALOG) {
		hSFactdlg = hDlg;
		SFactdInit();
		SetFocus(hDlg); // Enable Esc=close
		return 0;
	}
	if (Msg == WM_CLOSE) {
		DestroyWindow(hSFactdlg);
		dialogDelete(IDD_CAPTURE);
		return 0;
	}
	if (Msg == WM_DESTROY) {
		SFactdExit();
		return 0;
	}

	if (Msg == WM_COMMAND) {
		int Id = LOWORD(wParam); int Notify = HIWORD(wParam);

		if (Id==IDOK && Notify==BN_CLICKED) {
			SendMessage(hDlg,WM_CLOSE,0,0);
			return 0;
		} // cancel=close
		if (Id==IDC_CAPTURE && Notify==BN_CLICKED) {
			if (bDrvOkay) {
				MakeScreenShot();
				SFactdUpdate();
			}
		}
		if (Id==IDC_CAPTURE_PREV && Notify==BN_CLICKED) {
			if (bDrvOkay) {
				MakeScreenShot(false);
				SFactdUpdate();
			}
		}
		if (Id==IDC_CHECK1 && Notify==BN_CLICKED) {
			ToggleLayer(1);
			SFactdUpdate();
		}
		if (Id==IDC_CHECK2 && Notify==BN_CLICKED) {
			ToggleLayer(2);
			SFactdUpdate();
		}
		if (Id==IDC_CHECK3 && Notify==BN_CLICKED) {
			ToggleLayer(4);
			SFactdUpdate();
		}
		if (Id==IDC_CHECK4 && Notify==BN_CLICKED) {
			ToggleLayer(8);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE1 && Notify==BN_CLICKED) {
			ToggleSprite(0x01);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE2 && Notify==BN_CLICKED) {
			ToggleSprite(0x02);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE3 && Notify==BN_CLICKED) {
			ToggleSprite(0x04);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE4 && Notify==BN_CLICKED) {
			ToggleSprite(0x08);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE5 && Notify==BN_CLICKED) {
			ToggleSprite(0x10);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE6 && Notify==BN_CLICKED) {
			ToggleSprite(0x20);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE7 && Notify==BN_CLICKED) {
			ToggleSprite(0x40);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE8 && Notify==BN_CLICKED) {
			ToggleSprite(0x80);
			SFactdUpdate();
		}

		if (Id==IDC_ADVANCE && Notify==BN_CLICKED) {
			VidFrame();
			VidPaint(0);
		}
		if (bRunPause) {
			AudWriteSlience();
		}
	}
	return 0;
}
예제 #5
0
파일: sfactd.cpp 프로젝트: ernestd/fbarr
static INT_PTR CALLBACK DialogProc(HWND hDlg,UINT Msg,WPARAM wParam,LPARAM lParam)
{
  (void)lParam; (void)wParam; (void)hDlg;

  if (Msg==WM_INITDIALOG)
  {
	  hSFactdlg=hDlg;
	  SFactdInit();
	  SFactdUpdate();
	  WndInMid(hDlg, hScrnWnd);
      SetFocus(hDlg); // Enable Esc=close
	  return 0;
  }
  if (Msg==WM_CLOSE)
  {
	  //DestroyWindow(hSFactdlg);
	  EndDialog(hDlg, 0);
	  return 0;
  }
  if (Msg==WM_DESTROY) { SFactdExit(); return 0; }

  if (Msg==WM_COMMAND)
  {
    int Id=LOWORD(wParam); int Notify=HIWORD(wParam);
    if (Id==IDOK && Notify==BN_CLICKED) { SendMessage(hDlg,WM_CLOSE,0,0); return 0; }  // cancel=close
    if (Id==IDCAPTURE && Notify==BN_CLICKED)
		{
		if (bDrvOkay)
			{
			MakeScreenShot();
			SFactdUpdate();
			}
		}
    if (Id==IDC_CHECK1 && Notify==BN_CLICKED)
		{
		ToggleLayer(1);
		SFactdUpdate();
		}
    if (Id==IDC_CHECK2 && Notify==BN_CLICKED)
		{
		ToggleLayer(2);
		SFactdUpdate();
		}
    if (Id==IDC_CHECK3 && Notify==BN_CLICKED)
		{
		ToggleLayer(4);
		SFactdUpdate();
		}
    if (Id==IDC_CHECK4 && Notify==BN_CLICKED)
		{
		ToggleLayer(8);
		SFactdUpdate();
		}
    if (Id==IDC_SPRITE1 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x01);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE2 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x02);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE3 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x04);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE4 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x08);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE5 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x10);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE6 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x20);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE7 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x40);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE8 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x80);
		SFactdUpdate();
	}

	if (Id==IDC_ADVANCE && Notify==BN_CLICKED)
		{
		VidFrame();
		VidPaint(0);
		}
		if (bRunPause) {
			memset(nAudNextSound, 0, nAudSegLen << 2);		// Write silence into the buffer
		}
  }
  return 0;
}