Tried to fix all 64-bit related compiler warnings triggered from files
in graphics.
This commit is contained in:
parent
5af4ea35a7
commit
f2138e062d
@ -74,13 +74,13 @@ template<typename T>
|
||||
void FillInstances_impl(const InstanceList& instance_list,
|
||||
T * instance_buffer,
|
||||
DrawElementsIndirectCommand *command_buffer,
|
||||
size_t &instance_buffer_offset,
|
||||
size_t &command_buffer_offset,
|
||||
size_t &poly_count)
|
||||
unsigned int &instance_buffer_offset,
|
||||
unsigned int &command_buffer_offset,
|
||||
unsigned int&poly_count)
|
||||
{
|
||||
// Should never be empty
|
||||
GLMesh *mesh = instance_list.m_mesh;
|
||||
size_t initial_offset = instance_buffer_offset;
|
||||
unsigned int initial_offset = instance_buffer_offset;
|
||||
|
||||
for (unsigned i = 0; i < instance_list.m_instance_settings.size(); i++)
|
||||
{
|
||||
@ -92,7 +92,7 @@ void FillInstances_impl(const InstanceList& instance_list,
|
||||
DrawElementsIndirectCommand &CurrentCommand = command_buffer[command_buffer_offset++];
|
||||
CurrentCommand.baseVertex = mesh->vaoBaseVertex;
|
||||
CurrentCommand.count = mesh->IndexCount;
|
||||
CurrentCommand.firstIndex = mesh->vaoOffset / 2;
|
||||
CurrentCommand.firstIndex = GLuint(mesh->vaoOffset / 2);
|
||||
CurrentCommand.baseInstance = initial_offset;
|
||||
CurrentCommand.instanceCount = instance_buffer_offset - initial_offset;
|
||||
|
||||
@ -153,12 +153,12 @@ protected:
|
||||
DrawElementsIndirectCommand *m_draw_indirect_cmd;
|
||||
|
||||
std::array<std::vector<GLMesh *>, N> m_meshes;
|
||||
std::array<size_t,N> m_offset;
|
||||
std::array<size_t,N> m_size;
|
||||
std::array<unsigned int,N> m_offset;
|
||||
std::array<unsigned int,N> m_size;
|
||||
|
||||
size_t m_poly_count;
|
||||
size_t m_instance_buffer_offset;
|
||||
size_t m_command_buffer_offset;
|
||||
unsigned int m_poly_count;
|
||||
unsigned int m_instance_buffer_offset;
|
||||
unsigned int m_command_buffer_offset;
|
||||
|
||||
void clearMeshes();
|
||||
void mapIndirectBuffer();
|
||||
@ -238,7 +238,7 @@ public:
|
||||
CommandBuffer();
|
||||
virtual ~CommandBuffer() { glDeleteBuffers(1, &m_draw_indirect_cmd_id); }
|
||||
|
||||
inline size_t getPolyCount() const {return m_poly_count;}
|
||||
inline unsigned int getPolyCount() const {return m_poly_count;}
|
||||
|
||||
inline void bind() const
|
||||
{
|
||||
|
@ -966,7 +966,7 @@ int32_t DrawCalls::getSkinningOffset() const
|
||||
{
|
||||
return std::accumulate(m_mesh_for_skinning.begin(),
|
||||
m_mesh_for_skinning.end(), 0, []
|
||||
(const size_t previous, const STKAnimatedMesh* m)
|
||||
(const unsigned int previous, const STKAnimatedMesh* m)
|
||||
{ return previous + m->getTotalJoints(); });
|
||||
} // getSkinningOffset
|
||||
#endif // !SERVER_ONLY
|
||||
|
@ -226,8 +226,8 @@ unsigned GPUTimer::elapsedTimeus()
|
||||
|
||||
FrameBuffer::FrameBuffer() {}
|
||||
|
||||
FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, size_t w, size_t h,
|
||||
bool layered)
|
||||
FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, unsigned int w,
|
||||
unsigned int h, bool layered)
|
||||
: fbolayer(0), RenderTargets(RTTs), DepthTexture(0),
|
||||
width(w), height(h)
|
||||
{
|
||||
@ -249,8 +249,8 @@ FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, size_t w, size_t h,
|
||||
assert(result == GL_FRAMEBUFFER_COMPLETE_EXT);
|
||||
}
|
||||
|
||||
FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, GLuint DS, size_t w,
|
||||
size_t h, bool layered)
|
||||
FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, GLuint DS, unsigned int w,
|
||||
unsigned int h, bool layered)
|
||||
: fbolayer(0), RenderTargets(RTTs), DepthTexture(DS), width(w),
|
||||
height(h)
|
||||
{
|
||||
|
@ -66,18 +66,18 @@ private:
|
||||
GLuint fbo, fbolayer;
|
||||
std::vector<GLuint> RenderTargets;
|
||||
GLuint DepthTexture;
|
||||
size_t width, height;
|
||||
unsigned int width, height;
|
||||
public:
|
||||
FrameBuffer();
|
||||
FrameBuffer(const std::vector <GLuint> &RTTs, size_t w, size_t h, bool layered = false);
|
||||
FrameBuffer(const std::vector <GLuint> &RTTs, GLuint DS, size_t w, size_t h, bool layered = false);
|
||||
FrameBuffer(const std::vector <GLuint> &RTTs, unsigned int w, unsigned int h, bool layered = false);
|
||||
FrameBuffer(const std::vector <GLuint> &RTTs, GLuint DS, unsigned int w, unsigned int h, bool layered = false);
|
||||
~FrameBuffer();
|
||||
void bind() const;
|
||||
void bindLayer(unsigned) const;
|
||||
const std::vector<GLuint> &getRTT() const { return RenderTargets; }
|
||||
GLuint getDepthTexture() const { assert(DepthTexture); return DepthTexture; }
|
||||
size_t getWidth() const { return width; }
|
||||
size_t getHeight() const { return height; }
|
||||
unsigned int getWidth() const { return width; }
|
||||
unsigned int getHeight() const { return height; }
|
||||
static void Blit(const FrameBuffer &Src, const FrameBuffer &Dst, GLbitfield mask = GL_COLOR_BUFFER_BIT, GLenum filter = GL_NEAREST);
|
||||
void BlitToDefault(size_t, size_t, size_t, size_t);
|
||||
|
||||
|
@ -243,7 +243,7 @@ public:
|
||||
/** If *this < other. */
|
||||
bool operator< (const Version &other) const
|
||||
{
|
||||
unsigned int min_n = std::min(m_version.size(), other.m_version.size());
|
||||
unsigned int min_n = (unsigned int)std::min(m_version.size(), other.m_version.size());
|
||||
for (unsigned int i = 0; i<min_n; i++)
|
||||
{
|
||||
if (m_version[i] > other.m_version[i]) return false;
|
||||
@ -258,7 +258,7 @@ public:
|
||||
/** If *this <= other. */
|
||||
bool operator<= (const Version &other) const
|
||||
{
|
||||
unsigned int min_n = std::min(m_version.size(), other.m_version.size());
|
||||
unsigned int min_n = (unsigned int)std::min(m_version.size(), other.m_version.size());
|
||||
for (unsigned int i = 0; i<min_n; i++)
|
||||
{
|
||||
if (m_version[i] > other.m_version[i]) return false;
|
||||
|
@ -998,7 +998,7 @@ void PostProcessing::renderGaussian3Blur(const FrameBuffer &in_fbo,
|
||||
// ----------------------------------------------------------------------------
|
||||
void PostProcessing::renderGaussian6BlurLayer(const FrameBuffer &in_fbo,
|
||||
const FrameBuffer &scalar_fbo,
|
||||
size_t layer, float sigma_h,
|
||||
unsigned int layer, float sigma_h,
|
||||
float sigma_v) const
|
||||
{
|
||||
#if !defined(USE_GLES2)
|
||||
|
@ -93,7 +93,7 @@ public:
|
||||
void renderHorizontalBlur(const FrameBuffer &in_fbo, const FrameBuffer &auxiliary) const;
|
||||
|
||||
void renderGaussian6BlurLayer(const FrameBuffer &in_fbo, const FrameBuffer &scalar_fbo,
|
||||
size_t layer, float sigmaH, float sigmaV) const;
|
||||
unsigned int layer, float sigmaH, float sigmaV) const;
|
||||
void renderGaussian17TapBlur(const FrameBuffer &in_fbo,
|
||||
const FrameBuffer &auxiliary,
|
||||
const FrameBuffer &linear_depth) const;
|
||||
|
@ -25,7 +25,9 @@
|
||||
#include "graphics/materials.hpp"
|
||||
#include "utils/log.hpp"
|
||||
|
||||
static GLuint generateRTT3D(GLenum target, size_t w, size_t h, size_t d, GLint internalFormat, GLint format, GLint type, unsigned mipmaplevel = 1)
|
||||
static GLuint generateRTT3D(GLenum target, unsigned int w, unsigned int h,
|
||||
unsigned int d, GLint internalFormat, GLint format,
|
||||
GLint type, unsigned mipmaplevel = 1)
|
||||
{
|
||||
GLuint result;
|
||||
glGenTextures(1, &result);
|
||||
@ -49,10 +51,10 @@ static GLuint generateRTT(const core::dimension2du &res, GLint internalFormat, G
|
||||
return result;
|
||||
}
|
||||
|
||||
RTT::RTT(size_t width, size_t height, float rtt_scale)
|
||||
RTT::RTT(unsigned int width, unsigned int height, float rtt_scale)
|
||||
{
|
||||
m_width = width * rtt_scale;
|
||||
m_height = height * rtt_scale;
|
||||
m_width = unsigned int(width * rtt_scale);
|
||||
m_height = unsigned int(height * rtt_scale);
|
||||
m_shadow_FBO = NULL;
|
||||
m_RH_FBO = NULL;
|
||||
m_RSM = NULL;
|
||||
|
@ -144,11 +144,11 @@ enum TypeRTT : unsigned int
|
||||
class RTT
|
||||
{
|
||||
public:
|
||||
RTT(size_t width, size_t height, float rtt_scale = 1.0f);
|
||||
RTT(unsigned int width, unsigned int height, float rtt_scale = 1.0f);
|
||||
~RTT();
|
||||
|
||||
size_t getWidth () const { return m_width ; }
|
||||
size_t getHeight() const { return m_height; }
|
||||
unsigned int getWidth () const { return m_width ; }
|
||||
unsigned int getHeight() const { return m_height; }
|
||||
|
||||
FrameBuffer &getShadowFrameBuffer() { return *m_shadow_FBO; }
|
||||
FrameBuffer &getRadianceHintFrameBuffer() { return *m_RH_FBO; }
|
||||
@ -165,8 +165,8 @@ private:
|
||||
std::vector<uint64_t> m_prefilled_handles;
|
||||
unsigned DepthStencilTexture;
|
||||
|
||||
size_t m_width;
|
||||
size_t m_height;
|
||||
unsigned int m_width;
|
||||
unsigned int m_height;
|
||||
|
||||
unsigned shadowColorTex, shadowDepthTex;
|
||||
unsigned RSM_Color, RSM_Normal, RSM_Depth;
|
||||
|
@ -197,7 +197,7 @@ void ShaderBasedRenderer::uploadLightingData() const
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void ShaderBasedRenderer::computeMatrixesAndCameras(scene::ICameraSceneNode *const camnode,
|
||||
size_t width, size_t height)
|
||||
unsigned int width, unsigned int height)
|
||||
{
|
||||
m_current_screen_size = core::vector2df((float)width, (float)height);
|
||||
m_shadow_matrices.computeMatrixesAndCameras(camnode, width, height,
|
||||
@ -665,8 +665,8 @@ ShaderBasedRenderer::~ShaderBasedRenderer()
|
||||
void ShaderBasedRenderer::onLoadWorld()
|
||||
{
|
||||
const core::recti &viewport = Camera::getCamera(0)->getViewport();
|
||||
size_t width = viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X;
|
||||
size_t height = viewport.LowerRightCorner.Y - viewport.UpperLeftCorner.Y;
|
||||
unsigned int width = viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X;
|
||||
unsigned int height = viewport.LowerRightCorner.Y - viewport.UpperLeftCorner.Y;
|
||||
RTT* rtts = new RTT(width, height, CVS->isDefferedEnabled() ?
|
||||
UserConfigParams::m_scale_rtts_factor : 1.0f);
|
||||
setRTT(rtts);
|
||||
|
@ -52,7 +52,7 @@ private:
|
||||
/** Static glowing things are loaded once per track.
|
||||
* Glowing items can appear ordisappear each frame */
|
||||
std::vector<GlowData> m_glowing;
|
||||
size_t m_nb_static_glowing;
|
||||
unsigned int m_nb_static_glowing;
|
||||
|
||||
void setOverrideMaterial();
|
||||
|
||||
@ -67,7 +67,7 @@ private:
|
||||
void uploadLightingData() const;
|
||||
|
||||
void computeMatrixesAndCameras(scene::ICameraSceneNode * const camnode,
|
||||
size_t width, size_t height);
|
||||
unsigned int width, unsigned int height);
|
||||
|
||||
void resetShadowCamNodes(){m_shadow_matrices.resetShadowCamNodes();}
|
||||
|
||||
|
@ -191,7 +191,7 @@ GLuint ShaderFilesManager::loadShader(const std::string &file, unsigned type)
|
||||
Log::info("ShaderFilesManager", "Compiling shader : %s", file.c_str());
|
||||
const std::string &source = code.str();
|
||||
char const *source_pointer = source.c_str();
|
||||
int len = source.size();
|
||||
int len = (int)source.size();
|
||||
glShaderSource(id, 1, &source_pointer, &len);
|
||||
glCompileShader(id);
|
||||
|
||||
|
@ -203,7 +203,7 @@ void Skybox::generateSpecularCubemap()
|
||||
{
|
||||
glGenTextures(1, &m_specular_probe);
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, m_specular_probe);
|
||||
size_t cubemap_size = 256;
|
||||
unsigned int cubemap_size = 256;
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
#if !defined(USE_GLES2)
|
||||
|
@ -95,7 +95,7 @@ namespace
|
||||
{
|
||||
v *= (1.0f/255.0f);
|
||||
if( v <= 0.04045f )
|
||||
v = v * (1.0f/12.92);
|
||||
v = v * (1.0f/12.92f);
|
||||
else
|
||||
v = pow( ( v + 0.055f ) * (1.0f/1.055f), 2.4f );
|
||||
return v;
|
||||
@ -233,7 +233,8 @@ namespace
|
||||
* \param sh_rgba The 6 cubemap faces (sRGB byte textures)
|
||||
* \param edge_size Size of the cubemap face
|
||||
*/
|
||||
void SphericalHarmonics::generateSphericalHarmonics(unsigned char *sh_rgba[6], size_t edge_size)
|
||||
void SphericalHarmonics::generateSphericalHarmonics(unsigned char *sh_rgba[6],
|
||||
unsigned int edge_size)
|
||||
{
|
||||
|
||||
#if SIMD_SSE2_SUPPORT
|
||||
@ -644,7 +645,7 @@ void SphericalHarmonics::printCoeff() {
|
||||
* \param Yml The sphericals harmonics functions values
|
||||
* \param[out] output The environment map texels values
|
||||
*/
|
||||
void SphericalHarmonics::unprojectSH(size_t width, size_t height,
|
||||
void SphericalHarmonics::unprojectSH(unsigned int width, unsigned int height,
|
||||
float *Y00[], float *Y1minus1[], float *Y10[],
|
||||
float *Y11[], float *Y2minus2[], float *Y2minus1[],
|
||||
float *Y20[], float *Y21[], float *Y22[],
|
||||
|
@ -49,7 +49,7 @@ private:
|
||||
/** The spherical harmonics coefficients */
|
||||
SHCoefficients *m_SH_coeff;
|
||||
|
||||
void generateSphericalHarmonics(unsigned char *sh_rgba[6], size_t edge_size);
|
||||
void generateSphericalHarmonics(unsigned char *sh_rgba[6], unsigned int edge_size);
|
||||
|
||||
public:
|
||||
SphericalHarmonics(const std::vector<irr::video::ITexture *> &spherical_harmonics_textures);
|
||||
@ -65,7 +65,7 @@ public:
|
||||
|
||||
void printCoeff();
|
||||
|
||||
void unprojectSH (size_t width, size_t height,
|
||||
void unprojectSH (unsigned int width, unsigned int height,
|
||||
float *Y00[], float *Y1minus1[], float *Y10[],
|
||||
float *Y11[], float *Y2minus2[], float *Y2minus1[],
|
||||
float * Y20[], float *Y21[], float *Y22[],
|
||||
|
@ -52,11 +52,11 @@ struct GLMesh
|
||||
video::ITexture *textures[8];
|
||||
GLenum PrimitiveType;
|
||||
GLenum IndexType;
|
||||
size_t IndexCount;
|
||||
size_t Stride;
|
||||
unsigned int IndexCount;
|
||||
unsigned int Stride;
|
||||
core::vector2df texture_trans;
|
||||
size_t vaoBaseVertex;
|
||||
size_t vaoOffset;
|
||||
unsigned int vaoBaseVertex;
|
||||
intptr_t vaoOffset;
|
||||
video::E_VERTEX_TYPE VAOType;
|
||||
uint64_t TextureHandles[8];
|
||||
scene::IMeshBuffer *mb;
|
||||
@ -72,7 +72,7 @@ GLMesh allocateMeshBuffer(scene::IMeshBuffer* mb,
|
||||
const std::string& debug_name,
|
||||
RenderInfo* render_info);
|
||||
void fillLocalBuffer(GLMesh &, scene::IMeshBuffer* mb);
|
||||
video::E_VERTEX_TYPE getVTXTYPEFromStride(size_t stride);
|
||||
video::E_VERTEX_TYPE getVTXTYPEFromStride(unsigned int stride);
|
||||
GLuint createVAO(GLuint vbo, GLuint idx, video::E_VERTEX_TYPE type);
|
||||
core::matrix4 computeMVP(const core::matrix4 &ModelViewProjectionMatrix);
|
||||
bool isObject(video::E_MATERIAL_TYPE type);
|
||||
|
@ -158,7 +158,7 @@ void STKMeshSceneNode::drawGlow(const GLMesh &mesh)
|
||||
|
||||
GLenum ptype = mesh.PrimitiveType;
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
unsigned int count = mesh.IndexCount;
|
||||
ColorizeShader::getInstance()->setUniforms(AbsoluteTransformation, video::SColorf(glowcolor.getRed() / 255.f, glowcolor.getGreen() / 255.f, glowcolor.getBlue() / 255.f));
|
||||
glDrawElementsBaseVertex(ptype, count, itype, (GLvoid *)mesh.vaoOffset, mesh.vaoBaseVertex);
|
||||
}
|
||||
@ -352,7 +352,7 @@ void STKMeshSceneNode::render()
|
||||
GLMesh &mesh = GLmeshes[i];
|
||||
GLenum ptype = mesh.PrimitiveType;
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
unsigned int count = mesh.IndexCount;
|
||||
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled())
|
||||
@ -392,7 +392,7 @@ void STKMeshSceneNode::render()
|
||||
GLMesh &mesh = GLmeshes[i];
|
||||
GLenum ptype = mesh.PrimitiveType;
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
unsigned int count = mesh.IndexCount;
|
||||
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled())
|
||||
@ -484,7 +484,7 @@ void STKMeshSceneNode::render()
|
||||
irr_driver->increaseObjectCount();
|
||||
GLenum ptype = mesh.PrimitiveType;
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
unsigned int count = mesh.IndexCount;
|
||||
|
||||
// This function is only called once per frame - thus no need for setters.
|
||||
const float fogmax = track->getFogMax();
|
||||
@ -531,7 +531,7 @@ void STKMeshSceneNode::render()
|
||||
GLMesh &mesh = GLmeshes[i];
|
||||
GLenum ptype = mesh.PrimitiveType;
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
unsigned int count = mesh.IndexCount;
|
||||
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled())
|
||||
|
@ -63,7 +63,7 @@ STKTexture::STKTexture(const std::string& path, TexConfig* tc, bool no_upload)
|
||||
} // STKTexture
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
STKTexture::STKTexture(uint8_t* data, const std::string& name, size_t size,
|
||||
STKTexture::STKTexture(uint8_t* data, const std::string& name, unsigned int size,
|
||||
bool single_channel, bool delete_ttl)
|
||||
: video::ITexture(name.c_str()), m_texture_handle(0),
|
||||
m_single_channel(single_channel), m_tex_config(NULL),
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
// ------------------------------------------------------------------------
|
||||
STKTexture(const std::string& path, TexConfig* tc, bool no_upload = false);
|
||||
// ------------------------------------------------------------------------
|
||||
STKTexture(uint8_t* data, const std::string& name, size_t size,
|
||||
STKTexture(uint8_t* data, const std::string& name, unsigned int size,
|
||||
bool single_channel = false, bool delete_ttl = false);
|
||||
// ------------------------------------------------------------------------
|
||||
STKTexture(video::IImage* img, const std::string& name);
|
||||
|
@ -83,7 +83,9 @@ VAOManager::~VAOManager()
|
||||
}
|
||||
|
||||
static void
|
||||
resizeBufferIfNecessary(size_t &lastIndex, size_t newLastIndex, size_t bufferSize, size_t stride, GLenum type, GLuint &id, void *&Pointer)
|
||||
resizeBufferIfNecessary(unsigned int &lastIndex, unsigned int newLastIndex,
|
||||
unsigned int bufferSize, unsigned int stride, GLenum type,
|
||||
GLuint &id, void *&Pointer)
|
||||
{
|
||||
if (newLastIndex * stride >= bufferSize)
|
||||
{
|
||||
@ -116,11 +118,14 @@ resizeBufferIfNecessary(size_t &lastIndex, size_t newLastIndex, size_t bufferSiz
|
||||
lastIndex = newLastIndex;
|
||||
}
|
||||
|
||||
void VAOManager::regenerateBuffer(enum VTXTYPE tp, size_t newlastvertex, size_t newlastindex)
|
||||
void VAOManager::regenerateBuffer(enum VTXTYPE tp, unsigned int newlastvertex,
|
||||
unsigned int newlastindex)
|
||||
{
|
||||
glBindVertexArray(0);
|
||||
resizeBufferIfNecessary(last_vertex[tp], newlastvertex, RealVBOSize[tp], getVertexPitch(tp), GL_ARRAY_BUFFER, vbo[tp], VBOPtr[tp]);
|
||||
resizeBufferIfNecessary(last_index[tp], newlastindex, RealIBOSize[tp], sizeof(u16), GL_ELEMENT_ARRAY_BUFFER, ibo[tp], IBOPtr[tp]);
|
||||
resizeBufferIfNecessary(last_vertex[tp], newlastvertex, RealVBOSize[tp],
|
||||
getVertexPitch(tp), GL_ARRAY_BUFFER, vbo[tp], VBOPtr[tp]);
|
||||
resizeBufferIfNecessary(last_index[tp], newlastindex, RealIBOSize[tp],
|
||||
sizeof(u16), GL_ELEMENT_ARRAY_BUFFER, ibo[tp], IBOPtr[tp]);
|
||||
}
|
||||
|
||||
void VAOManager::regenerateVAO(enum VTXTYPE tp)
|
||||
@ -265,7 +270,7 @@ void VAOManager::regenerateInstancedVAO()
|
||||
|
||||
}
|
||||
|
||||
size_t VAOManager::getVertexPitch(enum VTXTYPE tp) const
|
||||
unsigned int VAOManager::getVertexPitch(enum VTXTYPE tp) const
|
||||
{
|
||||
switch (tp)
|
||||
{
|
||||
@ -318,8 +323,8 @@ irr::video::E_VERTEX_TYPE VAOManager::getVertexType(enum VTXTYPE tp)
|
||||
|
||||
void VAOManager::append(scene::IMeshBuffer *mb, VTXTYPE tp)
|
||||
{
|
||||
size_t old_vtx_cnt = last_vertex[tp];
|
||||
size_t old_idx_cnt = last_index[tp];
|
||||
unsigned int old_vtx_cnt = last_vertex[tp];
|
||||
unsigned int old_idx_cnt = last_index[tp];
|
||||
|
||||
regenerateBuffer(tp, old_vtx_cnt + mb->getVertexCount(), old_idx_cnt + mb->getIndexCount());
|
||||
#if !defined(USE_GLES2)
|
||||
|
@ -194,16 +194,16 @@ class VAOManager : public Singleton<VAOManager>
|
||||
GLuint instance_vbo[InstanceTypeCount];
|
||||
void *Ptr[InstanceTypeCount];
|
||||
void *VBOPtr[VTXTYPE_COUNT], *IBOPtr[VTXTYPE_COUNT];
|
||||
size_t RealVBOSize[VTXTYPE_COUNT], RealIBOSize[VTXTYPE_COUNT];
|
||||
size_t last_vertex[VTXTYPE_COUNT], last_index[VTXTYPE_COUNT];
|
||||
unsigned int RealVBOSize[VTXTYPE_COUNT], RealIBOSize[VTXTYPE_COUNT];
|
||||
unsigned int last_vertex[VTXTYPE_COUNT], last_index[VTXTYPE_COUNT];
|
||||
std::unordered_map<irr::scene::IMeshBuffer*, unsigned> mappedBaseVertex[VTXTYPE_COUNT], mappedBaseIndex[VTXTYPE_COUNT];
|
||||
std::map<std::pair<irr::video::E_VERTEX_TYPE, InstanceType>, GLuint> InstanceVAO;
|
||||
|
||||
void cleanInstanceVAOs();
|
||||
void regenerateBuffer(enum VTXTYPE, size_t, size_t);
|
||||
void regenerateBuffer(enum VTXTYPE, unsigned int, unsigned int);
|
||||
void regenerateVAO(enum VTXTYPE);
|
||||
void regenerateInstancedVAO();
|
||||
size_t getVertexPitch(enum VTXTYPE) const;
|
||||
unsigned int getVertexPitch(enum VTXTYPE) const;
|
||||
VTXTYPE getVTXTYPE(irr::video::E_VERTEX_TYPE type);
|
||||
irr::video::E_VERTEX_TYPE getVertexType(enum VTXTYPE tp);
|
||||
void append(irr::scene::IMeshBuffer *, VTXTYPE tp);
|
||||
|
@ -108,8 +108,8 @@ void ScreenKeyboard::init()
|
||||
const core::dimension2d<u32>& frame_size = irr_driver->getFrameSize();
|
||||
|
||||
int margin = 15;
|
||||
int w = frame_size.Width * m_percent_width;
|
||||
int h = frame_size.Height * m_percent_height;
|
||||
int w = int(frame_size.Width * m_percent_width);
|
||||
int h = int(frame_size.Height * m_percent_height);
|
||||
int x = frame_size.Width/2 - w/2;
|
||||
int y = frame_size.Height - h - margin;
|
||||
|
||||
|
@ -318,7 +318,7 @@ void SpinnerWidget::addLabel(stringw label)
|
||||
{
|
||||
m_labels.push_back(label);
|
||||
m_min = 0;
|
||||
m_max = m_labels.size()-1;
|
||||
m_max = (int)m_labels.size()-1;
|
||||
|
||||
if (m_element != NULL) setValue(0);
|
||||
}
|
||||
|
@ -1034,7 +1034,7 @@ EventPropagation InputManager::input(const SEvent& event)
|
||||
else if (event.EventType == EET_TOUCH_INPUT_EVENT)
|
||||
{
|
||||
MultitouchDevice* device = m_device_manager->getMultitouchDevice();
|
||||
unsigned int id = event.TouchInput.ID;
|
||||
unsigned int id = (unsigned int)event.TouchInput.ID;
|
||||
|
||||
if (device != NULL && id < device->m_events.size())
|
||||
{
|
||||
|
@ -172,7 +172,7 @@ unsigned int RewindManager::findFirstIndex(float target_time) const
|
||||
#ifdef REWIND_SEARCH_STATS
|
||||
m_count_of_searches++;
|
||||
#endif
|
||||
int index = m_rewind_info.size()-1;
|
||||
int index = (int)m_rewind_info.size()-1;
|
||||
int index_last_state = -1;
|
||||
while(index>=0)
|
||||
{
|
||||
@ -294,7 +294,7 @@ void RewindManager::rewindTo(float rewind_time)
|
||||
|
||||
// Then undo the rewind infos going backwards in time
|
||||
// --------------------------------------------------
|
||||
for(int i=m_rewind_info.size()-1; i>=(int)index; i--)
|
||||
for(int i=(int)m_rewind_info.size()-1; i>=(int)index; i--)
|
||||
{
|
||||
m_rewind_info[i]->undo();
|
||||
|
||||
|
@ -108,7 +108,7 @@ namespace Scripting
|
||||
// Read the entire file
|
||||
std::string script;
|
||||
script.resize(len);
|
||||
int c = fread(&script[0], len, 1, f);
|
||||
size_t c = fread(&script[0], len, 1, f);
|
||||
fclose(f);
|
||||
if (c != 1)
|
||||
{
|
||||
|
@ -271,8 +271,8 @@ void RaceGUIMultitouch::drawMultitouchSteering(const AbstractKart* kart,
|
||||
float scale = UserConfigParams::m_multitouch_scale *
|
||||
(float)(irr_driver->getActualScreenSize().Height) / 720.0f;
|
||||
|
||||
m_race_gui->drawEnergyMeter(button->x + button->width * 1.15f,
|
||||
button->y + button->height * 1.35f,
|
||||
m_race_gui->drawEnergyMeter(int(button->x + button->width * 1.15f),
|
||||
int(button->y + button->height * 1.35f),
|
||||
kart, viewport,
|
||||
core::vector2df(scale, scale));
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ void RaceResultGUI::init()
|
||||
else
|
||||
{
|
||||
m_start_track = 0;
|
||||
m_end_track = tracks.size();
|
||||
m_end_track = (int)tracks.size();
|
||||
}
|
||||
} // init
|
||||
|
||||
@ -1340,7 +1340,7 @@ void RaceResultGUI::backToLobby()
|
||||
// ----------------------------------------------------------------------------
|
||||
void RaceResultGUI::cleanupGPProgress()
|
||||
{
|
||||
for (size_t i = 0; i < m_gp_progress_widgets.size(); i++)
|
||||
for (unsigned int i = 0; i < m_gp_progress_widgets.size(); i++)
|
||||
m_widgets.remove(m_gp_progress_widgets.get(i));
|
||||
m_gp_progress_widgets.clearAndDeleteAll();
|
||||
} // cleanupGPProgress
|
||||
|
@ -138,7 +138,7 @@ void DriveGraph::load(const std::string &quad_file_name,
|
||||
ai_ignore = true;
|
||||
}
|
||||
|
||||
createQuad(p0, p1, p2, p3, m_all_nodes.size(), invisible, ai_ignore,
|
||||
createQuad(p0, p1, p2, p3, (unsigned int)m_all_nodes.size(), invisible, ai_ignore,
|
||||
false/*is_arena*/, ignored);
|
||||
}
|
||||
delete quad;
|
||||
@ -154,8 +154,8 @@ void DriveGraph::load(const std::string &quad_file_name,
|
||||
|
||||
if (m_all_nodes.size() > 0)
|
||||
{
|
||||
m_lap_length = getNode(m_all_nodes.size()-1)->getDistanceFromStart()
|
||||
+ getNode(m_all_nodes.size()-1)->getDistanceToSuccessor(0);
|
||||
m_lap_length = getNode((int)m_all_nodes.size()-1)->getDistanceFromStart()
|
||||
+ getNode((int)m_all_nodes.size()-1)->getDistanceToSuccessor(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -233,7 +233,7 @@ void TrackManager::removeTrack(const std::string &ident)
|
||||
if (it == m_tracks.end())
|
||||
Log::fatal("TrackManager", "Cannot find track '%s' in map!!", ident.c_str());
|
||||
|
||||
int index = it - m_tracks.begin();
|
||||
int index = int(it - m_tracks.begin());
|
||||
|
||||
// Remove the track from all groups it belongs to
|
||||
Group2Indices &group_2_indices =
|
||||
|
@ -373,8 +373,8 @@ void TrackObject::onWorldReady()
|
||||
// There are arguments to pass to the function
|
||||
// TODO: For the moment we only support string arguments
|
||||
// TODO: this parsing could be improved
|
||||
unsigned first = m_visibility_condition.find("(");
|
||||
unsigned last = m_visibility_condition.find_last_of(")");
|
||||
unsigned first = (unsigned)m_visibility_condition.find("(");
|
||||
unsigned last = (unsigned)m_visibility_condition.find_last_of(")");
|
||||
std::string fn_name = m_visibility_condition.substr(0, first);
|
||||
std::string str_arguments = m_visibility_condition.substr(first + 1, last - first - 1);
|
||||
arguments = StringUtils::split(str_arguments, ',');
|
||||
@ -403,7 +403,7 @@ void TrackObject::onWorldReady()
|
||||
{
|
||||
ctx->SetArgObject(i, &arguments[i]);
|
||||
}
|
||||
ctx->SetArgObject(arguments.size(), self);
|
||||
ctx->SetArgObject((int)arguments.size(), self);
|
||||
},
|
||||
[&](asIScriptContext* ctx) { result = ctx->GetReturnByte(); });
|
||||
|
||||
|
@ -171,7 +171,7 @@ void Profiler::pushCpuMarker(const char* name, const video::SColor& color)
|
||||
ThreadInfo& ti = getThreadInfo();
|
||||
MarkerStack& markers_stack = ti.markers_stack[m_write_id];
|
||||
double start = getTimeMilliseconds() - m_time_last_sync;
|
||||
size_t layer = markers_stack.size();
|
||||
unsigned int layer = (unsigned int)markers_stack.size();
|
||||
|
||||
// Add to the stack of current markers
|
||||
markers_stack.push(Marker(start, -1.0, name, color, layer));
|
||||
|
@ -136,12 +136,13 @@ private:
|
||||
{
|
||||
double start; // Times of start and end, in milliseconds,
|
||||
double end; // relatively to the time of last synchronization
|
||||
size_t layer;
|
||||
unsigned int layer;
|
||||
|
||||
std::string name;
|
||||
video::SColor color;
|
||||
|
||||
Marker(double start, double end, const char* name="N/A", const video::SColor& color=video::SColor(), size_t layer=0)
|
||||
Marker(double start, double end, const char* name="N/A",
|
||||
const video::SColor& color=video::SColor(), unsigned int layer=0)
|
||||
: start(start), end(end), layer(layer), name(name), color(color)
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user