This commit is contained in:
deve 2014-09-23 15:48:59 +02:00
commit 1fad8fd994
54 changed files with 183 additions and 150 deletions

View File

@ -3,7 +3,10 @@ project(SuperTuxKart)
set(PROJECT_VERSION "0.8.1")
cmake_minimum_required(VERSION 2.8.1)
cmake_policy(SET CMP0043 OLD)
if(NOT (CMAKE_MAJOR_VERSION VERSION_LESS 3))
cmake_policy(SET CMP0043 OLD)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
include(BuildTypeSTKRelease)

View File

@ -32,5 +32,4 @@
<screenshot>http://supertuxkart.sourceforge.net/persistent/images/1/1f/SuperTuxKart_0.8_screenshot4.jpg</screenshot>
</screenshots>
<updatecontact>supertuxkart-devel@lists.sourceforge.net</updatecontact>
-->
</application>

View File

@ -81,7 +81,7 @@ int getRAM()
int getNumProcessors()
{
#ifdef __linux__
return sysconf(_SC_NPROCESSORS_CONF);
return sysconf(_SC_NPROCESSORS_CONF);
#endif
#ifdef WIN32
SYSTEM_INFO si;
@ -89,13 +89,13 @@ int getNumProcessors()
return si.dwNumberOfProcessors;
#endif
#ifdef __APPLE__
// Mac OS X doesn't have sysconf(_SC_NPROCESSORS_CONF)
int mib[] = { CTL_HW, HW_NCPU };
int ncpus;
size_t len = sizeof(ncpus);
int ret = sysctl(mib, 2, &ncpus, &len, NULL, 0);
assert(ret != -1);
return ncpus;
// Mac OS X doesn't have sysconf(_SC_NPROCESSORS_CONF)
int mib[] = { CTL_HW, HW_NCPU };
int ncpus;
size_t len = sizeof(ncpus);
int ret = sysctl(mib, 2, &ncpus, &len, NULL, 0);
assert(ret != -1);
return ncpus;
#endif
Log::error("HW report",
"Number of processors not available for hardware report.");

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

@ -93,6 +93,15 @@ void Screen::init()
World::getWorld()->schedulePause(World::IN_GAME_MENU_PHASE);
} // init
// -----------------------------------------------------------------------------
/** Displays this screen bu pushing it onto the stack of screen
* in the state manager.
*/
void Screen::push()
{
StateManager::get()->pushScreen(this);
} // push
// -----------------------------------------------------------------------------
/** Prepares removal of this screen. If necessary this will unpause the
* race (so this means that if you have several consecutive screens while

View File

@ -228,6 +228,10 @@ namespace GUIEngine
*/
virtual void init();
/** Displays this screen bu pushing it onto the stack of screen
* in the state manager. */
void push();
/**
* \brief Callback invoked before leaving this menu.
*

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

@ -1300,16 +1300,16 @@ int main(int argc, char *argv[] )
if(PlayerManager::getCurrentPlayer() && !
UserConfigParams::m_always_show_login_screen)
{
StateManager::get()->pushScreen(MainMenuScreen::getInstance());
MainMenuScreen::getInstance()->push();
}
else
{
StateManager::get()->pushScreen(UserScreen::getInstance());
UserScreen::getInstance()->push();
// If there is no player, push the RegisterScreen on top of
// the login screen. This way on first start players are
// forced to create a player.
if(PlayerManager::get()->getNumPlayers()==0)
StateManager::get()->pushScreen(RegisterScreen::getInstance());
RegisterScreen::getInstance()->push();
}
#ifdef ENABLE_WIIUSE
// Show a dialog to allow connection of wiimotes. */

View File

@ -408,7 +408,7 @@ void CutsceneWorld::enterRaceOverState()
GUIEngine::Screen* newStack[] = { mainMenu, credits, NULL };
race_manager->exitRace();
StateManager::get()->resetAndSetStack(newStack);
StateManager::get()->pushScreen(credits);
credits->push();
}
// TODO: remove hardcoded knowledge of cutscenes, replace with scripting probably
else if (m_parts.size() == 1 && m_parts[0] == "gpwin")
@ -525,7 +525,7 @@ void CutsceneWorld::enterRaceOverState()
KartSelectionScreen* s = OfflineKartSelectionScreen::getInstance();
s->setMultiplayer(false);
s->setGoToOverworldNext();
StateManager::get()->pushScreen( s );
s->push();
}
}
// TODO: remove hardcoded knowledge of cutscenes, replace with scripting probably

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

