Removed more compiler warnings for 64 bit windows compilation.

This commit is contained in:
hiker 2014-09-23 16:23:22 +10:00
parent ad20635cce
commit c28728d903
33 changed files with 87 additions and 75 deletions

View File

@ -201,7 +201,7 @@ public:
LEAK_CHECK()
/** Returns the number of cameras used. */
static unsigned int getNumCameras() { return m_all_cameras.size(); }
static unsigned int getNumCameras() { return (unsigned int)m_all_cameras.size(); }
// ------------------------------------------------------------------------
/** Returns a camera. */
@ -223,7 +223,7 @@ public:
*/
static Camera* createCamera(AbstractKart* kart)
{
Camera *c = new Camera(m_all_cameras.size(), kart);
Camera *c = new Camera((int)m_all_cameras.size(), kart);
m_all_cameras.push_back(c);
return c;
} // createCamera

View File

@ -172,7 +172,7 @@ GLuint LoadShader(const char * file, unsigned type)
int InfoLogLength;
Log::info("GLWrap", "Compiling shader : %s", file);
char const * SourcePointer = Code.c_str();
int length = strlen(SourcePointer);
int length = (int)strlen(SourcePointer);
glShaderSource(Id, 1, &SourcePointer, &length);
glCompileShader(Id);
@ -366,16 +366,17 @@ FrameBuffer::~FrameBuffer()
void FrameBuffer::Bind()
{
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glViewport(0, 0, width, height);
glViewport(0, 0, (int)width, (int)height);
GLenum bufs[] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2 };
glDrawBuffers(RenderTargets.size(), bufs);
glDrawBuffers((int)RenderTargets.size(), bufs);
}
void FrameBuffer::Blit(const FrameBuffer &Src, FrameBuffer &Dst, GLbitfield mask, GLenum filter)
{
glBindFramebuffer(GL_READ_FRAMEBUFFER, Src.fbo);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, Dst.fbo);
glBlitFramebuffer(0, 0, Src.width, Src.height, 0, 0, Dst.width, Dst.height, mask, filter);
glBlitFramebuffer(0, 0, (int)Src.width, (int)Src.height, 0, 0,
(int)Dst.width, (int)Dst.height, mask, filter);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
@ -384,7 +385,7 @@ void FrameBuffer::BlitToDefault(size_t x0, size_t y0, size_t x1, size_t y1)
{
glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBlitFramebuffer(0, 0, width, height, x0, y0, x1, y1, GL_COLOR_BUFFER_BIT, GL_NEAREST);
glBlitFramebuffer(0, 0, (int)width, (int)height, (int)x0, (int)y0, (int)x1, (int)y1, GL_COLOR_BUFFER_BIT, GL_NEAREST);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
@ -583,7 +584,7 @@ void draw2DImageFromRTT(GLuint texture, size_t texture_w, size_t texture_h,
tex_width, tex_height,
tex_center_pos_x, tex_center_pos_y;
getSize(texture_w, texture_h, true,
getSize((int)texture_w, (int)texture_h, true,
destRect, sourceRect, width, height, center_pos_x, center_pos_y,
tex_width, tex_height, tex_center_pos_x, tex_center_pos_y);

View File

@ -77,8 +77,8 @@ void ParticleSystemProxy::setHeightmap(const std::vector<std::vector<float> > &h
{
track_x = f1, track_z = f2, track_x_len = f3, track_z_len = f4;
unsigned width = hm.size();
unsigned height = hm[0].size();
unsigned width = (unsigned)hm.size();
unsigned height = (unsigned)hm[0].size();
float *hm_array = new float[width * height];
for (unsigned i = 0; i < width; i++)
{

View File

@ -2505,7 +2505,7 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy,
void IrrDriver::clearLights()
{
u32 i;
const u32 max = m_lights.size();
const u32 max = (int)m_lights.size();
for (i = 0; i < max; i++)
{
m_lights[i]->drop();

View File

@ -78,7 +78,7 @@ int LODNode::getLevel()
scene::ICameraSceneNode* curr_cam = irr_driver->getSceneManager()->getActiveCamera();
Camera* camera = Camera::getActiveCamera();
if (camera == NULL)
return m_detail.size() - 1;
return (int)m_detail.size() - 1;
AbstractKart* kart = camera->getKart();
const Vec3 &pos = kart->getFrontXYZ();

View File

@ -352,7 +352,7 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
FullScreenShader::ComputeGaussian17TapHShader::getInstance()->SetTextureUnits({ in_fbo.getRTT()[0], irr_driver->getFBO(FBO_LINEAR_DEPTH).getRTT()[0] });
glBindImageTexture(FullScreenShader::ComputeGaussian17TapHShader::getInstance()->TU_dest, auxiliary.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_R16F);
FullScreenShader::ComputeGaussian17TapHShader::getInstance()->setUniforms(core::vector2df(inv_width, inv_height));
glDispatchCompute(in_fbo.getWidth() / 8 + 1, in_fbo.getHeight() / 8 + 1, 1);
glDispatchCompute((int)in_fbo.getWidth() / 8 + 1, (int)in_fbo.getHeight() / 8 + 1, 1);
}
}
if (irr_driver->hasARBComputeShaders())
@ -372,7 +372,7 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
FullScreenShader::ComputeGaussian17TapVShader::getInstance()->SetTextureUnits({ auxiliary.getRTT()[0], irr_driver->getFBO(FBO_LINEAR_DEPTH).getRTT()[0] });
glBindImageTexture(FullScreenShader::ComputeGaussian17TapVShader::getInstance()->TU_dest, in_fbo.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_R16F);
FullScreenShader::ComputeGaussian17TapVShader::getInstance()->setUniforms(core::vector2df(inv_width, inv_height));
glDispatchCompute(in_fbo.getWidth() / 8 + 1, in_fbo.getHeight() / 8 + 1, 1);
glDispatchCompute((int)in_fbo.getWidth() / 8 + 1, (int)in_fbo.getHeight() / 8 + 1, 1);
}
}
if (irr_driver->hasARBComputeShaders())

View File

@ -223,7 +223,7 @@ void IrrDriver::renderGLSL(float dt)
const float *tmp = vertex.data();
for (unsigned int i = 0; i < vertex.size(); i += 1024 * 6)
{
unsigned count = MIN2(vertex.size() - i, 1024 * 6);
unsigned count = MIN2((int)vertex.size() - i, 1024 * 6);
glBufferSubData(GL_ARRAY_BUFFER, 0, count * sizeof(float), &tmp[i]);
glDrawArrays(GL_LINES, 0, count / 3);
@ -842,7 +842,7 @@ void IrrDriver::renderGlow(std::vector<GlowData>& glows)
glClearColor(0, 0, 0, 0);
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
const u32 glowcount = glows.size();
const u32 glowcount = (int)glows.size();
ColorizeProvider * const cb = (ColorizeProvider *) m_shaders->m_callbacks[ES_COLORIZE];
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
@ -879,7 +879,7 @@ void IrrDriver::renderGlow(std::vector<GlowData>& glows)
{
glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT,
(const void*)(GlowPassCmd::getInstance()->Offset * sizeof(DrawElementsIndirectCommand)),
GlowPassCmd::getInstance()->Size,
(int)GlowPassCmd::getInstance()->Size,
sizeof(DrawElementsIndirectCommand));
}
}

View File

@ -271,7 +271,7 @@ void draw(const T *Shader, const GLMesh *mesh, uniforms... Args)
size_t count = mesh->IndexCount;
Shader->setUniforms(Args...);
glDrawElementsBaseVertex(ptype, count, itype, (GLvoid *)mesh->vaoOffset, mesh->vaoBaseVertex);
glDrawElementsBaseVertex(ptype, (int)count, itype, (GLvoid *)mesh->vaoOffset, (int)mesh->vaoBaseVertex);
}
template<int...List>
@ -371,7 +371,7 @@ void multidraw1stPass(Args...args)
T::InstancedFirstPassShader::getInstance()->setUniforms(args...);
glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT,
(const void*)(SolidPassCmd::getInstance()->Offset[T::MaterialType] * sizeof(DrawElementsIndirectCommand)),
SolidPassCmd::getInstance()->Size[T::MaterialType],
(int)SolidPassCmd::getInstance()->Size[T::MaterialType],
sizeof(DrawElementsIndirectCommand));
}
}
@ -495,8 +495,8 @@ void multidraw2ndPass(const std::vector<uint64_t> &Handles, Args... args)
T::InstancedSecondPassShader::getInstance()->setUniforms(args...);
glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT,
(const void*)(SolidPassCmd::getInstance()->Offset[T::MaterialType] * sizeof(DrawElementsIndirectCommand)),
SolidPassCmd::getInstance()->Size[T::MaterialType],
sizeof(DrawElementsIndirectCommand));
(int)SolidPassCmd::getInstance()->Size[T::MaterialType],
(int)sizeof(DrawElementsIndirectCommand));
}
}
@ -739,7 +739,8 @@ void IrrDriver::renderTransparent()
glUseProgram(MeshShader::DisplaceMaskShader::getInstance()->Program);
MeshShader::DisplaceMaskShader::getInstance()->setUniforms(AbsoluteTransformation);
glDrawElementsBaseVertex(ptype, count, itype, (GLvoid *)mesh.vaoOffset, mesh.vaoBaseVertex);
glDrawElementsBaseVertex(ptype, (int)count, itype,
(GLvoid *)mesh.vaoOffset, (int)mesh.vaoBaseVertex);
}
irr_driver->getFBO(FBO_DISPLACE).Bind();
@ -768,7 +769,7 @@ void IrrDriver::renderTransparent()
core::vector2df(cb->getDirX(), cb->getDirY()),
core::vector2df(cb->getDir2X(), cb->getDir2Y()));
glDrawElementsBaseVertex(ptype, count, itype, (GLvoid *)mesh.vaoOffset, mesh.vaoBaseVertex);
glDrawElementsBaseVertex(ptype, (int)count, itype, (GLvoid *)mesh.vaoOffset, (int)mesh.vaoBaseVertex);
}
irr_driver->getFBO(FBO_COLORS).Bind();
@ -787,7 +788,7 @@ void drawShadow(const T *Shader, unsigned cascade, const GLMesh *mesh, uniforms.
size_t count = mesh->IndexCount;
Shader->setUniforms(cascade, Args...);
glDrawElementsBaseVertex(ptype, count, itype, (GLvoid *)mesh->vaoOffset, mesh->vaoBaseVertex);
glDrawElementsBaseVertex(ptype, (int)count, itype, (GLvoid *)mesh->vaoOffset, (int)mesh->vaoBaseVertex);
}
template<int...List>
@ -871,7 +872,9 @@ static void multidrawShadow(unsigned i, Args ...args)
if (ShadowPassCmd::getInstance()->Size[i][Mat])
{
Shader::getInstance()->setUniforms(i, args...);
glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, (const void*)(ShadowPassCmd::getInstance()->Offset[i][Mat] * sizeof(DrawElementsIndirectCommand)), ShadowPassCmd::getInstance()->Size[i][Mat], sizeof(DrawElementsIndirectCommand));
glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT,
(const void*)(ShadowPassCmd::getInstance()->Offset[i][Mat] * sizeof(DrawElementsIndirectCommand)),
(int)ShadowPassCmd::getInstance()->Size[i][Mat], sizeof(DrawElementsIndirectCommand));
}
}
@ -1003,7 +1006,9 @@ void multidrawRSM(Args...args)
if (RSMPassCmd::getInstance()->Size[Mat])
{
Shader::getInstance()->setUniforms(args...);
glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, (const void*)(RSMPassCmd::getInstance()->Offset[Mat] * sizeof(DrawElementsIndirectCommand)), RSMPassCmd::getInstance()->Size[Mat], sizeof(DrawElementsIndirectCommand));
glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT,
(const void*)(RSMPassCmd::getInstance()->Offset[Mat] * sizeof(DrawElementsIndirectCommand)),
(int)RSMPassCmd::getInstance()->Size[Mat], sizeof(DrawElementsIndirectCommand));
}
}

