(svn r15428) -Codechange: consistently use colour instead of having both color and colour.
This commit is contained in:
@@ -129,11 +129,11 @@ inline void Blitter_32bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel
|
||||
break;
|
||||
|
||||
case BM_TRANSPARENT:
|
||||
/* TODO -- We make an assumption here that the remap in fact is transparency, not some color.
|
||||
/* TODO -- We make an assumption here that the remap in fact is transparency, not some colour.
|
||||
* This is never a problem with the code we produce, but newgrfs can make it fail... or at least:
|
||||
* we produce a result the newgrf maker didn't expect ;) */
|
||||
|
||||
/* Make the current color a bit more black, so it looks like this image is transparent */
|
||||
/* Make the current colour a bit more black, so it looks like this image is transparent */
|
||||
src_n += n;
|
||||
if (src_px->a == 255) {
|
||||
src_px += n;
|
||||
@@ -212,11 +212,11 @@ void Blitter_32bppAnim::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomL
|
||||
}
|
||||
}
|
||||
|
||||
void Blitter_32bppAnim::DrawColorMappingRect(void *dst, int width, int height, int pal)
|
||||
void Blitter_32bppAnim::DrawColourMappingRect(void *dst, int width, int height, int pal)
|
||||
{
|
||||
if (_screen_disable_anim) {
|
||||
/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent DrawColorMappingRect() */
|
||||
Blitter_32bppOptimized::DrawColorMappingRect(dst, width, height, pal);
|
||||
/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent DrawColourMappingRect() */
|
||||
Blitter_32bppOptimized::DrawColourMappingRect(dst, width, height, pal);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -252,38 +252,38 @@ void Blitter_32bppAnim::DrawColorMappingRect(void *dst, int width, int height, i
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG(misc, 0, "32bpp blitter doesn't know how to draw this color table ('%d')", pal);
|
||||
DEBUG(misc, 0, "32bpp blitter doesn't know how to draw this colour table ('%d')", pal);
|
||||
}
|
||||
|
||||
void Blitter_32bppAnim::SetPixel(void *video, int x, int y, uint8 color)
|
||||
void Blitter_32bppAnim::SetPixel(void *video, int x, int y, uint8 colour)
|
||||
{
|
||||
*((uint32 *)video + x + y * _screen.pitch) = LookupColourInPalette(color);
|
||||
*((uint32 *)video + x + y * _screen.pitch) = LookupColourInPalette(colour);
|
||||
|
||||
/* Set the color in the anim-buffer too, if we are rendering to the screen */
|
||||
/* Set the colour in the anim-buffer too, if we are rendering to the screen */
|
||||
if (_screen_disable_anim) return;
|
||||
this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = color;
|
||||
this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = colour;
|
||||
}
|
||||
|
||||
void Blitter_32bppAnim::SetPixelIfEmpty(void *video, int x, int y, uint8 color)
|
||||
void Blitter_32bppAnim::SetPixelIfEmpty(void *video, int x, int y, uint8 colour)
|
||||
{
|
||||
uint32 *dst = (uint32 *)video + x + y * _screen.pitch;
|
||||
if (*dst == 0) {
|
||||
*dst = LookupColourInPalette(color);
|
||||
/* Set the color in the anim-buffer too, if we are rendering to the screen */
|
||||
*dst = LookupColourInPalette(colour);
|
||||
/* Set the colour in the anim-buffer too, if we are rendering to the screen */
|
||||
if (_screen_disable_anim) return;
|
||||
this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = color;
|
||||
this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = colour;
|
||||
}
|
||||
}
|
||||
|
||||
void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 color)
|
||||
void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 colour)
|
||||
{
|
||||
if (_screen_disable_anim) {
|
||||
/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent DrawRect() */
|
||||
Blitter_32bppOptimized::DrawRect(video, width, height, color);
|
||||
Blitter_32bppOptimized::DrawRect(video, width, height, colour);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 color32 = LookupColourInPalette(color);
|
||||
uint32 colour32 = LookupColourInPalette(colour);
|
||||
uint8 *anim_line;
|
||||
|
||||
anim_line = ((uint32 *)video - (uint32 *)_screen.dst_ptr) + this->anim_buf;
|
||||
@@ -293,9 +293,9 @@ void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 color
|
||||
uint8 *anim = anim_line;
|
||||
|
||||
for (int i = width; i > 0; i--) {
|
||||
*dst = color32;
|
||||
/* Set the color in the anim-buffer too */
|
||||
*anim = color;
|
||||
*dst = colour32;
|
||||
/* Set the colour in the anim-buffer too */
|
||||
*anim = colour;
|
||||
dst++;
|
||||
anim++;
|
||||
}
|
||||
|
@@ -22,10 +22,10 @@ public:
|
||||
{}
|
||||
|
||||
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
/* virtual */ void DrawColorMappingRect(void *dst, int width, int height, int pal);
|
||||
/* virtual */ void SetPixel(void *video, int x, int y, uint8 color);
|
||||
/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 color);
|
||||
/* virtual */ void DrawRect(void *video, int width, int height, uint8 color);
|
||||
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, int pal);
|
||||
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
|
||||
/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 colour);
|
||||
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
|
||||
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
|
||||
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
|
||||
/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
|
||||
|
@@ -11,32 +11,32 @@ void *Blitter_32bppBase::MoveTo(const void *video, int x, int y)
|
||||
return (uint32 *)video + x + y * _screen.pitch;
|
||||
}
|
||||
|
||||
void Blitter_32bppBase::SetPixel(void *video, int x, int y, uint8 color)
|
||||
void Blitter_32bppBase::SetPixel(void *video, int x, int y, uint8 colour)
|
||||
{
|
||||
*((uint32 *)video + x + y * _screen.pitch) = LookupColourInPalette(color);
|
||||
*((uint32 *)video + x + y * _screen.pitch) = LookupColourInPalette(colour);
|
||||
}
|
||||
|
||||
void Blitter_32bppBase::SetPixelIfEmpty(void *video, int x, int y, uint8 color)
|
||||
void Blitter_32bppBase::SetPixelIfEmpty(void *video, int x, int y, uint8 colour)
|
||||
{
|
||||
uint32 *dst = (uint32 *)video + x + y * _screen.pitch;
|
||||
if (*dst == 0) *dst = LookupColourInPalette(color);
|
||||
if (*dst == 0) *dst = LookupColourInPalette(colour);
|
||||
}
|
||||
|
||||
void Blitter_32bppBase::DrawRect(void *video, int width, int height, uint8 color)
|
||||
void Blitter_32bppBase::DrawRect(void *video, int width, int height, uint8 colour)
|
||||
{
|
||||
uint32 color32 = LookupColourInPalette(color);
|
||||
uint32 colour32 = LookupColourInPalette(colour);
|
||||
|
||||
do {
|
||||
uint32 *dst = (uint32 *)video;
|
||||
for (int i = width; i > 0; i--) {
|
||||
*dst = color32;
|
||||
*dst = colour32;
|
||||
dst++;
|
||||
}
|
||||
video = (uint32 *)video + _screen.pitch;
|
||||
} while (--height);
|
||||
}
|
||||
|
||||
void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 color)
|
||||
void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour)
|
||||
{
|
||||
int dy;
|
||||
int dx;
|
||||
@@ -60,7 +60,7 @@ void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int
|
||||
stepx = 1;
|
||||
}
|
||||
|
||||
if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
|
||||
if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, colour);
|
||||
if (dx > dy) {
|
||||
frac = dy - (dx / 2);
|
||||
while (x != x2) {
|
||||
@@ -70,7 +70,7 @@ void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int
|
||||
}
|
||||
x += stepx;
|
||||
frac += dy;
|
||||
if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
|
||||
if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, colour);
|
||||
}
|
||||
} else {
|
||||
frac = dx - (dy / 2);
|
||||
@@ -81,7 +81,7 @@ void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int
|
||||
}
|
||||
y += stepy;
|
||||
frac += dx;
|
||||
if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
|
||||
if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, colour);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,13 +12,13 @@ class Blitter_32bppBase : public Blitter {
|
||||
public:
|
||||
/* virtual */ uint8 GetScreenDepth() { return 32; }
|
||||
// /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
// /* virtual */ void DrawColorMappingRect(void *dst, int width, int height, int pal);
|
||||
// /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, int pal);
|
||||
// /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator);
|
||||
/* virtual */ void *MoveTo(const void *video, int x, int y);
|
||||
/* virtual */ void SetPixel(void *video, int x, int y, uint8 color);
|
||||
/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 color);
|
||||
/* virtual */ void DrawRect(void *video, int width, int height, uint8 color);
|
||||
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 color);
|
||||
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
|
||||
/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 colour);
|
||||
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
|
||||
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour);
|
||||
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
|
||||
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
|
||||
/* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch);
|
||||
|
@@ -136,11 +136,11 @@ inline void Blitter_32bppOptimized::Draw(const Blitter::BlitterParams *bp, ZoomL
|
||||
break;
|
||||
|
||||
case BM_TRANSPARENT:
|
||||
/* TODO -- We make an assumption here that the remap in fact is transparency, not some color.
|
||||
/* TODO -- We make an assumption here that the remap in fact is transparency, not some colour.
|
||||
* This is never a problem with the code we produce, but newgrfs can make it fail... or at least:
|
||||
* we produce a result the newgrf maker didn't expect ;) */
|
||||
|
||||
/* Make the current color a bit more black, so it looks like this image is transparent */
|
||||
/* Make the current colour a bit more black, so it looks like this image is transparent */
|
||||
src_n += n;
|
||||
if (src_px->a == 255) {
|
||||
src_px += n;
|
||||
|
@@ -39,11 +39,11 @@ void Blitter_32bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Zoo
|
||||
break;
|
||||
|
||||
case BM_TRANSPARENT:
|
||||
/* TODO -- We make an assumption here that the remap in fact is transparency, not some color.
|
||||
/* TODO -- We make an assumption here that the remap in fact is transparency, not some colour.
|
||||
* This is never a problem with the code we produce, but newgrfs can make it fail... or at least:
|
||||
* we produce a result the newgrf maker didn't expect ;) */
|
||||
|
||||
/* Make the current color a bit more black, so it looks like this image is transparent */
|
||||
/* Make the current colour a bit more black, so it looks like this image is transparent */
|
||||
if (src->a != 0) *dst = MakeTransparent(*dst, 192);
|
||||
break;
|
||||
|
||||
@@ -57,7 +57,7 @@ void Blitter_32bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Zoo
|
||||
}
|
||||
}
|
||||
|
||||
void Blitter_32bppSimple::DrawColorMappingRect(void *dst, int width, int height, int pal)
|
||||
void Blitter_32bppSimple::DrawColourMappingRect(void *dst, int width, int height, int pal)
|
||||
{
|
||||
uint32 *udst = (uint32 *)dst;
|
||||
|
||||
@@ -82,7 +82,7 @@ void Blitter_32bppSimple::DrawColorMappingRect(void *dst, int width, int height,
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG(misc, 0, "32bpp blitter doesn't know how to draw this color table ('%d')", pal);
|
||||
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)
|
||||
@@ -102,10 +102,10 @@ Sprite *Blitter_32bppSimple::Encode(SpriteLoader::Sprite *sprite, Blitter::Alloc
|
||||
for (int i = 0; i < sprite->height * sprite->width; i++) {
|
||||
if (dst[i].m != 0) {
|
||||
/* Pre-convert the mapping channel to a RGB value */
|
||||
uint color = this->LookupColourInPalette(dst[i].m);
|
||||
dst[i].r = GB(color, 16, 8);
|
||||
dst[i].g = GB(color, 8, 8);
|
||||
dst[i].b = GB(color, 0, 8);
|
||||
uint colour = this->LookupColourInPalette(dst[i].m);
|
||||
dst[i].r = GB(colour, 16, 8);
|
||||
dst[i].g = GB(colour, 8, 8);
|
||||
dst[i].b = GB(colour, 0, 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
class Blitter_32bppSimple : public Blitter_32bppBase {
|
||||
public:
|
||||
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
/* virtual */ void DrawColorMappingRect(void *dst, int width, int height, int pal);
|
||||
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, int pal);
|
||||
/* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator);
|
||||
|
||||
/* virtual */ const char *GetName() { return "32bpp-simple"; }
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "../gfx_func.h"
|
||||
#include "8bpp_base.hpp"
|
||||
|
||||
void Blitter_8bppBase::DrawColorMappingRect(void *dst, int width, int height, int pal)
|
||||
void Blitter_8bppBase::DrawColourMappingRect(void *dst, int width, int height, int pal)
|
||||
{
|
||||
const uint8 *ctab = GetNonSprite(pal, ST_RECOLOUR) + 1;
|
||||
|
||||
@@ -21,26 +21,26 @@ void *Blitter_8bppBase::MoveTo(const void *video, int x, int y)
|
||||
return (uint8 *)video + x + y * _screen.pitch;
|
||||
}
|
||||
|
||||
void Blitter_8bppBase::SetPixel(void *video, int x, int y, uint8 color)
|
||||
void Blitter_8bppBase::SetPixel(void *video, int x, int y, uint8 colour)
|
||||
{
|
||||
*((uint8 *)video + x + y * _screen.pitch) = color;
|
||||
*((uint8 *)video + x + y * _screen.pitch) = colour;
|
||||
}
|
||||
|
||||
void Blitter_8bppBase::SetPixelIfEmpty(void *video, int x, int y, uint8 color)
|
||||
void Blitter_8bppBase::SetPixelIfEmpty(void *video, int x, int y, uint8 colour)
|
||||
{
|
||||
uint8 *dst = (uint8 *)video + x + y * _screen.pitch;
|
||||
if (*dst == 0) *dst = color;
|
||||
if (*dst == 0) *dst = colour;
|
||||
}
|
||||
|
||||
void Blitter_8bppBase::DrawRect(void *video, int width, int height, uint8 color)
|
||||
void Blitter_8bppBase::DrawRect(void *video, int width, int height, uint8 colour)
|
||||
{
|
||||
do {
|
||||
memset(video, color, width);
|
||||
memset(video, colour, width);
|
||||
video = (uint8 *)video + _screen.pitch;
|
||||
} while (--height);
|
||||
}
|
||||
|
||||
void Blitter_8bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 color)
|
||||
void Blitter_8bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour)
|
||||
{
|
||||
int dy;
|
||||
int dx;
|
||||
@@ -64,7 +64,7 @@ void Blitter_8bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int s
|
||||
stepx = 1;
|
||||
}
|
||||
|
||||
if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
|
||||
if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, colour);
|
||||
if (dx > dy) {
|
||||
frac = dy - (dx / 2);
|
||||
while (x != x2) {
|
||||
@@ -74,7 +74,7 @@ void Blitter_8bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int s
|
||||
}
|
||||
x += stepx;
|
||||
frac += dy;
|
||||
if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
|
||||
if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, colour);
|
||||
}
|
||||
} else {
|
||||
frac = dx - (dy / 2);
|
||||
@@ -85,7 +85,7 @@ void Blitter_8bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int s
|
||||
}
|
||||
y += stepy;
|
||||
frac += dx;
|
||||
if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
|
||||
if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, colour);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -11,13 +11,13 @@ class Blitter_8bppBase : public Blitter {
|
||||
public:
|
||||
/* virtual */ uint8 GetScreenDepth() { return 8; }
|
||||
// /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
/* virtual */ void DrawColorMappingRect(void *dst, int width, int height, int pal);
|
||||
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, int pal);
|
||||
// /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator);
|
||||
/* virtual */ void *MoveTo(const void *video, int x, int y);
|
||||
/* virtual */ void SetPixel(void *video, int x, int y, uint8 color);
|
||||
/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 color);
|
||||
/* virtual */ void DrawRect(void *video, int width, int height, uint8 color);
|
||||
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 color);
|
||||
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
|
||||
/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 colour);
|
||||
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
|
||||
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour);
|
||||
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
|
||||
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
|
||||
/* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch);
|
||||
|
@@ -44,10 +44,10 @@ Sprite *Blitter_8bppDebug::Encode(SpriteLoader::Sprite *sprite, Blitter::Allocat
|
||||
dest_sprite->x_offs = sprite->x_offs;
|
||||
dest_sprite->y_offs = sprite->y_offs;
|
||||
|
||||
/* Write a random color as sprite; this makes debugging really easy */
|
||||
uint color = InteractiveRandom() % 150 + 2;
|
||||
/* Write a random colour as sprite; this makes debugging really easy */
|
||||
uint colour = InteractiveRandom() % 150 + 2;
|
||||
for (int i = 0; i < sprite->height * sprite->width; i++) {
|
||||
dest_sprite->data[i] = (sprite->data[i].m == 0) ? 0 : color;
|
||||
dest_sprite->data[i] = (sprite->data[i].m == 0) ? 0 : colour;
|
||||
}
|
||||
|
||||
return dest_sprite;
|
||||
|
@@ -140,7 +140,7 @@ Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, Blitter::All
|
||||
for (int x = 0; x < scaled_width; x++) {
|
||||
uint colour = 0;
|
||||
|
||||
/* Get the color keeping in mind the zoom-level */
|
||||
/* Get the colour keeping in mind the zoom-level */
|
||||
for (int j = 0; j < scaled_1; j++) {
|
||||
if (src->m != 0) colour = src->m;
|
||||
/* Because of the scaling it might happen we read outside the buffer. Avoid that. */
|
||||
|
@@ -25,22 +25,22 @@ void Blitter_8bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Zoom
|
||||
src_line += bp->sprite_width * ScaleByZoom(1, zoom);
|
||||
|
||||
for (int x = 0; x < bp->width; x++) {
|
||||
uint color = 0;
|
||||
uint colour = 0;
|
||||
|
||||
switch (mode) {
|
||||
case BM_COLOUR_REMAP:
|
||||
color = bp->remap[*src];
|
||||
colour = bp->remap[*src];
|
||||
break;
|
||||
|
||||
case BM_TRANSPARENT:
|
||||
if (*src != 0) color = bp->remap[*dst];
|
||||
if (*src != 0) colour = bp->remap[*dst];
|
||||
break;
|
||||
|
||||
default:
|
||||
color = *src;
|
||||
colour = *src;
|
||||
break;
|
||||
}
|
||||
if (color != 0) *dst = color;
|
||||
if (colour != 0) *dst = colour;
|
||||
dst++;
|
||||
src += ScaleByZoom(1, zoom);
|
||||
}
|
||||
|
@@ -54,15 +54,15 @@ public:
|
||||
virtual void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) = 0;
|
||||
|
||||
/**
|
||||
* Draw a colortable to the screen. This is: the color of the screen is read
|
||||
* and is looked-up in the palette to match a new color, which then is put
|
||||
* Draw a colourtable to the screen. This is: the colour of the screen is read
|
||||
* and is looked-up in the palette to match a new colour, which then is put
|
||||
* on the screen again.
|
||||
* @param dst the destination pointer (video-buffer).
|
||||
* @param width the width of the buffer.
|
||||
* @param height the height of the buffer.
|
||||
* @param pal the palette to use.
|
||||
*/
|
||||
virtual void DrawColorMappingRect(void *dst, int width, int height, int pal) = 0;
|
||||
virtual void DrawColourMappingRect(void *dst, int width, int height, int pal) = 0;
|
||||
|
||||
/**
|
||||
* Convert a sprite from the loader to our own format.
|
||||
@@ -80,33 +80,33 @@ public:
|
||||
virtual void *MoveTo(const void *video, int x, int y) = 0;
|
||||
|
||||
/**
|
||||
* Draw a pixel with a given color on the video-buffer.
|
||||
* Draw a pixel with a given colour on the video-buffer.
|
||||
* @param video The destination pointer (video-buffer).
|
||||
* @param x The x position within video-buffer.
|
||||
* @param y The y position within video-buffer.
|
||||
* @param color A 8bpp mapping color.
|
||||
* @param colour A 8bpp mapping colour.
|
||||
*/
|
||||
virtual void SetPixel(void *video, int x, int y, uint8 color) = 0;
|
||||
virtual void SetPixel(void *video, int x, int y, uint8 colour) = 0;
|
||||
|
||||
/**
|
||||
* Draw a pixel with a given color on the video-buffer if there is currently a black pixel.
|
||||
* Draw a pixel with a given colour on the video-buffer if there is currently a black pixel.
|
||||
* @param video The destination pointer (video-buffer).
|
||||
* @param x The x position within video-buffer.
|
||||
* @param y The y position within video-buffer.
|
||||
* @param color A 8bpp mapping color.
|
||||
* @param colour A 8bpp mapping colour.
|
||||
*/
|
||||
virtual void SetPixelIfEmpty(void *video, int x, int y, uint8 color) = 0;
|
||||
virtual void SetPixelIfEmpty(void *video, int x, int y, uint8 colour) = 0;
|
||||
|
||||
/**
|
||||
* Make a single horizontal line in a single color on the video-buffer.
|
||||
* Make a single horizontal line in a single colour on the video-buffer.
|
||||
* @param video The destination pointer (video-buffer).
|
||||
* @param width The lenght of the line.
|
||||
* @param color A 8bpp mapping color.
|
||||
* @param colour A 8bpp mapping colour.
|
||||
*/
|
||||
virtual void DrawRect(void *video, int width, int height, uint8 color) = 0;
|
||||
virtual void DrawRect(void *video, int width, int height, uint8 colour) = 0;
|
||||
|
||||
/**
|
||||
* Draw a line with a given color.
|
||||
* Draw a line with a given colour.
|
||||
* @param video The destination pointer (video-buffer).
|
||||
* @param x The x coordinate from where the line starts.
|
||||
* @param y The y coordinate from where the line starts.
|
||||
@@ -114,9 +114,9 @@ public:
|
||||
* @param y2 The y coordinate to where the lines goes.
|
||||
* @param screen_width The width of the screen you are drawing in (to avoid buffer-overflows).
|
||||
* @param screen_height The height of the screen you are drawing in (to avoid buffer-overflows).
|
||||
* @param color A 8bpp mapping color.
|
||||
* @param colour A 8bpp mapping colour.
|
||||
*/
|
||||
virtual void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 color) = 0;
|
||||
virtual void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour) = 0;
|
||||
|
||||
/**
|
||||
* Copy from a buffer to the screen.
|
||||
|
@@ -12,13 +12,13 @@ class Blitter_Null : public Blitter {
|
||||
public:
|
||||
/* virtual */ uint8 GetScreenDepth() { return 0; }
|
||||
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) {};
|
||||
/* virtual */ void DrawColorMappingRect(void *dst, int width, int height, int pal) {};
|
||||
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, int pal) {};
|
||||
/* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator);
|
||||
/* virtual */ void *MoveTo(const void *video, int x, int y) { return NULL; };
|
||||
/* virtual */ void SetPixel(void *video, int x, int y, uint8 color) {};
|
||||
/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 color) {};
|
||||
/* virtual */ void DrawRect(void *video, int width, int height, uint8 color) {};
|
||||
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 color) {};
|
||||
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour) {};
|
||||
/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 colour) {};
|
||||
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour) {};
|
||||
/* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour) {};
|
||||
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height) {};
|
||||
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height) {};
|
||||
/* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) {};
|
||||
|
Reference in New Issue
Block a user