@ -548,7 +548,7 @@ void World::terminateRace()
results->clearHighscores();
}
StateManager::get()->pushScreen(results);
results->push();
WorldStatus::terminateRace();
} // terminateRace
@ -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

@ -245,7 +245,7 @@ void ClientLobbyRoomProtocol::update()
case KART_SELECTION:
{
NetworkKartSelectionScreen* screen = NetworkKartSelectionScreen::getInstance();
StateManager::get()->pushScreen(screen);
screen->push();
m_state = SELECTING_KARTS;
}
break;

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

@ -12,7 +12,6 @@
#include "network/protocols/synchronization_protocol.hpp"
#include "online/online_profile.hpp"
#include "race/race_manager.hpp"
#include "states_screens/state_manager.hpp"
#include "states_screens/kart_selection.hpp"
#include "states_screens/network_kart_selection.hpp"
#include "utils/log.hpp"
@ -159,7 +158,7 @@ void StartGameProtocol::update()
KartSelectionScreen* s = KartSelectionScreen::getInstance();
s->setMultiplayer(false);
s->setFromOverworld(false);
StateManager::get()->pushScreen( s );*/
s->push();*/
}
else if (m_state == SYNCHRONIZATION_WAIT)
{

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() );
@ -692,14 +692,14 @@ void RaceManager::exitRace(bool delete_world)
{
race_manager->startSingleRace("gpwin", 999, false);
GrandPrixWin* scene = GrandPrixWin::getInstance();
StateManager::get()->pushScreen(scene);
scene->push();
scene->setKarts(winners);
}
else
{
race_manager->startSingleRace("gplose", 999, false);
GrandPrixLose* scene = GrandPrixLose::getInstance();
StateManager::get()->pushScreen(scene);
scene->push();
if (humanLosers.size() >= 1)
{
@ -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

@ -167,7 +167,7 @@ void ArenasScreen::eventCallback(Widget* widget, const std::string& name, const
if (clicked_track != NULL)
{
TrackInfoScreen::getInstance()->setTrack(clicked_track);
StateManager::get()->pushScreen(TrackInfoScreen::getInstance());
TrackInfoScreen::getInstance()->push();
}
}
@ -184,7 +184,7 @@ void ArenasScreen::eventCallback(Widget* widget, const std::string& name, const
if (clicked_track != NULL)
{
TrackInfoScreen::getInstance()->setTrack(clicked_track);
StateManager::get()->pushScreen(TrackInfoScreen::getInstance());
TrackInfoScreen::getInstance()->push();
} // clickedTrack != NULL
} // if random_track

View File

@ -139,12 +139,12 @@ void NotificationDialog::onUpdate(float dt)
if(type == T_Friends)
{
ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId());
StateManager::get()->pushScreen(OnlineProfileFriends::getInstance());
OnlineProfileFriends::getInstance()->push();
}
else if (type == T_Achievements)
{
ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId());
StateManager::get()->pushScreen(OnlineProfileAchievements::getInstance());
OnlineProfileAchievements::getInstance()->push();
}
}
return;

View File

@ -134,13 +134,13 @@ GUIEngine::EventPropagation
else if (selection == "help")
{
dismiss();
StateManager::get()->pushScreen(HelpScreen1::getInstance());
HelpScreen1::getInstance()->push();
return GUIEngine::EVENT_BLOCK;
}
else if (selection == "options")
{
dismiss();
StateManager::get()->pushScreen(OptionsScreenVideo::getInstance());
OptionsScreenVideo::getInstance()->push();
return GUIEngine::EVENT_BLOCK;
}
else if (selection == "restart")

View File

