J :
* Fix a number of warnings
This commit is contained in:
@@ -60,9 +60,9 @@ void CardGui::alternateRender(MTGCard * card, JLBFont * mFont, JQuad ** manaIcon
|
|||||||
ManaCost * manacost = card->getManaCost();
|
ManaCost * manacost = card->getManaCost();
|
||||||
int nbicons = 0;
|
int nbicons = 0;
|
||||||
ManaCostHybrid * h;
|
ManaCostHybrid * h;
|
||||||
|
|
||||||
unsigned int j = 0;
|
unsigned int j = 0;
|
||||||
while (h = manacost->getHybridCost(j)){
|
while ((h = manacost->getHybridCost(j))){
|
||||||
OutputDebugString("Hybrid\n");
|
OutputDebugString("Hybrid\n");
|
||||||
for (int i = 0; i < 2; i++){
|
for (int i = 0; i < 2; i++){
|
||||||
int color = h->color1;
|
int color = h->color1;
|
||||||
@@ -317,8 +317,8 @@ void CardGui::Render(){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
char buffer[200];
|
char buffer[200];
|
||||||
sprintf(buffer, "%s",card->getName());
|
sprintf(buffer, "%s",card->getName());
|
||||||
mFont->SetColor(ARGB(255,Constants::_r[color],Constants::_g[color],Constants::_b[color]));
|
mFont->SetColor(ARGB(255,Constants::_r[color],Constants::_g[color],Constants::_b[color]));
|
||||||
|
|
||||||
JQuad * mIcon = NULL;
|
JQuad * mIcon = NULL;
|
||||||
@@ -337,7 +337,7 @@ void CardGui::Render(){
|
|||||||
if (card->isTapped()){
|
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->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]));
|
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->SetScale(DEFAULT_MAIN_FONT_SCALE * 0.8 * mScale);
|
||||||
mFont->DrawString(buffer,myX - (myH)+4,myY + 1);
|
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 (mIcon) renderer->RenderQuad(mIcon,myX - myH/2, myY + myW/2,M_PI_2,mScale,mScale);
|
||||||
if (tc){
|
if (tc){
|
||||||
@@ -348,7 +348,7 @@ void CardGui::Render(){
|
|||||||
}else{
|
}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->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]));
|
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->SetScale(DEFAULT_MAIN_FONT_SCALE * 0.5 * mScale);
|
||||||
mFont->DrawString(buffer,myX+4,myY + 1);
|
mFont->DrawString(buffer,myX+4,myY + 1);
|
||||||
if (mIcon) renderer->RenderQuad(mIcon,myX + myW/2, myY + myH/2,0,mScale, mScale);
|
if (mIcon) renderer->RenderQuad(mIcon,myX + myW/2, myY + myH/2,0,mScale, mScale);
|
||||||
if (tc){
|
if (tc){
|
||||||
@@ -357,7 +357,7 @@ void CardGui::Render(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -411,9 +411,9 @@ void GameStateMenu::ButtonPressed(int controllerId, int controlId)
|
|||||||
{
|
{
|
||||||
case MENUITEM_PLAY:
|
case MENUITEM_PLAY:
|
||||||
#ifdef TESTSUITE
|
#ifdef TESTSUITE
|
||||||
subMenuController = NEW SimpleMenu(102, this, mFont, 180,110);
|
subMenuController = NEW SimpleMenu(102, this, mFont, 150,60);
|
||||||
#else
|
#else
|
||||||
subMenuController = NEW SimpleMenu(102, this, mFont, 180,110);
|
subMenuController = NEW SimpleMenu(102, this, mFont, 150,60);
|
||||||
#endif
|
#endif
|
||||||
if (subMenuController){
|
if (subMenuController){
|
||||||
subMenuController->Add(SUBMENUITEM_1PLAYER,"1 Player");
|
subMenuController->Add(SUBMENUITEM_1PLAYER,"1 Player");
|
||||||
|
|||||||
@@ -143,9 +143,9 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
|||||||
OutputDebugString(buf);
|
OutputDebugString(buf);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
MultiAbility * multi = NULL;
|
MultiAbility * multi = NULL;
|
||||||
int delimiter = line.find("}:");
|
unsigned int delimiter = line.find("}:");
|
||||||
ManaCost * cost = NULL;
|
ManaCost * cost = NULL;
|
||||||
if (delimiter!= string::npos){
|
if (delimiter!= string::npos){
|
||||||
cost = ManaCost::parseManaCost(line.substr(0,delimiter+1));
|
cost = ManaCost::parseManaCost(line.substr(0,delimiter+1));
|
||||||
@@ -522,7 +522,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
|||||||
multi->Add(a);
|
multi->Add(a);
|
||||||
}else{
|
}else{
|
||||||
game->addObserver(a);
|
game->addObserver(a);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
OutputDebugString ("uh oh\n");
|
OutputDebugString ("uh oh\n");
|
||||||
card->controller()->getManaPool()->add(output);
|
card->controller()->getManaPool()->add(output);
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ ManaCost::ManaCost(ManaCost * _manaCost){
|
|||||||
|
|
||||||
ManaCost::~ManaCost(){
|
ManaCost::~ManaCost(){
|
||||||
LOG("==Deleting ManaCost==");
|
LOG("==Deleting ManaCost==");
|
||||||
for (int i = 0; i < nbhybrids ; i++){
|
for (unsigned int i = 0; i < nbhybrids ; i++){
|
||||||
SAFE_DELETE(hybrids[i]);
|
SAFE_DELETE(hybrids[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -132,10 +132,10 @@ void ManaCost::init(){
|
|||||||
|
|
||||||
|
|
||||||
void ManaCost::copy(ManaCost * _manaCost){
|
void ManaCost::copy(ManaCost * _manaCost){
|
||||||
for (int i=0; i<= Constants::MTG_NB_COLORS; i++){
|
for (unsigned int i = 0; i <= Constants::MTG_NB_COLORS; i++){
|
||||||
cost[i] = _manaCost->getCost(i);
|
cost[i] = _manaCost->getCost(i);
|
||||||
}
|
}
|
||||||
for (int i=0; i< _manaCost->nbhybrids; i++){
|
for (unsigned int i = 0; i < _manaCost->nbhybrids; i++){
|
||||||
hybrids[i] = NEW ManaCostHybrid((*_manaCost->hybrids[i]));
|
hybrids[i] = NEW ManaCostHybrid((*_manaCost->hybrids[i]));
|
||||||
}
|
}
|
||||||
nbhybrids = _manaCost->nbhybrids;
|
nbhybrids = _manaCost->nbhybrids;
|
||||||
@@ -159,7 +159,7 @@ int ManaCost::getMainColor(){
|
|||||||
|
|
||||||
int ManaCost::hasColor(int color){
|
int ManaCost::hasColor(int color){
|
||||||
if (cost[color]) return 1;
|
if (cost[color]) return 1;
|
||||||
for (int i = 0; i < nbhybrids; i++){
|
for (unsigned int i = 0; i < nbhybrids; i++){
|
||||||
if (hybrids[i]->hasColor(color)) return 1;
|
if (hybrids[i]->hasColor(color)) return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -167,10 +167,10 @@ int ManaCost::hasColor(int color){
|
|||||||
|
|
||||||
int ManaCost::getConvertedCost(){
|
int ManaCost::getConvertedCost(){
|
||||||
int result = 0;
|
int result = 0;
|
||||||
for (int i=0; i< Constants::MTG_NB_COLORS; i++){
|
for (unsigned int i = 0; i < Constants::MTG_NB_COLORS; i++){
|
||||||
result += cost[i];
|
result += cost[i];
|
||||||
}
|
}
|
||||||
for (int i = 0; i < nbhybrids; i++){
|
for (unsigned int i = 0; i < nbhybrids; i++){
|
||||||
result+= hybrids[i]->getConvertedCost();
|
result+= hybrids[i]->getConvertedCost();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -188,10 +188,10 @@ int ManaCost::add(int color, int value){
|
|||||||
|
|
||||||
int ManaCost::add(ManaCost * _cost){
|
int ManaCost::add(ManaCost * _cost){
|
||||||
if(!_cost) return 0;
|
if(!_cost) return 0;
|
||||||
for (int i=0; i< Constants::MTG_NB_COLORS; i++){
|
for (unsigned int i = 0; i < Constants::MTG_NB_COLORS; i++){
|
||||||
cost[i]+= _cost->getCost(i);
|
cost[i]+= _cost->getCost(i);
|
||||||
}
|
}
|
||||||
for (int i=0; i< _cost->nbhybrids; i++){
|
for (unsigned int i = 0; i < _cost->nbhybrids; i++){
|
||||||
hybrids[nbhybrids] = NEW ManaCostHybrid((*_cost->hybrids[i]));
|
hybrids[nbhybrids] = NEW ManaCostHybrid((*_cost->hybrids[i]));
|
||||||
nbhybrids++;
|
nbhybrids++;
|
||||||
}
|
}
|
||||||
@@ -208,7 +208,7 @@ int ManaCost::addHybrid(int c1, int v1, int c2, int v2){
|
|||||||
hybrids[nbhybrids] = h;
|
hybrids[nbhybrids] = h;
|
||||||
nbhybrids++;
|
nbhybrids++;
|
||||||
return nbhybrids;
|
return nbhybrids;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ManaCost::pay(ManaCost * _cost){
|
int ManaCost::pay(ManaCost * _cost){
|
||||||
ManaCost * diff = Diff(_cost);
|
ManaCost * diff = Diff(_cost);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ Phase * PhaseRing::forward(){
|
|||||||
|
|
||||||
Phase * PhaseRing::goToPhase(int id, Player * player){
|
Phase * PhaseRing::goToPhase(int id, Player * player){
|
||||||
Phase * currentPhase = *current;
|
Phase * currentPhase = *current;
|
||||||
while(currentPhase->id !=id || currentPhase->player !=player){ //Dangerous, risk for inifinte loop !
|
while(currentPhase->id !=id || currentPhase->player != player){ //Dangerous, risk for inifinte loop !
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
OutputDebugString("goto");
|
OutputDebugString("goto");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
#include "../include/GameApp.h"
|
#include "../include/GameApp.h"
|
||||||
|
|
||||||
const unsigned SimpleMenu::SIDE_SIZE = 7;
|
const unsigned SimpleMenu::SIDE_SIZE = 7;
|
||||||
const unsigned SimpleMenu::VMARGIN = 12;
|
const unsigned SimpleMenu::VMARGIN = 16;
|
||||||
const unsigned SimpleMenu::HMARGIN = 27;
|
const unsigned SimpleMenu::HMARGIN = 30;
|
||||||
const signed SimpleMenu::LINE_HEIGHT = 16;
|
const signed SimpleMenu::LINE_HEIGHT = 28;
|
||||||
const char* SimpleMenu::spadeLPath = "graphics/spade_ul.png";
|
const char* SimpleMenu::spadeLPath = "graphics/spade_ul.png";
|
||||||
const char* SimpleMenu::spadeRPath = "graphics/spade_ur.png";
|
const char* SimpleMenu::spadeRPath = "graphics/spade_ur.png";
|
||||||
const char* SimpleMenu::jewelPath = "graphics/jewel.png";
|
const char* SimpleMenu::jewelPath = "graphics/jewel.png";
|
||||||
|
|||||||
Reference in New Issue
Block a user