View File

@ -57,7 +57,7 @@ static void renderPointLights(unsigned count)
unsigned IrrDriver::UpdateLightsInfo(scene::ICameraSceneNode * const camnode, float dt)
{
const u32 lightcount = m_lights.size();
const u32 lightcount = (u32)m_lights.size();
const core::vector3df &campos = camnode->getAbsolutePosition();
std::vector<LightNode *> BucketedLN[15];

View File

@ -79,7 +79,7 @@ struct UniformHelper
template<unsigned N = 0, typename... Args>
static void setUniformsHelper(const std::vector<GLuint> &uniforms, const std::vector<float> &v, Args... arg)
{
glUniform1fv(uniforms[N], v.size(), v.data());
glUniform1fv(uniforms[N], (int)v.size(), v.data());
setUniformsHelper<N + 1>(uniforms, arg...);
}

View File

@ -376,7 +376,7 @@ stringw SpinnerWidget::getStringValue() const
void SpinnerWidget::setValue(irr::core::stringw new_value)
{
const int size = m_labels.size();
const int size = (int)m_labels.size();
for (int n=0; n<size; n++)
{
if (m_labels[n] == new_value)

View File

@ -103,7 +103,9 @@ public:
int askUserToConnectWiimotes();
// ------------------------------------------------------------------------
/** Returns the number of wiimotes connected. */
unsigned int getNumberOfWiimotes() const {return m_wiimotes.size();}
unsigned int getNumberOfWiimotes() const {
return (unsigned int)m_wiimotes.size();
} // getNumberOfWiimotes
}; // class WiimoteManager

View File

@ -422,7 +422,9 @@ XMLNode *FileManager::createXMLTreeFromString(const std::string & content)
{
char *b = new char[content.size()];
memcpy(b, content.c_str(), content.size());
io::IReadFile * ireadfile = m_file_system->createMemoryReadFile(b, content.size(), "tempfile", true);
io::IReadFile * ireadfile =
m_file_system->createMemoryReadFile(b, (int)content.size(),
"tempfile", true);
io::IXMLReader * reader = m_file_system->createXMLReader(ireadfile);
XMLNode* node = new XMLNode(reader);
reader->drop();

View File

@ -390,7 +390,7 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim
// Enable rim lighting for the kart
irr_driver->applyObjectPassShader(lod_node, true);
std::vector<scene::ISceneNode*> &lodnodes = lod_node->getAllNodes();
const u32 max = lodnodes.size();
const u32 max = (u32)lodnodes.size();
for (u32 i = 0; i < max; i++)
{
irr_driver->applyObjectPassShader(lodnodes[i], true);

View File

@ -401,7 +401,7 @@ void SoccerWorld::moveKartAfterRescue(AbstractKart* kart)
/** Set position and team for the karts */
void SoccerWorld::initKartList()
{
const unsigned int kart_amount = m_karts.size();
const unsigned int kart_amount = (unsigned int)m_karts.size();
int team_karts_amount[NB_SOCCER_TEAMS];
memset(team_karts_amount, 0, sizeof(team_karts_amount));

View File

@ -88,7 +88,7 @@ void ThreeStrikesBattle::reset()
{
WorldWithRank::reset();
const unsigned int kart_amount = m_karts.size();
const unsigned int kart_amount = (unsigned int)m_karts.size();
for(unsigned int n=0; n<kart_amount; n++)
{

View File

@ -926,7 +926,7 @@ void World::update(float dt)
}
PROFILER_PUSH_CPU_MARKER("World::update (AI)", 0x40, 0x7F, 0x00);
const int kart_amount = m_karts.size();
const int kart_amount = (int)m_karts.size();
for (int i = 0 ; i < kart_amount; ++i)
{
// Update all karts that are not eliminated

View File

@ -65,7 +65,7 @@ class GameSetup
* \return A vector containing pointers on the players profiles.
*/
std::vector<NetworkPlayerProfile*> getPlayers() { return m_players; }
int getPlayerCount() { return m_players.size(); }
int getPlayerCount() { return (int)m_players.size(); }
/*! \brief Get a network player profile matching a universal id.
* \param id : Global id of the player (the one in the SQL database)
* \return The profile of the player matching the id.

View File

@ -98,13 +98,13 @@ class NetworkManager : public AbstractSingleton<NetworkManager>
virtual bool isConnectedTo(TransportAddress peer);
virtual bool isServer() = 0;
inline bool isClient() { return !isServer(); }
bool isPlayingOnline() { return m_playing_online; }
STKHost* getHost() { return m_localhost; }
std::vector<STKPeer*> getPeers() { return m_peers; }
unsigned int getPeerCount() { return m_peers.size(); }
TransportAddress getPublicAddress() { return m_public_address; }
GameSetup* getGameSetup() { return m_game_setup; }
inline bool isClient() { return !isServer(); }
bool isPlayingOnline() { return m_playing_online; }
STKHost* getHost() { return m_localhost; }
std::vector<STKPeer*> getPeers() { return m_peers; }
unsigned int getPeerCount() { return (int)m_peers.size(); }
TransportAddress getPublicAddress() { return m_public_address; }
GameSetup* getGameSetup() { return m_game_setup; }
protected:
NetworkManager();

View File

@ -154,7 +154,7 @@ class NetworkString
int size() const
{
return m_string.size();
return (int)m_string.size();
}
uint8_t* getBytes() { return &m_string[0]; };

View File

@ -357,7 +357,7 @@ void ProtocolManager::update()
{
// before updating, notice protocols that they have received events
pthread_mutex_lock(&m_events_mutex); // secure threads
int size = m_events_to_process.size();
int size = (int)m_events_to_process.size();
int offset = 0;
for (int i = 0; i < size; i++)
{
@ -383,7 +383,7 @@ void ProtocolManager::asynchronousUpdate()
{
// before updating, notice protocols that they have received information
pthread_mutex_lock(&m_events_mutex); // secure threads
int size = m_events_to_process.size();
int size = (int)m_events_to_process.size();
int offset = 0;
for (int i = 0; i < size; i++)
{
@ -435,7 +435,7 @@ void ProtocolManager::asynchronousUpdate()
int ProtocolManager::runningProtocolsCount()
{
return m_protocols.size();
return (int)m_protocols.size();
}
PROTOCOL_STATE ProtocolManager::getProtocolState(uint32_t id)

View File

@ -111,7 +111,7 @@ void GetPublicAddress::asynchronousUpdate()
std::vector<std::string> stun_servers = UserConfigParams::m_stun_servers;
RandomGenerator random_gen;
int rand_result = random_gen.get(stun_servers.size());
int rand_result = random_gen.get((int)stun_servers.size());
Log::verbose("GetPublicAddress", "Using STUN server %s",
stun_servers[rand_result].c_str());

View File

@ -147,8 +147,8 @@ namespace Online
assert(isPreparing());
std::string s = StringUtils::toString(value);
char *s1 = curl_easy_escape(m_curl_session, name.c_str(), name.size());
char *s2 = curl_easy_escape(m_curl_session, s.c_str(), s.size());
char *s1 = curl_easy_escape(m_curl_session, name.c_str(), (int)name.size());
char *s2 = curl_easy_escape(m_curl_session, s.c_str(), (int)s.size());
m_parameters.append(std::string(s1) + "=" + s2 + "&");
curl_free(s1);
curl_free(s2);

View File

@ -400,7 +400,7 @@ namespace Online
else if(to_notify.size() > 3)
{
message = _("%d friends are now online.",
to_notify.size());
(int)to_notify.size());
}
MessageQueue::add(MessageQueue::MT_FRIEND, message);
}

View File

@ -352,7 +352,7 @@ void RaceManager::startNew(bool from_overworld)
m_grand_prix.getId(),
m_difficulty,
m_num_karts,
m_player_karts.size());
(int)m_player_karts.size());
// Start the race with the appropriate track
// =========================================
@ -503,7 +503,7 @@ void RaceManager::next()
m_grand_prix.getId(),
m_difficulty,
m_num_karts,
m_player_karts.size());
(int)m_player_karts.size());
if(gp != NULL)
{
//if so addept it
@ -519,7 +519,7 @@ void RaceManager::next()
->getUniqueID(),
m_grand_prix.getId(),
m_difficulty,
m_player_karts.size(),
(int)m_player_karts.size(),
m_track_number,
m_kart_status
)
@ -639,7 +639,7 @@ void RaceManager::exitRace(bool delete_world)
m_grand_prix.getId(),
m_difficulty,
m_num_karts,
m_player_karts.size());
(int)m_player_karts.size());
if(gp != NULL) gp->remove();
}
StateManager::get()->resetAndGoToScreen( MainMenuScreen::getInstance() );
@ -816,7 +816,7 @@ void RaceManager::setupPlayerKartInfo()
std::sort(kart_info.begin(), kart_info.end());
// Set the player kart information
setNumPlayers(kart_info.size());
setNumPlayers((int)kart_info.size());
// Set the global player ID for each player
for(unsigned int i=0; i<kart_info.size(); i++)

View File

@ -130,7 +130,7 @@ void EasterEggScreen::beforeAddingWidget()
tabs->clearAllChildren();
const std::vector<std::string>& groups = track_manager->getAllTrackGroups();
const int group_amount = groups.size();
const int group_amount = (int)groups.size();
if (group_amount > 1)
{
@ -210,7 +210,7 @@ void EasterEggScreen::buildTrackList()
// Build track list
if (curr_group_name == ALL_TRACK_GROUPS_ID)
{
const int trackAmount = track_manager->getNumberOfTracks();
const int trackAmount = (int)track_manager->getNumberOfTracks();
for (int n=0; n<trackAmount; n++)
{
@ -240,7 +240,7 @@ void EasterEggScreen::buildTrackList()
else
{
const std::vector<int>& curr_group = track_manager->getTracksInGroup( curr_group_name );
const int trackAmount = curr_group.size();
const int trackAmount = (int)curr_group.size();
for (int n=0; n<trackAmount; n++)
{

View File

@ -195,7 +195,7 @@ void GPInfoScreen::init()
// was shown), adjust it:
int max_num_tracks = m_group_name=="all"
? track_manager->getNumberOfRaceTracks()
: track_manager->getTracksInGroup(m_group_name).size();
: (int)track_manager->getTracksInGroup(m_group_name).size();
m_num_tracks_spinner->setMax(max_num_tracks);
if(m_num_tracks_spinner->getValue() > max_num_tracks)
{
@ -310,7 +310,7 @@ void GPInfoScreen::eventCallback(Widget *, const std::string &name,
// can be bigger than the maximum. (Might be a TODO to fix this)
int max_num_tracks = m_group_name=="all"
? track_manager->getNumberOfRaceTracks()
: track_manager->getTracksInGroup(m_group_name).size();
: (int)track_manager->getTracksInGroup(m_group_name).size();
m_num_tracks_spinner->setMax(max_num_tracks);
if (m_num_tracks_spinner->getValue() > max_num_tracks)
m_num_tracks_spinner->setValue(max_num_tracks);

View File

@ -181,7 +181,7 @@ void GrandPrixEditorScreen::loadTrackList (const std::string& gpname)
const std::vector<std::string> tracks = gp->getTrackNames(true);
tracks_widget->clearItems();
tracks_widget->setItemCountHint(tracks.size());
tracks_widget->setItemCountHint((int)tracks.size());
for (unsigned int t = 0; t < tracks.size(); t++)
{
Track* curr = track_manager->getTrack(tracks[t]);

View File

@ -360,7 +360,7 @@ PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,
kart_model.getWheelGraphicsPosition(3) );
for(size_t i=0 ; i < kart_model.getSpeedWeightedObjectsCount() ; i++)
{
const SpeedWeightedObject& obj = kart_model.getSpeedWeightedObject(i);
const SpeedWeightedObject& obj = kart_model.getSpeedWeightedObject((int)i);
m_model_view->addModel(obj.m_model, obj.m_position);
}
m_model_view->setRotateContinuously( 35.0f );
@ -1601,7 +1601,7 @@ void KartSelectionScreen::updateKartWidgetModel(uint8_t widget_id,
kart_model.getWheelGraphicsPosition(3) );
for (size_t i = 0; i < kart_model.getSpeedWeightedObjectsCount(); i++)
{
const SpeedWeightedObject& obj = kart_model.getSpeedWeightedObject(i);
const SpeedWeightedObject& obj = kart_model.getSpeedWeightedObject((int)i);
w3->addModel(obj.m_model, obj.m_position);
}
w3->update(0);
@ -1989,7 +1989,7 @@ bool KartSelectionScreen::validateKartChoices()
// players than karts then just allow duplicates
DynamicRibbonWidget* w = getWidget<DynamicRibbonWidget>("karts");
assert( w != NULL );
const unsigned int availableKartCount = w->getItems().size();
const unsigned int availableKartCount = (unsigned int)w->getItems().size();
if (amount > availableKartCount) return true;
// Check everyone for duplicates

View File

@ -362,7 +362,8 @@ void RaceGUI::drawGlobalMiniMap()
}
else if (new_rtt_mini_map != NULL)
{
core::rect<s32> source(0, 0, new_rtt_mini_map->getWidth(), new_rtt_mini_map->getHeight());
core::rect<s32> source(0, 0, (int)new_rtt_mini_map->getWidth(),
(int)new_rtt_mini_map->getHeight());
draw2DImageFromRTT(new_rtt_mini_map->getRTT()[0],
new_rtt_mini_map->getWidth(), new_rtt_mini_map->getHeight(),
dest, source, NULL, video::SColor(127, 255, 255, 255), true);

View File

@ -337,7 +337,8 @@ void RaceGUIOverworld::drawGlobalMiniMap()
}
else if (new_rtt_mini_map != NULL)
{
core::rect<s32> source(0, 0, new_rtt_mini_map->getWidth(), new_rtt_mini_map->getHeight());
core::rect<s32> source(0, 0, (int)new_rtt_mini_map->getWidth(),
(int)new_rtt_mini_map->getHeight());
draw2DImageFromRTT(new_rtt_mini_map->getRTT()[0],
new_rtt_mini_map->getWidth(), new_rtt_mini_map->getHeight(),
dest, source, NULL, video::SColor(127, 255, 255, 255), true);

View File

@ -94,7 +94,7 @@ void RaceResultGUI::init()
// Calculate screenshot scrolling parameters
const std::vector<std::string> tracks =
race_manager->getGrandPrix().getTrackNames();
int n_tracks = tracks.size();
int n_tracks = (int)tracks.size();
int currentTrack = race_manager->getTrackNumber();
m_start_track = currentTrack;
if (n_tracks > m_max_tracks)

View File

@ -63,7 +63,7 @@ void SoccerSetupScreen::eventCallback(Widget* widget, const std::string& name,
if(name == "continue")
{
int nb_players = m_kart_view_info.size();
int nb_players = (int)m_kart_view_info.size();
if (getNumKartsInTeam(SOCCER_TEAM_RED) == 0 ||
getNumKartsInTeam(SOCCER_TEAM_BLUE) == 0)
@ -266,7 +266,7 @@ GUIEngine::EventPropagation SoccerSetupScreen::filterActions(PlayerAction action
ButtonWidget* bt_continue = getWidget<ButtonWidget>("continue");
GUIEngine::EventPropagation result = EVENT_LET;
SoccerTeam team_switch = SOCCER_TEAM_NONE;
int nb_players = m_kart_view_info.size();
int nb_players = (int)m_kart_view_info.size();
switch(action)
{
@ -373,7 +373,7 @@ GUIEngine::EventPropagation SoccerSetupScreen::filterActions(PlayerAction action
// -----------------------------------------------------------------------------
void SoccerSetupScreen::onUpdate(float delta)
{
int nb_players = m_kart_view_info.size();
int nb_players = (int)m_kart_view_info.size();
if(m_schedule_continue)
{
@ -391,7 +391,7 @@ void SoccerSetupScreen::onUpdate(float delta)
bool SoccerSetupScreen::areAllKartsConfirmed() const
{
bool all_confirmed = true;
int nb_players = m_kart_view_info.size();
int nb_players = (int)m_kart_view_info.size();
for(int i=0 ; i < nb_players ; i++)
{
if(!m_kart_view_info[i].confirmed)
@ -407,7 +407,7 @@ bool SoccerSetupScreen::areAllKartsConfirmed() const
int SoccerSetupScreen::getNumKartsInTeam(int team)
{
int karts_in_team = 0;
int nb_players = m_kart_view_info.size();
int nb_players = (int)m_kart_view_info.size();
for(int i=0 ; i < nb_players ; i++)
{
if(m_kart_view_info[i].team == team)
@ -420,7 +420,7 @@ int SoccerSetupScreen::getNumKartsInTeam(int team)
int SoccerSetupScreen::getNumConfirmedKarts()
{
int confirmed_karts = 0;
int nb_players = m_kart_view_info.size();
int nb_players = (int)m_kart_view_info.size();
for(int i=0 ; i < nb_players ; i++)
{
if(m_kart_view_info[i].confirmed == true)
@ -444,7 +444,7 @@ void SoccerSetupScreen::updateKartViewsLayout()
const int center_y = central_div->m_y + central_div->m_h/2;
// Count the number of karts per team
int nb_players = m_kart_view_info.size();
int nb_players = (int)m_kart_view_info.size();
int nb_karts_per_team[2] = {0,0};
for(int i=0 ; i < nb_players ; i++)
nb_karts_per_team[m_kart_view_info[i].team]++;