prefetching options
This commit is contained in:
@@ -47,6 +47,7 @@ public:
|
||||
BLKBORDER,
|
||||
SHOWTOKENS,
|
||||
GDVLARGEIMAGE,
|
||||
CARDPREFETCHING,
|
||||
OSD,
|
||||
CLOSEDHAND,
|
||||
HANDDIRECTION,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "PrecompiledHeader.h"
|
||||
#include "CarouselDeckView.h"
|
||||
|
||||
const float CarouselDeckView::max_scale = 0.82f;
|
||||
@@ -85,7 +86,8 @@ void CarouselDeckView::Render()
|
||||
{
|
||||
// even though we want to draw the cards in a particular z order for layering, we want to prefetch them
|
||||
// in a different order, ie the center card should appear first, then the adjacent ones
|
||||
if (WResourceManager::Instance()->IsThreaded())
|
||||
bool prefetch = options[Options::CARDPREFETCHING].number?false:true;
|
||||
if (prefetch && WResourceManager::Instance()->IsThreaded())
|
||||
{
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[0].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[3].card);
|
||||
|
||||
@@ -146,18 +146,6 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail, bool griddeckv
|
||||
else
|
||||
{//NORMAL VIEW WITH IMAGES
|
||||
int mode = !options[Options::DISABLECARDS].number ? DrawMode::kNormal : DrawMode::kText;
|
||||
/*//border for editor && others???
|
||||
string cardsetname = setlist[cardPosition.card->setId].c_str();
|
||||
if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM")
|
||||
{
|
||||
JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(255,248,248,255));
|
||||
JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(150,20,20,20));
|
||||
}
|
||||
else
|
||||
{
|
||||
JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(255,10,10,10));
|
||||
JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(50,240,240,240));
|
||||
}*///disabled this for universal border
|
||||
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
|
||||
CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true, griddeckview);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ const string Options::optionNames[] = {
|
||||
"BlackBorder",
|
||||
"ShowTokens",
|
||||
"GDVLargeImages",
|
||||
"CardPrefetching",
|
||||
"displayOSD",
|
||||
"closed_hand",
|
||||
"hand_direction",
|
||||
|
||||
@@ -60,8 +60,14 @@ void GameStateOptions::Start()
|
||||
optionsList->Add(NEW OptionInteger(Options::BLKBORDER, "All Black Border"));
|
||||
//show tokens in editor
|
||||
optionsList->Add(NEW OptionInteger(Options::SHOWTOKENS, "Show Tokens in Editor"));
|
||||
WDecoStyled * wMisc = NEW WDecoStyled(NEW WGuiHeader("Warning!!!"));
|
||||
wMisc->mStyle = WDecoStyled::DS_STYLE_ALERT;
|
||||
optionsList->Add(wMisc);
|
||||
//show large images
|
||||
optionsList->Add(NEW OptionInteger(Options::GDVLARGEIMAGE, "Show Large Images in Grid Deck View (could crash PSP!)"));
|
||||
optionsList->Add(NEW OptionInteger(Options::GDVLARGEIMAGE, "Show Large Images in Grid Deck View"));
|
||||
//prefetch
|
||||
if(WResourceManager::Instance()->IsThreaded())
|
||||
optionsList->Add(NEW OptionInteger(Options::CARDPREFETCHING, "Enable Prefetching"));
|
||||
optionsTabs->Add(optionsList);
|
||||
|
||||
optionsList = NEW WGuiList("Game");
|
||||
|
||||
@@ -107,6 +107,8 @@ void GridDeckView::Render()
|
||||
{
|
||||
int firstVisibleCard = 2;
|
||||
int lastVisibleCard = mCards.size() - 2;
|
||||
bool mode = options[Options::GDVLARGEIMAGE].number?false:true;
|
||||
bool prefetch = options[Options::CARDPREFETCHING].number?false:true;
|
||||
|
||||
if(!mScrollEasing.finished())
|
||||
{
|
||||
@@ -121,28 +123,15 @@ void GridDeckView::Render()
|
||||
|
||||
for(int i = firstVisibleCard; i < lastVisibleCard; ++i)
|
||||
{
|
||||
if(prefetch && WResourceManager::Instance()->IsThreaded())
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[i].card);
|
||||
|
||||
if(mCurrentSelection != i)
|
||||
{
|
||||
if (WResourceManager::Instance()->IsThreaded())
|
||||
{
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[i].card, RETRIEVE_NORMAL);
|
||||
}
|
||||
bool mode = options[Options::GDVLARGEIMAGE].number?false:true;
|
||||
renderCard(i, 255, mode);//WARNING FOR PSP!!!
|
||||
}
|
||||
else
|
||||
{
|
||||
if (WResourceManager::Instance()->IsThreaded())
|
||||
{
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[i].card);
|
||||
}
|
||||
}
|
||||
renderCard(i, 255, mode,true);//the last value is to resize scale in drawcard so we don't have large borders on grid deck view
|
||||
}
|
||||
|
||||
if(2 <= mCurrentSelection && mCurrentSelection < 12)
|
||||
{
|
||||
renderCard(mCurrentSelection, 255, false);
|
||||
renderCard(mCurrentSelection, 255, false,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user