• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PPGeDrawText函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PPGeDrawText函数的典型用法代码示例。如果您正苦于以下问题:C++ PPGeDrawText函数的具体用法?C++ PPGeDrawText怎么用?C++ PPGeDrawText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PPGeDrawText函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetI18NCategory

void PSPSaveDialog::DisplayEnterBack()
{
	I18NCategory *d = GetI18NCategory("Dialog");
	PPGeDrawImage(okButtonImg, 180, 257, 11, 11, 0, CalcFadedColor(0xFFFFFFFF));
	PPGeDrawImage(cancelButtonImg, 270, 257, 11, 11, 0, CalcFadedColor(0xFFFFFFFF));
	PPGeDrawText(d->T("Enter"), 195, 255, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(0xFFFFFFFF));
	PPGeDrawText(d->T("Back"), 285, 255, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(0xFFFFFFFF));
}
开发者ID:Bennieboj,项目名称:ppsspp,代码行数:8,代码来源:PSPSaveDialog.cpp


示例2: DebugStats

void DebugStats()
{
	gpu->UpdateStats();
	char stats[2048];

	sprintf(stats,
		"Frames: %i\n"
		"DL processing time: %0.2f ms\n"
		"Kernel processing time: %0.2f ms\n"
		"Slowest syscall: %s : %0.2f ms\n"
		"Most active syscall: %s : %0.2f ms\n"
		"Draw calls: %i, flushes %i\n"
		"Cached Draw calls: %i\n"
		"Num Tracked Vertex Arrays: %i\n"
		"Vertices Submitted: %i\n"
		"Cached Vertices Drawn: %i\n"
		"Uncached Vertices Drawn: %i\n"
		"FBOs active: %i\n"
		"Textures active: %i, decoded: %i\n"
		"Texture invalidations: %i\n"
		"Vertex shaders loaded: %i\n"
		"Fragment shaders loaded: %i\n"
		"Combined shaders loaded: %i\n",
		gpuStats.numFrames,
		gpuStats.msProcessingDisplayLists * 1000.0f,
		kernelStats.msInSyscalls * 1000.0f,
		kernelStats.slowestSyscallName ? kernelStats.slowestSyscallName : "(none)",
		kernelStats.slowestSyscallTime * 1000.0f,
		kernelStats.summedSlowestSyscallName ? kernelStats.summedSlowestSyscallName : "(none)",
		kernelStats.summedSlowestSyscallTime * 1000.0f,
		gpuStats.numDrawCalls,
		gpuStats.numFlushes,
		gpuStats.numCachedDrawCalls,
		gpuStats.numTrackedVertexArrays,
		gpuStats.numVertsSubmitted,
		gpuStats.numCachedVertsDrawn,
		gpuStats.numUncachedVertsDrawn,
		gpuStats.numFBOs,
		gpuStats.numTextures,
		gpuStats.numTexturesDecoded,
		gpuStats.numTextureInvalidations,
		gpuStats.numVertexShaders,
		gpuStats.numFragmentShaders,
		gpuStats.numShaders
		);

	float zoom = 0.3f; /// g_Config.iWindowZoom;
	float soff = 0.3f;
	PPGeBegin();
	PPGeDrawText(stats, soff, soff, 0, zoom, 0xCC000000);
	PPGeDrawText(stats, -soff, -soff, 0, zoom, 0xCC000000);
	PPGeDrawText(stats, 0, 0, 0, zoom, 0xFFFFFFFF);
	PPGeEnd();

	gpuStats.resetFrame();
	kernelStats.ResetFrame();
}
开发者ID:rasyid-irsyadi,项目名称:ppsspp,代码行数:57,代码来源:sceDisplay.cpp


示例3: guard

void PSPSaveDialog::DisplaySaveDataInfo2()
{
	lock_guard guard(paramLock);
	if (param.GetFileInfo(currentSelectedSave).size == 0) {		
	} else {
		char txt[1024];
		char date[256];
		char am_pm[] = "AM";
		char hour_time[10] ;
		int hour = param.GetFileInfo(currentSelectedSave).modif_time.tm_hour;
		int min  = param.GetFileInfo(currentSelectedSave).modif_time.tm_min;
		switch (g_Config.iTimeFormat) {
		case 1:
			if (hour > 12) {
				strcpy(am_pm, "PM");
				hour -= 12;
			}
			snprintf(hour_time,10,"%02d:%02d %s", hour, min, am_pm);
			break;
		case 2:
			snprintf(hour_time,10,"%02d:%02d", hour, min); 
			break;
		default:
			if (hour > 12) {
				strcpy(am_pm, "PM");
				hour -= 12;
			}
			snprintf(hour_time,10,"%02d:%02d %s", hour, min, am_pm);
		}

		const char *saveTitle = param.GetFileInfo(currentSelectedSave).saveTitle;
		int day   = param.GetFileInfo(currentSelectedSave).modif_time.tm_mday;
		int month = param.GetFileInfo(currentSelectedSave).modif_time.tm_mon + 1;
		int year  = param.GetFileInfo(currentSelectedSave).modif_time.tm_year + 1900;
		s64 sizeK = param.GetFileInfo(currentSelectedSave).size / 1024;
		switch (g_Config.iDateFormat) {
		case 1:
			snprintf(date, 256, "%d/%02d/%02d", year, month, day);
			break;
		case 2:
			snprintf(date, 256, "%02d/%02d/%d", month, day, year);
			break;
		case 3:
			snprintf(date, 256, "%02d/%02d/%d", day, month, year);
			break;
		default:
			snprintf(date, 256, "%d/%02d/%02d", year, month, day);
		}
		snprintf(txt, 1024, "%s\n%s  %s\n%lld KB", saveTitle, date, hour_time, sizeK);
		std::string saveinfoTxt = txt;
		PPGeDrawText(saveinfoTxt.c_str(), 9, 202, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0x80000000));
		PPGeDrawText(saveinfoTxt.c_str(), 8, 200, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
	}
}
开发者ID:AdmiralCurtiss,项目名称:ppsspp,代码行数:54,代码来源:PSPSaveDialog.cpp


