mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-11 17:17:42 +03:00
More code clean up, some minor optimizations in cImage::CopyImage
This commit is contained in:
@@ -389,9 +389,19 @@ void cImage::CopyImage( cImage * image, const Uint32& x, const Uint32& y ) {
|
||||
eeUint dWidth = image->Width();
|
||||
eeUint dHeight = image->Height();
|
||||
|
||||
for ( eeUint ty = 0; ty < dHeight; ty++ ) {
|
||||
for ( eeUint tx = 0; tx < dWidth; tx++ ) {
|
||||
SetPixel( x + tx, y + ty, image->GetPixel( tx, ty ) );
|
||||
if ( mChannels != image->Channels() ) {
|
||||
for ( eeUint ty = 0; ty < dHeight; ty++ ) {
|
||||
for ( eeUint tx = 0; tx < dWidth; tx++ ) {
|
||||
SetPixel( x + tx, y + ty, image->GetPixel( tx, ty ) );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Copy per row
|
||||
for ( eeUint ty = 0; ty < dHeight; ty++ ) {
|
||||
Uint8 * pDst = &mPixels[ ( x + ( ( ty + y ) * mWidth ) ) * mChannels ];
|
||||
const Uint8 * pSrc = &( ( image->GetPixelsPtr() )[ ( ty * dWidth ) * mChannels ] );
|
||||
|
||||
memcpy( pDst, pSrc, mChannels * dWidth );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,10 +339,6 @@ void cTTFFont::RebuildFromGlyphs() {
|
||||
for (eeUint i = 0; i < mNumChars; i++) {
|
||||
tGlyph = mGlyphs[i];
|
||||
|
||||
if ( 99 == i ) {
|
||||
Top++;
|
||||
}
|
||||
|
||||
tR.Left = (eeFloat)tGlyph.CurX / Tex->Width();
|
||||
tR.Top = (eeFloat)tGlyph.CurY / Tex->Height();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user