|
From: <axl...@us...> - 2010-05-18 20:14:56
|
Revision: 738
http://hgengine.svn.sourceforge.net/hgengine/?rev=738&view=rev
Author: axlecrusher
Date: 2010-05-18 20:14:49 +0000 (Tue, 18 May 2010)
Log Message:
-----------
fix warnings
Modified Paths:
--------------
Mercury2/modules/Cu2.cpp
Mercury2/modules/ParticleEmitter.cpp
Mercury2/modules/TextNode.cpp
Mercury2/src/DataTypes/MTriangle.cpp
Mercury2/src/MercuryInput.cpp
Mercury2/src/MercurySound.cpp
Mercury2/src/MercurySound.h
Mercury2/src/MercuryValue.cpp
Mercury2/src/Quad.cpp
Modified: Mercury2/modules/Cu2.cpp
===================================================================
--- Mercury2/modules/Cu2.cpp 2010-05-18 20:01:48 UTC (rev 737)
+++ Mercury2/modules/Cu2.cpp 2010-05-18 20:14:49 UTC (rev 738)
@@ -62,8 +62,8 @@
for( unsigned button = 0; button < 3; button++ )
{
unsigned char Mask = 1<<button;
- bool bWasDown = iLastButtonMask & Mask;
- bool bIsDown = iCurrentButtonMask & Mask;
+ bool bWasDown = GetBit(iLastButtonMask,Mask);
+ bool bIsDown = GetBit(iCurrentButtonMask,Mask);
if( bWasDown && !bIsDown )
{
//XXX: When we release outside - we want to propogate that information, and that can be tricky..
@@ -396,8 +396,8 @@
{
if( m_sAssociatedValueX.length() && m_bDown && x >= 0 && y >= 0 && x < GetW() && y < GetH() )
{
- float fxRangeMin = atof( m_sxRangeMin.c_str() );
- float fxRangeMax = m_sxRangeMax.length()?atof( m_sxRangeMax.c_str() ):GetW();
+ float fxRangeMin = (float)atof( m_sxRangeMin.c_str() );
+ float fxRangeMax = m_sxRangeMax.length()?(float)atof( m_sxRangeMax.c_str() ):GetW();
float fX = ( float(x) / float(GetW()-1) ) * (fxRangeMax - fxRangeMin) + fxRangeMin;
MESSAGEMAN.GetValue( m_sAssociatedValueX )->SetFloat( fX );
@@ -405,8 +405,8 @@
if( m_sAssociatedValueY.length() && m_bDown && x >= 0 && y >= 0 && x < GetW() && y < GetH() )
{
- float fyRangeMin = atof( m_syRangeMin.c_str() );
- float fyRangeMax = m_syRangeMax.length()?atof( m_syRangeMax.c_str() ):GetW();
+ float fyRangeMin = (float)atof( m_syRangeMin.c_str() );
+ float fyRangeMax = m_syRangeMax.length()?(float)atof( m_syRangeMax.c_str() ):GetW();
float fY = ( float(y) / float(GetH()-1) ) * (fyRangeMax - fyRangeMin) + fyRangeMin;
MESSAGEMAN.GetValue( m_sAssociatedValueY )->SetFloat( fY );
@@ -446,9 +446,9 @@
{
glDisable( GL_TEXTURE_2D );
if( m_bDown )
- glColor3f( 0.3, 0.3, 0.3 );
+ glColor3f( 0.3f, 0.3f, 0.3f );
else
- glColor3f( 0.5, 0.5, 0.5 );
+ glColor3f( 0.5f, 0.5f, 0.5f );
glBegin( GL_QUADS );
glVertex2f( 1., 1. );
@@ -460,17 +460,17 @@
glLineWidth( 2 );
glBegin( GL_LINES );
if( m_bDown )
- glColor3f( 0.1, 0.1, 0.1 );
+ glColor3f( 0.1f, 0.1f, 0.1f );
else
- glColor3f( 0.7, 0.7, 0.7 );
+ glColor3f( 0.7f, 0.7f, 0.7f );
glVertex2f( 1, 1 );
glVertex2f( 1, GetH()-1 );
glVertex2f( 1, GetH()-1 );
glVertex2f( GetW()-2, GetH()-1 );
if( !m_bDown )
- glColor3f( 0.1, 0.1, 0.1 );
+ glColor3f( 0.1f, 0.1f, 0.1f );
else
- glColor3f( 0.7, 0.7, 0.7 );
+ glColor3f( 0.7f, 0.7f, 0.7f );
glVertex2f( GetW()-1, GetH()-2 );
glVertex2f( GetW()-1, 1 );
glVertex2f( GetW()-1, 1 );
@@ -618,12 +618,12 @@
glLineWidth( 2 );
glBegin( GL_LINES );
- glColor3f( 0.7, 0.7, 0.7 );
+ glColor3f( 0.7f, 0.7f, 0.7f );
glVertex2f( 1, 1 );
glVertex2f( 1, GetH()-1 );
glVertex2f( 1, GetH()-1 );
glVertex2f( GetW()-2, GetH()-1 );
- glColor3f( 0.1, 0.1, 0.1 );
+ glColor3f( 0.1f, 0.1f, 0.1f );
glVertex2f( GetW()-1, GetH()-2 );
glVertex2f( GetW()-1, 1 );
glVertex2f( GetW()-1, 1 );
@@ -633,7 +633,7 @@
if( HasFocus() )
glColor3f( 0., 0., 1. );
else
- glColor3f( .3, .3, .3 );
+ glColor3f( .3f, .3f, .3f );
glBegin( GL_QUADS );
glVertex2f( 2., GetH()-19 );
Modified: Mercury2/modules/ParticleEmitter.cpp
===================================================================
--- Mercury2/modules/ParticleEmitter.cpp 2010-05-18 20:01:48 UTC (rev 737)
+++ Mercury2/modules/ParticleEmitter.cpp 2010-05-18 20:14:49 UTC (rev 738)
@@ -113,8 +113,8 @@
}
ParticleEmitter::ParticleEmitter()
- :base(), m_maxParticles(50), m_age(0), m_emitDelay(0.1), m_lifespan(0),
- m_particlesEmitted(0), m_particleMinLife(0.1), m_particleMaxLife(5),
+ :base(), m_maxParticles(50), m_age(0), m_emitDelay(0.1f), m_lifespan(0),
+ m_particlesEmitted(0), m_particleMinLife(0.1f), m_particleMaxLife(5.0f),
m_particles(NULL), GenerateParticlesClbk(NULL),
m_dirtyVBO(0)
{
@@ -184,8 +184,8 @@
p->m_lifespan = m_particleMinLife;
p->m_lifespan += (rand()%(int(m_particleMaxLife*1000) - int(m_particleMinLife*1000)))/1000.0f;
- p->m_rand1 = rand()%100000;
- p->m_rand2 = rand()%100000;
+ p->m_rand1 = float(rand()%100000);
+ p->m_rand2 = float(rand()%100000);
// +((rand()%((m_particleMaxLife*1000)-(m_particleMinLife*1000)))/1000.0f);
Modified: Mercury2/modules/TextNode.cpp
===================================================================
--- Mercury2/modules/TextNode.cpp 2010-05-18 20:01:48 UTC (rev 737)
+++ Mercury2/modules/TextNode.cpp 2010-05-18 20:14:49 UTC (rev 738)
@@ -249,7 +249,7 @@
float offset = m_fTextWidth - fEndOfLine;
offset/=2;
if( m_fTextWidth > BIG_NUMBER )
- offset = -fEndOfLine/2.;
+ offset = -fEndOfLine/2.0f;
for( unsigned j = iLineStart; j < i; j++ )
chars[j].xps += offset;
} else if( m_alignment == FIT_FULL )
Modified: Mercury2/src/DataTypes/MTriangle.cpp
===================================================================
--- Mercury2/src/DataTypes/MTriangle.cpp 2010-05-18 20:01:48 UTC (rev 737)
+++ Mercury2/src/DataTypes/MTriangle.cpp 2010-05-18 20:14:49 UTC (rev 738)
@@ -77,7 +77,7 @@
v[0] = m_verts[1] - m_verts[0];
v[1] = m_verts[2] - m_verts[0];
MercuryVector r( v[0].CrossProduct( v[1] ) );
- return r.Length() * 0.5;
+ return r.Length() * 0.5f;
}
bool MTriangle::operator == (const MTriangle& rhs) const
@@ -92,8 +92,8 @@
{
float minX, minY, minZ;
float maxX, maxY, maxZ;
- minX=minY=minZ = 9999999999999;
- maxX=maxY=maxZ = -9999999999999;
+ minX=minY=minZ = 9999999999999.0f;
+ maxX=maxY=maxZ = -9999999999999.0f;
for (uint8_t i = 0; i<3; ++i)
{
@@ -109,7 +109,7 @@
MercuryVertex center( (maxX+minX)/2.0f, (maxY+minY)/2.0f, (maxZ+minZ)/2.0f );
//extends
- MercuryVertex extend( (maxX-minX)/2.0, (maxY-minY)/2.0, (maxZ-minZ)/2.0 );
+ MercuryVertex extend( (maxX-minX)/2.0f, (maxY-minY)/2.0f, (maxZ-minZ)/2.0f );
return BoundingBox(center, extend);
}
Modified: Mercury2/src/MercuryInput.cpp
===================================================================
--- Mercury2/src/MercuryInput.cpp 2010-05-18 20:01:48 UTC (rev 737)
+++ Mercury2/src/MercuryInput.cpp 2010-05-18 20:14:49 UTC (rev 738)
@@ -26,8 +26,8 @@
mi->buttons.motion = bMotionEvent;
currentButtonMasks = buttons;
- GlobalMouseX_Set.Set( dx );
- GlobalMouseY_Set.Set( dy );
+ GlobalMouseX_Set.Set( (float)dx );
+ GlobalMouseY_Set.Set( (float)dy );
GlobalMouseB_Set.Set( currentButtonMasks.data );
POST_MESSAGE( INPUTEVENT_MOUSE, mi, 0 );
Modified: Mercury2/src/MercurySound.cpp
===================================================================
--- Mercury2/src/MercurySound.cpp 2010-05-18 20:01:48 UTC (rev 737)
+++ Mercury2/src/MercurySound.cpp 2010-05-18 20:14:49 UTC (rev 738)
@@ -134,7 +134,7 @@
//XXX: CONSIDER MUTEXING THIS AREA, AND USING THE SAME MUTEX IN SampleHoldCalcand Attac/Detach sound.
float ftd = m_tLastTrip.Touch();
- iLastCountDifference = ftd * fSPS;
+ iLastCountDifference = int(ftd * fSPS);
for( int j = 0; j < iCount * iChannels; ++j )
cBufferToFill[j] = 0;
Modified: Mercury2/src/MercurySound.h
===================================================================
--- Mercury2/src/MercurySound.h 2010-05-18 20:01:48 UTC (rev 737)
+++ Mercury2/src/MercurySound.h 2010-05-18 20:14:49 UTC (rev 738)
@@ -71,7 +71,7 @@
//Useful tools
inline float GetSecondsSinceLastFrame() { float tr = m_tLastTrip.Age(); return (tr>1.f)?1.f:tr; }
- inline unsigned int SamplesSinceLastFrame() { float tr = m_tLastTrip.Age(); return (unsigned int)(tr>1.)?fSPS:(tr*fSPS); }
+ inline unsigned int SamplesSinceLastFrame() { float tr = m_tLastTrip.Age(); return (unsigned int)((tr>1.)?fSPS:(tr*fSPS)); }
//For registering and creation of new sound sources...
MAutoPtr< MercurySoundSource > LoadSoundSource( const MString & sSourceType, MAutoPtr< MercurySoundSource > Chain = 0 );
Modified: Mercury2/src/MercuryValue.cpp
===================================================================
--- Mercury2/src/MercuryValue.cpp 2010-05-18 20:01:48 UTC (rev 737)
+++ Mercury2/src/MercuryValue.cpp 2010-05-18 20:14:49 UTC (rev 738)
@@ -74,8 +74,8 @@
{
switch( m_CurType )
{
- case TYPE_INT: return (int)m_Data.l;
- case TYPE_FLOAT: return m_Data.f;
+ case TYPE_INT: return m_Data.l;
+ case TYPE_FLOAT: return (int)m_Data.f;
case TYPE_STRING: return StrToInt(*m_Data.dataS);
default: return 0;
}
Modified: Mercury2/src/Quad.cpp
===================================================================
--- Mercury2/src/Quad.cpp 2010-05-18 20:01:48 UTC (rev 737)
+++ Mercury2/src/Quad.cpp 2010-05-18 20:14:49 UTC (rev 738)
@@ -89,19 +89,19 @@
//UV oriented so 0,0 is lower left and 1,0 upper right.
//this makes it so FBO images render correctly right out of the buffer, no flip needed
- m_vertexData[i++] = 0; m_vertexData[i++] = (m_bFlipV)?0:1;
- m_vertexData[i++] = 0; m_vertexData[i++] = 0; m_vertexData[i++] = -1.0;
+ m_vertexData[i++] = 0; m_vertexData[i++] = (m_bFlipV)?0:1.0f;
+ m_vertexData[i++] = 0; m_vertexData[i++] = 0; m_vertexData[i++] = -1.0f;
m_vertexData[i++] = lX; m_vertexData[i++] = lY; m_vertexData[i++] = zp;
- m_vertexData[i++] = 1; m_vertexData[i++] = (m_bFlipV)?0:1;
- m_vertexData[i++] = 0; m_vertexData[i++] = 0; m_vertexData[i++] = -1.0;
+ m_vertexData[i++] = 1; m_vertexData[i++] = (m_bFlipV)?0:1.0f;
+ m_vertexData[i++] = 0; m_vertexData[i++] = 0; m_vertexData[i++] = -1.0f;
m_vertexData[i++] = hX; m_vertexData[i++] = lY; m_vertexData[i++] = zp;
- m_vertexData[i++] = 1; m_vertexData[i++] = (m_bFlipV)?1:0;
- m_vertexData[i++] = 0; m_vertexData[i++] = 0; m_vertexData[i++] = -1.0;
+ m_vertexData[i++] = 1; m_vertexData[i++] = (m_bFlipV)?1.0f:0;
+ m_vertexData[i++] = 0; m_vertexData[i++] = 0; m_vertexData[i++] = -1.0f;
m_vertexData[i++] = hX; m_vertexData[i++] = hY; m_vertexData[i++] = zp;
- m_vertexData[i++] = 0; m_vertexData[i++] = (m_bFlipV)?1:0;
+ m_vertexData[i++] = 0; m_vertexData[i++] = (m_bFlipV)?1.0f:0;
m_vertexData[i++] = 0; m_vertexData[i++] = 0; m_vertexData[i++] = -1.0;
m_vertexData[i++] = lX; m_vertexData[i++] = hY; m_vertexData[i++] = zp;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|