GRAPHICS: Fix NinePatch palette length.
Byte did not allow to have 256 color palettes.
This commit is contained in:
parent
6f20f676cd
commit
2da99ab0dc
2 changed files with 4 additions and 4 deletions
|
@ -203,7 +203,7 @@ bad_bitmap:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NinePatchBitmap::blit(Graphics::Surface &target, int dx, int dy, int dw, int dh, byte *palette, byte numColors) {
|
void NinePatchBitmap::blit(Graphics::Surface &target, int dx, int dy, int dw, int dh, byte *palette, int numColors) {
|
||||||
/* don't draw bitmaps that are smaller than the fixed area */
|
/* don't draw bitmaps that are smaller than the fixed area */
|
||||||
if (dw < _h._fix || dh < _v._fix)
|
if (dw < _h._fix || dh < _v._fix)
|
||||||
return;
|
return;
|
||||||
|
@ -347,7 +347,7 @@ static inline uint32 dist(uint32 a, uint32 b) {
|
||||||
return b - a;
|
return b - a;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte NinePatchBitmap::closestGrayscale(uint32 color, byte* palette, byte paletteLength) {
|
byte NinePatchBitmap::closestGrayscale(uint32 color, byte* palette, int paletteLength) {
|
||||||
if (!_cached_colors.contains(color)) {
|
if (!_cached_colors.contains(color)) {
|
||||||
byte target = grayscale(color);
|
byte target = grayscale(color);
|
||||||
byte bestNdx = 0;
|
byte bestNdx = 0;
|
||||||
|
|
|
@ -88,7 +88,7 @@ public:
|
||||||
NinePatchBitmap(Graphics::TransparentSurface *bmp, bool owns_bitmap);
|
NinePatchBitmap(Graphics::TransparentSurface *bmp, bool owns_bitmap);
|
||||||
~NinePatchBitmap();
|
~NinePatchBitmap();
|
||||||
|
|
||||||
void blit(Graphics::Surface &target, int dx, int dy, int dw, int dh, byte *palette = NULL, byte numColors = 0);
|
void blit(Graphics::Surface &target, int dx, int dy, int dw, int dh, byte *palette = NULL, int numColors = 0);
|
||||||
void blitClip(Graphics::Surface &target, Common::Rect clip, int dx, int dy, int dw, int dh);
|
void blitClip(Graphics::Surface &target, Common::Rect clip, int dx, int dy, int dw, int dh);
|
||||||
|
|
||||||
int getWidth() { return _width; }
|
int getWidth() { return _width; }
|
||||||
|
@ -106,7 +106,7 @@ private:
|
||||||
byte getColorIndex(uint32 target, byte *palette);
|
byte getColorIndex(uint32 target, byte *palette);
|
||||||
uint32 grayscale(uint32 color);
|
uint32 grayscale(uint32 color);
|
||||||
uint32 grayscale(byte r, byte g, byte b);
|
uint32 grayscale(byte r, byte g, byte b);
|
||||||
byte closestGrayscale(uint32 color, byte* palette, byte paletteLength);
|
byte closestGrayscale(uint32 color, byte* palette, int paletteLength);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end of namespace Graphics
|
} // end of namespace Graphics
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue