aboutsummaryrefslogtreecommitdiff
path: root/graphics/VectorRendererSpec.cpp
diff options
context:
space:
mode:
authorMax Horn2008-09-01 12:41:46 +0000
committerMax Horn2008-09-01 12:41:46 +0000
commit83cc4e1c921eb7d17cfbf830b68c3564926bdf17 (patch)
treeb3bafb4acbf378c2ea7abbe796dc0439a7b29ab9 /graphics/VectorRendererSpec.cpp
parentb53220d2cc97afa1ecc1a3b499a8571a5e8885e4 (diff)
downloadscummvm-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/VectorRendererSpec.cpp')
-rw-r--r--graphics/VectorRendererSpec.cpp22
1 files changed, 2 insertions, 20 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 *