[Scummvm-git-logs] scummvm master -> c27ad28ab2dbefb80f51073abdbc8aeba4c57774

sev- sev at scummvm.org
Tue Apr 13 06:09:36 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c27ad28ab2 GRAPHICS: GUI: Take tab shadow size from theme


Commit: c27ad28ab2dbefb80f51073abdbc8aeba4c57774
    https://github.com/scummvm/scummvm/commit/c27ad28ab2dbefb80f51073abdbc8aeba4c57774
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-04-13T08:09:16+02:00

Commit Message:
GRAPHICS: GUI: Take tab shadow size from theme

Changed paths:
    graphics/VectorRenderer.h
    graphics/VectorRendererSpec.cpp
    graphics/VectorRendererSpec.h


diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index 57ec477eda..e2a89b8f92 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -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) {
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 0f99ecc9a9..fcd3cc63ab 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -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)
diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h
index 64c5876977..4e934030fa 100644
--- a/graphics/VectorRendererSpec.h
+++ b/graphics/VectorRendererSpec.h
@@ -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,




More information about the Scummvm-git-logs mailing list