Merge branch 'master' of https://github.com/WagicProject/wagic
This commit is contained in:
BIN
projects/mtg/bin/Res/graphics/pspdeckmenu.png
Normal file
BIN
projects/mtg/bin/Res/graphics/pspdeckmenu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 122 KiB |
@@ -107,7 +107,8 @@ class AIPlayerBaka: public AIPlayer{
|
||||
virtual bool payTheManaCost(ManaCost * cost, MTGCardInstance * card = NULL,vector<MTGAbility*> gotPayment = vector<MTGAbility*>());
|
||||
virtual int getCreaturesInfo(Player * player, int neededInfo = INFO_NBCREATURES , int untapMode = 0, int canAttack = 0);
|
||||
virtual ManaCost * getPotentialMana(MTGCardInstance * card = NULL);
|
||||
virtual int selectAbility(MTGAbility * Specific = NULL);
|
||||
virtual int selectAbility();
|
||||
virtual int doAbility(MTGAbility * Specific = NULL, MTGCardInstance * withCard = NULL);
|
||||
|
||||
public:
|
||||
enum {
|
||||
|
||||
@@ -1369,7 +1369,7 @@ int AIPlayerBaka::selectHintAbility()
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AIPlayerBaka::selectAbility(MTGAbility * Specific)
|
||||
int AIPlayerBaka::selectAbility()
|
||||
{
|
||||
if(observer->mExtraPayment && observer->mExtraPayment->source && observer->mExtraPayment->source->controller() == this)
|
||||
{
|
||||
@@ -1410,14 +1410,12 @@ int AIPlayerBaka::selectAbility(MTGAbility * Specific)
|
||||
for (size_t i = 1; i < observer->mLayers->actionLayer()->mObjects.size(); i++)
|
||||
{ //0 is not a mtgability...hackish
|
||||
MTGAbility * a = ((MTGAbility *) observer->mLayers->actionLayer()->mObjects[i]);
|
||||
if (Specific && Specific != a)
|
||||
continue;
|
||||
//Skip mana abilities for performance
|
||||
if (dynamic_cast<AManaProducer*> (a))
|
||||
continue;
|
||||
//Make sure we can use the ability
|
||||
for (int j = 0; j < game->inPlay->nb_cards; j++)
|
||||
{//zeth fox: note to self, this is where I can teach it suspend and other cost types.
|
||||
{
|
||||
MTGCardInstance * card = game->inPlay->cards[j];
|
||||
if(a->getCost() && !a->isReactingToClick(card, totalPotentialMana))//for performance reason only look for specific mana if the payment couldnt be made with potential.
|
||||
{
|
||||
@@ -1448,29 +1446,6 @@ int AIPlayerBaka::selectAbility(MTGAbility * Specific)
|
||||
if (a->isReactingToClick(card, pMana))
|
||||
{
|
||||
createAbilityTargets(a, card, ranking);
|
||||
if (Specific)
|
||||
{
|
||||
if (!Specific->getCost())
|
||||
{
|
||||
//attackcost, blockcost
|
||||
if (a->aType == MTGAbility::ATTACK_COST)
|
||||
{
|
||||
ManaCost * specificCost = NEW ManaCost(ManaCost::parseManaCost("{0}", NULL, NULL));
|
||||
specificCost->add(0, card->attackCostBackup);
|
||||
abilityPayment = canPayMana(card, specificCost);
|
||||
SAFE_DELETE(specificCost);
|
||||
}
|
||||
else if (a->aType == MTGAbility::BLOCK_COST)
|
||||
{
|
||||
ManaCost * specificCost = NEW ManaCost(ManaCost::parseManaCost("{0}", NULL, NULL));
|
||||
specificCost->add(0, card->blockCostBackup);
|
||||
abilityPayment = canPayMana(card, specificCost);
|
||||
SAFE_DELETE(specificCost);
|
||||
}
|
||||
}
|
||||
delete (pMana);
|
||||
break;
|
||||
}
|
||||
}
|
||||
delete (pMana);
|
||||
}
|
||||
@@ -1485,8 +1460,6 @@ int AIPlayerBaka::selectAbility(MTGAbility * Specific)
|
||||
if (!forceBestAbilityUse)
|
||||
chance = 1 + randomGenerator.random() % 100;
|
||||
int actionScore = action.getEfficiency();
|
||||
if (Specific)
|
||||
actionScore = 95;
|
||||
if(action.ability->getCost() && action.ability->getCost()->hasX() && this->game->hand->cards.size())
|
||||
actionScore = actionScore/int(this->game->hand->cards.size());//reduce chance for "x" abilities if cards are in hand.
|
||||
if (actionScore >= chance)
|
||||
@@ -1498,35 +1471,6 @@ int AIPlayerBaka::selectAbility(MTGAbility * Specific)
|
||||
DebugTrace(" Ai knows exactly what mana to use for this ability.");
|
||||
}
|
||||
DebugTrace("AIPlayer:Using Activated ability");
|
||||
if (Specific)
|
||||
{
|
||||
if (!Specific->getCost())
|
||||
{
|
||||
//attackcost, blockcost
|
||||
if (action.ability->aType == MTGAbility::ATTACK_COST)
|
||||
{
|
||||
ManaCost * specificCost = NEW ManaCost(ManaCost::parseManaCost("{0}", NULL, NULL));
|
||||
specificCost->add(0, action.click->attackCostBackup);
|
||||
if (payTheManaCost(specificCost, action.click, abilityPayment))
|
||||
clickstream.push(NEW AIAction(action));
|
||||
SAFE_DELETE(specificCost);
|
||||
}
|
||||
else if (action.ability->aType == MTGAbility::BLOCK_COST)
|
||||
{
|
||||
ManaCost * specificCost = NEW ManaCost(ManaCost::parseManaCost("{0}", NULL, NULL));
|
||||
specificCost->add(0, action.click->blockCostBackup);
|
||||
if (payTheManaCost(specificCost, action.click, abilityPayment))
|
||||
clickstream.push(NEW AIAction(action));
|
||||
SAFE_DELETE(specificCost);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (payTheManaCost(action.ability->getCost(), action.click, abilityPayment))
|
||||
clickstream.push(NEW AIAction(action));
|
||||
}
|
||||
}
|
||||
else
|
||||
if (payTheManaCost(action.ability->getCost(), action.click,abilityPayment))
|
||||
clickstream.push(NEW AIAction(action));
|
||||
}
|
||||
@@ -1537,6 +1481,148 @@ int AIPlayerBaka::selectAbility(MTGAbility * Specific)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int AIPlayerBaka::doAbility(MTGAbility * Specific, MTGCardInstance * withCard)
|
||||
{
|
||||
if (observer->mExtraPayment && observer->mExtraPayment->source && observer->mExtraPayment->source->controller() == this)
|
||||
{
|
||||
ExtraManaCost * check = NULL;
|
||||
check = dynamic_cast<ExtraManaCost*>(observer->mExtraPayment->costs[0]);
|
||||
if (check)
|
||||
{
|
||||
vector<MTGAbility*> CostToPay = canPayMana(observer->mExtraPayment->source, check->costToPay);
|
||||
if (CostToPay.size())
|
||||
{
|
||||
payTheManaCost(check->costToPay, check->source, CostToPay);
|
||||
}
|
||||
else
|
||||
{
|
||||
observer->mExtraPayment->action->CheckUserInput(JGE_BTN_SEC);
|
||||
observer->mExtraPayment = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (observer->mLayers->stackLayer()->lastActionController == this)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
RankingContainer ranking;
|
||||
list<int>::iterator it;
|
||||
vector<MTGAbility*>abilityPayment = vector<MTGAbility*>();
|
||||
MTGCardInstance * card = withCard;
|
||||
ManaCost * totalPotentialMana = getPotentialMana();
|
||||
totalPotentialMana->add(this->getManaPool());
|
||||
for (size_t i = 1; i < observer->mLayers->actionLayer()->mObjects.size(); i++)
|
||||
{
|
||||
MTGAbility * a = ((MTGAbility *)observer->mLayers->actionLayer()->mObjects[i]);
|
||||
if (Specific && Specific != a)
|
||||
continue;
|
||||
//Make sure we can use the ability
|
||||
if (a->getCost() && !a->isReactingToClick(card, totalPotentialMana))//for performance reason only look for specific mana if the payment couldnt be made with potential.
|
||||
{
|
||||
abilityPayment = canPayMana(card, a->getCost());
|
||||
}
|
||||
if (a->isReactingToClick(card, totalPotentialMana) || abilityPayment.size())
|
||||
{ //This test is to avoid the huge call to getPotentialManaCost after that
|
||||
if (a->getCost() && a->getCost()->hasX() && totalPotentialMana->getConvertedCost() < a->getCost()->getConvertedCost() + 1)
|
||||
continue;
|
||||
//don't even bother to play an ability with {x} if you can't even afford x=1.
|
||||
if (abilityPayment.size())
|
||||
{
|
||||
ManaCost *fullPayment = NEW ManaCost();
|
||||
for (int ch = 0; ch < int(abilityPayment.size()); ch++)
|
||||
{
|
||||
AManaProducer * ampp = dynamic_cast<AManaProducer*> (abilityPayment[ch]);
|
||||
if (ampp)
|
||||
fullPayment->add(ampp->output);
|
||||
}
|
||||
if (fullPayment && a->isReactingToClick(card, fullPayment))
|
||||
createAbilityTargets(a, card, ranking);
|
||||
delete fullPayment;
|
||||
}
|
||||
else
|
||||
{
|
||||
ManaCost * pMana = getPotentialMana(card);
|
||||
pMana->add(this->getManaPool());
|
||||
if (a->isReactingToClick(card, pMana))
|
||||
{
|
||||
createAbilityTargets(a, card, ranking);
|
||||
|
||||
if (!Specific->getCost())
|
||||
{
|
||||
//attackcost, blockcost
|
||||
if (a->aType == MTGAbility::ATTACK_COST)
|
||||
{
|
||||
ManaCost * specificCost = NEW ManaCost(ManaCost::parseManaCost("{0}", NULL, NULL));
|
||||
specificCost->add(0, card->attackCostBackup);
|
||||
abilityPayment = canPayMana(card, specificCost);
|
||||
SAFE_DELETE(specificCost);
|
||||
}
|
||||
else if (a->aType == MTGAbility::BLOCK_COST)
|
||||
{
|
||||
ManaCost * specificCost = NEW ManaCost(ManaCost::parseManaCost("{0}", NULL, NULL));
|
||||
specificCost->add(0, card->blockCostBackup);
|
||||
abilityPayment = canPayMana(card, specificCost);
|
||||
SAFE_DELETE(specificCost);
|
||||
}
|
||||
}
|
||||
}
|
||||
delete (pMana);
|
||||
}
|
||||
}
|
||||
}
|
||||
delete totalPotentialMana;
|
||||
if (ranking.size())
|
||||
{
|
||||
OrderedAIAction action = ranking.begin()->first;
|
||||
int chance = 1;
|
||||
if (!forceBestAbilityUse)
|
||||
chance = 1 + randomGenerator.random() % 100;
|
||||
int actionScore = 95;
|
||||
if (action.ability->getCost() && action.ability->getCost()->hasX() && this->game->hand->cards.size())
|
||||
actionScore = actionScore / int(this->game->hand->cards.size());//reduce chance for "x" abilities if cards are in hand.
|
||||
if (actionScore >= chance)
|
||||
{
|
||||
if (!clickstream.size())
|
||||
{
|
||||
if (abilityPayment.size())
|
||||
{
|
||||
DebugTrace(" Ai knows exactly what mana to use for this ability.");
|
||||
}
|
||||
DebugTrace("AIPlayer:Using Activated ability");
|
||||
|
||||
if (!Specific->getCost())
|
||||
{
|
||||
//attackcost, blockcost
|
||||
if (action.ability->aType == MTGAbility::ATTACK_COST)
|
||||
{
|
||||
ManaCost * specificCost = NEW ManaCost(ManaCost::parseManaCost("{0}", NULL, NULL));
|
||||
specificCost->add(0, action.click->attackCostBackup);
|
||||
if (payTheManaCost(specificCost, action.click, abilityPayment))
|
||||
clickstream.push(NEW AIAction(action));
|
||||
SAFE_DELETE(specificCost);
|
||||
}
|
||||
else if (action.ability->aType == MTGAbility::BLOCK_COST)
|
||||
{
|
||||
ManaCost * specificCost = NEW ManaCost(ManaCost::parseManaCost("{0}", NULL, NULL));
|
||||
specificCost->add(0, action.click->blockCostBackup);
|
||||
if (payTheManaCost(specificCost, action.click, abilityPayment))
|
||||
clickstream.push(NEW AIAction(action));
|
||||
SAFE_DELETE(specificCost);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (payTheManaCost(action.ability->getCost(), action.click, abilityPayment))
|
||||
clickstream.push(NEW AIAction(action));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
abilityPayment.clear();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int AIPlayerBaka::interruptIfICan()
|
||||
{
|
||||
if (observer->mLayers->stackLayer()->askIfWishesToInterrupt == this)
|
||||
@@ -2600,6 +2686,7 @@ int AIPlayerBaka::computeActions()
|
||||
chooseBlockers();
|
||||
break;
|
||||
}
|
||||
case MTG_PHASE_COMBATDAMAGE:
|
||||
case MTG_PHASE_ENDOFTURN:
|
||||
selectAbility();
|
||||
break;
|
||||
@@ -2615,6 +2702,7 @@ int AIPlayerBaka::computeActions()
|
||||
case MTG_PHASE_FIRSTMAIN:
|
||||
case MTG_PHASE_COMBATATTACKERS:
|
||||
case MTG_PHASE_COMBATBLOCKERS:
|
||||
case MTG_PHASE_COMBATDAMAGE:
|
||||
case MTG_PHASE_SECONDMAIN:
|
||||
{
|
||||
selectAbility();
|
||||
@@ -2689,7 +2777,7 @@ int AIPlayerBaka::chooseAttackers()
|
||||
if (card->attackCost)
|
||||
{
|
||||
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::ATTACK_COST);
|
||||
selectAbility(a);
|
||||
doAbility(a,card);
|
||||
observer->cardClick(card, MTGAbility::ATTACK_COST);
|
||||
}
|
||||
}
|
||||
@@ -2712,7 +2800,7 @@ int AIPlayerBaka::chooseAttackers()
|
||||
if (card->attackCost)
|
||||
{
|
||||
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::ATTACK_COST);
|
||||
selectAbility(a);
|
||||
doAbility(a, card);
|
||||
observer->cardClick(card, MTGAbility::ATTACK_COST);
|
||||
}
|
||||
observer->cardClick(card, MTGAbility::MTG_ATTACK_RULE);
|
||||
@@ -2796,7 +2884,7 @@ int AIPlayerBaka::chooseBlockers()
|
||||
if (card->blockCost)
|
||||
{
|
||||
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::BLOCK_COST);
|
||||
selectAbility(a);
|
||||
doAbility(a, card);
|
||||
observer->cardClick(card, MTGAbility::BLOCK_COST);
|
||||
}
|
||||
observer->cardClick(card, MTGAbility::MTG_BLOCK_RULE);
|
||||
@@ -2832,7 +2920,7 @@ int AIPlayerBaka::chooseBlockers()
|
||||
if (card->blockCost)
|
||||
{
|
||||
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::BLOCK_COST);
|
||||
selectAbility(a);
|
||||
doAbility(a, card);
|
||||
}
|
||||
observer->cardClick(card, MTGAbility::MTG_BLOCK_RULE);
|
||||
int set = 0;
|
||||
@@ -2851,7 +2939,7 @@ int AIPlayerBaka::chooseBlockers()
|
||||
if (card->blockCost)
|
||||
{
|
||||
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::BLOCK_COST);
|
||||
selectAbility(a);
|
||||
doAbility(a, card);
|
||||
}
|
||||
observer->cardClick(card, MTGAbility::MTG_BLOCK_RULE);
|
||||
}
|
||||
@@ -2863,7 +2951,7 @@ int AIPlayerBaka::chooseBlockers()
|
||||
}
|
||||
}
|
||||
}
|
||||
selectAbility();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -505,12 +505,14 @@ void Credits::Render()
|
||||
if (!p1)
|
||||
return;
|
||||
JRenderer * r = JRenderer::GetInstance();
|
||||
#if !defined (PSP)
|
||||
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
||||
if (wpTex)
|
||||
{
|
||||
JQuadPtr wpQuad = WResourceManager::Instance()->RetrieveTempQuad("bgdeckeditor.jpg");
|
||||
JRenderer::GetInstance()->RenderQuad(wpQuad.get(), 0, 0, 0, SCREEN_WIDTH_F / wpQuad->mWidth, SCREEN_HEIGHT_F / wpQuad->mHeight);
|
||||
r->RenderQuad(wpQuad.get(), 0, 0, 0, SCREEN_WIDTH_F / wpQuad->mWidth, SCREEN_HEIGHT_F / wpQuad->mHeight);
|
||||
}
|
||||
#endif
|
||||
WFont * f = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||
WFont * f2 = WResourceManager::Instance()->GetWFont(Fonts::MENU_FONT);
|
||||
WFont * f3 = WResourceManager::Instance()->GetWFont(Fonts::MAGIC_FONT);
|
||||
|
||||
@@ -150,6 +150,10 @@ void DeckMenu::RenderBackground()
|
||||
else
|
||||
bgFilename << backgroundName << ".png";
|
||||
|
||||
#if defined (PSP)
|
||||
bgFilename << "psppspdeckmenu.png";
|
||||
#endif
|
||||
|
||||
static bool loadBackground = true;
|
||||
if (loadBackground)
|
||||
{
|
||||
@@ -263,13 +267,20 @@ void DeckMenu::Render()
|
||||
timeOpen = 0;
|
||||
menuInitialized = true;
|
||||
}
|
||||
#if !defined (PSP)
|
||||
if (avatarholder.get() && menupanel.get() && inDeckMenu)//bg panel
|
||||
renderer->RenderQuad(menupanel.get(), 225.f, 0, 0 ,SCREEN_WIDTH_F / avatarholder.get()->mWidth, SCREEN_HEIGHT_F / avatarholder.get()->mHeight);
|
||||
|
||||
RenderBackground();//background deck menu
|
||||
mScroller->Render();
|
||||
#else
|
||||
mScroller->Render();
|
||||
RenderBackground();//background deck menu
|
||||
#endif
|
||||
#if !defined (PSP)
|
||||
if (menuholder.get() && inDeckMenu)//menuholder
|
||||
renderer->RenderQuad(menuholder.get(), 0, 0, 0 ,SCREEN_WIDTH_F / menuholder.get()->mWidth, SCREEN_HEIGHT_F / menuholder.get()->mHeight);
|
||||
|
||||
#endif
|
||||
if (timeOpen < 1) height *= timeOpen > 0 ? timeOpen : -timeOpen;
|
||||
|
||||
for (int i = startId; i < startId + maxItems; i++)
|
||||
@@ -313,16 +324,20 @@ void DeckMenu::Render()
|
||||
{
|
||||
JQuad * evil = quad.get();
|
||||
evil->SetHFlip(true);
|
||||
#if !defined (PSP)
|
||||
if (avatarholder.get() && inDeckMenu)
|
||||
renderer->RenderQuad(avatarholder.get(), 0, 0, 0 ,SCREEN_WIDTH_F / avatarholder.get()->mWidth, SCREEN_HEIGHT_F / avatarholder.get()->mHeight);
|
||||
#endif
|
||||
renderer->RenderQuad(quad.get(), avatarX+modAvatarX, avatarY+modAvatarY, 0, xscale, yscale);
|
||||
renderer->DrawRect(avatarX+modAvatarX, avatarY+modAvatarY,37.f,50.f,ARGB(200,3,3,3));
|
||||
evil = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if !defined (PSP)
|
||||
if (avatarholder.get() && inDeckMenu)
|
||||
renderer->RenderQuad(avatarholder.get(), 0, 0, 0 ,SCREEN_WIDTH_F / avatarholder.get()->mWidth, SCREEN_HEIGHT_F / avatarholder.get()->mHeight);
|
||||
#endif
|
||||
renderer->RenderQuad(quad.get(), avatarX+modAvatarX, avatarY+modAvatarY, 0, xscale, yscale);
|
||||
renderer->DrawRect(avatarX+modAvatarX, avatarY+modAvatarY,37.f,50.f,ARGB(200,3,3,3));
|
||||
}
|
||||
|
||||
@@ -1285,6 +1285,7 @@ void GameStateDeckViewer::Render()
|
||||
setButtonState(false);
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||
JRenderer::GetInstance()->ClearScreen(ARGB(0,0,0,0));
|
||||
#if !defined (PSP)
|
||||
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
||||
if (wpTex)
|
||||
{
|
||||
@@ -1293,7 +1294,7 @@ void GameStateDeckViewer::Render()
|
||||
}/*
|
||||
if (mView->deck() == myDeck && mStage != STAGE_MENU)
|
||||
renderDeckBackground();*/
|
||||
|
||||
#endif
|
||||
mView->Render();
|
||||
|
||||
if (mView->deck()->Size() > 0)
|
||||
|
||||
@@ -1037,12 +1037,14 @@ void GameStateDuel::Render()
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||
JRenderer * r = JRenderer::GetInstance();
|
||||
r->ClearScreen(ARGB(0,0,0,0));
|
||||
#if !defined (PSP)
|
||||
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
||||
if (wpTex)
|
||||
{
|
||||
JQuadPtr wpQuad = WResourceManager::Instance()->RetrieveTempQuad("bgdeckeditor.jpg");
|
||||
JRenderer::GetInstance()->RenderQuad(wpQuad.get(), 0, 0, 0, SCREEN_WIDTH_F / wpQuad->mWidth, SCREEN_HEIGHT_F / wpQuad->mHeight);
|
||||
}
|
||||
#endif
|
||||
//render the game until someone did win the game (otherwise it crashes sometimes under linux)
|
||||
if (game && !game->didWin())
|
||||
game->Render();
|
||||
|
||||
@@ -795,6 +795,7 @@ void GameStateMenu::Render()
|
||||
else
|
||||
sprintf(text, "%s", _("LOADING...").c_str());
|
||||
}
|
||||
#if !defined (PSP)
|
||||
//tooltip & overlay
|
||||
JQuadPtr menubar;
|
||||
menubar = WResourceManager::Instance()->RetrieveTempQuad("menubar.png");//new graphics menubar
|
||||
@@ -811,6 +812,7 @@ void GameStateMenu::Render()
|
||||
renderer->DrawRect(0, SCREEN_HEIGHT - 50, SCREEN_WIDTH + 1.5f, mFont->GetHeight(),ARGB(200, 204, 153, 0));
|
||||
//end
|
||||
}
|
||||
#endif
|
||||
mFont->SetColor(ARGB(170,0,0,0));
|
||||
mFont->DrawString(text, SCREEN_WIDTH / 2 + 2, SCREEN_HEIGHT - 50 + 2, JGETEXT_CENTER);
|
||||
mFont->SetColor(ARGB(255,255,255,255));
|
||||
|
||||
@@ -214,12 +214,14 @@ void GameStateOptions::Render()
|
||||
{
|
||||
//Erase
|
||||
JRenderer::GetInstance()->ClearScreen(ARGB(0,0,0,0));
|
||||
#if !defined (PSP)
|
||||
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
||||
if (wpTex)
|
||||
{
|
||||
JQuadPtr wpQuad = WResourceManager::Instance()->RetrieveTempQuad("bgdeckeditor.jpg");
|
||||
JRenderer::GetInstance()->RenderQuad(wpQuad.get(), 0, 0, 0, SCREEN_WIDTH_F / wpQuad->mWidth, SCREEN_HEIGHT_F / wpQuad->mHeight);
|
||||
}
|
||||
#endif
|
||||
const char * const CreditsText[] = {
|
||||
"Wagic, The Homebrew?! by Wololo",
|
||||
"",
|
||||
|
||||
@@ -35,15 +35,17 @@ void SimplePopup::Render()
|
||||
{
|
||||
mClosed = false;
|
||||
float modX = (SCREEN_WIDTH_F / 2)-5;
|
||||
JQuadPtr statsholder = WResourceManager::Instance()->RetrieveTempQuad("statsholder.png");//new graphics statsholder
|
||||
|
||||
JRenderer *r = JRenderer::GetInstance();
|
||||
string detailedInformation = getDetailedInformation(mDeckInformation->getFilename());
|
||||
|
||||
#if !defined (PSP)
|
||||
|
||||
JQuadPtr statsholder = WResourceManager::Instance()->RetrieveTempQuad("statsholder.png");//new graphics statsholder
|
||||
//const float textHeight = mTextFont->GetHeight() * mMaxLines;
|
||||
//r->FillRect(0,0,SCREEN_WIDTH_F,SCREEN_HEIGHT_F,ARGB(220,15,15,15));
|
||||
if(statsholder.get())
|
||||
r->RenderQuad(statsholder.get(),0,0,0,SCREEN_WIDTH_F/statsholder->mWidth,SCREEN_HEIGHT_F/statsholder->mHeight);
|
||||
#endif
|
||||
r->FillRoundRect(mX+modX+3, mY + 7, 190.f, 148.f, 0, ARGB( 240, 15, 15, 15 ) );
|
||||
|
||||
// currently causes a crash on the PSP when drawing the corners.
|
||||
|
||||
@@ -165,13 +165,17 @@ void VerticalTextScroller::Render()
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
||||
JQuadPtr textscroller;
|
||||
JQuadPtr textscrollershadow;
|
||||
#if !defined (PSP)
|
||||
textscroller = WResourceManager::Instance()->RetrieveTempQuad("textscroller.png");//new graphics textscroller
|
||||
textscrollershadow = WResourceManager::Instance()->RetrieveTempQuad("textscrollershadow.png");//new graphics textscroller shadow
|
||||
if(!mText.empty() && mText.length() > 1)
|
||||
if (textscrollershadow.get())
|
||||
JRenderer::GetInstance()->RenderQuad(textscrollershadow.get(), 0, 0, 0 ,SCREEN_WIDTH_F / textscrollershadow->mWidth, SCREEN_HEIGHT_F / textscrollershadow->mHeight);
|
||||
#endif
|
||||
mFont->DrawString(mText.c_str(), mX, mY);
|
||||
#if !defined (PSP)
|
||||
if(!mText.empty() && mText.length() > 1)
|
||||
if (textscroller.get())
|
||||
JRenderer::GetInstance()->RenderQuad(textscroller.get(), 0, 0, 0 ,SCREEN_WIDTH_F / textscroller->mWidth, SCREEN_HEIGHT_F / textscroller->mHeight);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user