aboutsummaryrefslogtreecommitdiff
path: root/graphics/nine_patch.h
diff options
context:
space:
mode:
authorBorja Lorente2016-07-29 10:27:30 +0200
committerBorja Lorente2016-08-02 08:33:43 +0200
commitbc798d9ff4d46ba758fa2d225cdd741f4c94ff18 (patch)
tree0b500c6fe1b753a224bbcc4ea279f1ede0934e17 /graphics/nine_patch.h
parent2b586e7c5959c839323d24d1f788c9a836ece765 (diff)
downloadscummvm-rg350-bc798d9ff4d46ba758fa2d225cdd741f4c94ff18.tar.gz
scummvm-rg350-bc798d9ff4d46ba758fa2d225cdd741f4c94ff18.tar.bz2
scummvm-rg350-bc798d9ff4d46ba758fa2d225cdd741f4c94ff18.zip
GRAPHICS: Add custom border measures
Diffstat (limited to 'graphics/nine_patch.h')
-rw-r--r--graphics/nine_patch.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/graphics/nine_patch.h b/graphics/nine_patch.h
index eaebac3e7b..d0fc1af05a 100644
--- a/graphics/nine_patch.h
+++ b/graphics/nine_patch.h
@@ -86,15 +86,25 @@ public:
NinePatchBitmap(Graphics::TransparentSurface *bmp, bool owns_bitmap);
~NinePatchBitmap();
- void blit(Graphics::Surface &target, int dx, int dy, int dw, int dh);
+ void blit(Graphics::Surface &target, int dx, int dy, int dw, int dh, byte *palette = NULL, byte numColours = 0);
void blitClip(Graphics::Surface &target, Common::Rect clip, int dx, int dy, int dw, int dh);
-
+
int getWidth() { return _width; }
int getHeight() { return _height; }
int getMinWidth() { return _h._fix; }
int getMinHeight() { return _v._fix; }
Graphics::TransparentSurface *getSource() { return _bmp; }
Common::Rect &getPadding() { return _padding; }
+
+private:
+
+ void drawRegions(Graphics::Surface &target, int dx, int dy, int dw, int dh);
+
+ // Assumes color is in the palette
+ byte getColorIndex(uint32 target, byte *palette);
+ uint32 grayscale(uint32 color);
+ uint32 grayscale(byte r, byte g, byte b);
+ byte closestGrayscale(uint32 color, byte* palette, byte paletteLength);
};
} // end of namespace Graphics