示例4: PPGeMeasureText

void PSPMsgDialog::DisplayMessage(std::string text, bool hasYesNo)
{
	const float WRAP_WIDTH = 300.0f;
	float y = 125.0f;
	float h;
	int n;
	PPGeMeasureText(0, &h, &n, text.c_str(), FONT_SCALE, PPGE_LINE_WRAP_WORD, WRAP_WIDTH);
	float h2 = h * (float)n / 2.0f;
	if (hasYesNo)
	{
		I18NCategory *d = GetI18NCategory("Dialog");
		const char *choiceText;
		u32 yesColor, noColor;
		float x, w;
		if (yesnoChoice == 1) {
			choiceText = d->T("Yes");
			x = 208.0f;
			yesColor = 0xFFFFFFFF;
			noColor  = 0xFFFFFFFF;
		}
		else {
			choiceText = d->T("No");
			x = 272.0f;
			yesColor = 0xFFFFFFFF;
			noColor  = 0xFFFFFFFF;
		}
		PPGeMeasureText(&w, &h, 0, choiceText, FONT_SCALE);
		w = w / 2.0f + 5.5f;
		h /= 2.0f;
		float y2 = y + h2 + 30.0f;
		h2 += h + 4.0f;
		y = 132.0f - h;
		PPGeDrawRect(x - w, y2 - h, x + w, y2 + h, CalcFadedColor(0x6DCFCFCF));
		PPGeDrawText(d->T("Yes"), 209.0f, y2+3, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x30000000));
		PPGeDrawText(d->T("Yes"), 208.0f, y2, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(yesColor));
		PPGeDrawText(d->T("No"), 273.0f, y2+3, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x30000000));
		PPGeDrawText(d->T("No"), 272.0f, y2, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(noColor));
		if (IsButtonPressed(CTRL_LEFT) && yesnoChoice == 0) {
			yesnoChoice = 1;
		}
		else if (IsButtonPressed(CTRL_RIGHT) && yesnoChoice == 1) {
			yesnoChoice = 0;
		}
	} 
	PPGeDrawTextWrapped(text.c_str(), 241.0f, y+3, WRAP_WIDTH, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x30000000));
	PPGeDrawTextWrapped(text.c_str(), 240.0f, y, WRAP_WIDTH, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
	float sy = 110.0f - h2, ey = 160.0f + h2;
	PPGeDrawRect(50.0f, sy, 420.0f, sy + 1.0f, CalcFadedColor(0xFFFFFFFF));
	PPGeDrawRect(50.0f, ey, 420.0f, ey + 1.0f, CalcFadedColor(0xFFFFFFFF));
}
开发者ID:JosipPranjic,项目名称:ppsspp,代码行数:50,代码来源:PSPMsgDialog.cpp


示例5: PPGeDrawText

void PSPOskDialog::RenderKeyboard()
{
	int selectedRow = selectedChar / KEYSPERROW;
	int selectedExtra = selectedChar % KEYSPERROW;

	char temp[2];
	temp[1] = '\0';

	u32 limit = oskData.outtextlimit;
	// TODO: Test more thoroughly.  Encountered a game where this was 0.
	if (limit <= 0)
		limit = 16;

	const float keyboardLeftSide = (480.0f - (23.0f * KEYSPERROW)) / 2.0f;
	float previewLeftSide = (480.0f - (15.0f * limit)) / 2.0f;
	float title = (480.0f - (7.0f * limit)) / 2.0f;

	PPGeDrawText(oskDesc.c_str(), title , 20, PPGE_ALIGN_CENTER, 0.5f, CalcFadedColor(0xFFFFFFFF));
	for (u32 i = 0; i < limit; ++i)
	{
		u32 color = CalcFadedColor(0xFFFFFFFF);
		if (i < inputChars.size())
			temp[0] = inputChars[i];
		else if (i == inputChars.size())
		{
			temp[0] = oskKeys[selectedRow][selectedExtra];
			color = CalcFadedColor(0xFF3060FF);
		}
		else
			temp[0] = '_';

		PPGeDrawText(temp, previewLeftSide + (i * 16.0f), 40.0f, 0, 0.5f, color);
	}
	for (int row = 0; row < NUMKEYROWS; ++row)
	{
		for (int col = 0; col < KEYSPERROW; ++col)
		{
			u32 color = CalcFadedColor(0xFFFFFFFF);
			if (selectedRow == row && col == selectedExtra)
				color = CalcFadedColor(0xFF7f7f7f);

			temp[0] = oskKeys[row][col];
			PPGeDrawText(temp, keyboardLeftSide + (25.0f * col), 70.0f + (25.0f * row), 0, 0.6f, color);

			if (selectedRow == row && col == selectedExtra)
				PPGeDrawText("_", keyboardLeftSide + (25.0f * col), 70.0f + (25.0f * row), 0, 0.6f, CalcFadedColor(0xFFFFFFFF));
		}
	}

}
开发者ID:Almamu,项目名称:ppsspp,代码行数:50,代码来源:PSPOskDialog.cpp


