From bc798d9ff4d46ba758fa2d225cdd741f4c94ff18 Mon Sep 17 00:00:00 2001 From: Borja Lorente Date: Fri, 29 Jul 2016 10:27:30 +0200 Subject: GRAPHICS: Add custom border measures --- graphics/nine_patch.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'graphics/nine_patch.h') 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 -- cgit v1.2.3