diff options
author | frosch <frosch@openttd.org> | 2011-01-14 15:34:33 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-01-14 15:34:33 +0000 |
commit | 3d1008318bf78ab89849f0f2f77c5abf999229d8 (patch) | |
tree | b184b3eaee6c87ac30738864d79f51d5d4cd0b24 | |
parent | 09d7f172a6a6362c243880fd32b66688d53da5a4 (diff) | |
download | openttd-3d1008318bf78ab89849f0f2f77c5abf999229d8.tar.xz |
(svn r21782) -Codechange: Move declaration of AllocatorProc from Blitter:: to spritecache.h
-rw-r--r-- | src/blitter/32bpp_base.hpp | 2 | ||||
-rw-r--r-- | src/blitter/32bpp_optimized.cpp | 2 | ||||
-rw-r--r-- | src/blitter/32bpp_optimized.hpp | 2 | ||||
-rw-r--r-- | src/blitter/32bpp_simple.cpp | 2 | ||||
-rw-r--r-- | src/blitter/32bpp_simple.hpp | 2 | ||||
-rw-r--r-- | src/blitter/8bpp_base.hpp | 2 | ||||
-rw-r--r-- | src/blitter/8bpp_debug.cpp | 2 | ||||
-rw-r--r-- | src/blitter/8bpp_debug.hpp | 2 | ||||
-rw-r--r-- | src/blitter/8bpp_optimized.cpp | 2 | ||||
-rw-r--r-- | src/blitter/8bpp_optimized.hpp | 2 | ||||
-rw-r--r-- | src/blitter/8bpp_simple.cpp | 2 | ||||
-rw-r--r-- | src/blitter/8bpp_simple.hpp | 2 | ||||
-rw-r--r-- | src/blitter/base.hpp | 4 | ||||
-rw-r--r-- | src/blitter/null.cpp | 2 | ||||
-rw-r--r-- | src/blitter/null.hpp | 2 | ||||
-rw-r--r-- | src/spritecache.h | 2 |
16 files changed, 17 insertions, 17 deletions
diff --git a/src/blitter/32bpp_base.hpp b/src/blitter/32bpp_base.hpp index 5538ac468..79d097e80 100644 --- a/src/blitter/32bpp_base.hpp +++ b/src/blitter/32bpp_base.hpp @@ -21,7 +21,7 @@ public: /* virtual */ uint8 GetScreenDepth() { return 32; } // /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); // /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal); -// /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator); +// /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator); /* virtual */ void *MoveTo(const void *video, int x, int y); /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour); /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour); diff --git a/src/blitter/32bpp_optimized.cpp b/src/blitter/32bpp_optimized.cpp index 492e4b66f..b9c1f037b 100644 --- a/src/blitter/32bpp_optimized.cpp +++ b/src/blitter/32bpp_optimized.cpp @@ -255,7 +255,7 @@ static const SpriteLoader::Sprite *ResizeSprite(const SpriteLoader::Sprite *spri return sprite; } -Sprite *Blitter_32bppOptimized::Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator) +Sprite *Blitter_32bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) { /* streams of pixels (a, r, g, b channels) * diff --git a/src/blitter/32bpp_optimized.hpp b/src/blitter/32bpp_optimized.hpp index e5168654e..247c78290 100644 --- a/src/blitter/32bpp_optimized.hpp +++ b/src/blitter/32bpp_optimized.hpp @@ -23,7 +23,7 @@ public: }; /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator); + /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator); /* virtual */ const char *GetName() { return "32bpp-optimized"; } diff --git a/src/blitter/32bpp_simple.cpp b/src/blitter/32bpp_simple.cpp index 56309bbaa..83c43fb27 100644 --- a/src/blitter/32bpp_simple.cpp +++ b/src/blitter/32bpp_simple.cpp @@ -91,7 +91,7 @@ void Blitter_32bppSimple::DrawColourMappingRect(void *dst, int width, int height DEBUG(misc, 0, "32bpp blitter doesn't know how to draw this colour table ('%d')", pal); } -Sprite *Blitter_32bppSimple::Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator) +Sprite *Blitter_32bppSimple::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) { Sprite *dest_sprite; SpriteLoader::CommonPixel *dst; diff --git a/src/blitter/32bpp_simple.hpp b/src/blitter/32bpp_simple.hpp index 18f646030..233c1723d 100644 --- a/src/blitter/32bpp_simple.hpp +++ b/src/blitter/32bpp_simple.hpp @@ -19,7 +19,7 @@ class Blitter_32bppSimple : public Blitter_32bppBase { public: /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal); - /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator); + /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator); /* virtual */ const char *GetName() { return "32bpp-simple"; } }; diff --git a/src/blitter/8bpp_base.hpp b/src/blitter/8bpp_base.hpp index 6bca3949a..926d61739 100644 --- a/src/blitter/8bpp_base.hpp +++ b/src/blitter/8bpp_base.hpp @@ -19,7 +19,7 @@ public: /* virtual */ uint8 GetScreenDepth() { return 8; } // /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal); -// /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator); +// /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator); /* virtual */ void *MoveTo(const void *video, int x, int y); /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour); /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour); diff --git a/src/blitter/8bpp_debug.cpp b/src/blitter/8bpp_debug.cpp index b1f55dbc0..e57517c99 100644 --- a/src/blitter/8bpp_debug.cpp +++ b/src/blitter/8bpp_debug.cpp @@ -41,7 +41,7 @@ void Blitter_8bppDebug::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomL } } -Sprite *Blitter_8bppDebug::Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator) +Sprite *Blitter_8bppDebug::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) { Sprite *dest_sprite; dest_sprite = (Sprite *)allocator(sizeof(*dest_sprite) + sprite->height * sprite->width); diff --git a/src/blitter/8bpp_debug.hpp b/src/blitter/8bpp_debug.hpp index 6fea8bb35..3e1ad61f5 100644 --- a/src/blitter/8bpp_debug.hpp +++ b/src/blitter/8bpp_debug.hpp @@ -18,7 +18,7 @@ class Blitter_8bppDebug : public Blitter_8bppBase { public: /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator); + /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator); /* virtual */ const char *GetName() { return "8bpp-debug"; } }; diff --git a/src/blitter/8bpp_optimized.cpp b/src/blitter/8bpp_optimized.cpp index dcd616add..45ac4a9c4 100644 --- a/src/blitter/8bpp_optimized.cpp +++ b/src/blitter/8bpp_optimized.cpp @@ -110,7 +110,7 @@ void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Z } } -Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator) +Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) { /* Make memory for all zoom-levels */ uint memory = sizeof(SpriteData); diff --git a/src/blitter/8bpp_optimized.hpp b/src/blitter/8bpp_optimized.hpp index fbc9457fe..5445e8055 100644 --- a/src/blitter/8bpp_optimized.hpp +++ b/src/blitter/8bpp_optimized.hpp @@ -23,7 +23,7 @@ public: }; /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator); + /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator); /* virtual */ const char *GetName() { return "8bpp-optimized"; } }; diff --git a/src/blitter/8bpp_simple.cpp b/src/blitter/8bpp_simple.cpp index a864633f1..1b373cc0e 100644 --- a/src/blitter/8bpp_simple.cpp +++ b/src/blitter/8bpp_simple.cpp @@ -54,7 +54,7 @@ void Blitter_8bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Zoom } } -Sprite *Blitter_8bppSimple::Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator) +Sprite *Blitter_8bppSimple::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) { Sprite *dest_sprite; dest_sprite = (Sprite *)allocator(sizeof(*dest_sprite) + sprite->height * sprite->width); diff --git a/src/blitter/8bpp_simple.hpp b/src/blitter/8bpp_simple.hpp index 25edabf2f..47485e16f 100644 --- a/src/blitter/8bpp_simple.hpp +++ b/src/blitter/8bpp_simple.hpp @@ -18,7 +18,7 @@ class Blitter_8bppSimple : public Blitter_8bppBase { public: /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator); + /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator); /* virtual */ const char *GetName() { return "8bpp-simple"; } }; diff --git a/src/blitter/base.hpp b/src/blitter/base.hpp index 52ded3659..03898582c 100644 --- a/src/blitter/base.hpp +++ b/src/blitter/base.hpp @@ -46,8 +46,6 @@ public: PALETTE_ANIMATION_BLITTER, ///< The blitter takes care of the palette animation }; - typedef void *AllocatorProc(size_t size); - /** * Get the screen depth this blitter works for. * This is either: 8, 16, 24 or 32. @@ -73,7 +71,7 @@ public: /** * Convert a sprite from the loader to our own format. */ - virtual Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator) = 0; + virtual Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) = 0; /** * Move the destination pointer the requested amount x and y, keeping in mind diff --git a/src/blitter/null.cpp b/src/blitter/null.cpp index 604ac5249..4b70e52fb 100644 --- a/src/blitter/null.cpp +++ b/src/blitter/null.cpp @@ -14,7 +14,7 @@ static FBlitter_Null iFBlitter_Null; -Sprite *Blitter_Null::Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator) +Sprite *Blitter_Null::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) { Sprite *dest_sprite; dest_sprite = (Sprite *)allocator(sizeof(*dest_sprite)); diff --git a/src/blitter/null.hpp b/src/blitter/null.hpp index 32fea7d9f..f2c57243a 100644 --- a/src/blitter/null.hpp +++ b/src/blitter/null.hpp @@ -20,7 +20,7 @@ public: /* virtual */ uint8 GetScreenDepth() { return 0; } /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) {}; /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) {}; - /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator); + /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator); /* virtual */ void *MoveTo(const void *video, int x, int y) { return NULL; }; /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour) {}; /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour) {}; diff --git a/src/spritecache.h b/src/spritecache.h index 7801f5609..91fda9b53 100644 --- a/src/spritecache.h +++ b/src/spritecache.h @@ -25,6 +25,8 @@ struct Sprite { extern uint _sprite_cache_size; +typedef void *AllocatorProc(size_t size); + void *GetRawSprite(SpriteID sprite, SpriteType type); bool SpriteExists(SpriteID sprite); |