More type conversion warning cleanup.

This commit is contained in:
wrenczes@gmail.com
2010-11-07 12:09:04 +00:00
parent e717b2f260
commit 471cbd6ba4
5 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -240,9 +240,9 @@ class MTGDeathtouchRule:public MTGAbility{
class HUDString { class HUDString {
public: public:
string value; string value;
int timestamp; float timestamp;
int quantity; 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{ class HUDDisplay:public MTGAbility{
+2 -2
View File
@@ -1026,7 +1026,7 @@ void MTGMomirRule::Update(float dt){
alreadyplayed = 0; alreadyplayed = 0;
} }
if (textAlpha){ if (textAlpha){
textAlpha -= (200*dt); textAlpha -= static_cast<int>(200*dt);
if (textAlpha <0) textAlpha = 0; if (textAlpha <0) textAlpha = 0;
} }
MTGAbility::Update(dt); MTGAbility::Update(dt);
@@ -1116,7 +1116,7 @@ void HUDDisplay::Render(){
float x0 = SCREEN_WIDTH-10-maxWidth-10; float x0 = SCREEN_WIDTH-10-maxWidth-10;
float y0 = 20; float y0 = 20;
float size = events.size() * 16; float size = static_cast<float>(events.size() * 16);
JRenderer * r = JRenderer::GetInstance(); JRenderer * r = JRenderer::GetInstance();
r->FillRoundRect(x0,y0,maxWidth + 10,size,5,ARGB(50,0,0,0)); r->FillRoundRect(x0,y0,maxWidth + 10,size,5,ARGB(50,0,0,0));
+1 -1
View File
@@ -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) void Pos::Update(float dt)
{ {
if (dt > 0.05f) if (dt > 0.05f)
dt = 0.05; dt = 0.05f;
actX += 10 * dt * (x - actX); actX += 10 * dt * (x - actX);
actY += 10 * dt * (y - actY); actY += 10 * dt * (y - actY);
actT += 10 * dt * (t - actT); actT += 10 * dt * (t - actT);
+2 -2
View File
@@ -67,7 +67,7 @@ void SimpleMenu::drawHorzPole(float x, float y, float width)
{ {
JRenderer* renderer = JRenderer::GetInstance(); JRenderer* renderer = JRenderer::GetInstance();
static int offset = (spadeR->mWidth - kPoleWidth) / 2; float offset = (spadeR->mWidth - kPoleWidth) / 2;
renderer->RenderQuad(side, x, y, 0, width); renderer->RenderQuad(side, x, y, 0, width);
spadeR->SetHFlip(true); spadeR->SetHFlip(true);
spadeL->SetHFlip(false); spadeL->SetHFlip(false);
@@ -82,7 +82,7 @@ void SimpleMenu::drawVertPole(float x, float y, float height)
{ {
JRenderer* renderer = JRenderer::GetInstance(); 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); renderer->RenderQuad(side, x + kPoleWidth, y, M_PI/2, height);
spadeR->SetHFlip(false); spadeR->SetHFlip(false);
spadeL->SetHFlip(true); spadeL->SetHFlip(true);
+2 -2
View File
@@ -367,12 +367,12 @@ StoryDialog::StoryDialog(TiXmlElement* root, StoryFlow * mParent):StoryPage(mPar
TiXmlElement* element = node->ToElement(); TiXmlElement* element = node->ToElement();
if (element) { if (element) {
string sX = safeAttribute(element, "x"); string sX = safeAttribute(element, "x");
float x = atof(sX.c_str()); float x = static_cast<float>(atof(sX.c_str()));
if (x > 0 && x < 1){ if (x > 0 && x < 1){
x = SCREEN_WIDTH_F * x; x = SCREEN_WIDTH_F * x;
} }
string sY = safeAttribute(element,"y"); string sY = safeAttribute(element,"y");
float y = atof(sY.c_str()); float y = static_cast<float>(atof(sY.c_str()));
if (y > 0 && y < 1){ if (y > 0 && y < 1){
y = SCREEN_HEIGHT_F * y; y = SCREEN_HEIGHT_F * y;
} }