@ -64,7 +64,7 @@ ServerInfoDialog::ServerInfoDialog(uint32_t server_id, uint32_t host_id, bool fr
assert(m_cancel_widget != NULL);
m_options_widget->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
}
} // ServerInfoDialog
// -----------------------------------------------------------------------------
ServerInfoDialog::~ServerInfoDialog()
@ -72,7 +72,8 @@ ServerInfoDialog::~ServerInfoDialog()
if (m_server_join_request)
delete m_server_join_request;
m_server_join_request = NULL;
}
} // ~ServerInfoDialog
// -----------------------------------------------------------------------------
void ServerInfoDialog::requestJoin()
{
@ -81,9 +82,9 @@ void ServerInfoDialog::requestJoin()
Online::ServersManager::get()->setJoinedServer(m_server_id);
ProtocolManager::getInstance()->requestStart(new ConnectToServer(m_server_id, m_host_id));
ModalDialog::dismiss();
StateManager::get()->pushScreen(NetworkingLobby::getInstance());
NetworkingLobby::getInstance()->push();
//Online::CurrentUser::release();
}
} // requestJoin
// -----------------------------------------------------------------------------
GUIEngine::EventPropagation ServerInfoDialog::processEvent(const std::string& eventSource)
@ -104,7 +105,7 @@ GUIEngine::EventPropagation ServerInfoDialog::processEvent(const std::string& ev
}
}
return GUIEngine::EVENT_LET;
}
} // processEvent
// -----------------------------------------------------------------------------
@ -116,7 +117,7 @@ void ServerInfoDialog::onEnterPressedInternal()
if (GUIEngine::isFocusedForPlayer(m_options_widget, playerID))
return;
requestJoin();
}
} // onEnterPressedInternal
// -----------------------------------------------------------------------------
@ -125,7 +126,7 @@ bool ServerInfoDialog::onEscapePressed()
if (m_cancel_widget->isActivated())
m_self_destroy = true;
return false;
}
} // onEscapePressed
// -----------------------------------------------------------------------------
@ -166,7 +167,7 @@ void ServerInfoDialog::onUpdate(float dt)
if (m_from_server_creation)
StateManager::get()->popMenu();
if (m_enter_lobby)
StateManager::get()->pushScreen(NetworkingLobby::getInstance());
NetworkingLobby::getInstance()->push();
return;
}
}
} // onUpdate

View File

@ -86,7 +86,7 @@ void EasterEggScreen::eventCallback(Widget* widget, const std::string& name, con
if (clicked_track != NULL)
{
TrackInfoScreen::getInstance()->setTrack(clicked_track);
StateManager::get()->pushScreen(TrackInfoScreen::getInstance());
TrackInfoScreen::getInstance()->push();
}
}
@ -100,7 +100,7 @@ void EasterEggScreen::eventCallback(Widget* widget, const std::string& name, con
if (clicked_track != NULL)
{
TrackInfoScreen::getInstance()->setTrack(clicked_track);
StateManager::get()->pushScreen(TrackInfoScreen::getInstance());
TrackInfoScreen::getInstance()->push();
}
}
}
@ -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

@ -113,7 +113,7 @@ void EditGPScreen::eventCallback(GUIEngine::Widget* widget, const std::string& n
assert(edit != NULL);
//By default, 3 laps and no reversing
edit->setSelection(NULL, 3, false);
StateManager::get()->pushScreen(edit);
edit->push();
}
else if (m_action == "remove")
{
@ -301,7 +301,7 @@ void EditGPScreen::edit()
m_gp->getTrackId(m_selected)),
m_gp->getLaps((unsigned int)m_selected),
m_gp->getReverse((unsigned int)m_selected));
StateManager::get()->pushScreen(edit_screen);
edit_screen->push();
}
}

View File

@ -197,7 +197,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)
{
@ -313,7 +313,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]);
@ -248,7 +248,7 @@ void GrandPrixEditorScreen::showEditScreen(GrandPrixData* gp)
assert(gp != NULL);
EditGPScreen* edit = EditGPScreen::getInstance();
edit->setSelectedGP(gp);
StateManager::get()->pushScreen(edit);
edit->push();
}
// -----------------------------------------------------------------------------

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);
@ -1887,7 +1887,7 @@ void KartSelectionScreen::allPlayersDone()
}
else
{
StateManager::get()->pushScreen( RaceSetupScreen::getInstance() );
RaceSetupScreen::getInstance()->push();
}
} // allPlayersDone
@ -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

