From 471cbd6ba4177d2b04a0ef053c00d52d50612dfc Mon Sep 17 00:00:00 2001 From: "wrenczes@gmail.com" Date: Sun, 7 Nov 2010 12:09:04 +0000 Subject: [PATCH] More type conversion warning cleanup. --- projects/mtg/include/MTGRules.h | 4 ++-- projects/mtg/src/MTGRules.cpp | 4 ++-- projects/mtg/src/Pos.cpp | 2 +- projects/mtg/src/SimpleMenu.cpp | 4 ++-- projects/mtg/src/StoryFlow.cpp | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/projects/mtg/include/MTGRules.h b/projects/mtg/include/MTGRules.h index 979141c80..92f9c3e17 100644 --- a/projects/mtg/include/MTGRules.h +++ b/projects/mtg/include/MTGRules.h @@ -240,9 +240,9 @@ class MTGDeathtouchRule:public MTGAbility{ class HUDString { public: string value; - int timestamp; + float timestamp; int quantity; - HUDString(string s, int ts):value(s),timestamp(ts){quantity = 1;}; + HUDString(string s, float ts):value(s),timestamp(ts){quantity = 1;}; }; class HUDDisplay:public MTGAbility{ diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 0a9808a61..bb897a7cf 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -1026,7 +1026,7 @@ void MTGMomirRule::Update(float dt){ alreadyplayed = 0; } if (textAlpha){ - textAlpha -= (200*dt); + textAlpha -= static_cast(200*dt); if (textAlpha <0) textAlpha = 0; } MTGAbility::Update(dt); @@ -1116,7 +1116,7 @@ void HUDDisplay::Render(){ float x0 = SCREEN_WIDTH-10-maxWidth-10; float y0 = 20; - float size = events.size() * 16; + float size = static_cast(events.size() * 16); JRenderer * r = JRenderer::GetInstance(); r->FillRoundRect(x0,y0,maxWidth + 10,size,5,ARGB(50,0,0,0)); diff --git a/projects/mtg/src/Pos.cpp b/projects/mtg/src/Pos.cpp index 4351ca99c..85a3907b9 100644 --- a/projects/mtg/src/Pos.cpp +++ b/projects/mtg/src/Pos.cpp @@ -7,7 +7,7 @@ Pos::Pos(float x, float y, float z, float t, float a) : actX(x), actY(y), actZ(z void Pos::Update(float dt) { if (dt > 0.05f) - dt = 0.05; + dt = 0.05f; actX += 10 * dt * (x - actX); actY += 10 * dt * (y - actY); actT += 10 * dt * (t - actT); diff --git a/projects/mtg/src/SimpleMenu.cpp b/projects/mtg/src/SimpleMenu.cpp index b8de6f0c0..6c66d3ef5 100644 --- a/projects/mtg/src/SimpleMenu.cpp +++ b/projects/mtg/src/SimpleMenu.cpp @@ -67,7 +67,7 @@ void SimpleMenu::drawHorzPole(float x, float y, float width) { JRenderer* renderer = JRenderer::GetInstance(); - static int offset = (spadeR->mWidth - kPoleWidth) / 2; + float offset = (spadeR->mWidth - kPoleWidth) / 2; renderer->RenderQuad(side, x, y, 0, width); spadeR->SetHFlip(true); spadeL->SetHFlip(false); @@ -82,7 +82,7 @@ void SimpleMenu::drawVertPole(float x, float y, float height) { JRenderer* renderer = JRenderer::GetInstance(); - static int offset = (spadeR->mHeight - kPoleWidth) / 2; + float offset = (spadeR->mHeight - kPoleWidth) / 2; renderer->RenderQuad(side, x + kPoleWidth, y, M_PI/2, height); spadeR->SetHFlip(false); spadeL->SetHFlip(true); diff --git a/projects/mtg/src/StoryFlow.cpp b/projects/mtg/src/StoryFlow.cpp index 44d3e80aa..17d68c899 100644 --- a/projects/mtg/src/StoryFlow.cpp +++ b/projects/mtg/src/StoryFlow.cpp @@ -367,12 +367,12 @@ StoryDialog::StoryDialog(TiXmlElement* root, StoryFlow * mParent):StoryPage(mPar TiXmlElement* element = node->ToElement(); if (element) { string sX = safeAttribute(element, "x"); - float x = atof(sX.c_str()); + float x = static_cast(atof(sX.c_str())); if (x > 0 && x < 1){ x = SCREEN_WIDTH_F * x; } string sY = safeAttribute(element,"y"); - float y = atof(sY.c_str()); + float y = static_cast(atof(sY.c_str())); if (y > 0 && y < 1){ y = SCREEN_HEIGHT_F * y; }