Exemplo n.º 1
0
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();
}
Exemplo n.º 2
0
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();
}
Exemplo n.º 3
0
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++;
		}
	}
}
Exemplo n.º 4
0
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++;
	}
}