当前位置: 首页>>代码示例>>C++>>正文


C++ CalcFadedColor函数代码示例

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


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

示例1: CalcFadedColor

void PSPSaveDialog::DisplaySaveIcon()
{
	int textureColor = CalcFadedColor(0xFFFFFFFF);

	if (param.GetFileInfo(currentSelectedSave).size == 0)
		textureColor = CalcFadedColor(0xFF777777);

	// Calc save image position on screen
	float w = 144;
	float h = 80;
	float x = 27;
	float y = 97;

	int tw = 256;
	int th = 256;
	if (param.GetFileInfo(currentSelectedSave).textureData != 0) {
		tw = param.GetFileInfo(currentSelectedSave).textureWidth;
		th = param.GetFileInfo(currentSelectedSave).textureHeight;
		PPGeSetTexture(param.GetFileInfo(currentSelectedSave).textureData, param.GetFileInfo(currentSelectedSave).textureWidth, param.GetFileInfo(currentSelectedSave).textureHeight);
	} else
		PPGeDisableTexture();
	PPGeDrawImage(x, y, w, h, 0, 0 ,1 ,1 ,tw, th, textureColor);
	if (param.GetFileInfo(currentSelectedSave).textureData != 0)
		PPGeSetDefaultTexture();
}
开发者ID:Bulkman,项目名称:ppsspp,代码行数:25,代码来源:PSPSaveDialog.cpp

示例2: guard

void PSPSaveDialog::DisplaySaveIcon()
{
	lock_guard guard(paramLock);
	int textureColor = CalcFadedColor(0xFFFFFFFF);
	auto curSave = param.GetFileInfo(currentSelectedSave);

	if (curSave.size == 0)
		textureColor = CalcFadedColor(0xFF777777);

	// Calc save image position on screen
	float w = 144;
	float h = 80;
	float x = 27;
	float y = 97;

	int tw = 256;
	int th = 256;
	if (curSave.texture != NULL) {
		curSave.texture->SetTexture();
		tw = curSave.texture->Width();
		th = curSave.texture->Height();
	} else {
		PPGeDisableTexture();
	}
	PPGeDrawImage(x, y, w, h, 0, 0, 1, 1, tw, th, textureColor);
	if (curSave.texture != NULL)
		PPGeSetDefaultTexture();
}
开发者ID:AdmiralCurtiss,项目名称:ppsspp,代码行数:28,代码来源:PSPSaveDialog.cpp

示例3: CalcFadedColor

void PSPSaveDialog::DisplaySaveList(bool canMove)
{
	int displayCount = 0;
	for(int i = 0; i < param.GetFilenameCount(); i++)
	{
		int textureColor = CalcFadedColor(0xFFFFFFFF);

		if(param.GetFileInfo(i).size == 0 && param.GetFileInfo(i).textureData == 0)
		{
			textureColor = CalcFadedColor(0xFF777777);
		}

		// Calc save image position on screen
		float w = 150;
		float h = 80;
		float x = 20;
		if(displayCount != currentSelectedSave)
		{
			w = 80;
			h = 40;
			x = 55;
		}
		float y = 96;
		if(displayCount < currentSelectedSave)
			y -= 10 + 40 * (currentSelectedSave - displayCount );
		else if(displayCount > currentSelectedSave)
		{
			y += 91 + 40 * (displayCount - currentSelectedSave - 1);
		}

		int tw = 256;
		int th = 256;
		if(param.GetFileInfo(i).textureData != 0)
		{
			tw = param.GetFileInfo(i).textureWidth;
			th = param.GetFileInfo(i).textureHeight;
			PPGeSetTexture(param.GetFileInfo(i).textureData, param.GetFileInfo(i).textureWidth, param.GetFileInfo(i).textureHeight);
		}
		else
		{
			PPGeDisableTexture();
		}
		PPGeDrawImage(x, y, w, h, 0, 0 ,1 ,1 ,tw, th, textureColor);
		PPGeSetDefaultTexture();
		displayCount++;
	}

	if(canMove)
	{
		if (IsButtonPressed(CTRL_UP) && currentSelectedSave > 0)
		{
			currentSelectedSave--;
		}
		else if (IsButtonPressed(CTRL_DOWN) && currentSelectedSave < (param.GetFilenameCount()-1))
		{
			currentSelectedSave++;
		}
	}
}
开发者ID:Bennieboj,项目名称:ppsspp,代码行数:59,代码来源:PSPSaveDialog.cpp

