[Scummvm-git-logs] scummvm branch-2-6 -> d71c248b734e33c51bc1a29413023da82f277782

athrxx noreply at scummvm.org
Thu Jun 23 21:09:58 UTC 2022


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:
d71c248b73 KYRA: rename some flags


Commit: d71c248b734e33c51bc1a29413023da82f277782
    https://github.com/scummvm/scummvm/commit/d71c248b734e33c51bc1a29413023da82f277782
Author: athrxx (athrxx at scummvm.org)
Date: 2022-06-23T23:06:41+02:00

Commit Message:
KYRA: rename some flags

Changed paths:
    engines/kyra/graphics/screen.cpp
    engines/kyra/graphics/screen.h


diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp
index 9ea45098e0e..0a106d3e252 100644
--- a/engines/kyra/graphics/screen.cpp
+++ b/engines/kyra/graphics/screen.cpp
@@ -1592,7 +1592,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 		shapeData += 2;
 
 	if (*shapeData & 1)
-		flags |= 0x400;
+		flags |= kDRAWSHP_COMPACT;
 
 	va_list args;
 	va_start(args, flags);
@@ -1609,36 +1609,36 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 	_dsBackgroundFadingTable = nullptr;
 	_dsDrawLayer = 0;
 
-	if (flags & DSF_CUSTOM_PALETTE) {
+	if (flags & kDRAWSHP_COLOR) {
 		_dsColorTable = va_arg(args, uint8 *);
 	}
 
-	if (flags & DSF_SHAPE_FADING) {
+	if (flags & kDRAWSHP_FADE) {
 		_dsShapeFadingTable = va_arg(args, uint8 *);
 		_dsShapeFadingLevel = va_arg(args, int);
 		if (!_dsShapeFadingLevel)
-			flags &= ~DSF_SHAPE_FADING;
+			flags &= ~kDRAWSHP_FADE;
 	}
 
-	if (flags & DSF_TRANSPARENCY) {
+	if (flags & kDRAWSHP_TRANSPARENT) {
 		_dsTransparencyTable1 = va_arg(args, uint8 *);
 		_dsTransparencyTable2 = va_arg(args, uint8 *);
 	}
 
-	if (flags & 0x200) {
+	if (flags & kDRAWSHP_PREDATOR) {
 		_drawShapeVar1 = (_drawShapeVar1 + 1) & 0x7;
 		_drawShapeVar3 = drawShapeVar2[_drawShapeVar1];
 		_drawShapeVar4 = 0;
 		_drawShapeVar5 = 256;
 	}
 
-	if (flags & 0x4000)
+	if (flags & kDRAWSHP_MORPH)
 		_drawShapeVar5 = va_arg(args, int);
 
-	if (flags & 0x800)
+	if (flags & kDRAWSHP_PRIORITY)
 		_dsDrawLayer = va_arg(args, int);
 
-	if (flags & DSF_SCALE) {
+	if (flags & kDRAWSHP_SCALE) {
 		_dsScaleW = va_arg(args, int);
 		_dsScaleH = va_arg(args, int);
 	} else {
@@ -1646,7 +1646,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 		_dsScaleH = 0x100;
 	}
 
-	if ((flags & DSF_BACKGROUND_FADING) && _vm->game() != GI_KYRA1)
+	if ((flags & kDRAWSHP_BCKGRNDFADE) && _vm->game() != GI_KYRA1)
 		_dsBackgroundFadingTable = va_arg(args, uint8 *);
 
 	va_end(args);
@@ -1728,7 +1728,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 	const int ppc = (flags >> 8) & 0x3F;
 	_dsPlot = dsPlotFunc[ppc];
 	DsPlotFunc dsPlot2 = dsPlotFunc[ppc], dsPlot3 = dsPlotFunc[ppc];
-	if (flags & 0x800)
+	if (flags & kDRAWSHP_PRIORITY)
 		dsPlot3 = dsPlotFunc[((flags >> 8) & 0xF7) & 0x3F];
 
 	if (!_dsPlot || !dsPlot2 || !dsPlot3) {
@@ -1746,12 +1746,12 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 	const ScreenDim *dsDim = getScreenDim(sd);
 	dst += (dsDim->sx << 3);
 
-	if (!(flags & 0x10))
+	if (!(flags & kDRAWSHP_WINREL))
 		x -= (dsDim->sx << 3);
 
 	int x2 = (dsDim->w << 3);
 	int y1 = dsDim->sy;
-	if (flags & 0x10)
+	if (flags & kDRAWSHP_WINREL)
 		y += y1;
 
 	int y2 = y1 + dsDim->h;
@@ -1764,7 +1764,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 	int shpWidthScaled1 = shapeWidth;
 	int shpWidthScaled2 = shapeWidth;
 
-	if (flags & DSF_SCALE) {
+	if (flags & kDRAWSHP_SCALE) {
 		shapeHeight = (shapeHeight * _dsScaleH) >> 8;
 		shpWidthScaled1 = shpWidthScaled2 = (shapeWidth * _dsScaleW) >> 8;
 
@@ -1772,7 +1772,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 			return;
 	}
 
-	if (flags & DSF_CENTER) {
+	if (flags & kDRAWSHP_CENTER) {
 		x -= (shpWidthScaled1 >> 1);
 		y -= (shapeHeight >> 1);
 	}
@@ -1783,10 +1783,10 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 
 	int colorTableColors = ((_vm->game() != GI_KYRA1) && (shapeFlags & 4)) ? *src++ : 16;
 
-	if (!(flags & 0x8000) && (shapeFlags & 1))
+	if (!(flags & kDRAWSHP_COLOR) && (shapeFlags & 1))
 		_dsColorTable = src;
 
-	if (flags & 0x400)
+	if (flags & kDRAWSHP_COMPACT)
 		src += colorTableColors;
 
 	if (!(shapeFlags & 2)) {
@@ -1794,7 +1794,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 		src = _animBlockPtr;
 	}
 
-	int t = (flags & 2) ? y2 - y - shapeHeight : y - y1;
+	int t = (flags & kDRAWSHP_YFLIP) ? y2 - y - shapeHeight : y - y1;
 
 	if (t < 0) {
 		shapeHeight += t;
@@ -1827,17 +1827,17 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 			scaleCounterV += (-t << 8);
 		}
 
-		if (!(flags & 2))
+		if (!(flags & kDRAWSHP_YFLIP))
 			y = y1;
 	}
 
-	t = (flags & 2) ? y + shapeHeight - y1 : y2 - y;
+	t = (flags & kDRAWSHP_YFLIP) ? y + shapeHeight - y1 : y2 - y;
 	if (t <= 0)
 		return;
 
 	if (t < shapeHeight) {
 		shapeHeight = t;
-		if (flags & 2)
+		if (flags & kDRAWSHP_YFLIP)
 			y = y1;
 	}
 
@@ -1864,19 +1864,19 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 	int dsPitch = 320;
 	int ty = y;
 
-	if (flags & 2) {
+	if (flags & kDRAWSHP_YFLIP) {
 		dsPitch *= -1;
 		ty = ty - 1 + shapeHeight;
 	}
 
-	if (flags & DSF_X_FLIPPED) {
+	if (flags & kDRAWSHP_XFLIP) {
 		SWAP(_dsOffscreenLeft, _dsOffscreenRight);
 		dst += (shpWidthScaled1 - 1);
 	}
 
 	dst += (320 * ty + x);
 
-	if (flags & DSF_SCALE) {
+	if (flags & kDRAWSHP_SCALE) {
 		_dsOffscreenRight = 0;
 		_dsOffscreenScaleVal2 = _dsOffscreenLeft;
 		_dsOffscreenLeft <<= 8;
@@ -1915,7 +1915,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
 			if (_dsTmpWidth) {
 				cnt += shpWidthScaled1;
 				if (cnt > 0) {
-					if (flags & 0x800)
+					if (flags & kDRAWSHP_PRIORITY)
 						normalPlot = (curY > _maskMinY && curY < _maskMaxY);
 					_dsPlot = normalPlot ? dsPlot2 : dsPlot3;
 					(this->*_dsProcessLine)(d, src, cnt, scaleState);
diff --git a/engines/kyra/graphics/screen.h b/engines/kyra/graphics/screen.h
index b1ab0d0149c..a34d14c1b20 100644
--- a/engines/kyra/graphics/screen.h
+++ b/engines/kyra/graphics/screen.h
@@ -518,16 +518,19 @@ public:
 	};
 
 	enum DrawShapeFlags {
-		DSF_X_FLIPPED  = 0x01,
-		DSF_Y_FLIPPED  = 0x02,
-		DSF_SCALE      = 0x04,
-		DSF_WND_COORDS = 0x10,
-		DSF_CENTER     = 0x20,
-
-		DSF_SHAPE_FADING		= 0x100,
-		DSF_TRANSPARENCY		= 0x1000,
-		DSF_BACKGROUND_FADING	= 0x2000,
-		DSF_CUSTOM_PALETTE		= 0x8000
+		kDRAWSHP_XFLIP			= 0x01,
+		kDRAWSHP_YFLIP			= 0x02,
+		kDRAWSHP_SCALE			= 0x04,
+		kDRAWSHP_WINREL			= 0x10,
+		kDRAWSHP_CENTER			= 0x20,
+		kDRAWSHP_FADE			= 0x100,
+		kDRAWSHP_PREDATOR		= 0x200,
+		kDRAWSHP_COMPACT		= 0x400,
+		kDRAWSHP_PRIORITY		= 0x800,
+		kDRAWSHP_TRANSPARENT	= 0x1000,
+		kDRAWSHP_BCKGRNDFADE	= 0x2000,
+		kDRAWSHP_MORPH			= 0x4000,
+		kDRAWSHP_COLOR			= 0x8000
 	};
 
 	enum FontId {




More information about the Scummvm-git-logs mailing list