src/blitter/32bpp_optimized.hpp
author rubidium
Wed, 17 Dec 2008 23:08:11 +0000
changeset 10434 3659467c844c
parent 9597 825e5483799b
permissions -rw-r--r--
(svn r14687) -Change: log all configure errors to config.log
7553
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
     1
/* $Id$ */
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
     2
9111
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 7553
diff changeset
     3
/** @file 32bpp_optimized.hpp Optimized 32 bpp blitter. */
7553
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
     4
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
     5
#ifndef BLITTER_32BPP_OPTIMIZED_HPP
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
     6
#define BLITTER_32BPP_OPTIMIZED_HPP
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
     7
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
     8
#include "32bpp_simple.hpp"
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
     9
#include "factory.hpp"
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    10
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    11
class Blitter_32bppOptimized : public Blitter_32bppSimple {
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    12
public:
9597
825e5483799b (svn r13639) -Codechange: rewrite 32bpp-anim and 32bpp-optimized drawing and encoding so it uses similiar scheme as 8bpp-optimized
smatz
parents: 9486
diff changeset
    13
	struct SpriteData {
825e5483799b (svn r13639) -Codechange: rewrite 32bpp-anim and 32bpp-optimized drawing and encoding so it uses similiar scheme as 8bpp-optimized
smatz
parents: 9486
diff changeset
    14
		uint32 offset[ZOOM_LVL_COUNT][2];
825e5483799b (svn r13639) -Codechange: rewrite 32bpp-anim and 32bpp-optimized drawing and encoding so it uses similiar scheme as 8bpp-optimized
smatz
parents: 9486
diff changeset
    15
		byte data[VARARRAY_SIZE];
825e5483799b (svn r13639) -Codechange: rewrite 32bpp-anim and 32bpp-optimized drawing and encoding so it uses similiar scheme as 8bpp-optimized
smatz
parents: 9486
diff changeset
    16
	};
825e5483799b (svn r13639) -Codechange: rewrite 32bpp-anim and 32bpp-optimized drawing and encoding so it uses similiar scheme as 8bpp-optimized
smatz
parents: 9486
diff changeset
    17
7553
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    18
	/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    19
	/* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator);
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    20
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    21
	/* virtual */ const char *GetName() { return "32bpp-optimized"; }
9486
860750c7df74 (svn r13445) -Codechange: make 32bpp_optimized blitter ~10-20% faster in drawing (depends on architecture and compiler)
smatz
parents: 9111
diff changeset
    22
9597
825e5483799b (svn r13639) -Codechange: rewrite 32bpp-anim and 32bpp-optimized drawing and encoding so it uses similiar scheme as 8bpp-optimized
smatz
parents: 9486
diff changeset
    23
	template <BlitterMode mode> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
7553
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    24
};
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    25
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    26
class FBlitter_32bppOptimized: public BlitterFactory<FBlitter_32bppOptimized> {
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    27
public:
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    28
	/* virtual */ const char *GetName() { return "32bpp-optimized"; }
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    29
	/* virtual */ const char *GetDescription() { return "32bpp Optimized Blitter (no palette animation)"; }
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    30
	/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppOptimized(); }
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    31
};
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    32
63d4424de5d7 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
diff changeset
    33
#endif /* BLITTER_32BPP_OPTIMIZED_HPP */