@ -251,7 +251,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
race_manager->setNumLocalPlayers(0);
race_manager->startSingleRace("gpwin", 999, false);
GrandPrixWin* scene = GrandPrixWin::getInstance();
StateManager::get()->pushScreen(scene);
scene->push();
const std::string winners[] = { "elephpant", "nolok", "pidgin" };
scene->setKarts(winners);
}
@ -264,7 +264,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
race_manager->setNumLocalPlayers(0);
race_manager->startSingleRace("gplose", 999, false);
GrandPrixLose* scene = GrandPrixLose::getInstance();
StateManager::get()->pushScreen(scene);
scene->push();
std::vector<std::string> losers;
losers.push_back("nolok");
losers.push_back("elephpant");
@ -305,7 +305,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
L"You unlocked <actual text would go here...>"
);
scene->addUnlockedTrack(track_manager->getTrack("lighthouse"));
StateManager::get()->pushScreen(scene);
scene->push();
}
else if (selection == "test_unlocked2")
{
@ -325,7 +325,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
scene->addUnlockedPictures(textures, 4.0, 3.0, L"You unlocked <actual text would go here...>");
StateManager::get()->pushScreen(scene);
scene->push();
}
}
else
@ -335,18 +335,18 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
KartSelectionScreen* s = OfflineKartSelectionScreen::getInstance(); //FIXME : that was for tests
s->setMultiplayer(false);
s->setFromOverworld(false);
StateManager::get()->pushScreen( s );
s->push();
}
else if (selection == "multiplayer")
{
KartSelectionScreen* s = OfflineKartSelectionScreen::getInstance();
s->setMultiplayer(true);
s->setFromOverworld(false);
StateManager::get()->pushScreen( s );
s->push();
}
else if (selection == "options")
{
StateManager::get()->pushScreen( OptionsScreenVideo::getInstance() );
OptionsScreenVideo::getInstance()->push();
}
else if (selection == "quit")
{
@ -355,11 +355,11 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
}
else if (selection == "about")
{
StateManager::get()->pushScreen(CreditsScreen::getInstance());
CreditsScreen::getInstance()->push();
}
else if (selection == "help")
{
StateManager::get()->pushScreen(HelpScreen1::getInstance());
HelpScreen1::getInstance()->push();
}
else if (selection == "startTutorial")
{
@ -440,11 +440,12 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
return;
}
if (PlayerManager::getCurrentOnlineId())
StateManager::get()->pushScreen(OnlineScreen::getInstance());
{
OnlineScreen::getInstance()->push();
}
else
{
BaseUserScreen *login = UserScreen::getInstance();
StateManager::get()->pushScreen(login);
UserScreen::getInstance()->push();
}
}
else if (selection == "addons")
@ -460,11 +461,11 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
"\"Allow STK to connect to the Internet\"."));
return;
}
StateManager::get()->pushScreen(AddonsScreen::getInstance());
AddonsScreen::getInstance()->push();
}
else if (selection == "gpEditor")
{
StateManager::get()->pushScreen(GrandPrixEditorScreen::getInstance());
GrandPrixEditorScreen::getInstance()->push();
}
} // eventCallback

View File

