diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems index b72144fe07..36fb0e93e7 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems @@ -499,7 +499,6 @@ - diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters index aea30bd7d5..c055afb439 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters @@ -676,9 +676,6 @@ platform\winrt - - platform\winrt - platform\winrt diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Windows/libcocos2d_8_1.Windows.vcxproj b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Windows/libcocos2d_8_1.Windows.vcxproj index 8c45d45fee..b83a329a84 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Windows/libcocos2d_8_1.Windows.vcxproj +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Windows/libcocos2d_8_1.Windows.vcxproj @@ -119,40 +119,40 @@ false false - libcocos2d_v3.11_Windows_8.1 + libcocos2d_v3.12_Windows_8.1 false false - libcocos2d_v3.11_Windows_8.1 + libcocos2d_v3.12_Windows_8.1 false false - libcocos2d_v3.11_Windows_8.1 + libcocos2d_v3.12_Windows_8.1 false false false - libcocos2d_v3.11_Windows_8.1 + libcocos2d_v3.12_Windows_8.1 false false false - libcocos2d_v3.11_Windows_8.1 + libcocos2d_v3.12_Windows_8.1 false false - libcocos2d_v3.11_Windows_8.1 + libcocos2d_v3.12_Windows_8.1 diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj index 1c55c925c0..e980c0565e 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj @@ -91,23 +91,23 @@ false false - libcocos2d_v3.11_WindowsPhone_8.1 + libcocos2d_v3.12_WindowsPhone_8.1 false false - libcocos2d_v3.11_WindowsPhone_8.1 + libcocos2d_v3.12_WindowsPhone_8.1 false false - libcocos2d_v3.11_WindowsPhone_8.1 + libcocos2d_v3.12_WindowsPhone_8.1 false false false - libcocos2d_v3.11_WindowsPhone_8.1 + libcocos2d_v3.12_WindowsPhone_8.1 false diff --git a/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj b/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj index c6c9ff0ec9..6f20946c2b 100644 --- a/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj @@ -1233,7 +1233,6 @@ - @@ -1535,34 +1534,34 @@ false false - libcocos2d_v3.11_Windows_10.0 + libcocos2d_v3.12_Windows_10.0 false false - libcocos2d_v3.11_Windows_10.0 + libcocos2d_v3.12_Windows_10.0 false false false - libcocos2d_v3.11_Windows_10.0 + libcocos2d_v3.12_Windows_10.0 false false false - libcocos2d_v3.11_Windows_10.0 + libcocos2d_v3.12_Windows_10.0 false false - libcocos2d_v3.11_Windows_10.0 + libcocos2d_v3.12_Windows_10.0 false false - libcocos2d_v3.11_Windows_10.0 + libcocos2d_v3.12_Windows_10.0 diff --git a/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj.filters index f78dcaf75c..3bcd645c44 100644 --- a/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj.filters @@ -3425,9 +3425,6 @@ platform\winrt - - platform\winrt - platform\winrt diff --git a/cocos/audio/winrt/Audio.cpp b/cocos/audio/winrt/Audio.cpp index 6f6f7ea9da..1e506abf20 100644 --- a/cocos/audio/winrt/Audio.cpp +++ b/cocos/audio/winrt/Audio.cpp @@ -116,7 +116,7 @@ void Audio::CreateResources() unsigned int Audio::Hash(const char *key) { - unsigned int len = strlen(key); + unsigned int len = static_cast(strlen(key)); const char *end=key+len; unsigned int hash; @@ -505,7 +505,7 @@ void Audio::PreloadSoundEffect(const char* pszFilePath, bool isMusic) } m_soundEffects[sound].m_soundID = sound; - uint32 bufferLength = reader->getTotalAudioBytes(); + size_t bufferLength = reader->getTotalAudioBytes(); WAVEFORMATEX wfx = reader->getWaveFormatInfo(); cocos2d::experimental::AudioDataChunk chunk; @@ -560,7 +560,7 @@ void Audio::PreloadSoundEffect(const char* pszFilePath, bool isMusic) // Queue in-memory buffer for playback ZeroMemory(&m_soundEffects[sound].m_audioBuffer, sizeof(m_soundEffects[sound].m_audioBuffer)); - m_soundEffects[sound].m_audioBuffer.AudioBytes = m_soundEffects[sound].m_soundEffectBufferLength; + m_soundEffects[sound].m_audioBuffer.AudioBytes = static_cast(m_soundEffects[sound].m_soundEffectBufferLength); m_soundEffects[sound].m_audioBuffer.pAudioData = m_soundEffects[sound].m_soundEffectBufferData; m_soundEffects[sound].m_audioBuffer.pContext = &m_soundEffects[sound]; m_soundEffects[sound].m_audioBuffer.Flags = XAUDIO2_END_OF_STREAM; diff --git a/cocos/audio/winrt/Audio.h b/cocos/audio/winrt/Audio.h index f1eeaa4222..10f8929ba0 100644 --- a/cocos/audio/winrt/Audio.h +++ b/cocos/audio/winrt/Audio.h @@ -30,7 +30,7 @@ struct SoundEffectData IXAudio2SourceVoice* m_soundEffectSourceVoice; XAUDIO2_BUFFER m_audioBuffer; byte* m_soundEffectBufferData; - uint32 m_soundEffectBufferLength; + size_t m_soundEffectBufferLength; uint32 m_soundEffectSampleRate; bool m_soundEffectStarted; bool m_soundEffectPaused; diff --git a/cocos/audio/winrt/AudioCachePlayer.cpp b/cocos/audio/winrt/AudioCachePlayer.cpp index 6cf24ff05e..9a22d2ddc2 100644 --- a/cocos/audio/winrt/AudioCachePlayer.cpp +++ b/cocos/audio/winrt/AudioCachePlayer.cpp @@ -489,7 +489,7 @@ bool AudioPlayer::submitBuffers() if (!_cachedBufferQ.size() || (_isStreaming && _cachedBufferQ.size() < QUEUEBUFFER_NUM)) { AudioDataChunk chunk; if (_cache->getChunk(chunk) && chunk._dataSize) { - _xaBuffer.AudioBytes = chunk._dataSize; + _xaBuffer.AudioBytes = static_cast(chunk._dataSize); _xaBuffer.pAudioData = chunk._data->data(); _xaBuffer.Flags = chunk._endOfStream ? XAUDIO2_END_OF_STREAM : 0; _cachedBufferQ.push(chunk); diff --git a/cocos/audio/winrt/AudioSourceReader.cpp b/cocos/audio/winrt/AudioSourceReader.cpp index 163d383f4a..b7df13802c 100644 --- a/cocos/audio/winrt/AudioSourceReader.cpp +++ b/cocos/audio/winrt/AudioSourceReader.cpp @@ -103,7 +103,7 @@ bool WAVReader::initialize(const std::string& filePath) _streamer->Initialize(StringUtf8ToWideChar(_filePath).c_str(), true); _wfx = _streamer->GetOutputWaveFormatEx(); - UINT32 dataSize = _streamer->GetMaxStreamLengthInBytes(); + size_t dataSize = _streamer->GetMaxStreamLengthInBytes(); if (dataSize <= 0) break; @@ -146,7 +146,7 @@ bool WAVReader::consumeChunk(AudioDataChunk& chunk) void WAVReader::produceChunk() { _rwMutex.lock(); - int chunkSize = _audioSize; + size_t chunkSize = _audioSize; do { if (!_isStreaming && _chnkQ.size() || _chnkQ.size() >= QUEUEBUFFER_NUM) { @@ -167,10 +167,10 @@ void WAVReader::produceChunk() break; } - UINT retSize = 0; + unsigned int retSize = 0; AudioDataChunk chunk = { 0 }; chunk._data = std::make_shared(chunkSize); - _streamer->ReadChunk(chunk._data->data(), _bytesRead, chunkSize, &retSize); + _streamer->ReadChunk(chunk._data->data(), static_cast(_bytesRead), static_cast(chunkSize), &retSize); _bytesRead += retSize; chunk._dataSize = retSize; chunk._seqNo = ((float)_bytesRead / _audioSize) * ((float)_audioSize / CHUNK_SIZE_MAX); @@ -259,7 +259,7 @@ bool MP3Reader::consumeChunk(AudioDataChunk& chunk) void MP3Reader::produceChunk() { _rwMutex.lock(); - int chunkSize = _audioSize; + size_t chunkSize = _audioSize; do { if (!_isStreaming && _chnkQ.size() || _chnkQ.size() >= QUEUEBUFFER_NUM) { @@ -430,7 +430,7 @@ void MP3Reader::chunkify(PCMBuffer& buffer) if (buffer.size() && _chnkQ.size() < QUEUEBUFFER_NUM) { AudioDataChunk chunk = { 0 }; - int chunkSize = buffer.size(); + size_t chunkSize = buffer.size(); chunk._data = std::make_shared(buffer); _bytesRead += chunkSize; chunk._dataSize = chunkSize; @@ -459,14 +459,14 @@ bool MP3Reader::appendToMappedWavFile(PCMBuffer& buffer) break; } - ret = (TRUE == WriteFile(file.Get(), buffer.data(), buffer.size(), nullptr, nullptr)); + ret = (TRUE == WriteFile(file.Get(), buffer.data(), static_cast(buffer.size()), nullptr, nullptr)); } while (false); _rwMutex.unlock(); return ret; } -void MP3Reader::readFromMappedWavFile(BYTE *data, size_t offset, int size, UINT *pRetSize) +void MP3Reader::readFromMappedWavFile(BYTE *data, size_t offset, size_t size, UINT *pRetSize) { do { auto file = openFile(_mappedWavFile); @@ -483,7 +483,7 @@ void MP3Reader::readFromMappedWavFile(BYTE *data, size_t offset, int size, UINT } } - ReadFile(file.Get(), data, size, (LPDWORD)pRetSize, nullptr); + ReadFile(file.Get(), data, static_cast(size), (LPDWORD)pRetSize, nullptr); } while (false); } @@ -581,7 +581,7 @@ bool OGGReader::consumeChunk(AudioDataChunk& chunk) void OGGReader::produceChunk() { _rwMutex.lock(); - int chunkSize = _audioSize; + size_t chunkSize = _audioSize; do { if (!_isStreaming && _chnkQ.size() || _chnkQ.size() >= QUEUEBUFFER_NUM) { @@ -615,7 +615,7 @@ void OGGReader::produceChunk() { long br = 0; int current_section = 0; - if ((br = ov_read(_vorbisFd.get(), (char*)chunk._data->data() + retSize, chunkSize - retSize, 0, 2, 1, ¤t_section)) == 0) { + if ((br = ov_read(_vorbisFd.get(), (char*)chunk._data->data() + retSize, static_cast(chunkSize) - retSize, 0, 2, 1, ¤t_section)) == 0) { break; } retSize += br; diff --git a/cocos/audio/winrt/AudioSourceReader.h b/cocos/audio/winrt/AudioSourceReader.h index bd9e09aecf..c594db4448 100644 --- a/cocos/audio/winrt/AudioSourceReader.h +++ b/cocos/audio/winrt/AudioSourceReader.h @@ -37,9 +37,9 @@ NS_CC_BEGIN namespace experimental{ -const UINT PCMDATA_CACHEMAXSIZE = 2621440; -const UINT QUEUEBUFFER_NUM = 4; -const UINT CHUNK_SIZE_MAX = PCMDATA_CACHEMAXSIZE / QUEUEBUFFER_NUM; +const size_t PCMDATA_CACHEMAXSIZE = 2621440; +const size_t QUEUEBUFFER_NUM = 4; +const size_t CHUNK_SIZE_MAX = PCMDATA_CACHEMAXSIZE / QUEUEBUFFER_NUM; typedef std::vector PCMBuffer; @@ -127,7 +127,7 @@ class MP3Reader : public AudioSourceReader HRESULT readAudioData(IMFSourceReader* pReader); void chunkify(PCMBuffer& buffer); bool appendToMappedWavFile(PCMBuffer& buffer); - void readFromMappedWavFile(BYTE *data, size_t offset, int size, UINT *pRetSize); + void readFromMappedWavFile(BYTE *data, size_t offset, size_t size, UINT *pRetSize); Microsoft::WRL::Wrappers::FileHandle openFile(const std::string& path, bool append = false); private: diff --git a/cocos/audio/winrt/MediaStreamer.cpp b/cocos/audio/winrt/MediaStreamer.cpp index 886feac2c0..78710a5220 100644 --- a/cocos/audio/winrt/MediaStreamer.cpp +++ b/cocos/audio/winrt/MediaStreamer.cpp @@ -99,7 +99,7 @@ Platform::Array^ MediaStreamer::ReadData(_In_ Platform::String^ filename, throw ref new Platform::OutOfMemoryException(); } - from += m_offset; + from += static_cast(m_offset); length = (length == 0 || from + length > fileInfo.EndOfFile.LowPart) ? fileInfo.EndOfFile.LowPart - from : length; Platform::Array^ fileData = ref new Platform::Array(length); @@ -215,11 +215,11 @@ void MediaStreamer::ReadAll(uint8* buffer, uint32 maxBufferSize, uint32* bufferL { if (!m_data.size()) { - ReadChunk(buffer, 0, m_dataLen, bufferLength); + ReadChunk(buffer, 0, static_cast(m_dataLen), bufferLength); } else { - UINT32 toCopy = m_data.size() - m_offset; + UINT32 toCopy = static_cast(m_data.size() - m_offset); if (toCopy > maxBufferSize) toCopy = maxBufferSize; CopyMemory(buffer, m_data.data(), toCopy); diff --git a/cocos/audio/winrt/MediaStreamer.h b/cocos/audio/winrt/MediaStreamer.h index d2c46f613f..2798e85197 100644 --- a/cocos/audio/winrt/MediaStreamer.h +++ b/cocos/audio/winrt/MediaStreamer.h @@ -28,8 +28,8 @@ private: WAVEFORMATEX m_waveFormat; uint32 m_maxStreamLengthInBytes; std::vector m_data; - UINT32 m_offset; - UINT32 m_dataLen; + size_t m_offset; + size_t m_dataLen; Platform::String^ m_filename; Platform::Array^ ReadData(_In_ Platform::String^ filename); @@ -50,7 +50,7 @@ internal: return m_waveFormat; } - UINT32 GetMaxStreamLengthInBytes() + size_t GetMaxStreamLengthInBytes() { return m_dataLen; } diff --git a/cocos/platform/winrt/CCFreeTypeFont.cpp b/cocos/platform/winrt/CCFreeTypeFont.cpp index 0e7b373abc..61b940eccc 100644 --- a/cocos/platform/winrt/CCFreeTypeFont.cpp +++ b/cocos/platform/winrt/CCFreeTypeFont.cpp @@ -179,7 +179,7 @@ unsigned char* CCFreeTypeFont::initWithString(const char * text, const FontDefin unsigned char* CCFreeTypeFont::getBitmap(Device::TextAlign eAlignMask, int &width, int &height, ssize_t& dataLength) { int lineNumber = 0; - int totalLines = m_lines.size(); + int totalLines = static_cast(m_lines.size()); m_width = m_inWidth ? m_inWidth : m_textWidth; m_height = m_inHeight ? m_inHeight : m_textHeight; @@ -463,7 +463,7 @@ FT_Error CCFreeTypeFont::initWordGlyphs(std::vector& glyphs, const std:: unsigned int numGlyphs = 0; wchar_t * pwszBuffer = nullptr; - int num_chars = text.size(); + int num_chars = static_cast(text.size()); int nBufLen = num_chars + 1; pwszBuffer = new wchar_t[nBufLen]; if(!pwszBuffer) diff --git a/cocos/platform/winrt/CCGL.h b/cocos/platform/winrt/CCGL.h index 562eb81557..62d37c4cb3 100644 --- a/cocos/platform/winrt/CCGL.h +++ b/cocos/platform/winrt/CCGL.h @@ -38,10 +38,15 @@ THE SOFTWARE. #include "GLES2/gl2ext.h" #include "GLES3/gl3.h" +#define glClearDepth glClearDepthf +#define glDeleteVertexArrays glDeleteVertexArraysOES +#define glGenVertexArrays glGenVertexArraysOES +#define glBindVertexArray glBindVertexArrayOES #define glMapBuffer glMapBufferOES +#define glUnmapBuffer glUnmapBufferOES + +#define GL_WRITE_ONLY GL_WRITE_ONLY_OES -#else -#include "platform/winrt/CCGL_Angle.h" #endif diff --git a/cocos/platform/winrt/CCGLViewImpl-winrt.cpp b/cocos/platform/winrt/CCGLViewImpl-winrt.cpp index 7276a8779b..b37cc7e2a8 100644 --- a/cocos/platform/winrt/CCGLViewImpl-winrt.cpp +++ b/cocos/platform/winrt/CCGLViewImpl-winrt.cpp @@ -259,7 +259,7 @@ void GLViewImpl::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args) void GLViewImpl::OnPointerPressed(PointerEventArgs^ args) { - int id = args->CurrentPoint->PointerId; + intptr_t id = args->CurrentPoint->PointerId; Vec2 pt = GetPoint(args); handleTouchesBegin(1, &id, &pt.x, &pt.y); } @@ -267,7 +267,7 @@ void GLViewImpl::OnPointerPressed(PointerEventArgs^ args) void GLViewImpl::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ args) { float direction = (float)args->CurrentPoint->Properties->MouseWheelDelta; - int id = 0; + intptr_t id = 0; Vec2 p(0.0f,0.0f); handleTouchesBegin(1, &id, &p.x, &p.y); p.y += direction; @@ -297,7 +297,7 @@ void GLViewImpl::OnPointerMoved( PointerEventArgs^ args) { if (m_lastPointValid) { - int id = args->CurrentPoint->PointerId; + intptr_t id = args->CurrentPoint->PointerId; Vec2 p = GetPoint(args); handleTouchesMove(1, &id, &p.x, &p.y); } @@ -317,7 +317,7 @@ void GLViewImpl::OnPointerReleased(CoreWindow^ sender, PointerEventArgs^ args) void GLViewImpl::OnPointerReleased(PointerEventArgs^ args) { - int id = args->CurrentPoint->PointerId; + intptr_t id = args->CurrentPoint->PointerId; Vec2 pt = GetPoint(args); handleTouchesEnd(1, &id, &pt.x, &pt.y); } diff --git a/cocos/platform/winrt/CCGL_Angle.h b/cocos/platform/winrt/CCGL_Angle.h deleted file mode 100644 index 04c8e88cd4..0000000000 --- a/cocos/platform/winrt/CCGL_Angle.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __CCGL_ANGLE_H__ -#define __CCGL_ANGLE_H__ - -// disable unimplemented function declarations in Angle -#define GL_OES_mapbuffer 1 -#define GL_OES_vertex_array_object 1 - -#include "EGL/egl.h" -#include "EGL/eglext.h" -#include "EGL/eglplatform.h" -#include "GLES2/gl2.h" -#include "GLES2/gl2ext.h" -#include "winrtangle.h" -#include "esUtil.h" -#include "base/ccMacros.h" - -#define GL_WRITE_ONLY_OES 0x88B9 -#define GL_BUFFER_ACCESS_OES 0x88BB -#define GL_BUFFER_MAPPED_OES 0x88BC -#define GL_BUFFER_MAP_POINTER_OES 0x88BD - - - -inline void glGenVertexArrays(GLsizei n, GLuint *arrays) -{ - CCASSERT(false, "AngleProject does not implement glGenVertexArraysOES"); -} - -inline void glBindVertexArray(GLuint array) -{ - CCASSERT(false, "AngleProject does not implement glBindVertexArrayOES"); -} - -inline void glDeleteVertexArrays(GLsizei n, const GLuint *arrays) -{ - CCASSERT(false, "AngleProject does not implement glDeleteVertexArraysOES"); -} - -inline void* glMapBuffer(GLenum target, GLenum access) -{ - CCASSERT(false, "AngleProject does not implement glMapBufferOES"); - return NULL; -} - -inline GLboolean glUnmapBuffer(GLenum targets) -{ - CCASSERT(false, "AngleProject does not implement glUnmapBufferOES"); - return false; -} - -#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES - -#endif // __CCGL_ANGLE_H__ diff --git a/cocos/platform/winrt/CCPrecompiledShaders.cpp b/cocos/platform/winrt/CCPrecompiledShaders.cpp index e852bbfc72..bcb7cd3e78 100644 --- a/cocos/platform/winrt/CCPrecompiledShaders.cpp +++ b/cocos/platform/winrt/CCPrecompiledShaders.cpp @@ -83,16 +83,16 @@ static std::string computeHash(const GLchar* vShaderByteArray, const GLchar* fSh if(!err) { - err = SHA1Input(&sha,(const unsigned char *) vShaderByteArray,strlen(vShaderByteArray)); + err = SHA1Input(&sha,(const unsigned char *) vShaderByteArray,static_cast(strlen(vShaderByteArray))); } if(!err) { - err = SHA1Input(&sha,(const unsigned char *) fShaderByteArray,strlen(fShaderByteArray)); + err = SHA1Input(&sha,(const unsigned char *) fShaderByteArray, static_cast(strlen(fShaderByteArray))); } if(!err) { char* shader_version = (char*) glGetString(GL_SHADING_LANGUAGE_VERSION); - err = SHA1Input(&sha,(const unsigned char *) shader_version,strlen(shader_version)); + err = SHA1Input(&sha,(const unsigned char *) shader_version, static_cast(strlen(shader_version))); } if(!err) { diff --git a/cocos/platform/winrt/CCWinRTUtils.cpp b/cocos/platform/winrt/CCWinRTUtils.cpp index 64895b84d5..f87a5d6410 100644 --- a/cocos/platform/winrt/CCWinRTUtils.cpp +++ b/cocos/platform/winrt/CCWinRTUtils.cpp @@ -153,7 +153,7 @@ std::string PlatformStringToString(Platform::String^ s) { Platform::String^ PlatformStringFromString(const std::string& s) { std::wstring ws = StringUtf8ToWideChar(s); - return ref new Platform::String(ws.data(), ws.length()); + return ref new Platform::String(ws.data(), static_cast(ws.length())); } #if 0 diff --git a/cocos/platform/winrt/WICImageLoader-winrt.cpp b/cocos/platform/winrt/WICImageLoader-winrt.cpp index e9fc9d7977..40827ea138 100644 --- a/cocos/platform/winrt/WICImageLoader-winrt.cpp +++ b/cocos/platform/winrt/WICImageLoader-winrt.cpp @@ -107,7 +107,7 @@ bool WICImageLoader::decodeImageData(ImageBlob blob, size_t size) if(SUCCEEDED(hr)) { - hr = pWicStream->InitializeFromMemory((BYTE*)blob, size); + hr = pWicStream->InitializeFromMemory((BYTE*)blob, static_cast(size)); } IWICBitmapDecoder* pDecoder = NULL; @@ -172,11 +172,11 @@ bool WICImageLoader::processImage(IWICBitmapDecoder* pDecoder) if(NULL != pConv) { - hr = pConv->CopyPixels(NULL, rowPitch, _dataLen, _data); + hr = pConv->CopyPixels(NULL, static_cast(rowPitch), static_cast(_dataLen), _data); } else { - hr = pFrame->CopyPixels(NULL, rowPitch, _dataLen, _data); + hr = pFrame->CopyPixels(NULL, static_cast(rowPitch), static_cast(_dataLen), _data); } } @@ -287,7 +287,7 @@ int WICImageLoader::getWidth() return _width; } -int WICImageLoader::getImageData(ImageBlob rawData, size_t dataLen) +size_t WICImageLoader::getImageData(ImageBlob rawData, size_t dataLen) { if(dataLen < _dataLen) return 0; @@ -297,7 +297,7 @@ int WICImageLoader::getImageData(ImageBlob rawData, size_t dataLen) return _dataLen; } -int WICImageLoader::getImageDataSize() +size_t WICImageLoader::getImageDataSize() { return _dataLen; } @@ -363,7 +363,7 @@ bool WICImageLoader::encodeImageData(std::string path, const unsigned char* data size_t bpp = getBitsPerPixel(pixelFormat); size_t stride = (width * bpp + 7) / 8; - hr = pFrame->WritePixels(height, stride, dataLen, (BYTE*)data); + hr = pFrame->WritePixels(height, static_cast(stride), static_cast(dataLen), (BYTE*)data); } if (SUCCEEDED(hr)) { diff --git a/cocos/platform/winrt/WICImageLoader-winrt.h b/cocos/platform/winrt/WICImageLoader-winrt.h index 85b7f839fe..b3c9934861 100644 --- a/cocos/platform/winrt/WICImageLoader-winrt.h +++ b/cocos/platform/winrt/WICImageLoader-winrt.h @@ -58,9 +58,9 @@ public: int getWidth(); int getHeight(); - int getImageDataSize(); + size_t getImageDataSize(); WICPixelFormatGUID getPixelFormat(); - int getImageData(ImageBlob rawData, size_t dataLen); + size_t getImageData(ImageBlob rawData, size_t dataLen); bool decodeImageData(ImageBlob data, size_t dataLen); bool encodeImageData(std::string path, const unsigned char* data, size_t dataLen, WICPixelFormatGUID pixelFormat, int width, int height, GUID containerFormat); @@ -75,7 +75,7 @@ private: int _height; int _width; size_t _dataLen; - UINT _bpp; + size_t _bpp; WICPixelFormatGUID _format; BYTE* _data; diff --git a/tests/cpp-tests/proj.win10/Package.appxmanifest b/tests/cpp-tests/proj.win10/Package.appxmanifest index 3c0b8b3270..891d4c4466 100644 --- a/tests/cpp-tests/proj.win10/Package.appxmanifest +++ b/tests/cpp-tests/proj.win10/Package.appxmanifest @@ -1,6 +1,6 @@  - + cpp-tests diff --git a/tests/cpp-tests/proj.win10/cpp-tests.vcxproj b/tests/cpp-tests/proj.win10/cpp-tests.vcxproj index a7737eed4b..91db37e3a4 100644 --- a/tests/cpp-tests/proj.win10/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win10/cpp-tests.vcxproj @@ -126,6 +126,9 @@ cpp-tests_TemporaryKey.pfx F3187E657336E152D7AC4C352643738EE7C7C055 + False + Always + x86 false @@ -659,4 +662,4 @@ - + \ No newline at end of file