- Fix case sensitivity issue for some card sounds

- added null checks for "shadow" textures
This commit is contained in:
wagic.the.homebrew
2011-12-12 13:10:33 +00:00
parent db664e2836
commit 54a2f949b7
2 changed files with 16 additions and 6 deletions

View File

@@ -153,16 +153,22 @@ void CardGui::Render()
if (actZ > 1) if (actZ > 1)
{ {
shadow = game? game->getResourceManager()->GetQuad("shadow"):WResourceManager::Instance()->GetQuad("shadow"); shadow = game? game->getResourceManager()->GetQuad("shadow"):WResourceManager::Instance()->GetQuad("shadow");
shadow->SetColor(ARGB(static_cast<unsigned char>(actA)/2,255,255,255)); if (shadow)
renderer->RenderQuad(shadow.get(), actX + (actZ - 1) * 15, actY + (actZ - 1) * 15, actT, 28 * actZ / 16, 40 * actZ / 16); {
shadow->SetColor(ARGB(static_cast<unsigned char>(actA)/2,255,255,255));
renderer->RenderQuad(shadow.get(), actX + (actZ - 1) * 15, actY + (actZ - 1) * 15, actT, 28 * actZ / 16, 40 * actZ / 16);
}
} }
JQuadPtr extracostshadow; JQuadPtr extracostshadow;
if (card->isExtraCostTarget) if (card->isExtraCostTarget)
{ {
extracostshadow = card->getObserver()->getResourceManager()->GetQuad("extracostshadow"); extracostshadow = card->getObserver()->getResourceManager()->GetQuad("extracostshadow");
extracostshadow->SetColor(ARGB(static_cast<unsigned char>(actA)/2,100,0,0)); if (extracostshadow)
renderer->RenderQuad(extracostshadow.get(), actX + (actZ - 1) * 15, actY + (actZ - 1) * 15, actT, 28 * actZ / 16, 40 * actZ / 16); {
extracostshadow->SetColor(ARGB(static_cast<unsigned char>(actA)/2,100,0,0));
renderer->RenderQuad(extracostshadow.get(), actX + (actZ - 1) * 15, actY + (actZ - 1) * 15, actT, 28 * actZ / 16, 40 * actZ / 16);
}
} }
if(game && game->connectRule) if(game && game->connectRule)
@@ -305,8 +311,11 @@ void CardGui::Render()
{ {
if (!shadow) if (!shadow)
shadow = card->getObserver()->getResourceManager()->GetQuad("shadow"); shadow = card->getObserver()->getResourceManager()->GetQuad("shadow");
shadow->SetColor(ARGB(200,255,255,255)); if (shadow)
renderer->RenderQuad(shadow.get(), actX, actY, actT, (28 * actZ + 1) / 16, 40 * actZ / 16); {
shadow->SetColor(ARGB(200,255,255,255));
renderer->RenderQuad(shadow.get(), actX, actY, actT, (28 * actZ + 1) / 16, 40 * actZ / 16);
}
} }
// Render a mask over the card, if set // Render a mask over the card, if set

View File

@@ -1056,6 +1056,7 @@ JSample * MTGCardInstance::getSample()
if(!types.size()) if(!types.size())
return NULL; return NULL;
type = Subtypes::subtypesList->find(types[0]); type = Subtypes::subtypesList->find(types[0]);
std::transform(type.begin(), type.end(), type.begin(), ::tolower);
type.append(".wav"); type.append(".wav");
js = WResourceManager::Instance()->RetrieveSample(type); js = WResourceManager::Instance()->RetrieveSample(type);
if (js) if (js)