Further miscellaneous warning-squashing.

This was SVN commit r260.
This commit is contained in:
MarkT 2004-05-24 21:01:50 +00:00
parent d63248d276
commit 011bd189ea
6 changed files with 23 additions and 18 deletions

View File

@ -38,7 +38,7 @@ public:
// Extended properties table
std::hash_map<CStr,CGenericProperty,CStr_hash_compare> m_properties;
STL_HASH_MAP<CStr,CGenericProperty,CStr_hash_compare> m_properties;
};
#endif

View File

@ -52,7 +52,7 @@ void CBaseEntityCollection::addTemplate( CBaseEntity& temp )
CBaseEntity* CBaseEntityCollection::getTemplate( CStr name )
{
for( int t = 0; t < m_templates.size(); t++ )
for( u16 t = 0; t < m_templates.size(); t++ )
if( m_templates[t].m_name == name ) return( &( m_templates[t] ) );
return( NULL );
@ -60,7 +60,7 @@ CBaseEntity* CBaseEntityCollection::getTemplate( CStr name )
CBaseEntity* CBaseEntityCollection::getTemplateByActor( CObjectEntry* actor )
{
for( int t = 0; t < m_templates.size(); t++ )
for( u16 t = 0; t < m_templates.size(); t++ )
if( m_templates[t].m_actorObject == actor ) return( &( m_templates[t] ) );
return( NULL );

View File

@ -59,13 +59,13 @@ float CEntity::getExactGroundLevel( float x, float y )
x /= 4.0f;
y /= 4.0f;
int xi = floor( x );
int yi = floor( y );
int xi = (int)floor( x );
int yi = (int)floor( y );
float xf = x - (float)xi;
float yf = y - (float)yi;
u16* heightmap = g_Terrain.GetHeightMap();
u16 mapsize = g_Terrain.GetVerticesPerSide();
unsigned long mapsize = g_Terrain.GetVerticesPerSide();
float h00 = heightmap[yi*mapsize + xi];
float h01 = heightmap[yi*mapsize + xi + mapsize];
@ -189,7 +189,7 @@ void CEntity::dispatch( CMessage* msg )
while( !waypoints->empty() )
{
CEntityOrder patrol;
int id = rand() % waypoints->size();
size_t id = rand() % waypoints->size();
std::vector<HEntity>::iterator it = waypoints->begin();
it += id;
HEntity waypoint = *it;

View File

@ -54,7 +54,7 @@ public:
// Extended properties table
std::hash_map<CStr,CGenericProperty,CStr_hash_compare> m_properties;
STL_HASH_MAP<CStr,CGenericProperty,CStr_hash_compare> m_properties;
private:
CEntity( CBaseEntity* base, CVector3D position, float orientation );

View File

@ -18,16 +18,21 @@
#ifndef ENTITY_PROPERTIES_INCLUDED
#define ENTITY_PROPERTIES_INCLUDED
#if( defined( _MSC_VER ) && ( _MSC_VER >= 1300 ) )
#define STL_HASH_MAP stdext::hash_map
#else
#define STL_HASH_MAP std::hash_map
#endif //( defined( _MSC_VER ) && ( _MSC_VER >= 1300 ) )
#include "CStr.h"
#include "Vector3D.h"
#pragma warning(push)
#pragma warning(disable:4996)
#include <hash_map>
#pragma warning(pop)
class CGenericProperty
{
public:

View File

@ -84,7 +84,7 @@ void CParticleEmitter::Render()
void CParticleEmitter::Update()
{
float timeElapsed = get_time() - m_timeOfLastFrame;
double timeElapsed = get_time() - m_timeOfLastFrame;
// update existing particles
vector<CParticle *>::iterator itor = m_particles.begin();
@ -105,12 +105,12 @@ void CParticleEmitter::Update()
++itor;
}
float secondsPerEmit = 1 / (m_minParticles / m_minLifetime);
double secondsPerEmit = 1 / (m_minParticles / m_minLifetime);
if (m_timeSinceLastEmit > secondsPerEmit)
{
int duration;
float duration;
CVector3D position, velocity;
float colour[4];
@ -119,7 +119,7 @@ void CParticleEmitter::Update()
CParticle * newParticle = new CParticle();
// calculate particle duration
duration = m_minLifetime;
duration = (float)m_minLifetime;
duration += (rand() % (int)((m_maxLifetime - m_minLifetime) * 1000.0f + 1)) / 1000.0f;
newParticle->m_duration = duration;
@ -168,7 +168,7 @@ void CParticleEmitter::Update()
m_timeSinceLastEmit = 0.0f;
}
else
m_timeSinceLastEmit += timeElapsed;
m_timeSinceLastEmit += (float)timeElapsed;
m_timeOfLastFrame = get_time();
}