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 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 int getCreaturesInfo(Player * player, int neededInfo = INFO_NBCREATURES , int untapMode = 0, int canAttack = 0);
|
||||||
virtual ManaCost * getPotentialMana(MTGCardInstance * card = NULL);
|
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:
|
public:
|
||||||
enum {
|
enum {
|
||||||
|
|||||||
@@ -1369,7 +1369,7 @@ int AIPlayerBaka::selectHintAbility()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AIPlayerBaka::selectAbility(MTGAbility * Specific)
|
int AIPlayerBaka::selectAbility()
|
||||||
{
|
{
|
||||||
if(observer->mExtraPayment && observer->mExtraPayment->source && observer->mExtraPayment->source->controller() == this)
|
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++)
|
for (size_t i = 1; i < observer->mLayers->actionLayer()->mObjects.size(); i++)
|
||||||
{ //0 is not a mtgability...hackish
|
{ //0 is not a mtgability...hackish
|
||||||
MTGAbility * a = ((MTGAbility *) observer->mLayers->actionLayer()->mObjects[i]);
|
MTGAbility * a = ((MTGAbility *) observer->mLayers->actionLayer()->mObjects[i]);
|
||||||
if (Specific && Specific != a)
|
|
||||||
continue;
|
|
||||||
//Skip mana abilities for performance
|
//Skip mana abilities for performance
|
||||||
if (dynamic_cast<AManaProducer*> (a))
|
if (dynamic_cast<AManaProducer*> (a))
|
||||||
continue;
|
continue;
|
||||||
//Make sure we can use the ability
|
//Make sure we can use the ability
|
||||||
for (int j = 0; j < game->inPlay->nb_cards; j++)
|
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];
|
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.
|
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))
|
if (a->isReactingToClick(card, pMana))
|
||||||
{
|
{
|
||||||
createAbilityTargets(a, card, ranking);
|
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);
|
delete (pMana);
|
||||||
}
|
}
|
||||||
@@ -1485,8 +1460,6 @@ int AIPlayerBaka::selectAbility(MTGAbility * Specific)
|
|||||||
if (!forceBestAbilityUse)
|
if (!forceBestAbilityUse)
|
||||||
chance = 1 + randomGenerator.random() % 100;
|
chance = 1 + randomGenerator.random() % 100;
|
||||||
int actionScore = action.getEfficiency();
|
int actionScore = action.getEfficiency();
|
||||||
if (Specific)
|
|
||||||
actionScore = 95;
|
|
||||||
if(action.ability->getCost() && action.ability->getCost()->hasX() && this->game->hand->cards.size())
|
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.
|
actionScore = actionScore/int(this->game->hand->cards.size());//reduce chance for "x" abilities if cards are in hand.
|
||||||
if (actionScore >= chance)
|
if (actionScore >= chance)
|
||||||
@@ -1498,35 +1471,6 @@ int AIPlayerBaka::selectAbility(MTGAbility * Specific)
|
|||||||
DebugTrace(" Ai knows exactly what mana to use for this ability.");
|
DebugTrace(" Ai knows exactly what mana to use for this ability.");
|
||||||
}
|
}
|
||||||
DebugTrace("AIPlayer:Using Activated 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))
|
if (payTheManaCost(action.ability->getCost(), action.click,abilityPayment))
|
||||||
clickstream.push(NEW AIAction(action));
|
clickstream.push(NEW AIAction(action));
|
||||||
}
|
}
|
||||||
@@ -1537,6 +1481,148 @@ int AIPlayerBaka::selectAbility(MTGAbility * Specific)
|
|||||||
return 1;
|
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()
|
int AIPlayerBaka::interruptIfICan()
|
||||||
{
|
{
|
||||||
if (observer->mLayers->stackLayer()->askIfWishesToInterrupt == this)
|
if (observer->mLayers->stackLayer()->askIfWishesToInterrupt == this)
|
||||||
@@ -2600,6 +2686,7 @@ int AIPlayerBaka::computeActions()
|
|||||||
chooseBlockers();
|
chooseBlockers();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case MTG_PHASE_COMBATDAMAGE:
|
||||||
case MTG_PHASE_ENDOFTURN:
|
case MTG_PHASE_ENDOFTURN:
|
||||||
selectAbility();
|
selectAbility();
|
||||||
break;
|
break;
|
||||||
@@ -2615,6 +2702,7 @@ int AIPlayerBaka::computeActions()
|
|||||||
case MTG_PHASE_FIRSTMAIN:
|
case MTG_PHASE_FIRSTMAIN:
|
||||||
case MTG_PHASE_COMBATATTACKERS:
|
case MTG_PHASE_COMBATATTACKERS:
|
||||||
case MTG_PHASE_COMBATBLOCKERS:
|
case MTG_PHASE_COMBATBLOCKERS:
|
||||||
|
case MTG_PHASE_COMBATDAMAGE:
|
||||||
case MTG_PHASE_SECONDMAIN:
|
case MTG_PHASE_SECONDMAIN:
|
||||||
{
|
{
|
||||||
selectAbility();
|
selectAbility();
|
||||||
@@ -2689,7 +2777,7 @@ int AIPlayerBaka::chooseAttackers()
|
|||||||
if (card->attackCost)
|
if (card->attackCost)
|
||||||
{
|
{
|
||||||
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::ATTACK_COST);
|
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::ATTACK_COST);
|
||||||
selectAbility(a);
|
doAbility(a,card);
|
||||||
observer->cardClick(card, MTGAbility::ATTACK_COST);
|
observer->cardClick(card, MTGAbility::ATTACK_COST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2712,7 +2800,7 @@ int AIPlayerBaka::chooseAttackers()
|
|||||||
if (card->attackCost)
|
if (card->attackCost)
|
||||||
{
|
{
|
||||||
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::ATTACK_COST);
|
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::ATTACK_COST);
|
||||||
selectAbility(a);
|
doAbility(a, card);
|
||||||
observer->cardClick(card, MTGAbility::ATTACK_COST);
|
observer->cardClick(card, MTGAbility::ATTACK_COST);
|
||||||
}
|
}
|
||||||
observer->cardClick(card, MTGAbility::MTG_ATTACK_RULE);
|
observer->cardClick(card, MTGAbility::MTG_ATTACK_RULE);
|
||||||
@@ -2796,7 +2884,7 @@ int AIPlayerBaka::chooseBlockers()
|
|||||||
if (card->blockCost)
|
if (card->blockCost)
|
||||||
{
|
{
|
||||||
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::BLOCK_COST);
|
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::BLOCK_COST);
|
||||||
selectAbility(a);
|
doAbility(a, card);
|
||||||
observer->cardClick(card, MTGAbility::BLOCK_COST);
|
observer->cardClick(card, MTGAbility::BLOCK_COST);
|
||||||
}
|
}
|
||||||
observer->cardClick(card, MTGAbility::MTG_BLOCK_RULE);
|
observer->cardClick(card, MTGAbility::MTG_BLOCK_RULE);
|
||||||
@@ -2832,7 +2920,7 @@ int AIPlayerBaka::chooseBlockers()
|
|||||||
if (card->blockCost)
|
if (card->blockCost)
|
||||||
{
|
{
|
||||||
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::BLOCK_COST);
|
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::BLOCK_COST);
|
||||||
selectAbility(a);
|
doAbility(a, card);
|
||||||
}
|
}
|
||||||
observer->cardClick(card, MTGAbility::MTG_BLOCK_RULE);
|
observer->cardClick(card, MTGAbility::MTG_BLOCK_RULE);
|
||||||
int set = 0;
|
int set = 0;
|
||||||
@@ -2851,7 +2939,7 @@ int AIPlayerBaka::chooseBlockers()
|
|||||||
if (card->blockCost)
|
if (card->blockCost)
|
||||||
{
|
{
|
||||||
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::BLOCK_COST);
|
MTGAbility * a = observer->mLayers->actionLayer()->getAbility(MTGAbility::BLOCK_COST);
|
||||||
selectAbility(a);
|
doAbility(a, card);
|
||||||
}
|
}
|
||||||
observer->cardClick(card, MTGAbility::MTG_BLOCK_RULE);
|
observer->cardClick(card, MTGAbility::MTG_BLOCK_RULE);
|
||||||
}
|
}
|
||||||
@@ -2863,7 +2951,7 @@ int AIPlayerBaka::chooseBlockers()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
selectAbility();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -505,12 +505,14 @@ void Credits::Render()
|
|||||||
if (!p1)
|
if (!p1)
|
||||||
return;
|
return;
|
||||||
JRenderer * r = JRenderer::GetInstance();
|
JRenderer * r = JRenderer::GetInstance();
|
||||||
|
#if !defined (PSP)
|
||||||
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
||||||
if (wpTex)
|
if (wpTex)
|
||||||
{
|
{
|
||||||
JQuadPtr wpQuad = WResourceManager::Instance()->RetrieveTempQuad("bgdeckeditor.jpg");
|
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 * f = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||||
WFont * f2 = WResourceManager::Instance()->GetWFont(Fonts::MENU_FONT);
|
WFont * f2 = WResourceManager::Instance()->GetWFont(Fonts::MENU_FONT);
|
||||||
WFont * f3 = WResourceManager::Instance()->GetWFont(Fonts::MAGIC_FONT);
|
WFont * f3 = WResourceManager::Instance()->GetWFont(Fonts::MAGIC_FONT);
|
||||||
|
|||||||
@@ -150,6 +150,10 @@ void DeckMenu::RenderBackground()
|
|||||||
else
|
else
|
||||||
bgFilename << backgroundName << ".png";
|
bgFilename << backgroundName << ".png";
|
||||||
|
|
||||||
|
#if defined (PSP)
|
||||||
|
bgFilename << "psppspdeckmenu.png";
|
||||||
|
#endif
|
||||||
|
|
||||||
static bool loadBackground = true;
|
static bool loadBackground = true;
|
||||||
if (loadBackground)
|
if (loadBackground)
|
||||||
{
|
{
|
||||||
@@ -263,13 +267,20 @@ void DeckMenu::Render()
|
|||||||
timeOpen = 0;
|
timeOpen = 0;
|
||||||
menuInitialized = true;
|
menuInitialized = true;
|
||||||
}
|
}
|
||||||
|
#if !defined (PSP)
|
||||||
if (avatarholder.get() && menupanel.get() && inDeckMenu)//bg panel
|
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);
|
renderer->RenderQuad(menupanel.get(), 225.f, 0, 0 ,SCREEN_WIDTH_F / avatarholder.get()->mWidth, SCREEN_HEIGHT_F / avatarholder.get()->mHeight);
|
||||||
|
|
||||||
RenderBackground();//background deck menu
|
RenderBackground();//background deck menu
|
||||||
mScroller->Render();
|
mScroller->Render();
|
||||||
|
#else
|
||||||
|
mScroller->Render();
|
||||||
|
RenderBackground();//background deck menu
|
||||||
|
#endif
|
||||||
|
#if !defined (PSP)
|
||||||
if (menuholder.get() && inDeckMenu)//menuholder
|
if (menuholder.get() && inDeckMenu)//menuholder
|
||||||
renderer->RenderQuad(menuholder.get(), 0, 0, 0 ,SCREEN_WIDTH_F / menuholder.get()->mWidth, SCREEN_HEIGHT_F / menuholder.get()->mHeight);
|
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;
|
if (timeOpen < 1) height *= timeOpen > 0 ? timeOpen : -timeOpen;
|
||||||
|
|
||||||
for (int i = startId; i < startId + maxItems; i++)
|
for (int i = startId; i < startId + maxItems; i++)
|
||||||
@@ -313,16 +324,20 @@ void DeckMenu::Render()
|
|||||||
{
|
{
|
||||||
JQuad * evil = quad.get();
|
JQuad * evil = quad.get();
|
||||||
evil->SetHFlip(true);
|
evil->SetHFlip(true);
|
||||||
|
#if !defined (PSP)
|
||||||
if (avatarholder.get() && inDeckMenu)
|
if (avatarholder.get() && inDeckMenu)
|
||||||
renderer->RenderQuad(avatarholder.get(), 0, 0, 0 ,SCREEN_WIDTH_F / avatarholder.get()->mWidth, SCREEN_HEIGHT_F / avatarholder.get()->mHeight);
|
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->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));
|
renderer->DrawRect(avatarX+modAvatarX, avatarY+modAvatarY,37.f,50.f,ARGB(200,3,3,3));
|
||||||
evil = NULL;
|
evil = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if !defined (PSP)
|
||||||
if (avatarholder.get() && inDeckMenu)
|
if (avatarholder.get() && inDeckMenu)
|
||||||
renderer->RenderQuad(avatarholder.get(), 0, 0, 0 ,SCREEN_WIDTH_F / avatarholder.get()->mWidth, SCREEN_HEIGHT_F / avatarholder.get()->mHeight);
|
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->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));
|
renderer->DrawRect(avatarX+modAvatarX, avatarY+modAvatarY,37.f,50.f,ARGB(200,3,3,3));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1285,6 +1285,7 @@ void GameStateDeckViewer::Render()
|
|||||||
setButtonState(false);
|
setButtonState(false);
|
||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||||
JRenderer::GetInstance()->ClearScreen(ARGB(0,0,0,0));
|
JRenderer::GetInstance()->ClearScreen(ARGB(0,0,0,0));
|
||||||
|
#if !defined (PSP)
|
||||||
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
||||||
if (wpTex)
|
if (wpTex)
|
||||||
{
|
{
|
||||||
@@ -1293,7 +1294,7 @@ void GameStateDeckViewer::Render()
|
|||||||
}/*
|
}/*
|
||||||
if (mView->deck() == myDeck && mStage != STAGE_MENU)
|
if (mView->deck() == myDeck && mStage != STAGE_MENU)
|
||||||
renderDeckBackground();*/
|
renderDeckBackground();*/
|
||||||
|
#endif
|
||||||
mView->Render();
|
mView->Render();
|
||||||
|
|
||||||
if (mView->deck()->Size() > 0)
|
if (mView->deck()->Size() > 0)
|
||||||
|
|||||||
@@ -1037,12 +1037,14 @@ void GameStateDuel::Render()
|
|||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||||
JRenderer * r = JRenderer::GetInstance();
|
JRenderer * r = JRenderer::GetInstance();
|
||||||
r->ClearScreen(ARGB(0,0,0,0));
|
r->ClearScreen(ARGB(0,0,0,0));
|
||||||
|
#if !defined (PSP)
|
||||||
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
||||||
if (wpTex)
|
if (wpTex)
|
||||||
{
|
{
|
||||||
JQuadPtr wpQuad = WResourceManager::Instance()->RetrieveTempQuad("bgdeckeditor.jpg");
|
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);
|
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)
|
//render the game until someone did win the game (otherwise it crashes sometimes under linux)
|
||||||
if (game && !game->didWin())
|
if (game && !game->didWin())
|
||||||
game->Render();
|
game->Render();
|
||||||
|
|||||||
@@ -795,6 +795,7 @@ void GameStateMenu::Render()
|
|||||||
else
|
else
|
||||||
sprintf(text, "%s", _("LOADING...").c_str());
|
sprintf(text, "%s", _("LOADING...").c_str());
|
||||||
}
|
}
|
||||||
|
#if !defined (PSP)
|
||||||
//tooltip & overlay
|
//tooltip & overlay
|
||||||
JQuadPtr menubar;
|
JQuadPtr menubar;
|
||||||
menubar = WResourceManager::Instance()->RetrieveTempQuad("menubar.png");//new graphics 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));
|
renderer->DrawRect(0, SCREEN_HEIGHT - 50, SCREEN_WIDTH + 1.5f, mFont->GetHeight(),ARGB(200, 204, 153, 0));
|
||||||
//end
|
//end
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
mFont->SetColor(ARGB(170,0,0,0));
|
mFont->SetColor(ARGB(170,0,0,0));
|
||||||
mFont->DrawString(text, SCREEN_WIDTH / 2 + 2, SCREEN_HEIGHT - 50 + 2, JGETEXT_CENTER);
|
mFont->DrawString(text, SCREEN_WIDTH / 2 + 2, SCREEN_HEIGHT - 50 + 2, JGETEXT_CENTER);
|
||||||
mFont->SetColor(ARGB(255,255,255,255));
|
mFont->SetColor(ARGB(255,255,255,255));
|
||||||
|
|||||||
@@ -214,12 +214,14 @@ void GameStateOptions::Render()
|
|||||||
{
|
{
|
||||||
//Erase
|
//Erase
|
||||||
JRenderer::GetInstance()->ClearScreen(ARGB(0,0,0,0));
|
JRenderer::GetInstance()->ClearScreen(ARGB(0,0,0,0));
|
||||||
|
#if !defined (PSP)
|
||||||
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
||||||
if (wpTex)
|
if (wpTex)
|
||||||
{
|
{
|
||||||
JQuadPtr wpQuad = WResourceManager::Instance()->RetrieveTempQuad("bgdeckeditor.jpg");
|
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);
|
JRenderer::GetInstance()->RenderQuad(wpQuad.get(), 0, 0, 0, SCREEN_WIDTH_F / wpQuad->mWidth, SCREEN_HEIGHT_F / wpQuad->mHeight);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
const char * const CreditsText[] = {
|
const char * const CreditsText[] = {
|
||||||
"Wagic, The Homebrew?! by Wololo",
|
"Wagic, The Homebrew?! by Wololo",
|
||||||
"",
|
"",
|
||||||
|
|||||||
@@ -35,15 +35,17 @@ void SimplePopup::Render()
|
|||||||
{
|
{
|
||||||
mClosed = false;
|
mClosed = false;
|
||||||
float modX = (SCREEN_WIDTH_F / 2)-5;
|
float modX = (SCREEN_WIDTH_F / 2)-5;
|
||||||
JQuadPtr statsholder = WResourceManager::Instance()->RetrieveTempQuad("statsholder.png");//new graphics statsholder
|
|
||||||
|
|
||||||
JRenderer *r = JRenderer::GetInstance();
|
JRenderer *r = JRenderer::GetInstance();
|
||||||
string detailedInformation = getDetailedInformation(mDeckInformation->getFilename());
|
string detailedInformation = getDetailedInformation(mDeckInformation->getFilename());
|
||||||
|
#if !defined (PSP)
|
||||||
|
|
||||||
|
JQuadPtr statsholder = WResourceManager::Instance()->RetrieveTempQuad("statsholder.png");//new graphics statsholder
|
||||||
//const float textHeight = mTextFont->GetHeight() * mMaxLines;
|
//const float textHeight = mTextFont->GetHeight() * mMaxLines;
|
||||||
//r->FillRect(0,0,SCREEN_WIDTH_F,SCREEN_HEIGHT_F,ARGB(220,15,15,15));
|
//r->FillRect(0,0,SCREEN_WIDTH_F,SCREEN_HEIGHT_F,ARGB(220,15,15,15));
|
||||||
if(statsholder.get())
|
if(statsholder.get())
|
||||||
r->RenderQuad(statsholder.get(),0,0,0,SCREEN_WIDTH_F/statsholder->mWidth,SCREEN_HEIGHT_F/statsholder->mHeight);
|
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 ) );
|
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.
|
// currently causes a crash on the PSP when drawing the corners.
|
||||||
|
|||||||
@@ -165,13 +165,17 @@ void VerticalTextScroller::Render()
|
|||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
||||||
JQuadPtr textscroller;
|
JQuadPtr textscroller;
|
||||||
JQuadPtr textscrollershadow;
|
JQuadPtr textscrollershadow;
|
||||||
|
#if !defined (PSP)
|
||||||
textscroller = WResourceManager::Instance()->RetrieveTempQuad("textscroller.png");//new graphics textscroller
|
textscroller = WResourceManager::Instance()->RetrieveTempQuad("textscroller.png");//new graphics textscroller
|
||||||
textscrollershadow = WResourceManager::Instance()->RetrieveTempQuad("textscrollershadow.png");//new graphics textscroller shadow
|
textscrollershadow = WResourceManager::Instance()->RetrieveTempQuad("textscrollershadow.png");//new graphics textscroller shadow
|
||||||
if(!mText.empty() && mText.length() > 1)
|
if(!mText.empty() && mText.length() > 1)
|
||||||
if (textscrollershadow.get())
|
if (textscrollershadow.get())
|
||||||
JRenderer::GetInstance()->RenderQuad(textscrollershadow.get(), 0, 0, 0 ,SCREEN_WIDTH_F / textscrollershadow->mWidth, SCREEN_HEIGHT_F / textscrollershadow->mHeight);
|
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);
|
mFont->DrawString(mText.c_str(), mX, mY);
|
||||||
|
#if !defined (PSP)
|
||||||
if(!mText.empty() && mText.length() > 1)
|
if(!mText.empty() && mText.length() > 1)
|
||||||
if (textscroller.get())
|
if (textscroller.get())
|
||||||
JRenderer::GetInstance()->RenderQuad(textscroller.get(), 0, 0, 0 ,SCREEN_WIDTH_F / textscroller->mWidth, SCREEN_HEIGHT_F / textscroller->mHeight);
|
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