diff options
author | Max Horn | 2008-09-01 12:41:46 +0000 |
---|---|---|
committer | Max Horn | 2008-09-01 12:41:46 +0000 |
commit | 83cc4e1c921eb7d17cfbf830b68c3564926bdf17 (patch) | |
tree | b3bafb4acbf378c2ea7abbe796dc0439a7b29ab9 /graphics | |
parent | b53220d2cc97afa1ecc1a3b499a8571a5e8885e4 (diff) | |
download | scummvm-rg350-83cc4e1c921eb7d17cfbf830b68c3564926bdf17.tar.gz scummvm-rg350-83cc4e1c921eb7d17cfbf830b68c3564926bdf17.tar.bz2 scummvm-rg350-83cc4e1c921eb7d17cfbf830b68c3564926bdf17.zip |
Use memcpy instead of hand-rolled colorCopy (on many systems, memcpy is hand-optimized asm or even a compiler built-in and *way* faster than any C code you could roll yourself -- it's way faster on my system, too)
svn-id: r34238
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/VectorRendererSpec.cpp | 22 | ||||
-rw-r--r-- | graphics/VectorRendererSpec.h | 11 |
2 files changed, 2 insertions, 31 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index 908b9eb1a3..4819ea8336 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -262,7 +262,7 @@ blitSurface(const Graphics::Surface *source, const Common::Rect &r) { int h = r.height(), w = r.width(); while (h--) { - colorCopy(src_ptr, dst_ptr, w); + memcpy(dst_ptr, src_ptr, w * sizeof(PixelType)); dst_ptr += dst_pitch; src_ptr += src_pitch; } @@ -280,7 +280,7 @@ blitSubSurface(const Graphics::Surface *source, const Common::Rect &r) { int h = r.height(), w = r.width(); while (h--) { - colorCopy(src_ptr, dst_ptr, w); + memcpy(dst_ptr, src_ptr, w * sizeof(PixelType)); dst_ptr += dst_pitch; src_ptr += src_pitch; } @@ -411,24 +411,6 @@ colorFill(PixelType *first, PixelType *last, PixelType color) { } } -template <typename PixelType, typename PixelFormat> -inline void VectorRendererSpec<PixelType, PixelFormat>:: -colorCopy(PixelType *src, PixelType *dst, int count) { - register int n = (count + 7) >> 3; - switch (count % 8) { - case 0: do { - *dst++ = *src++; - case 7: *dst++ = *src++; - case 6: *dst++ = *src++; - case 5: *dst++ = *src++; - case 4: *dst++ = *src++; - case 3: *dst++ = *src++; - case 2: *dst++ = *src++; - case 1: *dst++ = *src++; - } while (--n > 0); - } -} - /******************************************************************** ******************************************************************** * Primitive shapes drawing - Public API calls - VectorRendererSpec * diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h index 4d30e5a75a..04f28d4020 100644 --- a/graphics/VectorRendererSpec.h +++ b/graphics/VectorRendererSpec.h @@ -227,17 +227,6 @@ protected: * @param color Color of the pixel */ virtual inline void colorFill(PixelType *first, PixelType *last, PixelType color); - - /** - * Copies several pixes in a row from a surface to another one. - * Used for surface blitting. - * See colorFill() for optimization guidelines. - * - * @param src Source surface. - * @param dst Destination surface. - * @param count Amount of pixels to copy over. - */ - virtual inline void colorCopy(PixelType *src, PixelType *dst, int count); virtual void areaConvolution(const Common::Rect &area, const int filter[3][3], int filterDiv, int offset); |