示例4: 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

示例5: 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

示例6: PPGeDrawRect

void PSPSaveDialog::DisplaySaveList(bool canMove)
{
	int displayCount = 0;
	for (int i = 0; i < param.GetFilenameCount(); i++)
	{
		int textureColor = 0xFFFFFFFF;

		if (param.GetFileInfo(i).size == 0 && param.GetFileInfo(i).textureData == 0) 
			textureColor = 0xFF777777;

		// Calc save image position on screen
		float w, h , x, b;
		float y = 97;
		if (displayCount != currentSelectedSave) {
			w = 81;
			h = 45;
			x = 58.5f;
		} else {
			w = 144;
			h = 80;
			x = 27;
			b = 1.2;
			PPGeDrawRect(x-b, y-b, x+w+b, y, CalcFadedColor(0xD0FFFFFF)); // top border
			PPGeDrawRect(x-b, y, x, y+h, CalcFadedColor(0xD0FFFFFF)); // left border
			PPGeDrawRect(x-b, y+h, x+w+b, y+h+b, CalcFadedColor(0xD0FFFFFF)); //bottom border
			PPGeDrawRect(x+w, y, x+w+b, y+h, CalcFadedColor(0xD0FFFFFF)); //right border
		}
		if (displayCount < currentSelectedSave)
			y -= 13 + 45 * (currentSelectedSave - displayCount);
		else if (displayCount > currentSelectedSave)
			y += 48 + 45 * (displayCount - currentSelectedSave);

		int tw = 256;
		int th = 256;
		if (param.GetFileInfo(i).textureData != 0) {
			tw = param.GetFileInfo(i).textureWidth;
			th = param.GetFileInfo(i).textureHeight;
			PPGeSetTexture(param.GetFileInfo(i).textureData, param.GetFileInfo(i).textureWidth, param.GetFileInfo(i).textureHeight);
			PPGeDrawImage(x, y, w, h, 0, 0, 1, 1, tw, th, textureColor);
		} else
			PPGeDisableTexture();
		PPGeSetDefaultTexture();
		displayCount++;
	}

	if (canMove) {
		if (IsButtonPressed(CTRL_UP) && currentSelectedSave > 0)
			currentSelectedSave--;
		else if (IsButtonPressed(CTRL_DOWN) && currentSelectedSave < (param.GetFilenameCount()-1))
			currentSelectedSave++;
	}
}
开发者ID:Bulkman,项目名称:ppsspp,代码行数:52,代码来源:PSPSaveDialog.cpp

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: PPGeMeasureText

void PSPMsgDialog::DisplayMessage(std::string text, bool hasYesNo)
{
	const float WRAP_WIDTH = 450.0f;
	float y = 136.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 = 0xFF0FFFFF;
			noColor  = 0xFFFFFFFF;
		}
		else {
			choiceText = d->T("No");
			x = 272.0f;
			yesColor = 0xFFFFFFFF;
			noColor  = 0xFF0FFFFF;
		}
		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(0x6DCFCFCF));
		PPGeDrawText(d->T("Yes"), 208.0f, y2, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(yesColor));
		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(), 240.0f, y, WRAP_WIDTH, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
	float sy = 122.0f - h2, ey = 150.0f + h2;
	PPGeDrawRect(15.0f, sy, 465.0f, sy + 1.0f, CalcFadedColor(0xFFFFFFFF));
	PPGeDrawRect(15.0f, ey, 465.0f, ey + 1.0f, CalcFadedColor(0xFFFFFFFF));
}
开发者ID:HelicopterP,项目名称:ppsspp,代码行数:47,代码来源:PSPMsgDialog.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: PPGeDrawText

void PSPDialog::DisplayMessage(std::string text)
{
	PPGeDrawText(text.c_str(), 40, 30, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
}
开发者ID:Almamu,项目名称:ppsspp,代码行数:4,代码来源:PSPDialog.cpp

示例15: PPGeBegin

void PSPDialog::StartDraw()
{
	PPGeBegin();
	PPGeDrawRect(0, 0, 480, 272, CalcFadedColor(0x70606060));
}
开发者ID:Almamu,项目名称:ppsspp,代码行数:5,代码来源:PSPDialog.cpp


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