From c4bc9c5f2fba1290a060548569ec664e101b93f4 Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Mon, 14 Jan 2019 22:20:04 -0800 Subject: [PATCH] All non-3rdparty warnings cleared. --- kraken/KRAudioManager.cpp | 2 +- kraken/KRAudioSample.cpp | 14 +- kraken/KRAudioSample.h | 226 +++++++++++++-------------- kraken/KRBundle.cpp | 6 +- kraken/KRCamera.cpp | 24 +-- kraken/KRDSP_slow.cpp | 4 +- kraken/KRDataBlock.cpp | 4 +- kraken/KRLODGroup.cpp | 4 +- kraken/KRLight.cpp | 2 +- kraken/KRMaterial.cpp | 4 +- kraken/KRMeshCube.cpp | 2 +- kraken/KRMeshQuad.cpp | 2 +- kraken/KRMeshSphere.cpp | 6 +- kraken/KRParticleSystemNewtonian.cpp | 2 +- kraken/KRPointLight.cpp | 2 +- kraken/KRResource+obj.cpp | 4 +- kraken/KRShader.cpp | 12 +- kraken/KRTexture.cpp | 6 +- kraken/KRTextureAnimated.cpp | 12 +- kraken/KRTextureCube.cpp | 6 +- kraken/KRTextureKTX.cpp | 12 +- kraken/KRTexturePVR.cpp | 12 +- 22 files changed, 184 insertions(+), 184 deletions(-) diff --git a/kraken/KRAudioManager.cpp b/kraken/KRAudioManager.cpp index d7670f2..0c20ea3 100755 --- a/kraken/KRAudioManager.cpp +++ b/kraken/KRAudioManager.cpp @@ -309,7 +309,7 @@ void KRAudioManager::renderReverb() for(unordered_map::iterator zone_itr=m_reverb_zone_weights.begin(); zone_itr != m_reverb_zone_weights.end(); zone_itr++) { siren_reverb_zone_weight_info zi = (*zone_itr).second; if(zi.reverb_sample) { - int zone_sample_blocks = KRMIN(zi.reverb_sample->getFrameCount(), (int)(m_reverb_max_length * 44100.0f)) / KRENGINE_AUDIO_BLOCK_LENGTH + 1; + int zone_sample_blocks = KRMIN((int)zi.reverb_sample->getFrameCount(), (int)(m_reverb_max_length * 44100.0f)) / KRENGINE_AUDIO_BLOCK_LENGTH + 1; impulse_response_blocks = KRMAX(impulse_response_blocks, zone_sample_blocks); } } diff --git a/kraken/KRAudioSample.cpp b/kraken/KRAudioSample.cpp index 4c33828..ae87a5f 100755 --- a/kraken/KRAudioSample.cpp +++ b/kraken/KRAudioSample.cpp @@ -84,7 +84,7 @@ int KRAudioSample::getChannelCount() return m_channelsPerFrame; } -int KRAudioSample::getFrameCount() +__int64_t KRAudioSample::getFrameCount() { loadInfo(); //return (int)((__int64_t)m_totalFrames * (__int64_t)frame_rate / (__int64_t)m_frameRate); @@ -113,7 +113,7 @@ float KRAudioSample::sample(int frame_offset, int frame_rate, int channel) if(buffer_index >= m_bufferCount) { return 0.0f; // Past the end of the recording } else { - int buffer_offset = frame_offset - buffer_index * maxFramesPerBuffer; + __int64_t buffer_offset = frame_offset - buffer_index * maxFramesPerBuffer; KRAudioBuffer *buffer = getContext().getAudioManager()->getBuffer(*this, buffer_index); if(buffer == NULL) { @@ -132,12 +132,12 @@ void KRAudioSample::sample(__int64_t frame_offset, int frame_count, int channel, { loadInfo(); - m_last_frame_used = getContext().getAudioManager()->getAudioFrame(); + m_last_frame_used = (int)getContext().getAudioManager()->getAudioFrame(); if(loop) { int buffer_offset = 0; int frames_left = frame_count; - int sample_length = getFrameCount(); + int sample_length = (int)getFrameCount(); while(frames_left) { int next_frame = (int)(((__int64_t)frame_offset + (__int64_t)buffer_offset) % sample_length); if(next_frame + frames_left >= sample_length) { @@ -160,8 +160,8 @@ void KRAudioSample::sample(__int64_t frame_offset, int frame_count, int channel, // Range is entirely after the sample memset(buffer, 0, frame_count * sizeof(float)); } else { - int start_frame = frame_offset < 0 ? 0 : frame_offset; - int prefix_frames = frame_offset < 0 ? -frame_offset : 0; + int start_frame = (int)(frame_offset < 0 ? 0 : frame_offset); + int prefix_frames = (int)(frame_offset < 0 ? -frame_offset : 0); if(prefix_frames > 0) { // Prefix with padding of 0's memset(buffer, 0, prefix_frames * sizeof(float)); @@ -386,7 +386,7 @@ KRAudioBuffer *KRAudioSample::getBuffer(int index) void KRAudioSample::_endFrame() { const __int64_t AUDIO_SAMPLE_EXPIRY_FRAMES = 500; - long current_frame = getContext().getAudioManager()->getAudioFrame(); + __int64_t current_frame = getContext().getAudioManager()->getAudioFrame(); if(current_frame > m_last_frame_used + AUDIO_SAMPLE_EXPIRY_FRAMES) { closeFile(); } diff --git a/kraken/KRAudioSample.h b/kraken/KRAudioSample.h index 27bbd21..d8dc07a 100755 --- a/kraken/KRAudioSample.h +++ b/kraken/KRAudioSample.h @@ -1,113 +1,113 @@ -// -// KRAudioSample.h -// KREngine -// -// Copyright 2012 Kearwood Gilbert. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are -// permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list -// of conditions and the following disclaimer in the documentation and/or other materials -// provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// The views and conclusions contained in the software and documentation are those of the -// authors and should not be interpreted as representing official policies, either expressed -// or implied, of Kearwood Gilbert. -// - -#ifndef KRAUDIOSAMPLE_H -#define KRAUDIOSAMPLE_H - -#include "KREngine-common.h" -#include "KRContextObject.h" -#include "KRDataBlock.h" -#include "KRResource.h" - -class KRAudioBuffer; - -class KRAudioSample : public KRResource { - -public: - KRAudioSample(KRContext &context, std::string name, std::string extension); - KRAudioSample(KRContext &context, std::string name, std::string extension, KRDataBlock *data); - virtual ~KRAudioSample(); - - virtual std::string getExtension(); - - virtual bool save(KRDataBlock &data); - - float getDuration(); - KRAudioBuffer *getBuffer(int index); - int getBufferCount(); - - // Siren audio engine interface - int getChannelCount(); - int getFrameCount(); - float sample(int frame_offset, int frame_rate, int channel); - void sample(__int64_t frame_offset, int frame_count, int channel, float *buffer, float amplitude, bool loop); - - void _endFrame(); -private: - - long m_last_frame_used; - - std::string m_extension; - KRDataBlock *m_pData; - -#ifdef __APPLE__ - // Apple Audio Toolbox - AudioFileID m_audio_file_id; - ExtAudioFileRef m_fileRef; - - static OSStatus ReadProc( // AudioFile_ReadProc - void * inClientData, - SInt64 inPosition, - UInt32 requestCount, - void * buffer, - UInt32 * actualCount); - - static OSStatus WriteProc( // AudioFile_WriteProc - void * inClientData, - SInt64 inPosition, - UInt32 requestCount, - const void *buffer, - UInt32 * actualCount); - - static SInt64 GetSizeProc( // AudioFile_GetSizeProc - void * inClientData); - - - static OSStatus SetSizeProc( // AudioFile_SetSizeProc - void * inClientData, - SInt64 inSize); -#endif - - int m_bufferCount; - - __int64_t m_totalFrames; - int m_frameRate; - int m_bytesPerFrame; - int m_channelsPerFrame; - - void openFile(); - void closeFile(); - void loadInfo(); - - static void PopulateBuffer(KRAudioSample *sound, int index, void *data); -}; - -#endif /* defined(KRAUDIOSAMPLE_H) */ +// +// KRAudioSample.h +// KREngine +// +// Copyright 2012 Kearwood Gilbert. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and documentation are those of the +// authors and should not be interpreted as representing official policies, either expressed +// or implied, of Kearwood Gilbert. +// + +#ifndef KRAUDIOSAMPLE_H +#define KRAUDIOSAMPLE_H + +#include "KREngine-common.h" +#include "KRContextObject.h" +#include "KRDataBlock.h" +#include "KRResource.h" + +class KRAudioBuffer; + +class KRAudioSample : public KRResource { + +public: + KRAudioSample(KRContext &context, std::string name, std::string extension); + KRAudioSample(KRContext &context, std::string name, std::string extension, KRDataBlock *data); + virtual ~KRAudioSample(); + + virtual std::string getExtension(); + + virtual bool save(KRDataBlock &data); + + float getDuration(); + KRAudioBuffer *getBuffer(int index); + int getBufferCount(); + + // Siren audio engine interface + int getChannelCount(); + __int64_t getFrameCount(); + float sample(int frame_offset, int frame_rate, int channel); + void sample(__int64_t frame_offset, int frame_count, int channel, float *buffer, float amplitude, bool loop); + + void _endFrame(); +private: + + __int64_t m_last_frame_used; + + std::string m_extension; + KRDataBlock *m_pData; + +#ifdef __APPLE__ + // Apple Audio Toolbox + AudioFileID m_audio_file_id; + ExtAudioFileRef m_fileRef; + + static OSStatus ReadProc( // AudioFile_ReadProc + void * inClientData, + SInt64 inPosition, + UInt32 requestCount, + void * buffer, + UInt32 * actualCount); + + static OSStatus WriteProc( // AudioFile_WriteProc + void * inClientData, + SInt64 inPosition, + UInt32 requestCount, + const void *buffer, + UInt32 * actualCount); + + static SInt64 GetSizeProc( // AudioFile_GetSizeProc + void * inClientData); + + + static OSStatus SetSizeProc( // AudioFile_SetSizeProc + void * inClientData, + SInt64 inSize); +#endif + + int m_bufferCount; + + __int64_t m_totalFrames; + int m_frameRate; + int m_bytesPerFrame; + int m_channelsPerFrame; + + void openFile(); + void closeFile(); + void loadInfo(); + + static void PopulateBuffer(KRAudioSample *sound, int index, void *data); +}; + +#endif /* defined(KRAUDIOSAMPLE_H) */ diff --git a/kraken/KRBundle.cpp b/kraken/KRBundle.cpp index d152d77..996a9d2 100755 --- a/kraken/KRBundle.cpp +++ b/kraken/KRBundle.cpp @@ -54,14 +54,14 @@ KRBundle::KRBundle(KRContext &context, std::string name, KRDataBlock *pData) : K m_pData = pData; __int64_t file_pos = 0; - while(file_pos < m_pData->getSize()) { + while(file_pos < (__int64_t)m_pData->getSize()) { tar_header_type file_header; - m_pData->copy(&file_header, file_pos, sizeof(file_header)); + m_pData->copy(&file_header, (int)file_pos, sizeof(file_header)); size_t file_size = strtol(file_header.file_size, NULL, 8); file_pos += 512; // Skip past the header to the file contents if(file_header.file_name[0] != '\0' && file_header.file_name[0] != '.') { // We ignore the last two records in the tar file, which are zero'ed out tar_header structures - KRDataBlock *pFileData = pData->getSubBlock(file_pos, file_size); + KRDataBlock *pFileData = pData->getSubBlock((int)file_pos, (int)file_size); context.loadResource(file_header.file_name, pFileData); } file_pos += RoundUpSize(file_size); diff --git a/kraken/KRCamera.cpp b/kraken/KRCamera.cpp index 6e56c97..e359134 100755 --- a/kraken/KRCamera.cpp +++ b/kraken/KRCamera.cpp @@ -113,7 +113,7 @@ void KRCamera::renderFrame(GLint defaultFBO, GLint renderBufferWidth, GLint rend //Matrix4 viewMatrix = Matrix4::Invert(getModelMatrix()); - settings.setViewportSize(Vector2::Create(m_backingWidth, m_backingHeight)); + settings.setViewportSize(Vector2::Create((float)m_backingWidth, (float)m_backingHeight)); Matrix4 projectionMatrix; projectionMatrix.perspective(settings.perspective_fov, settings.m_viewportSize.x / settings.m_viewportSize.y, settings.perspective_nearz, settings.perspective_farz); m_viewport = KRViewport(settings.getViewportSize(), viewMatrix, projectionMatrix); @@ -132,7 +132,7 @@ void KRCamera::renderFrame(GLint defaultFBO, GLint renderBufferWidth, GLint rend GL_PUSH_GROUP_MARKER("Generate Shadowmaps"); scene.render(this, m_viewport.getVisibleBounds(), m_viewport, KRNode::RENDER_PASS_GENERATE_SHADOWMAPS, false /*settings.bEnableDeferredLighting*/); - GLDEBUG(glViewport(0, 0, m_viewport.getSize().x, m_viewport.getSize().y)); + GLDEBUG(glViewport(0, 0, (GLsizei)m_viewport.getSize().x, (GLsizei)m_viewport.getSize().y)); GL_POP_GROUP_MARKER; } @@ -184,7 +184,7 @@ void KRCamera::renderFrame(GLint defaultFBO, GLint renderBufferWidth, GLint rend // Set render target GLDEBUG(glBindFramebuffer(GL_FRAMEBUFFER, lightAccumulationBuffer)); GLDEBUG(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, compositeDepthTexture, 0)); - GLDEBUG(glViewport(0, 0, m_viewport.getSize().x * m_downsample.x, m_viewport.getSize().y * m_downsample.y)); + GLDEBUG(glViewport(0, 0, (GLsizei)(m_viewport.getSize().x * m_downsample.x), (GLsizei)(m_viewport.getSize().y * m_downsample.y))); GLDEBUG(glClearColor(0.0f, 0.0f, 0.0f, 0.0f)); GLDEBUG(glClear(GL_COLOR_BUFFER_BIT)); @@ -251,7 +251,7 @@ void KRCamera::renderFrame(GLint defaultFBO, GLint renderBufferWidth, GLint rend // Set render target GLDEBUG(glBindFramebuffer(GL_FRAMEBUFFER, compositeFramebuffer)); GLDEBUG(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, compositeDepthTexture, 0)); - GLDEBUG(glViewport(0, 0, m_viewport.getSize().x * m_downsample.x, m_viewport.getSize().y * m_downsample.y)); + GLDEBUG(glViewport(0, 0, (GLsizei)(m_viewport.getSize().x * m_downsample.x), (GLsizei)(m_viewport.getSize().y * m_downsample.y))); // Disable alpha blending GLDEBUG(glDisable(GL_BLEND)); @@ -419,7 +419,7 @@ void KRCamera::renderFrame(GLint defaultFBO, GLint renderBufferWidth, GLint rend GL_PUSH_GROUP_MARKER("Volumetric Lighting"); - KRViewport volumetricLightingViewport = KRViewport(Vector2::Create(volumetricBufferWidth, volumetricBufferHeight), m_viewport.getViewMatrix(), m_viewport.getProjectionMatrix()); + KRViewport volumetricLightingViewport = KRViewport(Vector2::Create((float)volumetricBufferWidth, (float)volumetricBufferHeight), m_viewport.getViewMatrix(), m_viewport.getProjectionMatrix()); if(settings.volumetric_environment_downsample != 0) { // Set render target @@ -431,7 +431,7 @@ void KRCamera::renderFrame(GLint defaultFBO, GLint renderBufferWidth, GLint rend GLDEBUG(glDisable(GL_DEPTH_TEST)); m_pContext->getTextureManager()->selectTexture(GL_TEXTURE_2D, 0, compositeDepthTexture); - GLDEBUG(glViewport(0, 0, volumetricLightingViewport.getSize().x, volumetricLightingViewport.getSize().y)); + GLDEBUG(glViewport(0, 0, (GLsizei)volumetricLightingViewport.getSize().x, (GLsizei)volumetricLightingViewport.getSize().y)); } else { // Enable z-buffer test GLDEBUG(glEnable(GL_DEPTH_TEST)); @@ -446,7 +446,7 @@ void KRCamera::renderFrame(GLint defaultFBO, GLint renderBufferWidth, GLint rend GLDEBUG(glBindFramebuffer(GL_FRAMEBUFFER, compositeFramebuffer)); GLDEBUG(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, compositeDepthTexture, 0)); - GLDEBUG(glViewport(0, 0, m_viewport.getSize().x, m_viewport.getSize().y)); + GLDEBUG(glViewport(0, 0, (GLsizei)m_viewport.getSize().x, (GLsizei)m_viewport.getSize().y)); } GL_POP_GROUP_MARKER; @@ -690,7 +690,7 @@ void KRCamera::renderPost() */ - GLDEBUG(glViewport(0, 0, m_viewport.getSize().x, m_viewport.getSize().y)); + GLDEBUG(glViewport(0, 0, (GLsizei)m_viewport.getSize().x, (GLsizei)m_viewport.getSize().y)); GLDEBUG(glDisable(GL_DEPTH_TEST)); KRShader *postShader = m_pContext->getShaderManager()->getShader("PostShader", this, std::vector(), std::vector(), std::vector(), 0, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, KRNode::RENDER_PASS_FORWARD_TRANSPARENT); @@ -809,7 +809,7 @@ void KRCamera::renderPost() int iTexRow = 15 - (iChar - iTexCol) / 16; Vector2 top_left_pos = Vector2::Create(-1.0f + dScaleX * iCol, dScaleY * iRow - 1.0f); - Vector2 bottom_right_pos = Vector2::Create(-1.0 + dScaleX * (iCol + 1), dScaleY * iRow + dScaleY - 1.0f); + Vector2 bottom_right_pos = Vector2::Create(-1.0f + dScaleX * (iCol + 1), dScaleY * iRow + dScaleY - 1.0f); top_left_pos += Vector2::Create(1.0f / 2048.0f * 0.5f, 1.0f / 1536.0f * 0.5f); bottom_right_pos += Vector2::Create(1.0f / 2048.0f * 0.5f, 1.0f / 1536.0f * 0.5f); Vector2 top_left_uv = Vector2::Create(dTexScale * iTexCol, dTexScale * iTexRow); @@ -967,13 +967,13 @@ std::string KRCamera::getDebugText() #endif // defined(__APPLE__) // ---- GPU Memory ---- - int texture_count_active = m_pContext->getTextureManager()->getActiveTextures().size(); - int texture_count = texture_count_active; + size_t texture_count_active = m_pContext->getTextureManager()->getActiveTextures().size(); + size_t texture_count = texture_count_active; long texture_mem_active = m_pContext->getTextureManager()->getMemActive(); long texture_mem_used = m_pContext->getTextureManager()->getMemUsed(); long texture_mem_throughput = m_pContext->getTextureManager()->getMemoryTransferedThisFrame(); - int vbo_count_active = m_pContext->getMeshManager()->getActiveVBOCount(); + size_t vbo_count_active = m_pContext->getMeshManager()->getActiveVBOCount(); long vbo_mem_active = m_pContext->getMeshManager()->getMemActive(); long vbo_mem_used = m_pContext->getMeshManager()->getMemUsed(); long vbo_mem_throughput = m_pContext->getMeshManager()->getMemoryTransferedThisFrame(); diff --git a/kraken/KRDSP_slow.cpp b/kraken/KRDSP_slow.cpp index 7ad01b5..22157a0 100644 --- a/kraken/KRDSP_slow.cpp +++ b/kraken/KRDSP_slow.cpp @@ -81,13 +81,13 @@ void FFTForward(const FFTWorkspace &workspace, SplitComplex *src, size_t count) assert((count & (count - 1)) == 0); unsigned int levels = 0; - while (1 << levels <= count) { + while (1 << levels <= (int)count) { levels++; } for (size_t i = 0; i < count; i++) { size_t j = 0; - for (int k = 0; k < levels; k++) { + for (int k = 0; k < (int)levels; k++) { j <<= 1; j |= ((i >> k) & 1); } diff --git a/kraken/KRDataBlock.cpp b/kraken/KRDataBlock.cpp index 5dd44e3..ae03868 100755 --- a/kraken/KRDataBlock.cpp +++ b/kraken/KRDataBlock.cpp @@ -140,7 +140,6 @@ bool KRDataBlock::load(const std::string &path) bool success = false; unload(); - struct stat statbuf; m_bReadOnly = true; #if defined(_WIN32) || defined(_WIN64) @@ -160,6 +159,7 @@ bool KRDataBlock::load(const std::string &path) if(m_fdPackFile >= 0) { m_fileOwnerDataBlock = this; m_fileName = KRResource::GetFileBase(path); + struct stat statbuf; if(fstat(m_fdPackFile, &statbuf) >= 0) { m_data_size = statbuf.st_size; m_data_offset = 0; @@ -269,7 +269,7 @@ void KRDataBlock::append(void *data, size_t size) { // Copy the entire data block to the destination pointer void KRDataBlock::copy(void *dest) { - copy(dest, 0, m_data_size); + copy(dest, 0, (int)m_data_size); } // Copy a range of data to the destination pointer diff --git a/kraken/KRLODGroup.cpp b/kraken/KRLODGroup.cpp index 2b635ff..c275b9a 100755 --- a/kraken/KRLODGroup.cpp +++ b/kraken/KRLODGroup.cpp @@ -121,12 +121,12 @@ KRNode::LodVisibility KRLODGroup::calcLODVisibility(const KRViewport &viewport) if(m_use_world_units) { Vector3 world_reference_point = localToWorld(local_reference_point); sqr_distance = (world_camera_position - world_reference_point).sqrMagnitude() * (lod_bias * lod_bias); - sqr_prestream_distance = getContext().KRENGINE_PRESTREAM_DISTANCE * getContext().KRENGINE_PRESTREAM_DISTANCE; + sqr_prestream_distance = (float)(getContext().KRENGINE_PRESTREAM_DISTANCE * getContext().KRENGINE_PRESTREAM_DISTANCE); } else { sqr_distance = (local_camera_position - local_reference_point).sqrMagnitude() * (lod_bias * lod_bias); Vector3 world_reference_point = localToWorld(local_reference_point); - sqr_prestream_distance = worldToLocal(Vector3::Normalize(world_reference_point - world_camera_position) * getContext().KRENGINE_PRESTREAM_DISTANCE).sqrMagnitude(); // TODO, FINDME - Optimize with precalc? + sqr_prestream_distance = worldToLocal(Vector3::Normalize(world_reference_point - world_camera_position) * (float)getContext().KRENGINE_PRESTREAM_DISTANCE).sqrMagnitude(); // TODO, FINDME - Optimize with precalc? } diff --git a/kraken/KRLight.cpp b/kraken/KRLight.cpp index 9242131..b35fc6d 100755 --- a/kraken/KRLight.cpp +++ b/kraken/KRLight.cpp @@ -384,7 +384,7 @@ void KRLight::allocateShadowBuffers(int cBuffers) { GLDEBUG(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_EXT, GL_COMPARE_REF_TO_TEXTURE_EXT)); // TODO - Detect GL_EXT_shadow_samplers and only activate if available GLDEBUG(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC_EXT, GL_LEQUAL)); // TODO - Detect GL_EXT_shadow_samplers and only activate if available #endif - GLDEBUG(glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, viewportSize.x, viewportSize.y, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL)); + GLDEBUG(glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, (GLsizei)viewportSize.x, (GLsizei)viewportSize.y, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL)); GLDEBUG(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, shadowDepthTexture[iShadow], 0)); } diff --git a/kraken/KRMaterial.cpp b/kraken/KRMaterial.cpp index 667e2be..a3742ff 100755 --- a/kraken/KRMaterial.cpp +++ b/kraken/KRMaterial.cpp @@ -319,7 +319,7 @@ bool KRMaterial::bind(KRCamera *pCamera, std::vector &point_ligh bool bAlphaTest = (m_alpha_mode == KRMATERIAL_ALPHA_MODE_TEST) && bDiffuseMap; bool bAlphaBlend = (m_alpha_mode == KRMATERIAL_ALPHA_MODE_BLENDONESIDE) || (m_alpha_mode == KRMATERIAL_ALPHA_MODE_BLENDTWOSIDE); - KRShader *pShader = getContext().getShaderManager()->getShader("ObjectShader", pCamera, point_lights, directional_lights, spot_lights, bones.size(), bDiffuseMap, bNormalMap, bSpecMap, bReflectionMap, bReflectionCubeMap, bLightMap, m_diffuseMapScale != default_scale && bDiffuseMap, m_specularMapScale != default_scale && bSpecMap, m_normalMapScale != default_scale && bNormalMap, m_reflectionMapScale != default_scale && bReflectionMap, m_diffuseMapOffset != default_offset && bDiffuseMap, m_specularMapOffset != default_offset && bSpecMap, m_normalMapOffset != default_offset && bNormalMap, m_reflectionMapOffset != default_offset && bReflectionMap, bAlphaTest, bAlphaBlend, renderPass, rim_power != 0.0f); + KRShader *pShader = getContext().getShaderManager()->getShader("ObjectShader", pCamera, point_lights, directional_lights, spot_lights, (int)bones.size(), bDiffuseMap, bNormalMap, bSpecMap, bReflectionMap, bReflectionCubeMap, bLightMap, m_diffuseMapScale != default_scale && bDiffuseMap, m_specularMapScale != default_scale && bSpecMap, m_normalMapScale != default_scale && bNormalMap, m_reflectionMapScale != default_scale && bReflectionMap, m_diffuseMapOffset != default_offset && bDiffuseMap, m_specularMapOffset != default_offset && bSpecMap, m_normalMapOffset != default_offset && bNormalMap, m_reflectionMapOffset != default_offset && bReflectionMap, bAlphaTest, bAlphaBlend, renderPass, rim_power != 0.0f); Vector4 fade_color; @@ -356,7 +356,7 @@ bool KRMaterial::bind(KRCamera *pCamera, std::vector &point_ligh } } if(pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_BONE_TRANSFORMS] != -1) { - glUniformMatrix4fv(pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_BONE_TRANSFORMS], bones.size(), GL_FALSE, bone_mats); + glUniformMatrix4fv(pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_BONE_TRANSFORMS], (GLsizei)bones.size(), GL_FALSE, bone_mats); } } diff --git a/kraken/KRMeshCube.cpp b/kraken/KRMeshCube.cpp index a4d936d..08597e0 100755 --- a/kraken/KRMeshCube.cpp +++ b/kraken/KRMeshCube.cpp @@ -55,7 +55,7 @@ KRMeshCube::KRMeshCube(KRContext &context) : KRMesh(context, "__cube") mi.submesh_starts.push_back(0); - mi.submesh_lengths.push_back(mi.vertices.size()); + mi.submesh_lengths.push_back((int)mi.vertices.size()); mi.material_names.push_back(""); mi.format = KRENGINE_MODEL_FORMAT_STRIP; diff --git a/kraken/KRMeshQuad.cpp b/kraken/KRMeshQuad.cpp index 024ca53..ac9a241 100755 --- a/kraken/KRMeshQuad.cpp +++ b/kraken/KRMeshQuad.cpp @@ -50,7 +50,7 @@ KRMeshQuad::KRMeshQuad(KRContext &context) : KRMesh(context, "__quad") mi.submesh_starts.push_back(0); - mi.submesh_lengths.push_back(mi.vertices.size()); + mi.submesh_lengths.push_back((int)mi.vertices.size()); mi.material_names.push_back(""); mi.format = KRENGINE_MODEL_FORMAT_STRIP; diff --git a/kraken/KRMeshSphere.cpp b/kraken/KRMeshSphere.cpp index 23aaef2..51c6621 100755 --- a/kraken/KRMeshSphere.cpp +++ b/kraken/KRMeshSphere.cpp @@ -42,7 +42,7 @@ KRMeshSphere::KRMeshSphere(KRContext &context) : KRMesh(context, "__sphere") // Based on algorithm from Paul Bourke: http://paulbourke.net/miscellaneous/sphere_cylinder/ int iterations = 3; - int facet_count = pow(4, iterations) * 8; + int facet_count = (int)(pow(4, iterations) * 8.0f); class Facet3 { public: @@ -74,7 +74,7 @@ KRMeshSphere::KRMeshSphere(KRContext &context) : KRMesh(context, "__sphere") int nt = 0,ntold; /* Create the level 0 object */ - a = 1 / sqrt(2.0); + a = 1.0f / sqrtf(2.0f); for (i=0;i<6;i++) { p[i].x *= a; p[i].y *= a; @@ -121,7 +121,7 @@ KRMeshSphere::KRMeshSphere(KRContext &context) : KRMesh(context, "__sphere") } mi.submesh_starts.push_back(0); - mi.submesh_lengths.push_back(mi.vertices.size()); + mi.submesh_lengths.push_back((int)mi.vertices.size()); mi.material_names.push_back(""); diff --git a/kraken/KRParticleSystemNewtonian.cpp b/kraken/KRParticleSystemNewtonian.cpp index 6e12046..daa5644 100755 --- a/kraken/KRParticleSystemNewtonian.cpp +++ b/kraken/KRParticleSystemNewtonian.cpp @@ -76,7 +76,7 @@ void KRParticleSystemNewtonian::render(KRCamera *pCamera, std::vectorgetShaderManager()->getShader("dust_particle", pCamera, point_lights, directional_lights, spot_lights, 0, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, renderPass); - Vector3 rim_color; Vector4 fade_color; + // Vector3 rim_color; Vector4 fade_color; if(getContext().getShaderManager()->selectShader(*pCamera, pParticleShader, viewport, getModelMatrix(), point_lights, directional_lights, spot_lights, 0, renderPass, Vector3::Zero(), 0.0f, Vector4::Zero())) { pParticleShader->setUniform(KRShader::KRENGINE_UNIFORM_FLARE_SIZE, 1.0f); diff --git a/kraken/KRPointLight.cpp b/kraken/KRPointLight.cpp index 55149f9..98a4bcf 100755 --- a/kraken/KRPointLight.cpp +++ b/kraken/KRPointLight.cpp @@ -127,7 +127,7 @@ void KRPointLight::generateMesh() { // Based on algorithm from Paul Bourke: http://paulbourke.net/miscellaneous/sphere_cylinder/ int iterations = 3; - int facet_count = pow(4, iterations) * 8; + int facet_count = (int)(pow(4, iterations) * 8); if(m_cVertices != facet_count * 3) { if(m_sphereVertices) { diff --git a/kraken/KRResource+obj.cpp b/kraken/KRResource+obj.cpp index 6842f53..93a3966 100755 --- a/kraken/KRResource+obj.cpp +++ b/kraken/KRResource+obj.cpp @@ -216,7 +216,7 @@ std::vector KRResource::LoadObj(KRContext &context, const std::str } else if(strcmp(szSymbol[0], "usemtl") == 0) { // Use Material (usemtl) if(pFace - pMaterialFaces > 1) { - *pMaterialFaces = pFace - pMaterialFaces - 1; + *pMaterialFaces = (int)(pFace - pMaterialFaces - 1); pMaterialFaces = pFace++; } } @@ -224,7 +224,7 @@ std::vector KRResource::LoadObj(KRContext &context, const std::str } - *pMaterialFaces = pFace - pMaterialFaces - 1; + *pMaterialFaces = (int)(pFace - pMaterialFaces - 1); *pFace++ = 0; diff --git a/kraken/KRShader.cpp b/kraken/KRShader.cpp index f070a4b..c06a375 100755 --- a/kraken/KRShader.cpp +++ b/kraken/KRShader.cpp @@ -246,7 +246,7 @@ void KRShader::setUniform(int location, float value) int value_index = m_uniform_value_index[location]; bool needs_update = true; if(value_index == -1) { - m_uniform_value_index[location] = m_uniform_value_float.size(); + m_uniform_value_index[location] = (int)m_uniform_value_float.size(); m_uniform_value_float.push_back(value); } else if(m_uniform_value_float[value_index] == value) { needs_update = false; @@ -264,7 +264,7 @@ void KRShader::setUniform(int location, int value) int value_index = m_uniform_value_index[location]; bool needs_update = true; if(value_index == -1) { - m_uniform_value_index[location] = m_uniform_value_int.size(); + m_uniform_value_index[location] = (int)m_uniform_value_int.size(); m_uniform_value_int.push_back(value); } else if(m_uniform_value_int[value_index] == value) { needs_update = false; @@ -283,7 +283,7 @@ void KRShader::setUniform(int location, const Vector2 &value) int value_index = m_uniform_value_index[location]; bool needs_update = true; if(value_index == -1) { - m_uniform_value_index[location] = m_uniform_value_vector2.size(); + m_uniform_value_index[location] = (int)m_uniform_value_vector2.size(); m_uniform_value_vector2.push_back(value); } else if(m_uniform_value_vector2[value_index] == value) { needs_update = false; @@ -301,7 +301,7 @@ void KRShader::setUniform(int location, const Vector3 &value) int value_index = m_uniform_value_index[location]; bool needs_update = true; if(value_index == -1) { - m_uniform_value_index[location] = m_uniform_value_vector3.size(); + m_uniform_value_index[location] = (int)m_uniform_value_vector3.size(); m_uniform_value_vector3.push_back(value); } else if(m_uniform_value_vector3[value_index] == value) { needs_update = false; @@ -319,7 +319,7 @@ void KRShader::setUniform(int location, const Vector4 &value) int value_index = m_uniform_value_index[location]; bool needs_update = true; if(value_index == -1) { - m_uniform_value_index[location] = m_uniform_value_vector4.size(); + m_uniform_value_index[location] = (int)m_uniform_value_vector4.size(); m_uniform_value_vector4.push_back(value); } else if(m_uniform_value_vector4[value_index] == value) { needs_update = false; @@ -338,7 +338,7 @@ void KRShader::setUniform(int location, const Matrix4 &value) int value_index = m_uniform_value_index[location]; bool needs_update = true; if(value_index == -1) { - m_uniform_value_index[location] = m_uniform_value_mat4.size(); + m_uniform_value_index[location] = (int)m_uniform_value_mat4.size(); m_uniform_value_mat4.push_back(value); } else if(m_uniform_value_mat4[value_index] == value) { needs_update = false; diff --git a/kraken/KRTexture.cpp b/kraken/KRTexture.cpp index 5c9570e..4520836 100755 --- a/kraken/KRTexture.cpp +++ b/kraken/KRTexture.cpp @@ -72,7 +72,7 @@ void KRTexture::resize(int max_dim) m_iNewHandle = 0; } else { int target_dim = max_dim; - if(target_dim < m_min_lod_max_dim) target_dim = m_min_lod_max_dim; + if(target_dim < (int)m_min_lod_max_dim) target_dim = m_min_lod_max_dim; if(m_new_lod_max_dim != target_dim || (m_iHandle == 0 && m_iNewHandle == 0)) { assert(m_newTextureMemUsed == 0); @@ -116,9 +116,9 @@ kraken_stream_level KRTexture::getStreamLevel(KRTexture::texture_usage_t texture { if(m_current_lod_max_dim == 0) { return kraken_stream_level::STREAM_LEVEL_OUT; - } else if(m_current_lod_max_dim == KRMIN(getContext().KRENGINE_MAX_TEXTURE_DIM, m_max_lod_max_dim)) { + } else if(m_current_lod_max_dim == KRMIN(getContext().KRENGINE_MAX_TEXTURE_DIM, (int)m_max_lod_max_dim)) { return kraken_stream_level::STREAM_LEVEL_IN_HQ; - } else if(m_current_lod_max_dim >= KRMAX(getContext().KRENGINE_MIN_TEXTURE_DIM, m_min_lod_max_dim)) { + } else if(m_current_lod_max_dim >= KRMAX(getContext().KRENGINE_MIN_TEXTURE_DIM, (int)m_min_lod_max_dim)) { return kraken_stream_level::STREAM_LEVEL_IN_LQ; } else { return kraken_stream_level::STREAM_LEVEL_OUT; diff --git a/kraken/KRTextureAnimated.cpp b/kraken/KRTextureAnimated.cpp index f3e80c8..dcecf99 100755 --- a/kraken/KRTextureAnimated.cpp +++ b/kraken/KRTextureAnimated.cpp @@ -43,13 +43,13 @@ KRTextureAnimated::KRTextureAnimated(KRContext &context, std::string name) : KRT // - yy is the framerate // TODO - Add error handling for mal-formatted animated texture formats - int first_comma_pos = name.find(","); - int second_comma_pos = name.find(",", first_comma_pos + 1); + size_t first_comma_pos = name.find(","); + size_t second_comma_pos = name.find(",", first_comma_pos + 1); m_texture_base_name = name.substr(8, first_comma_pos - 8); m_frame_count = atoi(name.substr(first_comma_pos+1, second_comma_pos - first_comma_pos -1).c_str()); - m_frame_rate = atof(name.substr(second_comma_pos+1).c_str()); + m_frame_rate = (float)atof(name.substr(second_comma_pos+1).c_str()); m_max_lod_max_dim = 2048; m_min_lod_max_dim = 64; @@ -57,8 +57,8 @@ KRTextureAnimated::KRTextureAnimated(KRContext &context, std::string name) : KRT for(int i=0; igetMaxMipMap() < m_max_lod_max_dim) m_max_lod_max_dim = frame_texture->getMaxMipMap(); - if(frame_texture->getMinMipMap() > m_min_lod_max_dim) m_min_lod_max_dim = frame_texture->getMinMipMap(); + if(frame_texture->getMaxMipMap() < (int)m_max_lod_max_dim) m_max_lod_max_dim = frame_texture->getMaxMipMap(); + if(frame_texture->getMinMipMap() > (int)m_min_lod_max_dim) m_min_lod_max_dim = frame_texture->getMinMipMap(); } } } @@ -106,7 +106,7 @@ void KRTextureAnimated::bind(GLuint texture_unit) { resetPoolExpiry(0.0f, TEXTURE_USAGE_NONE); // TODO - Need to set parameters here for streaming priority? KRTexture::bind(texture_unit); - int frame_number = (int)floor(fmodf(getContext().getAbsoluteTime() * m_frame_rate,m_frame_count)); + int frame_number = (int)floor(fmodf(getContext().getAbsoluteTime() * m_frame_rate, (float)m_frame_count)); KRTexture2D *frame_texture = textureForFrame(frame_number); if(frame_texture) { frame_texture->bind(texture_unit); diff --git a/kraken/KRTextureCube.cpp b/kraken/KRTextureCube.cpp index e1c5965..37bd3f3 100755 --- a/kraken/KRTextureCube.cpp +++ b/kraken/KRTextureCube.cpp @@ -44,8 +44,8 @@ KRTextureCube::KRTextureCube(KRContext &context, std::string name) : KRTexture(c std::string faceName = getName() + SUFFIXES[i]; m_textures[i] = (KRTexture2D *)getContext().getTextureManager()->getTexture(faceName); if(m_textures[i]) { - if(m_textures[i]->getMaxMipMap() < m_max_lod_max_dim) m_max_lod_max_dim = m_textures[i]->getMaxMipMap(); - if(m_textures[i]->getMinMipMap() > m_min_lod_max_dim) m_min_lod_max_dim = m_textures[i]->getMinMipMap(); + if(m_textures[i]->getMaxMipMap() < (int)m_max_lod_max_dim) m_max_lod_max_dim = m_textures[i]->getMaxMipMap(); + if(m_textures[i]->getMinMipMap() > (int)m_min_lod_max_dim) m_min_lod_max_dim = m_textures[i]->getMinMipMap(); } else { assert(false); } @@ -94,7 +94,7 @@ bool KRTextureCube::createGLTexture(int lod_max_dim) long KRTextureCube::getMemRequiredForSize(int max_dim) { int target_dim = max_dim; - if(target_dim < m_min_lod_max_dim) target_dim = m_min_lod_max_dim; + if(target_dim < (int)m_min_lod_max_dim) target_dim = m_min_lod_max_dim; long memoryRequired = 0; for(int i=0; i<6; i++) { diff --git a/kraken/KRTextureKTX.cpp b/kraken/KRTextureKTX.cpp index 30822d8..1f57ea1 100755 --- a/kraken/KRTextureKTX.cpp +++ b/kraken/KRTextureKTX.cpp @@ -59,7 +59,7 @@ KRTextureKTX::KRTextureKTX(KRContext &context, KRDataBlock *data, std::string na uint32_t blockStart = sizeof(KTXHeader) + m_header.bytesOfKeyValueData; uint32_t width = m_header.pixelWidth, height = m_header.pixelHeight; - for(int mipmap_level=0; mipmap_level < KRMAX(m_header.numberOfMipmapLevels, 1); mipmap_level++) { + for(int mipmap_level=0; mipmap_level < (int)KRMAX(m_header.numberOfMipmapLevels, 1); mipmap_level++) { uint32_t blockLength; data->copy(&blockLength, blockStart, 4); blockStart += 4; @@ -126,7 +126,7 @@ KRTextureKTX::~KRTextureKTX() { long KRTextureKTX::getMemRequiredForSize(int max_dim) { int target_dim = max_dim; - if(target_dim < m_min_lod_max_dim) target_dim = target_dim; + if(target_dim < (int)m_min_lod_max_dim) target_dim = target_dim; // Determine how much memory will be consumed @@ -137,7 +137,7 @@ long KRTextureKTX::getMemRequiredForSize(int max_dim) for(std::list::iterator itr = m_blocks.begin(); itr != m_blocks.end(); itr++) { KRDataBlock *block = *itr; if(width <= target_dim && height <= target_dim) { - memoryRequired += block->getSize(); + memoryRequired += (long)block->getSize(); } width = width >> 1; @@ -156,7 +156,7 @@ long KRTextureKTX::getMemRequiredForSize(int max_dim) bool KRTextureKTX::uploadTexture(GLenum target, int lod_max_dim, int ¤t_lod_max_dim, bool compress, bool premultiply_alpha) { int target_dim = lod_max_dim; - if(target_dim < m_min_lod_max_dim) target_dim = m_min_lod_max_dim; + if(target_dim < (int)m_min_lod_max_dim) target_dim = m_min_lod_max_dim; if(m_blocks.size() == 0) { return false; @@ -239,9 +239,9 @@ bool KRTextureKTX::uploadTexture(GLenum target, int lod_max_dim, int ¤t_lo GLDEBUG(glCompressedTexImage2D(target, destination_level, (GLenum)m_header.glInternalFormat, width, height, 0, (GLsizei)block->getSize(), block->getStart())); #endif block->unlock(); - memoryTransferred += block->getSize(); // memoryTransferred does not include throughput of mipmap levels copied through glCopyTextureLevelsAPPLE + memoryTransferred += (long)block->getSize(); // memoryTransferred does not include throughput of mipmap levels copied through glCopyTextureLevelsAPPLE #endif - memoryRequired += block->getSize(); + memoryRequired += (long)block->getSize(); // // err = glGetError(); // if (err != GL_NO_ERROR) { diff --git a/kraken/KRTexturePVR.cpp b/kraken/KRTexturePVR.cpp index 24de4b4..57a682f 100755 --- a/kraken/KRTexturePVR.cpp +++ b/kraken/KRTexturePVR.cpp @@ -147,7 +147,7 @@ KRTexturePVR::~KRTexturePVR() { long KRTexturePVR::getMemRequiredForSize(int max_dim) { int target_dim = max_dim; - if(target_dim < m_min_lod_max_dim) target_dim = target_dim; + if(target_dim < (int)m_min_lod_max_dim) target_dim = target_dim; // Determine how much memory will be consumed int width = m_iWidth; @@ -157,7 +157,7 @@ long KRTexturePVR::getMemRequiredForSize(int max_dim) for(std::list::iterator itr = m_blocks.begin(); itr != m_blocks.end(); itr++) { KRDataBlock *block = *itr; if(width <= target_dim && height <= target_dim) { - memoryRequired += block->getSize(); + memoryRequired += (long)block->getSize(); } width = width >> 1; @@ -176,7 +176,7 @@ long KRTexturePVR::getMemRequiredForSize(int max_dim) bool KRTexturePVR::uploadTexture(GLenum target, int lod_max_dim, int ¤t_lod_max_dim, bool compress, bool premultiply_alpha) { int target_dim = lod_max_dim; - if(target_dim < m_min_lod_max_dim) target_dim = m_min_lod_max_dim; + if(target_dim < (int)m_min_lod_max_dim) target_dim = m_min_lod_max_dim; if(m_blocks.size() == 0) { return false; @@ -256,12 +256,12 @@ bool KRTexturePVR::uploadTexture(GLenum target, int lod_max_dim, int ¤t_lo #if GL_EXT_texture_storage GLDEBUG(glCompressedTexSubImage2D(target, destination_level, 0, 0, width, height, m_internalFormat, block->getSize(), block->getStart())); #else - GLDEBUG(glCompressedTexImage2D(target, destination_level, m_internalFormat, width, height, 0, block->getSize(), block->getStart())); + GLDEBUG(glCompressedTexImage2D(target, destination_level, m_internalFormat, width, height, 0, (GLsizei)block->getSize(), block->getStart())); #endif block->unlock(); - memoryTransferred += block->getSize(); // memoryTransferred does not include throughput of mipmap levels copied through glCopyTextureLevelsAPPLE + memoryTransferred += (long)block->getSize(); // memoryTransferred does not include throughput of mipmap levels copied through glCopyTextureLevelsAPPLE #endif - memoryRequired += block->getSize(); + memoryRequired += (long)block->getSize(); // // err = glGetError(); // if (err != GL_NO_ERROR) {