Erwan
- Fixed a few font problems with alternate rendering
This commit is contained in:
@@ -2,9 +2,12 @@
|
||||
#include "../include/CardGui.h"
|
||||
#include "../include/ManaCostHybrid.h"
|
||||
#include "../include/Subtypes.h"
|
||||
#include "../include/MTGDefinitions.h"
|
||||
#include <Vector2D.h>
|
||||
|
||||
void CardGui::alternateRender(MTGCard * card, JLBFont * mFont, JQuad ** manaIcons, float x, float y, float rotation, float scale){
|
||||
void CardGui::alternateRender(MTGCard * card, JQuad ** manaIcons, float x, float y, float rotation, float scale){
|
||||
JLBFont * mFont = GameApp::CommonRes->GetJLBFont(Constants::MAGIC_FONT);
|
||||
float backup = mFont->GetScale();
|
||||
JQuad * mIcons[7];
|
||||
if (!manaIcons){
|
||||
mIcons[Constants::MTG_COLOR_ARTIFACT] = GameApp::CommonRes->GetQuad("c_artifact");
|
||||
@@ -29,7 +32,7 @@ void CardGui::alternateRender(MTGCard * card, JLBFont * mFont, JQuad ** manaIcon
|
||||
|
||||
JRenderer * renderer = JRenderer::GetInstance();
|
||||
mFont->SetRotation(rotation);
|
||||
|
||||
mFont->SetScale(scale);
|
||||
int color = card->getColor();
|
||||
|
||||
points[0].x = -width/2;
|
||||
@@ -162,8 +165,11 @@ void CardGui::alternateRender(MTGCard * card, JLBFont * mFont, JQuad ** manaIcon
|
||||
if (over > 0){
|
||||
multiply = 1.1;
|
||||
}
|
||||
mFont->SetScale(scale * multiply);
|
||||
|
||||
mFont->SetColor(ARGB(255,Constants::_r[color],Constants::_g[color],Constants::_b[color]));
|
||||
mFont->DrawString(card->getName(),x+v.x,y+v.y);
|
||||
mFont->SetScale(scale);
|
||||
mFont->SetColor(ARGB(255,255,255,255));
|
||||
|
||||
|
||||
@@ -183,6 +189,7 @@ void CardGui::alternateRender(MTGCard * card, JLBFont * mFont, JQuad ** manaIcon
|
||||
mFont->DrawString(s.c_str(),x+v.x,y+v.y);
|
||||
}
|
||||
|
||||
mFont->SetScale(backup);
|
||||
}
|
||||
|
||||
|
||||
@@ -262,7 +269,7 @@ void CardGui::RenderBig(float xpos, float ypos, int alternate){
|
||||
if (alternate){
|
||||
MTGCard * mtgcard = card->model;
|
||||
JLBFont * font = GameApp::CommonRes->GetJLBFont("graphics/magic");
|
||||
CardGui::alternateRender(mtgcard, font, NULL, xpos + 90 , ypos + 130, 0.0f,0.9f);
|
||||
CardGui::alternateRender(mtgcard, NULL, xpos + 90 , ypos + 130, 0.0f,0.9f);
|
||||
if (quad){
|
||||
float scale = 250 / quad->mHeight;
|
||||
quad->SetColor(ARGB(40,255,255,255));
|
||||
@@ -345,6 +352,7 @@ void CardGui::Render(){
|
||||
if (card->isTapped()){
|
||||
renderer->FillRect(myX - myH , myY , myH, myW, ARGB(255,Constants::_r[color]/2+50,Constants::_g[color]/2+50,Constants::_b[color]/2+50));
|
||||
renderer->DrawRect(myX - myH , myY , myH, myW, ARGB(255,Constants::_r[color],Constants::_g[color],Constants::_b[color]));
|
||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE * 0.8 * mScale);
|
||||
mFont->DrawString(buffer,myX - (myH)+4,myY + 1);
|
||||
if (mIcon) renderer->RenderQuad(mIcon,myX - myH/2, myY + myW/2,M_PI_2,mScale,mScale);
|
||||
if (tc){
|
||||
@@ -355,6 +363,7 @@ void CardGui::Render(){
|
||||
}else{
|
||||
renderer->FillRect(myX , myY , myW, myH, ARGB(255,Constants::_r[color]/2+50,Constants::_g[color]/2+50,Constants::_b[color]/2+50));
|
||||
renderer->DrawRect(myX , myY , myW, myH, ARGB(255,Constants::_r[color],Constants::_g[color],Constants::_b[color]));
|
||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE * 0.5 * mScale);
|
||||
mFont->DrawString(buffer,myX+4,myY + 1);
|
||||
if (mIcon) renderer->RenderQuad(mIcon,myX + myW/2, myY + myH/2,0,mScale, mScale);
|
||||
if (tc){
|
||||
@@ -363,6 +372,7 @@ void CardGui::Render(){
|
||||
}
|
||||
}
|
||||
}
|
||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
||||
}
|
||||
|
||||
if (tc && tc->alreadyHasTarget(card)){
|
||||
@@ -374,6 +384,7 @@ void CardGui::Render(){
|
||||
}
|
||||
|
||||
if (card->isACreature()){
|
||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
||||
char buffer[200];
|
||||
sprintf(buffer, "%i/%i",card->power,card->life);
|
||||
renderer->FillRect(x+2,y + mHeight - 12, 25 , 12 ,ARGB(128,0,0,0));
|
||||
|
||||
Reference in New Issue
Block a user