mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-21 03:31:40 +00:00
GRAPHICS: GUI: Take tab shadow size from theme
This commit is contained in:
parent
05ea21c94d
commit
c27ad28ab2
@ -239,8 +239,9 @@ public:
|
||||
* @param w Width of the tab
|
||||
* @param h Height of the tab
|
||||
* @param r Radius of the corners of the tab (0 for squared tabs).
|
||||
* @param s Shadow size
|
||||
*/
|
||||
virtual void drawTab(int x, int y, int r, int w, int h) = 0;
|
||||
virtual void drawTab(int x, int y, int r, int w, int h, int s) = 0;
|
||||
|
||||
/**
|
||||
* Simple helper function to draw a cross.
|
||||
@ -451,7 +452,7 @@ public:
|
||||
void drawCallback_TAB(const Common::Rect &area, const DrawStep &step) {
|
||||
uint16 x, y, w, h;
|
||||
stepGetPositions(step, area, x, y, w, h);
|
||||
drawTab(x, y, stepGetRadius(step, area), w, h);
|
||||
drawTab(x, y, stepGetRadius(step, area), w, h, step.shadow);
|
||||
}
|
||||
|
||||
void drawCallback_BITMAP(const Common::Rect &area, const DrawStep &step) {
|
||||
|
@ -1237,7 +1237,7 @@ drawRoundedSquare(int x, int y, int r, int w, int h) {
|
||||
|
||||
template<typename PixelType>
|
||||
void VectorRendererSpec<PixelType>::
|
||||
drawTab(int x, int y, int r, int w, int h) {
|
||||
drawTab(int x, int y, int r, int w, int h, int s) {
|
||||
if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h ||
|
||||
w <= 0 || h <= 0 || x < 0 || y < 0 || r > w || r > h)
|
||||
return;
|
||||
@ -1267,12 +1267,12 @@ drawTab(int x, int y, int r, int w, int h) {
|
||||
// See the rounded rect alg for how to fix it. (The border should
|
||||
// be drawn before the interior, both inside drawTabAlg.)
|
||||
if (useClippingVersions) {
|
||||
drawTabShadowClip(x, y, w - 2, h, r);
|
||||
drawTabShadowClip(x, y, w - 2, h, r, s);
|
||||
drawTabAlgClip(x, y, w - 2, h, r, _bgColor, Base::_fillMode);
|
||||
if (Base::_strokeWidth)
|
||||
drawTabAlgClip(x, y, w, h, r, _fgColor, kFillDisabled, (Base::_dynamicData >> 16), (Base::_dynamicData & 0xFFFF));
|
||||
} else {
|
||||
drawTabShadow(x, y, w - 2, h, r);
|
||||
drawTabShadow(x, y, w - 2, h, r, s);
|
||||
drawTabAlg(x, y, w - 2, h, r, _bgColor, Base::_fillMode);
|
||||
if (Base::_strokeWidth)
|
||||
drawTabAlg(x, y, w, h, r, _fgColor, kFillDisabled, (Base::_dynamicData >> 16), (Base::_dynamicData & 0xFFFF));
|
||||
@ -1598,8 +1598,8 @@ drawTabAlgClip(int x1, int y1, int w, int h, int r, PixelType color, VectorRende
|
||||
|
||||
template<typename PixelType>
|
||||
void VectorRendererSpec<PixelType>::
|
||||
drawTabShadow(int x1, int y1, int w, int h, int r) {
|
||||
int offset = 3;
|
||||
drawTabShadow(int x1, int y1, int w, int h, int r, int s) {
|
||||
int offset = s;
|
||||
int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
|
||||
|
||||
// "Harder" shadows when having lower BPP, since we will have artifacts (greenish tint on the modern theme)
|
||||
@ -1659,8 +1659,8 @@ drawTabShadow(int x1, int y1, int w, int h, int r) {
|
||||
|
||||
template<typename PixelType>
|
||||
void VectorRendererSpec<PixelType>::
|
||||
drawTabShadowClip(int x1, int y1, int w, int h, int r) {
|
||||
int offset = 3;
|
||||
drawTabShadowClip(int x1, int y1, int w, int h, int r, int s) {
|
||||
int offset = s;
|
||||
int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
|
||||
|
||||
// "Harder" shadows when having lower BPP, since we will have artifacts (greenish tint on the modern theme)
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
void drawSquare(int x, int y, int w, int h) override;
|
||||
void drawRoundedSquare(int x, int y, int r, int w, int h) override;
|
||||
void drawTriangle(int x, int y, int base, int height, TriangleOrientation orient) override;
|
||||
void drawTab(int x, int y, int r, int w, int h) override;
|
||||
void drawTab(int x, int y, int r, int w, int h, int s) override;
|
||||
|
||||
void drawBeveledSquare(int x, int y, int w, int h) override {
|
||||
bool useClippingVersions = !_clippingArea.contains(Common::Rect(x, y, x + w, y + h));
|
||||
@ -226,9 +226,9 @@ protected:
|
||||
PixelType color, VectorRenderer::FillMode fill_m,
|
||||
int baseLeft = 0, int baseRight = 0);
|
||||
|
||||
virtual void drawTabShadow(int x, int y, int w, int h, int r);
|
||||
virtual void drawTabShadow(int x, int y, int w, int h, int r, int s);
|
||||
|
||||
virtual void drawTabShadowClip(int x, int y, int w, int h, int r);
|
||||
virtual void drawTabShadowClip(int x, int y, int w, int h, int r, int s);
|
||||
|
||||
virtual void drawBevelTabAlg(int x, int y, int w, int h,
|
||||
int bevel, PixelType topColor, PixelType bottomColor,
|
||||
|
Loading…
x
Reference in New Issue
Block a user