Example #1
0
void CMainState::EndGifDraw()
{
	SceneManager->GetScene()->SetActiveCamera(Context->Scene.Camera);
	if (! gifWriter->Save("output.gif"))
	{
		std::cerr << "GIF writing failed" << std::endl;
		WaitForUser();
	}

	delete gifWriter;
	gifWriter = 0;
}
Example #2
0
/*
 * Test sub windows
 */
static int
SubWinTest(WINDOW *win)
{
    int w, h, sw, sh, bx, by;
    WINDOW *swin1, *swin2, *swin3;

    getmaxyx(win, h, w);
    getbegyx(win, by, bx);
    sw = w / 3;
    sh = h / 3;
    if ((swin1 = subwin(win, sh, sw, by + 3, bx + 5)) == NULL)
	return 1;
    if ((swin2 = subwin(win, sh, sw, by + 4, bx + 8)) == NULL)
	return 1;
    if ((swin3 = subwin(win, sh, sw, by + 5, bx + 11)) == NULL)
	return 1;

    set_colors(swin1, 8, COLOR_RED, COLOR_BLUE);
    werase(swin1);
    MvWAddStr(swin1, 0, 3, "Sub-window 1");
    wrefresh(swin1);

    set_colors(swin2, 9, COLOR_CYAN, COLOR_MAGENTA);
    werase(swin2);
    MvWAddStr(swin2, 0, 3, "Sub-window 2");
    wrefresh(swin2);

    set_colors(swin3, 10, COLOR_YELLOW, COLOR_GREEN);
    werase(swin3);
    MvWAddStr(swin3, 0, 3, "Sub-window 3");
    wrefresh(swin3);

    delwin(swin1);
    delwin(swin2);
    delwin(swin3);
    WaitForUser(win);
    return 0;
}
Example #3
0
BOOL HandleBPM(DWORD dwThID)
{
	HANDLE   hTh;
	CONTEXT  Con                = {CON_DRX};
	BOOL     bHandle            = FALSE;
	DWORD    dwEip;
	char     cStatusBuff[50];

	hTh = GetThreadHandle(dwThID);
	if (!hTh)
		return FALSE;

	if (!GetThreadContext(hTh, &Con))
		return FALSE;

	// is EIP == a BPM address ?
	dwEip = Con.Eip;

	// BPM0 ?
	if ((Con.Dr6 & BPM0_DETECTED) == BPM0_DETECTED &&
		(dwEip >= Con.Eip && dwEip <= Con.Eip + MAX_RW_OPCODE) &&
		(Con.Dr7 & BPM0_LOCAL_ENABLED) == BPM0_LOCAL_ENABLED)
	{
		wsprintf(cStatusBuff, "BPM - %08lXh ", Con.Dr0);
		// build info string
		if ((Con.Dr7 & BPM0_RW) == BPM0_RW)
			lstrcat(cStatusBuff, "RW");
		else if ((Con.Dr7 & BPM0_W) == BPM0_W)
			lstrcat(cStatusBuff, "W");
		else // x !
			lstrcat(cStatusBuff, "X");
		lstrcat(cStatusBuff, " (Dr0)");
		lstrcat(cStatusBuff, " reached...");
		bHandle = TRUE;
	}

	// BPM1 ?
	if ((Con.Dr6 & BPM1_DETECTED) == BPM1_DETECTED &&
		(dwEip >= Con.Eip && dwEip <= Con.Eip + MAX_RW_OPCODE) &&
		(Con.Dr7 & BPM1_LOCAL_ENABLED) == BPM1_LOCAL_ENABLED)
	{
		wsprintf(cStatusBuff, "BPM - %08lXh ", Con.Dr1);
		// build info string
		if ((Con.Dr7 & BPM1_RW) == BPM1_RW)
			lstrcat(cStatusBuff, "RW");
		else if ((Con.Dr7 & BPM1_W) == BPM1_W)
			lstrcat(cStatusBuff, "W");
		else // x !
			lstrcat(cStatusBuff, "X");
		lstrcat(cStatusBuff, " (Dr1)");
		lstrcat(cStatusBuff, " reached...");
		bHandle = TRUE;
	}

	// BPM2 ?
	if ((Con.Dr6 & BPM2_DETECTED) == BPM2_DETECTED &&
		(dwEip >= Con.Eip && dwEip <= Con.Eip + MAX_RW_OPCODE) &&
		(Con.Dr7 & BPM2_LOCAL_ENABLED) == BPM2_LOCAL_ENABLED)
	{
		wsprintf(cStatusBuff, "BPM - %08lXh ", Con.Dr2);
		// build info string
		if ((Con.Dr7 & BPM2_RW) == BPM2_RW)
			lstrcat(cStatusBuff, "RW");
		else if ((Con.Dr7 & BPM2_W) == BPM2_W)
			lstrcat(cStatusBuff, "W");
		else // x !
			lstrcat(cStatusBuff, "X");
		lstrcat(cStatusBuff, " (Dr2)");
		lstrcat(cStatusBuff, " reached...");
		bHandle = TRUE;
	}

	// BPM3 ?
	if ((Con.Dr6 & BPM3_DETECTED) == BPM3_DETECTED &&
		(dwEip >= Con.Eip && dwEip <= Con.Eip + MAX_RW_OPCODE) &&
		(Con.Dr7 & BPM3_LOCAL_ENABLED) == BPM3_LOCAL_ENABLED)
	{
		wsprintf(cStatusBuff, "BPM - %08lXh ", Con.Dr3);
		// build info string
		if ((Con.Dr7 & BPM3_RW) == BPM3_RW)
			lstrcat(cStatusBuff, "RW");
		else if ((Con.Dr7 & BPM3_W) == BPM3_W)
			lstrcat(cStatusBuff, "W");
		else // x !
			lstrcat(cStatusBuff, "X");
		lstrcat(cStatusBuff, " (Dr3)");
		lstrcat(cStatusBuff, " reached...");
		bHandle = TRUE;
	}

	if (bHandle)
	{
		SuspendProcess();
		UpdateStatus(cStatusBuff);
		if (Option.bDlgOnBPM)
			CreateBPMDlg(hInst, hDlg_);		// open BPM Menu
		WaitForUser();
	}

	return bHandle;
}