diff --git a/src/eepp/graphics/batchrenderer.cpp b/src/eepp/graphics/batchrenderer.cpp index 08523f5c6..1647edded 100755 --- a/src/eepp/graphics/batchrenderer.cpp +++ b/src/eepp/graphics/batchrenderer.cpp @@ -90,7 +90,10 @@ void BatchRenderer::addVertexs( const unsigned int& num ) { if ( ( mNumVertex + num ) >= mVertexSize ) { eeVertex * newVertex = eeNewArray( eeVertex, mVertexSize * 2 ); - memcpy( &mVertex[0], &newVertex[0], mVertexSize * sizeof(eeVertex) ); + + for ( Uint32 i = 0; i < mVertexSize; i++ ) + newVertex[i] = mVertex[i]; + eeSAFE_DELETE_ARRAY( mVertex ); mVertex = newVertex; mVertexSize = mVertexSize * 2; diff --git a/src/eepp/graphics/image.cpp b/src/eepp/graphics/image.cpp index 592b9309d..5fa02142e 100644 --- a/src/eepp/graphics/image.cpp +++ b/src/eepp/graphics/image.cpp @@ -607,7 +607,7 @@ const Uint8* Image::getPixelsPtr() { Color Image::getPixel( const unsigned int& x, const unsigned int& y ) { eeASSERT( !( mPixels == NULL || x > mWidth || y > mHeight ) ); Color dst; - memcpy( &dst, &mPixels[ ( ( x + y * mWidth ) * mChannels ) ], mChannels ); + memcpy( (void*)&dst, &mPixels[ ( ( x + y * mWidth ) * mChannels ) ], mChannels ); return dst; } diff --git a/src/eepp/graphics/text.cpp b/src/eepp/graphics/text.cpp index ca2ef860f..0d08ed448 100644 --- a/src/eepp/graphics/text.cpp +++ b/src/eepp/graphics/text.cpp @@ -867,7 +867,6 @@ void Text::setFillColor( const Color& color, Uint32 from, Uint32 to ) { Int32 rpos = from; Int32 lpos = 0; Uint32 i; - Uint32 qsize = sizeof(Color) * GLi->quadVertexs(); String::StringBaseType curChar; // Spaces, new lines and tabs are not rendered, and not counted as a color @@ -902,20 +901,22 @@ void Text::setFillColor( const Color& color, Uint32 from, Uint32 to ) { rpos--; if ( '\n' == curChar) { - if ( underlined ) { - memcpy( &(mColors[ rpos * GLi->quadVertexs() ]), &colors[0], qsize ); - rpos++; + if ( underlined || strikeThrough ) { + for ( int i = 0; i < GLi->quadVertexs(); i++ ) + mColors[ rpos * GLi->quadVertexs() + i ] = colors[i]; } - if ( strikeThrough ) { - memcpy( &(mColors[ rpos * GLi->quadVertexs() ]), &colors[0], qsize ); + if ( underlined ) + rpos++; + + if ( strikeThrough ) rpos++; - } } } } - memcpy( &(mColors[ lpos * GLi->quadVertexs() ]), &colors[0], qsize ); + for ( int i = 0; i < GLi->quadVertexs(); i++ ) + mColors[ lpos * GLi->quadVertexs() + i ] = colors[i]; } if ( rto == s ) { @@ -923,16 +924,20 @@ void Text::setFillColor( const Color& color, Uint32 from, Uint32 to ) { lpos++; Uint32 pos = lpos * GLi->quadVertexs(); - if ( pos < mColors.size() ) - memcpy( &(mColors[ lpos * GLi->quadVertexs() ]), &colors[0], qsize ); + if ( pos < mColors.size() ) { + for ( int i = 0; i < GLi->quadVertexs(); i++ ) + mColors[ lpos * GLi->quadVertexs() + i ] = colors[i]; + } } if ( strikeThrough ) { lpos++; Uint32 pos = lpos * GLi->quadVertexs(); - if ( pos < mColors.size() ) - memcpy( &(mColors[ lpos * GLi->quadVertexs() ]), &colors[0], qsize ); + if ( pos < mColors.size() ) { + for ( int i = 0; i < GLi->quadVertexs(); i++ ) + mColors[ lpos * GLi->quadVertexs() + i ] = colors[i]; + } } } } diff --git a/src/eepp/ui/uiskincomplex.cpp b/src/eepp/ui/uiskincomplex.cpp index cd28a385c..e3e0e1593 100644 --- a/src/eepp/ui/uiskincomplex.cpp +++ b/src/eepp/ui/uiskincomplex.cpp @@ -212,7 +212,8 @@ UISkinComplex * UISkinComplex::clone( const std::string& NewName, const bool& Co if ( CopyColorsState ) { SkinC->mColorDefault = mColorDefault; - memcpy( &SkinC->mColor[0], &mColor[0], UISkinState::StateCount * sizeof(Color) ); + for ( size_t i = 0; i < UISkinState::StateCount; i++ ) + SkinC->mColor[i] = mColor[i]; } memcpy( &SkinC->mDrawable[0], &mDrawable[0], UISkinState::StateCount * SideCount * sizeof(Drawable*) ); diff --git a/src/eepp/ui/uiskinsimple.cpp b/src/eepp/ui/uiskinsimple.cpp index 9a3f1044f..6c2484443 100644 --- a/src/eepp/ui/uiskinsimple.cpp +++ b/src/eepp/ui/uiskinsimple.cpp @@ -62,7 +62,8 @@ UISkinSimple * UISkinSimple::clone( const std::string& NewName, const bool& Copy if ( CopyColorsState ) { SkinS->mColorDefault = mColorDefault; - memcpy( &SkinS->mColor[0], &mColor[0], UISkinState::StateCount * sizeof(Color) ); + for ( size_t i = 0; i < UISkinState::StateCount; i++ ) + SkinS->mColor[i] = mColor[i]; } memcpy( &SkinS->mDrawable[0], &mDrawable[0], UISkinState::StateCount * sizeof(Drawable*) );