mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r25820) -Codechange: More const-ness.
This commit is contained in:
parent
2d972cb418
commit
640d39c001
@ -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)
|
||||
*
|
||||
|
@ -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"; }
|
||||
|
||||
|
@ -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));
|
||||
|
@ -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"; }
|
||||
};
|
||||
|
@ -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);
|
||||
|
@ -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"; }
|
||||
};
|
||||
|
@ -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);
|
||||
|
@ -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"; }
|
||||
};
|
||||
|
@ -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
|
||||
|
@ -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));
|
||||
|
@ -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) {};
|
||||
|
Loading…
Reference in New Issue
Block a user