From 15d57c8a9cad95f63797e4b91701c9c648c45ae3 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 5 Oct 2013 17:45:00 +0200 Subject: WINTERMUTE: Let pixel blending functions be inlined --- .../wintermute/graphics/transparent_surface.cpp | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'engines/wintermute/graphics') diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp index 64102d7eb0..f5528b1155 100644 --- a/engines/wintermute/graphics/transparent_surface.cpp +++ b/engines/wintermute/graphics/transparent_surface.cpp @@ -38,26 +38,26 @@ void doBlitBinaryFast(byte *ino, byte *outo, uint32 width, uint32 height, uint32 class BlenderAdditive { public: - static void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb); - static void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb); - static void blendPixel(byte *in, byte *out); - static void blendPixel(byte *in, byte *out, int colorMod); + inline void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb); + inline void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb); + inline void blendPixel(byte *in, byte *out); + inline void blendPixel(byte *in, byte *out, int colorMod); }; class BlenderSubtractive { public: - static void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb); - static void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb); - static void blendPixel(byte *in, byte *out); - static void blendPixel(byte *in, byte *out, int colorMod); + inline void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb); + inline void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb); + inline void blendPixel(byte *in, byte *out); + inline void blendPixel(byte *in, byte *out, int colorMod); }; class BlenderNormal { public: - static void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb); - static void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb); - static void blendPixel(byte *in, byte *out); - static void blendPixel(byte *in, byte *out, int colorMod); + inline void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb); + inline void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb); + inline void blendPixel(byte *in, byte *out); + inline void blendPixel(byte *in, byte *out, int colorMod); }; /** @@ -465,7 +465,7 @@ void doBlitBinaryFast(byte *ino, byte *outo, uint32 width, uint32 height, uint32 template void doBlit(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, int32 inStep, int32 inoStep, uint32 color) { - + Blender b; byte *in; byte *out; @@ -481,7 +481,7 @@ void doBlit(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, in byte *outg = &out[TransparentSurface::kGIndex]; byte *outb = &out[TransparentSurface::kBIndex]; - Blender::blendPixel(in[TransparentSurface::kAIndex], + b.blendPixel(in[TransparentSurface::kAIndex], in[TransparentSurface::kRIndex], in[TransparentSurface::kGIndex], in[TransparentSurface::kBIndex], @@ -510,7 +510,7 @@ void doBlit(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, in byte *outg = &out[TransparentSurface::kGIndex]; byte *outb = &out[TransparentSurface::kBIndex]; - Blender::blendPixel(in[TransparentSurface::kAIndex], + b.blendPixel(in[TransparentSurface::kAIndex], in[TransparentSurface::kRIndex], in[TransparentSurface::kGIndex], in[TransparentSurface::kBIndex], -- cgit v1.2.3