From 640d39c001982e6bba7034b75ae0adef3ea4b9bb Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 6 Oct 2013 19:38:36 +0000 Subject: [PATCH] (svn r25820) -Codechange: More const-ness. --- src/blitter/32bpp_optimized.cpp | 2 +- src/blitter/32bpp_optimized.hpp | 2 +- src/blitter/32bpp_simple.cpp | 2 +- src/blitter/32bpp_simple.hpp | 2 +- src/blitter/8bpp_optimized.cpp | 2 +- src/blitter/8bpp_optimized.hpp | 2 +- src/blitter/8bpp_simple.cpp | 2 +- src/blitter/8bpp_simple.hpp | 2 +- src/blitter/base.hpp | 2 +- src/blitter/null.cpp | 2 +- src/blitter/null.hpp | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/blitter/32bpp_optimized.cpp b/src/blitter/32bpp_optimized.cpp index 1c1ac816d6..4911e83140 100644 --- a/src/blitter/32bpp_optimized.cpp +++ b/src/blitter/32bpp_optimized.cpp @@ -207,7 +207,7 @@ void Blitter_32bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, } } -Sprite *Blitter_32bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) +Sprite *Blitter_32bppOptimized::Encode(const 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 c8cfd91cf9..ea55d8d9fc 100644 --- a/src/blitter/32bpp_optimized.hpp +++ b/src/blitter/32bpp_optimized.hpp @@ -24,7 +24,7 @@ public: }; /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator); + /* virtual */ Sprite *Encode(const 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 73487e54cd..539d26ff02 100644 --- a/src/blitter/32bpp_simple.cpp +++ b/src/blitter/32bpp_simple.cpp @@ -92,7 +92,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, AllocatorProc *allocator) +Sprite *Blitter_32bppSimple::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) { Blitter_32bppSimple::Pixel *dst; Sprite *dest_sprite = (Sprite *)allocator(sizeof(*dest_sprite) + sprite->height * sprite->width * sizeof(*dst)); diff --git a/src/blitter/32bpp_simple.hpp b/src/blitter/32bpp_simple.hpp index f09920d0e9..59ea50c283 100644 --- a/src/blitter/32bpp_simple.hpp +++ b/src/blitter/32bpp_simple.hpp @@ -28,7 +28,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, AllocatorProc *allocator); + /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator); /* virtual */ const char *GetName() { return "32bpp-simple"; } }; diff --git a/src/blitter/8bpp_optimized.cpp b/src/blitter/8bpp_optimized.cpp index 77fc36576e..c84e7aea77 100644 --- a/src/blitter/8bpp_optimized.cpp +++ b/src/blitter/8bpp_optimized.cpp @@ -112,7 +112,7 @@ void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Z } } -Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) +Sprite *Blitter_8bppOptimized::Encode(const 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 66fbe4091f..2be2214956 100644 --- a/src/blitter/8bpp_optimized.hpp +++ b/src/blitter/8bpp_optimized.hpp @@ -25,7 +25,7 @@ public: }; /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator); + /* virtual */ Sprite *Encode(const 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 f8a808186c..1d405e0eea 100644 --- a/src/blitter/8bpp_simple.cpp +++ b/src/blitter/8bpp_simple.cpp @@ -55,7 +55,7 @@ void Blitter_8bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Zoom } } -Sprite *Blitter_8bppSimple::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) +Sprite *Blitter_8bppSimple::Encode(const 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 28102fcab0..1ea438639c 100644 --- a/src/blitter/8bpp_simple.hpp +++ b/src/blitter/8bpp_simple.hpp @@ -19,7 +19,7 @@ class Blitter_8bppSimple FINAL : public Blitter_8bppBase { public: /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator); + /* virtual */ Sprite *Encode(const 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 45aa19b7d9..91ff68c3b2 100644 --- a/src/blitter/base.hpp +++ b/src/blitter/base.hpp @@ -77,7 +77,7 @@ public: /** * Convert a sprite from the loader to our own format. */ - virtual Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) = 0; + virtual Sprite *Encode(const 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 470b88354f..1c2b379d1b 100644 --- a/src/blitter/null.cpp +++ b/src/blitter/null.cpp @@ -15,7 +15,7 @@ /** Instantiation of the null blitter factory. */ static FBlitter_Null iFBlitter_Null; -Sprite *Blitter_Null::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) +Sprite *Blitter_Null::Encode(const 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 4ec5ff4763..821e01be65 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, AllocatorProc *allocator); + /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator); /* virtual */ void *MoveTo(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) {};