@ -198,7 +198,7 @@ void OnlineScreen::doQuickPlay()
if (join_request->isSuccess())
{
delete join_request;
StateManager::get()->pushScreen(NetworkingLobby::getInstance());
NetworkingLobby::getInstance()->push();
ConnectToServer *cts = new ConnectToServer(server->getServerId(),
server->getHostId());
ProtocolManager::getInstance()->requestStart(cts);
@ -233,15 +233,15 @@ void OnlineScreen::eventCallback(Widget* widget, const std::string& name,
else if (selection == m_profile_widget->m_properties[PROP_ID])
{
ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId());
StateManager::get()->pushScreen(OnlineProfileOverview::getInstance());
OnlineProfileOverview::getInstance()->push();
}
else if (selection == m_find_server_widget->m_properties[PROP_ID])
{
StateManager::get()->pushScreen(ServerSelection::getInstance());
ServerSelection::getInstance()->push();
}
else if (selection == m_create_server_widget->m_properties[PROP_ID])
{
StateManager::get()->pushScreen(CreateServerScreen::getInstance());
CreateServerScreen::getInstance()->push();
}
else if (selection == m_quick_play_widget->m_properties[PROP_ID])
{

View File

@ -295,7 +295,7 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con
UserConfigParams::m_language = selection.c_str();
user_config->saveConfig();
GUIEngine::getStateManager()->pushScreen(OptionsScreenUI::getInstance());
OptionsScreenUI::getInstance()->push();
}
} // eventCallback

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)
@ -289,7 +289,7 @@ void RaceResultGUI::eventCallback(GUIEngine::Widget* widget,
scene->addTrophy(race_manager->getDifficulty());
scene->findWhatWasUnlocked(race_manager->getDifficulty());
StateManager::get()->pushScreen(scene);
scene->push();
race_manager->setAIKartOverride("");
std::vector<std::string> parts;

View File

@ -76,13 +76,13 @@ void RaceSetupScreen::eventCallback(Widget* widget, const std::string& name, con
{
race_manager->setMinorMode(RaceManager::MINOR_MODE_NORMAL_RACE);
UserConfigParams::m_game_mode = CONFIG_CODE_NORMAL;
StateManager::get()->pushScreen( TracksScreen::getInstance() );
TracksScreen::getInstance()->push();
}
else if (selectedMode == IDENT_TTRIAL)
{
race_manager->setMinorMode(RaceManager::MINOR_MODE_TIME_TRIAL);
UserConfigParams::m_game_mode = CONFIG_CODE_TIMETRIAL;
StateManager::get()->pushScreen( TracksScreen::getInstance() );
TracksScreen::getInstance()->push();
}
else if (selectedMode == IDENT_FTL)
{
@ -92,21 +92,21 @@ void RaceSetupScreen::eventCallback(Widget* widget, const std::string& name, con
race_manager->setMinorMode(RaceManager::MINOR_MODE_FOLLOW_LEADER);
UserConfigParams::m_game_mode = CONFIG_CODE_FTL;
StateManager::get()->pushScreen( TracksScreen::getInstance() );
TracksScreen::getInstance()->push();
}
else if (selectedMode == IDENT_STRIKES)
{
race_manager->setMinorMode(RaceManager::MINOR_MODE_3_STRIKES);
UserConfigParams::m_game_mode = CONFIG_CODE_3STRIKES;
race_manager->setNumKarts( race_manager->getNumLocalPlayers() ); // no AI karts;
StateManager::get()->pushScreen( ArenasScreen::getInstance() );
ArenasScreen::getInstance()->push();
}
else if (selectedMode == IDENT_EASTER)
{
race_manager->setMinorMode(RaceManager::MINOR_MODE_EASTER_EGG);
UserConfigParams::m_game_mode = CONFIG_CODE_EASTER;
race_manager->setNumKarts( race_manager->getNumLocalPlayers() ); // no AI karts;
StateManager::get()->pushScreen( EasterEggScreen::getInstance() );
EasterEggScreen::getInstance()->push();
}
else if (selectedMode == IDENT_SOCCER)
{
@ -115,9 +115,9 @@ void RaceSetupScreen::eventCallback(Widget* widget, const std::string& name, con
race_manager->setNumKarts( race_manager->getNumLocalPlayers() ); // no AI karts;
// 1 player -> no need to choose a team or determine when the match ends
if(race_manager->getNumLocalPlayers() <= 1)
StateManager::get()->pushScreen( ArenasScreen::getInstance() );
ArenasScreen::getInstance()->push();
else
StateManager::get()->pushScreen( SoccerSetupScreen::getInstance() );
SoccerSetupScreen::getInstance()->push();
}
else if (selectedMode == "locked")
{

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)
{
@ -383,7 +383,7 @@ void SoccerSetupScreen::onUpdate(float delta)
return;
}
m_schedule_continue = false;
StateManager::get()->pushScreen( ArenasScreen::getInstance() );
ArenasScreen::getInstance()->push();
}
} // onUPdate
@ -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]++;

View File

@ -81,7 +81,7 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name,
if (clicked_track)
{
TrackInfoScreen::getInstance()->setTrack(clicked_track);
StateManager::get()->pushScreen(TrackInfoScreen::getInstance());
TrackInfoScreen::getInstance()->push();
} // if clicked_track
} // selection=="random_track"
@ -98,7 +98,7 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name,
if (clicked_track)
{
TrackInfoScreen::getInstance()->setTrack(clicked_track);
StateManager::get()->pushScreen(TrackInfoScreen::getInstance());
TrackInfoScreen::getInstance()->push();
}
}
} // name=="tracks"
@ -117,7 +117,7 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name,
GPInfoScreen *gpis = GPInfoScreen::getInstance();
gpis->setGP( selection == "Random Grand Prix" ? "random"
: selection);
StateManager::get()->pushScreen(gpis);
gpis->push();
}
}
else if (name == "trackgroups")

View File

@ -273,7 +273,7 @@ void BaseUserScreen::eventCallback(Widget* widget,
} // button==ok
else if (button == "new_user")
{
StateManager::get()->pushScreen(RegisterScreen::getInstance());
RegisterScreen::getInstance()->push();
// Make sure the new user will have an empty online name field
// that can also be edited.
m_username_tb->setText("");
@ -292,7 +292,7 @@ void BaseUserScreen::eventCallback(Widget* widget,
{
PlayerProfile *cp = getSelectedPlayer();
RegisterScreen::getInstance()->setRename(cp);
StateManager::get()->pushScreen(RegisterScreen::getInstance());
RegisterScreen::getInstance()->push();
// Init will automatically be called, which
// refreshes the player list
}

View File

@ -26,6 +26,11 @@
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#elif defined(_MSC_VER) && _MSC_VER >= 1700
#include <stdint.h>
// We can't use the ifndef SOCKET_ERROR below in this case, since
// SOCKET_ERROR will be defined again in winsock2.h later
// - without the #ifdef guard then causing a compiler error.
#else
#include <stdint.h>
#ifndef SOCKET_ERROR