示例6: PPGeMeasureText

void PSPSaveDialog::DisplayMessage(std::string text, bool hasYesNo)
{
	const float WRAP_WIDTH = 254.0f;
	float y = 136.0f, h;
	int n;
	PPGeMeasureText(0, &h, &n, text.c_str(), FONT_SCALE, PPGE_LINE_WRAP_WORD, WRAP_WIDTH);
	float h2 = h * (float)n / 2.0f;
	if (hasYesNo)
	{
		I18NCategory *di = GetI18NCategory("Dialog");
		const char *choiceText;
		u32 yesColor, noColor;
		float x, w;
		if (yesnoChoice == 1) {
			choiceText = di->T("Yes");
			x = 302.0f;
			yesColor = 0xFFFFFFFF;
			noColor  = 0xFFFFFFFF;
		}
		else {
			choiceText = di->T("No");
			x = 366.0f;
			yesColor = 0xFFFFFFFF;
			noColor  = 0xFFFFFFFF;
		}
		PPGeMeasureText(&w, &h, 0, choiceText, FONT_SCALE);
		w = w / 2.0f + 5.5f;
		h /= 2.0f;
		float y2 = y + h2 + 4.0f;
		h2 += h + 4.0f;
		y = 132.0f - h;
		PPGeDrawRect(x - w, y2 - h, x + w, y2 + h, CalcFadedColor(0x40C0C0C0));
		PPGeDrawText(di->T("Yes"), 303.0f, y2+2, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
		PPGeDrawText(di->T("Yes"), 302.0f, y2, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(yesColor));
		PPGeDrawText(di->T("No"), 367.0f, y2+2, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
		PPGeDrawText(di->T("No"), 366.0f, y2, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(noColor));
		if (IsButtonPressed(CTRL_LEFT) && yesnoChoice == 0) {
			yesnoChoice = 1;
		}
		else if (IsButtonPressed(CTRL_RIGHT) && yesnoChoice == 1) {
			yesnoChoice = 0;
		}
	}
	PPGeDrawTextWrapped(text.c_str(), 335.0f, y+2, WRAP_WIDTH, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
	PPGeDrawTextWrapped(text.c_str(), 334.0f, y, WRAP_WIDTH, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
	float sy = 122.0f - h2, ey = 150.0f + h2;
	PPGeDrawRect(202.0f, sy, 466.0f, sy + 1.0f, CalcFadedColor(0xFFFFFFFF));
	PPGeDrawRect(202.0f, ey, 466.0f, ey + 1.0f, CalcFadedColor(0xFFFFFFFF));
}
开发者ID:AdmiralCurtiss,项目名称:ppsspp,代码行数:49,代码来源:PSPSaveDialog.cpp


示例7: GetI18NCategory

void PSPMsgDialog::DisplayYesNo()
{
	I18NCategory *d = GetI18NCategory("Dialog");
	PPGeDrawText(d->T("Yes"), 200, 150, PPGE_ALIGN_LEFT, 0.55f, CalcFadedColor(yesnoChoice == 1?0xFF0000FF:0xFFFFFFFF));
	PPGeDrawText(d->T("No"), 320, 150, PPGE_ALIGN_LEFT, 0.55f, CalcFadedColor(yesnoChoice == 0?0xFF0000FF:0xFFFFFFFF));

	if (IsButtonPressed(CTRL_LEFT) && yesnoChoice == 0)
	{
		yesnoChoice = 1;
	}
	else if (IsButtonPressed(CTRL_RIGHT) && yesnoChoice == 1)
	{
		yesnoChoice = 0;
	}
}
开发者ID:Dzakus,项目名称:ppsspp,代码行数:15,代码来源:PSPMsgDialog.cpp


示例8: PPGeDrawText

void PSPMsgDialog::DisplayYesNo()
{

	PPGeDrawText("Yes", 200, 150, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(yesnoChoice == 1?0xFF0000FF:0xFFFFFFFF));
	PPGeDrawText("No", 320, 150, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(yesnoChoice == 0?0xFF0000FF:0xFFFFFFFF));

	if (IsButtonPressed(CTRL_LEFT) && yesnoChoice == 0)
	{
		yesnoChoice = 1;
	}
	else if (IsButtonPressed(CTRL_RIGHT) && yesnoChoice == 1)
	{
		yesnoChoice = 0;
	}
}
开发者ID:Almamu,项目名称:ppsspp,代码行数:15,代码来源:PSPMsgDialog.cpp


示例9: strcpy

void PSPSaveDialog::DisplaySaveDataInfo2()
{
	if(param.GetFileInfo(currentSelectedSave).size == 0)
	{
	}
	else
	{
		char txt[1024];
		char am_pm[] = "AM";
		char hour_time[10] ;
		int hour = param.GetFileInfo(currentSelectedSave).modif_time.tm_hour ;
		int min  = param.GetFileInfo(currentSelectedSave).modif_time.tm_min ;
		if (g_Config.itimeformat) {
			if( hour > 12 )  {
				strcpy(am_pm, "PM");
				hour -= 12;
			}
			snprintf(hour_time,10,"%02d:%02d %s", hour, min, am_pm);
		} else 
			snprintf(hour_time,10,"%02d:%02d", hour, min);

		snprintf(txt,1024,"%s\n%02d/%02d/%d  %s\n%lld KB"
						, param.GetFileInfo(currentSelectedSave).saveTitle
						, param.GetFileInfo(currentSelectedSave).modif_time.tm_mday
						, param.GetFileInfo(currentSelectedSave).modif_time.tm_mon + 1
						, param.GetFileInfo(currentSelectedSave).modif_time.tm_year + 1900
						, hour_time
						, param.GetFileInfo(currentSelectedSave).size / 1024
						);
		std::string saveinfoTxt = txt;
		PPGeDrawText(saveinfoTxt.c_str(), 10, 180, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(0xFFFFFFFF));
	}
}
开发者ID:Bennieboj,项目名称:ppsspp,代码行数:33,代码来源:PSPSaveDialog.cpp


示例10: PPGeDrawRect

void PSPNetconfDialog::DrawBanner() {

	PPGeDrawRect(0, 0, 480, 23, CalcFadedColor(0x65636358));

	// TODO: Draw a hexagon icon
	PPGeDrawImage(10, 6, 12.0f, 12.0f, 1, 10, 1, 10, 10, 10, CalcFadedColor(0xFFFFFFFF));
	I18NCategory *d = GetI18NCategory("Dialog");
	PPGeDrawText(d->T("Network Connection"), 30, 11, PPGE_ALIGN_VCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
}
开发者ID:3amrMost,项目名称:ppsspp,代码行数:9,代码来源:PSPNetconfDialog.cpp


示例11: UpdateButtons

int PSPNetconfDialog::Update(int animSpeed) {
	UpdateButtons();
	I18NCategory *d = GetI18NCategory("Dialog");
	I18NCategory *err = GetI18NCategory("Error");
	const float WRAP_WIDTH = 254.0f;
	const int confirmBtnImage = g_Config.iButtonPreference == PSP_SYSTEMPARAM_BUTTON_CROSS ? I_CROSS : I_CIRCLE;
	const int confirmBtn = g_Config.iButtonPreference == PSP_SYSTEMPARAM_BUTTON_CROSS ? CTRL_CROSS : CTRL_CIRCLE;

	if (status == SCE_UTILITY_STATUS_INITIALIZE)
	{
		status = SCE_UTILITY_STATUS_RUNNING;
	}
	else if (status == SCE_UTILITY_STATUS_RUNNING && (request.netAction == NETCONF_CONNECT_APNET || request.netAction == NETCONF_STATUS_APNET)) {
		UpdateFade(animSpeed);
		StartDraw();
		DrawBanner();
		PPGeDrawRect(0, 0, 480, 272, CalcFadedColor(0x63636363));
		PPGeDrawTextWrapped(err->T("PPSSPPDoesNotSupportInternet", "PPSSPP currently does not support connecting to the Internet for DLC, PSN, or game updates."), 241, 132, WRAP_WIDTH, PPGE_ALIGN_CENTER, 0.5f, CalcFadedColor(0xFFFFFFFF));
		PPGeDrawImage(confirmBtnImage, 195, 250, 20, 20, 0, CalcFadedColor(0xFFFFFFFF));
		PPGeDrawText(d->T("OK"), 225, 252, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));

		if (IsButtonPressed(confirmBtn)) {
			StartFade(false);
			status = SCE_UTILITY_STATUS_FINISHED;
			// TODO: When the dialog is aborted, does it really set the result to this?
			// It seems to make Phantasy Star Portable 2 happy, so it should be okay for now.
			request.common.result = SCE_UTILITY_DIALOG_RESULT_ABORT;
		}
		
	}
	else if (status == SCE_UTILITY_STATUS_RUNNING && (request.netAction == NETCONF_CONNECT_ADHOC || request.netAction == NETCONF_CREATE_ADHOC || request.netAction == NETCONF_JOIN_ADHOC)) {
		if (request.NetconfData != NULL) {
			Shutdown(true);
			if (sceNetAdhocctlCreate(request.NetconfData->groupName) == 0)
			{
				status = SCE_UTILITY_STATUS_FINISHED;
				return 0;
			}
			return -1;
		}
	}
	else if (status == SCE_UTILITY_STATUS_FINISHED)
	{
		status = SCE_UTILITY_STATUS_SHUTDOWN;
	}

	EndDraw();
	return 0;
}
开发者ID:3amrMost,项目名称:ppsspp,代码行数:49,代码来源:PSPNetconfDialog.cpp


示例12: CalculateFPS

void CalculateFPS()
{
	static double highestFps = 0.0;
	static int lastFpsFrame = 0;
	static double lastFpsTime = 0.0;
	static double fps = 0.0;

	time_update();
	double now = time_now_d();

	if (now >= lastFpsTime + 1.0)
	{
		fps = (gpuStats.numFrames - lastFpsFrame) / (now - lastFpsTime);
		if (fps > highestFps)
			highestFps = fps;

		lastFpsFrame = gpuStats.numFrames;	
		lastFpsTime = now;
	}

	char stats[50];
	sprintf(stats, "VPS: %0.1f", fps);

	#ifdef USING_GLES2
		float zoom = 0.7f; /// g_Config.iWindowZoom;
		float soff = 0.7f;
	#else
		float zoom = 0.5f; /// g_Config.iWindowZoom;
		float soff = 0.5f;
	#endif
	PPGeBegin();
	PPGeDrawText(stats, 476 + soff, 4 + soff, PPGE_ALIGN_RIGHT, zoom, 0xCC000000);
	PPGeDrawText(stats, 476 + -soff, 4 -soff, PPGE_ALIGN_RIGHT, zoom, 0xCC000000);
	PPGeDrawText(stats, 476, 4, PPGE_ALIGN_RIGHT, zoom, 0xFF30FF30);
	PPGeEnd();
}
开发者ID:foreveralive,项目名称:ppsspp,代码行数:36,代码来源:sceDisplay.cpp


示例13: GetI18NCategory

void PSPSaveDialog::DisplayBanner(int which)
{
	I18NCategory *d = GetI18NCategory("Dialog");
	PPGeDrawRect(0, 0, 480, 23, CalcFadedColor(0x65636358));
	const char *title;
	switch (which)
	{
	case DB_SAVE:
		title = d->T("Save");
		break;
	case DB_LOAD:
		title = d->T("Load");
		break;
	case DB_DELETE:
		title = d->T("Delete");
		break;
	default:
		title = "";
		break;
	}
	// TODO: Draw a hexagon icon
	PPGeDrawText(title, 30, 11, PPGE_ALIGN_VCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
}
开发者ID:jamesguo,项目名称:ppsspp,代码行数:23,代码来源:PSPSaveDialog.cpp


示例14: __CtrlReadLatch

int PSPOskDialog::Update()
{
	buttons = __CtrlReadLatch();
	int selectedRow = selectedChar / KEYSPERROW;
	int selectedExtra = selectedChar % KEYSPERROW;

	u32 limit = oskData.outtextlimit;
	// TODO: Test more thoroughly.  Encountered a game where this was 0.
	if (limit <= 0)
		limit = 16;

	if (status == SCE_UTILITY_STATUS_INITIALIZE)
	{
		status = SCE_UTILITY_STATUS_RUNNING;
	}
	else if (status == SCE_UTILITY_STATUS_RUNNING)
	{		
		UpdateFade();

		StartDraw();
		RenderKeyboard();
		PPGeDrawImage(I_CROSS, 100, 220, 20, 20, 0, CalcFadedColor(0xFFFFFFFF));
		PPGeDrawText("Select", 130, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));

		PPGeDrawImage(I_CIRCLE, 200, 220, 20, 20, 0, CalcFadedColor(0xFFFFFFFF));
		PPGeDrawText("Delete", 230, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));

		PPGeDrawImage(I_BUTTON, 290, 220, 50, 20, 0, CalcFadedColor(0xFFFFFFFF));
		PPGeDrawText("Start", 305, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
		PPGeDrawText("Finish", 350, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));

		if (IsButtonPressed(CTRL_UP))
		{
			selectedChar -= KEYSPERROW;
		}
		else if (IsButtonPressed(CTRL_DOWN))
		{
			selectedChar += KEYSPERROW;
		}
		else if (IsButtonPressed(CTRL_LEFT))
		{
			selectedChar--;
			if (((selectedChar + KEYSPERROW) % KEYSPERROW) == KEYSPERROW - 1)
				selectedChar += KEYSPERROW;
		}
		else if (IsButtonPressed(CTRL_RIGHT))
		{
			selectedChar++;
			if ((selectedChar % KEYSPERROW) == 0)
				selectedChar -= KEYSPERROW;
		}

		selectedChar = (selectedChar + NUMBEROFVALIDCHARS) % NUMBEROFVALIDCHARS;

		if (IsButtonPressed(CTRL_CROSS))
		{
			if (inputChars.size() < limit)
				inputChars += oskKeys[selectedRow][selectedExtra];
		}
		else if (IsButtonPressed(CTRL_CIRCLE))
		{
			if (inputChars.size() > 0)
				inputChars.resize(inputChars.size() - 1);
		}
		else if (IsButtonPressed(CTRL_START))
		{
			StartFade(false);
		}
		EndDraw();
	}
	else if (status == SCE_UTILITY_STATUS_FINISHED)
	{
		status = SCE_UTILITY_STATUS_SHUTDOWN;
	}

	for (u32 i = 0; i < limit; ++i)
	{
		u16 value = 0;
		if (i < inputChars.size())
			value = 0x0000 ^ inputChars[i];
		Memory::Write_U16(value, oskData.outtextPtr + (2 * i));
	}

	oskData.outtextlength = inputChars.size();
	oskParams.base.result= 0;
	oskData.result = PSP_UTILITY_OSK_RESULT_CHANGED;
	Memory::WriteStruct(oskParams.SceUtilityOskDataPtr, &oskData);
	Memory::WriteStruct(oskParamsAddr, &oskParams);

	return 0;
}
开发者ID:Almamu,项目名称:ppsspp,代码行数:91,代码来源:PSPOskDialog.cpp


示例15: GetI18NCategory

void PSPSaveDialog::DisplaySaveDataInfo1()
{
	if (param.GetFileInfo(currentSelectedSave).size == 0) {
		I18NCategory *d = GetI18NCategory("Dialog");
		PPGeDrawText(d->T("NEW DATA"), 180, 136, PPGE_ALIGN_VCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
	} else {
		char title[512];
		char time[512];
		char saveTitle[512];
		char saveDetail[512];

		char am_pm[] = "AM";
		char hour_time[10] ;
		int hour = param.GetFileInfo(currentSelectedSave).modif_time.tm_hour;
		int min  = param.GetFileInfo(currentSelectedSave).modif_time.tm_min;
		switch (g_Config.iTimeFormat) {
		case 1:
			if (hour > 12) {
				strcpy(am_pm, "PM");
				hour -= 12;
			}
			snprintf(hour_time,10,"%02d:%02d %s", hour, min, am_pm);
			break;
		case 2:
			snprintf(hour_time,10,"%02d:%02d", hour, min); 
			break;
		default:
			if (hour > 12) {
				strcpy(am_pm, "PM");
				hour -= 12;
			}
			snprintf(hour_time,10,"%02d:%02d %s", hour, min, am_pm);
		}

		snprintf(title, 512, "%s", param.GetFileInfo(currentSelectedSave).title);
		int day   = param.GetFileInfo(currentSelectedSave).modif_time.tm_mday;
		int month = param.GetFileInfo(currentSelectedSave).modif_time.tm_mon + 1;
		int year  = param.GetFileInfo(currentSelectedSave).modif_time.tm_year + 1900;
		s64 sizeK = param.GetFileInfo(currentSelectedSave).size / 1024;
		switch (g_Config.iDateFormat) {
		case 1:
			snprintf(time, 512, "%d/%02d/%02d   %s  %lld KB", year, month, day, hour_time, sizeK);
			break;
		case 2:
			snprintf(time, 512, "%02d/%02d/%d   %s  %lld KB", month, day, year, hour_time, sizeK);
			break;
		case 3:
			snprintf(time, 512, "%02d/%02d/%d   %s  %lld KB", day, month, year, hour_time, sizeK);
			break;
		default:
			snprintf(time, 512, "%d/%02d/%02d   %s  %lld KB", year, month, day, hour_time, sizeK);
		}
		snprintf(saveTitle, 512, "%s", param.GetFileInfo(currentSelectedSave).saveTitle);
		snprintf(saveDetail, 512, "%s", param.GetFileInfo(currentSelectedSave).saveDetail);
		
		PPGeDrawRect(180, 136, 980, 137, CalcFadedColor(0xFFFFFFFF));
		std::string titleTxt = title;
		std::string timeTxt = time;
		std::string saveTitleTxt = saveTitle;
		std::string saveDetailTxt = saveDetail;

		PPGeDrawText(titleTxt.c_str(), 181, 138, PPGE_ALIGN_BOTTOM, 0.6f, CalcFadedColor(0x80000000));
		PPGeDrawText(titleTxt.c_str(), 180, 136, PPGE_ALIGN_BOTTOM, 0.6f, CalcFadedColor(0xFFC0C0C0));
		PPGeDrawText(timeTxt.c_str(), 181, 139, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0x80000000));
		PPGeDrawText(timeTxt.c_str(), 180, 137, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
		PPGeDrawText(saveTitleTxt.c_str(), 176, 162, PPGE_ALIGN_LEFT, 0.55f, CalcFadedColor(0x80000000));
		PPGeDrawText(saveTitleTxt.c_str(), 175, 159, PPGE_ALIGN_LEFT, 0.55f, CalcFadedColor(0xFFFFFFFF));
		PPGeDrawText(saveDetailTxt.c_str(), 176, 183, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0x80000000));
		PPGeDrawText(saveDetailTxt.c_str(), 175, 181, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
	}
}
开发者ID:Bulkman,项目名称:ppsspp,代码行数:71,代码来源:PSPSaveDialog.cpp


示例16: PPGeDrawImage

void PSPMsgDialog::DisplayEnter()
{
	PPGeDrawImage(okButtonImg, 200, 220, 20, 20, 0, CalcFadedColor(0xFFFFFFFF));
	PPGeDrawText("Enter", 230, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
}
开发者ID:Almamu,项目名称:ppsspp,代码行数:5,代码来源:PSPMsgDialog.cpp


示例17: PPGeDrawRect

void PSPSaveDialog::DisplayInfo(std::string text)
{
	PPGeDrawRect(180, 105, 460, 106, CalcFadedColor(0xFFFFFFFF));
	PPGeDrawRect(180, 130, 460, 131, CalcFadedColor(0xFFFFFFFF));
	PPGeDrawText(text.c_str(), 270, 110, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(0xFFFFFFFF));
}
开发者ID:Bennieboj,项目名称:ppsspp,代码行数:6,代码来源:PSPSaveDialog.cpp


示例18: hleEnterVblank

void hleEnterVblank(u64 userdata, int cyclesLate) {
	int vbCount = userdata;

	DEBUG_LOG(HLE, "Enter VBlank %i", vbCount);

	isVblank = 1;

	// Fire the vblank listeners before we wake threads.
	__DisplayFireVblank();

	// Wake up threads waiting for VBlank
	for (size_t i = 0; i < vblankWaitingThreads.size(); i++) {
		if (--vblankWaitingThreads[i].vcountUnblock == 0) {
			__KernelResumeThreadFromWait(vblankWaitingThreads[i].threadID, 0);
			vblankWaitingThreads.erase(vblankWaitingThreads.begin() + i--);
		}
	}

	// Trigger VBlank interrupt handlers.
	__TriggerInterrupt(PSP_INTR_IMMEDIATE | PSP_INTR_ONLY_IF_ENABLED | PSP_INTR_ALWAYS_RESCHED, PSP_VBLANK_INTR, PSP_INTR_SUB_ALL);

	CoreTiming::ScheduleEvent(msToCycles(vblankMs) - cyclesLate, leaveVblankEvent, vbCount + 1);

	// TODO: Should this be done here or in hleLeaveVblank?
	if (framebufIsLatched) {
		DEBUG_LOG(HLE, "Setting latched framebuffer %08x (prev: %08x)", latchedFramebuf.topaddr, framebuf.topaddr);
		framebuf = latchedFramebuf;
		framebufIsLatched = false;
		gpu->SetDisplayFramebuffer(framebuf.topaddr, framebuf.pspFramebufLinesize, framebuf.pspFramebufFormat);
	}

	gpuStats.numFrames++;

	// Now we can subvert the Ge engine in order to draw custom overlays like stat counters etc.
	if (g_Config.bShowDebugStats && gpuStats.numDrawCalls) {
		DebugStats();
	}

	if (g_Config.bShowFPSCounter) {
		char stats[50];

		sprintf(stats, "%0.1f", calculateFPS());

		#ifdef USING_GLES2
			float zoom = 0.7f; /// g_Config.iWindowZoom;
			float soff = 0.7f;
		#else
			float zoom = 0.5f; /// g_Config.iWindowZoom;
			float soff = 0.5f;
		#endif
		PPGeBegin();
		PPGeDrawText(stats, 476 + soff, 4 + soff, PPGE_ALIGN_RIGHT, zoom, 0xCC000000);
		PPGeDrawText(stats, 476 + -soff, 4 -soff, PPGE_ALIGN_RIGHT, zoom, 0xCC000000);
		PPGeDrawText(stats, 476, 4, PPGE_ALIGN_RIGHT, zoom, 0xFF30FF30);
		PPGeEnd();
	}

	// Draw screen overlays before blitting. Saves and restores the Ge context.
	// Yeah, this has to be the right moment to end the frame. Give the graphics backend opportunity
	// to blit the framebuffer, in order to support half-framerate games that otherwise wouldn't have
	// anything to draw here.
	gstate_c.skipDrawReason &= ~SKIPDRAW_SKIPFRAME;

	bool throttle, skipFrame, skipFlip;
	
	DoFrameTiming(throttle, skipFrame, skipFlip);

	// Setting CORE_NEXTFRAME causes a swap.
	if (skipFrame) {
		gstate_c.skipDrawReason |= SKIPDRAW_SKIPFRAME;
		numSkippedFrames++;
	} else {
		numSkippedFrames = 0;
	}

	if (!skipFlip) {
		// Might've just quit / been paused.
		if (coreState == CORE_RUNNING) {
			coreState = CORE_NEXTFRAME;
		}
		CoreTiming::ScheduleEvent(0 - cyclesLate, afterFlipEvent, 0);

		gpu->CopyDisplayToOutput();
	}

	// Returning here with coreState == CORE_NEXTFRAME causes a buffer flip to happen (next frame).
	// Right after, we regain control for a little bit in hleAfterFlip. I think that's a great
	// place to do housekeeping.
}
开发者ID:rasyid-irsyadi,项目名称:ppsspp,代码行数:89,代码来源:sceDisplay.cpp


示例19: hleEnterVblank

void hleEnterVblank(u64 userdata, int cyclesLate) {
	int vbCount = userdata;

	DEBUG_LOG(HLE, "Enter VBlank %i", vbCount);

	isVblank = 1;

	// Fire the vblank listeners before we wake threads.
	__DisplayFireVblank();

	// Wake up threads waiting for VBlank
	for (size_t i = 0; i < vblankWaitingThreads.size(); i++) {
		__KernelResumeThreadFromWait(vblankWaitingThreads[i].threadID, 0);
	}
	vblankWaitingThreads.clear();

	// Trigger VBlank interrupt handlers.
	__TriggerInterrupt(PSP_INTR_IMMEDIATE | PSP_INTR_ONLY_IF_ENABLED, PSP_VBLANK_INTR);

	CoreTiming::ScheduleEvent(msToCycles(vblankMs) - cyclesLate, leaveVblankEvent, vbCount+1);

	// TODO: Should this be done here or in hleLeaveVblank?
	if (framebufIsLatched) {
		DEBUG_LOG(HLE, "Setting latched framebuffer %08x (prev: %08x)", latchedFramebuf.topaddr, framebuf.topaddr);
		framebuf = latchedFramebuf;
		framebufIsLatched = false;
		gpu->SetDisplayFramebuffer(framebuf.topaddr, framebuf.pspFramebufLinesize, framebuf.pspFramebufFormat);
	}

	// Draw screen overlays before blitting. Saves and restores the Ge context.

	gpuStats.numFrames++;

	// Yeah, this has to be the right moment to end the frame. Give the graphics backend opportunity
	// to blit the framebuffer, in order to support half-framerate games that otherwise wouldn't have
	// anything to draw here.
	gpu->CopyDisplayToOutput();

	// Now we can subvert the Ge engine in order to draw custom overlays like stat counters etc.
	// Here we will be drawing to the non buffered front surface.
	if (g_Config.bShowDebugStats && gpuStats.numDrawCalls) {
		gpu->UpdateStats();
		char stats[512];
		sprintf(stats,
			"Frames: %i\n"
			"Draw calls: %i\n"
			"Draw flushes: %i\n"
			"Vertices Transformed: %i\n"
			"Textures active: %i\n"
			"Textures decoded: %i\n"
			"Vertex shaders loaded: %i\n"
			"Fragment shaders loaded: %i\n"
			"Combined shaders loaded: %i\n",
			gpuStats.numFrames,
			gpuStats.numDrawCalls,
			gpuStats.numFlushes,
			gpuStats.numVertsTransformed,
			gpuStats.numTextures,
			gpuStats.numTexturesDecoded,
			gpuStats.numVertexShaders,
			gpuStats.numFragmentShaders,
			gpuStats.numShaders
			);

		float zoom = 0.7f; /// g_Config.iWindowZoom;
		PPGeBegin();
		PPGeDrawText(stats, 0, 0, 0, zoom, 0xFFc0c0c0);
		PPGeEnd();

		gpuStats.resetFrame();
	}

	host->EndFrame();

#ifdef _WIN32
	static double lastFrameTime = 0.0;
	// Best place to throttle the frame rate on non vsynced platforms is probably here. Let's try it.
	time_update();
	if (lastFrameTime == 0.0)
		lastFrameTime = time_now_d();
	if (!GetAsyncKeyState(VK_TAB)) {
		while (time_now_d() < lastFrameTime + 1.0 / 60.0) {
			Common::SleepCurrentThread(1);
			time_update();
		}
		// Advance lastFrameTime by a constant amount each frame,
		// but don't let it get too far behind.
		lastFrameTime = std::max(lastFrameTime + 1.0 / 60.0, time_now_d() - 1.5 / 60.0);
	}

	// We are going to have to do something about audio timing for platforms that
	// are vsynced to something that's not exactly 60fps..

#endif

	host->BeginFrame();
	gpu->BeginFrame();

	// Tell the emu core that it's time to stop emulating
	// Win32 doesn't need this.
//.........这里部分代码省略.........
开发者ID:medoror,项目名称:ppsspp,代码行数:101,代码来源:sceDisplay.cpp


示例20: PPGeDrawRect

void PSPDialog::DisplayMessage(std::string text)
{
	PPGeDrawRect(30, 50, 450, 51, CalcFadedColor(0xFFFFFFFF));
	PPGeDrawRect(30, 200, 450, 201, CalcFadedColor(0xFFFFFFFF));
	PPGeDrawText(text.c_str(), 40, 60, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
}
开发者ID:ThreeHT,项目名称:ppsspp,代码行数:6,代码来源:PSPDialog.cpp



注:本文中的PPGeDrawText函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PQcancel函数代码示例发布时间:2022-05-30
下一篇:
C++ PPBackup函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap