More warning cleanup (type to type conversion warnings).
This commit is contained in:
@@ -370,7 +370,7 @@ public:
|
|||||||
~GameSettings();
|
~GameSettings();
|
||||||
int save();
|
int save();
|
||||||
|
|
||||||
SimplePad * keypadStart(string input, string * _dest = NULL, bool _cancel=true, bool _numpad=false, int _x = SCREEN_WIDTH/2, int _y = SCREEN_HEIGHT/2);
|
SimplePad * keypadStart(string input, string * _dest = NULL, bool _cancel = true, bool _numpad = false, float _x = SCREEN_WIDTH_F / 2, float _y = SCREEN_HEIGHT_F / 2);
|
||||||
string keypadFinish();
|
string keypadFinish();
|
||||||
void keypadShutdown();
|
void keypadShutdown();
|
||||||
void keypadTitle(string set);
|
void keypadTitle(string set);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ void AIStats::updateStatsCard(MTGCardInstance * cardInstance, Damage * damage, f
|
|||||||
}
|
}
|
||||||
if (damage->target == player)
|
if (damage->target == player)
|
||||||
{
|
{
|
||||||
stat->value += multiplier * STATS_PLAYER_MULTIPLIER * damage->damage;
|
stat->value += static_cast<int>(multiplier * STATS_PLAYER_MULTIPLIER * damage->damage);
|
||||||
}
|
}
|
||||||
else if (damage->target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
else if (damage->target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
{
|
{
|
||||||
@@ -53,7 +53,7 @@ void AIStats::updateStatsCard(MTGCardInstance * cardInstance, Damage * damage, f
|
|||||||
if (target->controller() == player && !target->isInPlay())
|
if (target->controller() == player && !target->isInPlay())
|
||||||
{
|
{
|
||||||
//One of my creatures got lethal damage...
|
//One of my creatures got lethal damage...
|
||||||
stat->value += multiplier * STATS_CREATURE_MULTIPLIER * damage->damage;
|
stat->value += static_cast<int>(multiplier * STATS_CREATURE_MULTIPLIER * damage->damage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@ void AIStats::load(char * filename)
|
|||||||
std::getline(file, s);
|
std::getline(file, s);
|
||||||
int value = atoi(s.c_str());
|
int value = atoi(s.c_str());
|
||||||
std::getline(file, s);
|
std::getline(file, s);
|
||||||
int direct = atoi(s.c_str());
|
bool direct = atoi(s.c_str()) > 0;
|
||||||
AIStat * stat = NEW AIStat(cardid, value, 1, direct);
|
AIStat * stat = NEW AIStat(cardid, value, 1, direct);
|
||||||
stats.push_back(stat);
|
stats.push_back(stat);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -936,7 +936,7 @@ void ActionStack::Update(float dt)
|
|||||||
extraTime = 1;//we never want this int to be 0.
|
extraTime = 1;//we never want this int to be 0.
|
||||||
|
|
||||||
if (timer < 0)
|
if (timer < 0)
|
||||||
timer = options[Options::INTERRUPT_SECONDS].number * extraTime;
|
timer = static_cast<float>(options[Options::INTERRUPT_SECONDS].number * extraTime);
|
||||||
timer -= dt;
|
timer -= dt;
|
||||||
if (timer < 0)
|
if (timer < 0)
|
||||||
cancelInterruptOffer();
|
cancelInterruptOffer();
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ bool CardDisplay::CheckUserInput(int x, int y)
|
|||||||
float top, left;
|
float top, left;
|
||||||
if (mObjects[i]->getTopLeft(top, left))
|
if (mObjects[i]->getTopLeft(top, left))
|
||||||
{
|
{
|
||||||
distance2 = (top - y) * (top - y) + (left - x) * (left - x);
|
distance2 = static_cast<unsigned int>((top - y) * (top - y) + (left - x) * (left - x));
|
||||||
if (distance2 < minDistance2)
|
if (distance2 < minDistance2)
|
||||||
{
|
{
|
||||||
minDistance2 = distance2;
|
minDistance2 = distance2;
|
||||||
|
|||||||
@@ -221,7 +221,12 @@ JQuadPtr Credits::GetUnlockedQuad(string textureName)
|
|||||||
JTexture * unlockedTex = WResourceManager::Instance()->RetrieveTexture(textureName);
|
JTexture * unlockedTex = WResourceManager::Instance()->RetrieveTexture(textureName);
|
||||||
if (!unlockedTex) return JQuadPtr();
|
if (!unlockedTex) return JQuadPtr();
|
||||||
|
|
||||||
return WResourceManager::Instance()->RetrieveQuad(unlockedTextureName, 2, 2, unlockedTex->mWidth - 4, unlockedTex->mHeight - 4);
|
return WResourceManager::Instance()->RetrieveQuad(
|
||||||
|
unlockedTextureName,
|
||||||
|
2.0f,
|
||||||
|
2.0f,
|
||||||
|
static_cast<float>(unlockedTex->mWidth - 4),
|
||||||
|
static_cast<float>(unlockedTex->mHeight - 4));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -776,12 +776,14 @@ void GameSettings::createUsersFirstDeck(int setId)
|
|||||||
mCollection->save();
|
mCollection->save();
|
||||||
SAFE_DELETE(mCollection);
|
SAFE_DELETE(mCollection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameSettings::keypadTitle(string set)
|
void GameSettings::keypadTitle(string set)
|
||||||
{
|
{
|
||||||
if (keypad != NULL)
|
if (keypad != NULL)
|
||||||
keypad->title = set;
|
keypad->title = set;
|
||||||
}
|
}
|
||||||
SimplePad * GameSettings::keypadStart(string input, string * _dest, bool _cancel, bool _numpad, int _x, int _y)
|
|
||||||
|
SimplePad * GameSettings::keypadStart(string input, string * _dest, bool _cancel, bool _numpad, float _x, float _y)
|
||||||
{
|
{
|
||||||
if (keypad == NULL)
|
if (keypad == NULL)
|
||||||
keypad = NEW SimplePad();
|
keypad = NEW SimplePad();
|
||||||
|
|||||||
@@ -478,7 +478,7 @@ void GameStateDeckViewer::Update(float dt)
|
|||||||
{
|
{
|
||||||
for(int i=0; i < CARDS_DISPLAYED; i++)
|
for(int i=0; i < CARDS_DISPLAYED; i++)
|
||||||
{
|
{
|
||||||
distance2 = (cardsCoordinates[i].second - y) * (cardsCoordinates[i].second - y) + (cardsCoordinates[i].first - x) * (cardsCoordinates[i].first - x);
|
distance2 = static_cast<unsigned int>((cardsCoordinates[i].second - y) * (cardsCoordinates[i].second - y) + (cardsCoordinates[i].first - x) * (cardsCoordinates[i].first - x));
|
||||||
if (distance2 < minDistance2)
|
if (distance2 < minDistance2)
|
||||||
{
|
{
|
||||||
minDistance2 = distance2;
|
minDistance2 = distance2;
|
||||||
|
|||||||
@@ -219,7 +219,8 @@ void GameStateDuel::loadPlayer(int playerId, int decknb, bool isAI, bool isNetwo
|
|||||||
|
|
||||||
void GameStateDuel::initRand(unsigned int seed)
|
void GameStateDuel::initRand(unsigned int seed)
|
||||||
{
|
{
|
||||||
if (!seed) seed = time(0);
|
if (!seed)
|
||||||
|
seed = static_cast<unsigned int>(time(0));
|
||||||
srand(seed);
|
srand(seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ void GameStateMenu::Update(float dt)
|
|||||||
MTGCollection()->load(primitives[primitivesLoadCounter].c_str());
|
MTGCollection()->load(primitives[primitivesLoadCounter].c_str());
|
||||||
#if _DEBUG
|
#if _DEBUG
|
||||||
int endTime = JGEGetTime();
|
int endTime = JGEGetTime();
|
||||||
float elapsedTime = (endTime - startTime);
|
int elapsedTime = (endTime - startTime);
|
||||||
DebugTrace("Time elapsed while loading " << primitives[primitivesLoadCounter] << " : " << elapsedTime << " ms");
|
DebugTrace("Time elapsed while loading " << primitives[primitivesLoadCounter] << " : " << elapsedTime << " ms");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ void GuiAvatars::Render()
|
|||||||
}
|
}
|
||||||
else if (self == active)
|
else if (self == active)
|
||||||
{
|
{
|
||||||
r->FillRect(self->actX - w * self->actZ -4.5, self->actY - h * self->actZ, w * self->actZ, h * self->actZ, ARGB(200,0,0,0));
|
r->FillRect(self->actX - w * self->actZ - 4.5f, self->actY - h * self->actZ, w * self->actZ, h * self->actZ, ARGB(200,0,0,0));
|
||||||
}
|
}
|
||||||
GuiLayer::Render();
|
GuiLayer::Render();
|
||||||
|
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ void ModRulesGame::parse(TiXmlElement* element)
|
|||||||
{
|
{
|
||||||
int value = ModRules::getValueAsInt(element, "canInterrupt");
|
int value = ModRules::getValueAsInt(element, "canInterrupt");
|
||||||
if (value != -1)
|
if (value != -1)
|
||||||
mCanInterrupt = value;
|
mCanInterrupt = value > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -203,11 +203,11 @@ void ModRulesGeneral::parse(TiXmlElement* element)
|
|||||||
{
|
{
|
||||||
int value = ModRules::getValueAsInt(element, "hasDeckEditor");
|
int value = ModRules::getValueAsInt(element, "hasDeckEditor");
|
||||||
if (value != -1)
|
if (value != -1)
|
||||||
mHasDeckEditor = value;
|
mHasDeckEditor = value > 0;
|
||||||
|
|
||||||
value = ModRules::getValueAsInt(element, "hasShop");
|
value = ModRules::getValueAsInt(element, "hasShop");
|
||||||
if (value != -1)
|
if (value != -1)
|
||||||
mHasShop = value;
|
mHasShop = value > 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -819,7 +819,7 @@ void TaskDelay::restoreCustomAttribs()
|
|||||||
turn = atoi(persistentAttribs[COMMON_ATTRIBS_COUNT].c_str());
|
turn = atoi(persistentAttribs[COMMON_ATTRIBS_COUNT].c_str());
|
||||||
if (persistentAttribs.size() > COMMON_ATTRIBS_COUNT + 1)
|
if (persistentAttribs.size() > COMMON_ATTRIBS_COUNT + 1)
|
||||||
{
|
{
|
||||||
afterTurn = static_cast<bool> (atoi(persistentAttribs[COMMON_ATTRIBS_COUNT + 1].c_str()));
|
afterTurn = atoi(persistentAttribs[COMMON_ATTRIBS_COUNT + 1].c_str()) > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -897,10 +897,10 @@ bool WGuiMenu::CheckUserInput(JButton key)
|
|||||||
int n = currentItem;
|
int n = currentItem;
|
||||||
unsigned int distance2;
|
unsigned int distance2;
|
||||||
unsigned int minDistance2 = -1;
|
unsigned int minDistance2 = -1;
|
||||||
for(size_t k=0; k < items.size(); k++)
|
for(size_t k = 0; k < items.size(); k++)
|
||||||
{
|
{
|
||||||
WGuiItem* pItem = (WGuiItem*)items[k];
|
WGuiItem* pItem = (WGuiItem*)items[k];
|
||||||
distance2 = (pItem-> getY() - j) * (pItem-> getY() - j) + (pItem-> getX() - i) * (pItem-> getX() - i);
|
distance2 = static_cast<unsigned int>((pItem->getY() - j) * (pItem->getY() - j) + (pItem->getX() - i) * (pItem->getX() - i));
|
||||||
if (distance2 < minDistance2)
|
if (distance2 < minDistance2)
|
||||||
{
|
{
|
||||||
minDistance2 = distance2;
|
minDistance2 = distance2;
|
||||||
|
|||||||
Reference in New Issue
Block a user