added a true method to recycle our 100 avatar images, and made sure they stay in line with the menu image if theyre over 100.
This commit is contained in:
@@ -1251,7 +1251,14 @@ AIPlayer * AIPlayerFactory::createAIPlayer(MTGAllCards * collection, Player * op
|
||||
deckid = 1 + WRand() % (nbdecks);
|
||||
}
|
||||
sprintf(deckFile, JGE_GET_RES("ai/baka/deck%i.txt").c_str(), deckid);
|
||||
sprintf(avatarFile, "avatar%i.jpg", deckid);
|
||||
int tempDeckId = deckid;
|
||||
int avatarId = 0;
|
||||
while(tempDeckId > 100)
|
||||
{
|
||||
tempDeckId -= 100;
|
||||
avatarId = tempDeckId;
|
||||
}
|
||||
sprintf(avatarFile, "avatar%i.jpg", avatarId);
|
||||
sprintf(deckFileSmall, "ai_baka_deck%i", deckid);
|
||||
}
|
||||
|
||||
|
||||
@@ -253,7 +253,6 @@ void DeckMenu::Render()
|
||||
{
|
||||
JQuad * evil = quad.get();
|
||||
evil->SetHFlip(true);
|
||||
evil->SetColor(kRedColor);
|
||||
renderer->RenderQuad(quad.get(), avatarX, avatarY);
|
||||
evil = NULL;
|
||||
}
|
||||
|
||||
@@ -72,12 +72,13 @@ int DeckMetaData::getAvatarId()
|
||||
{
|
||||
if ( mDeckId < 101 )
|
||||
return mDeckId;
|
||||
|
||||
int avatarId = mDeckId % 100;
|
||||
|
||||
if (avatarId == 0)
|
||||
return 100;
|
||||
|
||||
int tempDeckId = mDeckId;
|
||||
int avatarId = 0;
|
||||
while(tempDeckId > 100)
|
||||
{
|
||||
tempDeckId -= 100;
|
||||
avatarId = tempDeckId;
|
||||
}
|
||||
return avatarId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user