-some fixes for HQ cards support
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-01-23 03:35:43 +00:00
parent feab777815
commit d22b7b5e37
5 changed files with 15 additions and 6 deletions

View File

@@ -7,7 +7,7 @@
#include "MTGCard.h"
#include "WCachedResource.h"
#define HUGE_CACHE_LIMIT 6000000 // Size of the cache for Windows and Linux
#define HUGE_CACHE_LIMIT 20000000 // Size of the cache for Windows and Linux
#define SAMPLES_CACHE_SIZE 1500000 // Size in bytes of the cached samples
#define PSI_CACHE_SIZE 500000 // Size in bytes of the cahed particles
#define TEXTURES_CACHE_MINSIZE 2000000 // Minimum size of the cache on the PSP. The program should complain if the cache ever gets smaller than this

View File

@@ -54,6 +54,10 @@ void CardGui::Render()
bool alternate = true;
JQuad * quad = resources.RetrieveCard(card,CACHE_THUMB);
#if defined (WIN32) || defined (LINUX)
//On pcs we render the big image if the thumbnail is not available
if (!quad) quad = resources.RetrieveCard(card);
#endif
if (quad) alternate = false;
else quad = alternateThumbQuad(card);

View File

@@ -115,8 +115,8 @@ void GameApp::Create()
for (int i = sizeof(manaIcons)/sizeof(manaIcons[0]) - 1; i >= 0; --i) manaIcons[i]->SetHotSpot(16,16);
resources.RetrieveTexture("back.jpg",RETRIEVE_MANAGE);
JQuad * jq = resources.RetrieveQuad("back.jpg", 0, 0, 200, 285, "back",RETRIEVE_MANAGE);
jq->SetHotSpot(100, 145);
JQuad * jq = resources.RetrieveQuad("back.jpg", 0, 0, 0, 0, "back",RETRIEVE_MANAGE);
jq->SetHotSpot(jq->mWidth/2, jq->mHeight/2);
resources.RetrieveTexture("back_thumb.jpg",RETRIEVE_MANAGE);
resources.RetrieveQuad("back_thumb.jpg", 0, 0, MTG_MINIIMAGE_WIDTH, MTG_MINIIMAGE_HEIGHT, "back_thumb",RETRIEVE_MANAGE);

View File

@@ -1223,7 +1223,8 @@ void GameStateDeckViewer::renderCard(int id, float rotation){
int quadAlpha = alpha;
if ( !displayed_deck->cards[card]) quadAlpha /=2;
quad->SetColor(ARGB(mAlpha,quadAlpha,quadAlpha,quadAlpha));
JRenderer::GetInstance()->RenderQuad(quad, x , y , 0.0f,scale,scale);
float _scale = scale *(285 / quad->mHeight);
JRenderer::GetInstance()->RenderQuad(quad, x , y , 0.0f,_scale,_scale);
if (showName){
char buffer[4096];
sprintf(buffer, "%s", _(card->data->getName()).c_str());

View File

@@ -72,7 +72,10 @@ ShopItem::ShopItem(int id, JLBFont *font, int _cardid, float _xy[], bool hasFocu
quad = NULL;
thumb = resources.RetrieveCard(card,RETRIEVE_LOCK,TEXTURE_SUB_THUMB);
#if defined (WIN32) || defined (LINUX)
//On pcs we render the big image if the thumbnail is not available
if (!thumb) thumb = resources.RetrieveCard(card,RETRIEVE_LOCK);
#endif
if (!thumb)
thumb = CardGui::alternateThumbQuad(card);
else
@@ -147,8 +150,9 @@ void ShopItem::Render(){
if (mHasFocus){
if (card) quad = resources.RetrieveCard(card);
if (quad){
float scale = 0.9 * 285/ quad->mHeight;
quad->SetColor(ARGB(255,255,255,255));
renderer->RenderQuad(quad,SCREEN_WIDTH - 105,SCREEN_HEIGHT/2 - 5,0, 0.9f,0.9f);
renderer->RenderQuad(quad,SCREEN_WIDTH - 105,SCREEN_HEIGHT/2 - 5,0, scale,scale);
}else{
if (card) CardGui::alternateRender(card,Pos(SCREEN_WIDTH - 105,SCREEN_HEIGHT/2 - 5,0.9f* 285/250, 0,255));