[Scummvm-git-logs] scummvm master -> 214c7537a1fa8eab3dd597d3e9c9966cf29c6bac

sev- noreply at scummvm.org
Fri Sep 13 23:07:19 UTC 2024


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

Summary:
754b824d34 QDENGINE: Improved QDA debug output
214c7537a1 QDENGINE: Fix rounding errors in non-scaled tile sprite calculations


Commit: 754b824d34bab750cb283831f34b15b249105a87
    https://github.com/scummvm/scummvm/commit/754b824d34bab750cb283831f34b15b249105a87
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-14T00:48:00+02:00

Commit Message:
QDENGINE: Improved QDA debug output

Changed paths:
    engines/qdengine/qdcore/qd_animation.cpp


diff --git a/engines/qdengine/qdcore/qd_animation.cpp b/engines/qdengine/qdcore/qd_animation.cpp
index 8dffa790512..4698329cc60 100644
--- a/engines/qdengine/qdcore/qd_animation.cpp
+++ b/engines/qdengine/qdcore/qd_animation.cpp
@@ -138,7 +138,7 @@ void qdAnimation::quant(float dt) {
 }
 
 void qdAnimation::redraw(int x, int y, int z, int mode) const {
-	debugC(2, kDebugGraphics, "qdAnimation::redraw([%d, %d, %d], mode: %d), file: '%s', name: '%s'", x, y, z, mode, transCyrillic(qda_file().toString()), name());
+	debugC(2, kDebugGraphics, "qdAnimation::redraw([%d, %d, %d], mode: %d), name: '%s'", x, y, z, mode, transCyrillic(_parent ? _parent->name() : name()));
 
 	if (check_flag(QD_ANIMATION_FLAG_FLIP_HORIZONTAL))
 		mode |= GR_FLIP_HORIZONTAL;
@@ -156,7 +156,7 @@ void qdAnimation::redraw(int x, int y, int z, int mode) const {
 }
 
 void qdAnimation::redraw(int x, int y, int z, float scale, int mode) const {
-	debugC(2, kDebugGraphics, "qdAnimation::redraw([%d, %d, %d], scale: %f, mode: %d), file: '%s', name: '%s'", x, y, z, scale, mode, transCyrillic(qda_file().toString()), name());
+	debugC(2, kDebugGraphics, "qdAnimation::redraw([%d, %d, %d], scale: %f, mode: %d), name: '%s'", x, y, z, scale, mode, transCyrillic(_parent ? _parent->name() : name()));
 
 	if (fabs(scale - 1.0f) < 0.01f) {
 		redraw(x, y, z, mode);
@@ -189,7 +189,7 @@ void qdAnimation::redraw(int x, int y, int z, float scale, int mode) const {
 }
 
 void qdAnimation::redraw_rot(int x, int y, int z, float angle, int mode) const {
-	debugC(2, kDebugGraphics, "qdAnimation::redraw_rot([%d, %d, %d], angle: %f, mode: %d), file: '%s', name: '%s'", x, y, z, angle, mode, transCyrillic(qda_file().toString()), name());
+	debugC(2, kDebugGraphics, "qdAnimation::redraw_rot([%d, %d, %d], angle: %f, mode: %d), name: '%s'", x, y, z, angle, mode, transCyrillic(_parent ? _parent->name() : name()));
 
 	if (check_flag(QD_ANIMATION_FLAG_FLIP_HORIZONTAL))
 		mode |= GR_FLIP_HORIZONTAL;
@@ -204,7 +204,7 @@ void qdAnimation::redraw_rot(int x, int y, int z, float angle, int mode) const {
 }
 
 void qdAnimation::redraw_rot(int x, int y, int z, float angle, const Vect2f &scale, int mode) const {
-	debugC(2, kDebugGraphics, "qdAnimation::redraw_rot([%d, %d, %d], angle: %f, scale: [%f, %f], mode: %d), file: '%s', name: '%s'", x, y, z, angle, scale.x, scale.y, mode, transCyrillic(qda_file().toString()), name());
+	debugC(2, kDebugGraphics, "qdAnimation::redraw_rot([%d, %d, %d], angle: %f, scale: [%f, %f], mode: %d), name: '%s'", x, y, z, angle, scale.x, scale.y, mode, transCyrillic(_parent ? _parent->name() : name()));
 
 	if (fabs(scale.x - 1.0f) < 0.01f && fabs(scale.y - 1.0f) < 0.01f) {
 		redraw_rot(x, y, z, angle, mode);


Commit: 214c7537a1fa8eab3dd597d3e9c9966cf29c6bac
    https://github.com/scummvm/scummvm/commit/214c7537a1fa8eab3dd597d3e9c9966cf29c6bac
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-14T01:06:41+02:00

Commit Message:
QDENGINE: Fix rounding errors in non-scaled tile sprite calculations

Changed paths:
    engines/qdengine/system/graphics/gr_tile_animation.cpp


diff --git a/engines/qdengine/system/graphics/gr_tile_animation.cpp b/engines/qdengine/system/graphics/gr_tile_animation.cpp
index 5a8351f1e37..59b86c06c69 100644
--- a/engines/qdengine/system/graphics/gr_tile_animation.cpp
+++ b/engines/qdengine/system/graphics/gr_tile_animation.cpp
@@ -298,7 +298,7 @@ bool grTileAnimation::load(Common::SeekableReadStream *fh, int version) {
 }
 
 void grTileAnimation::drawFrame(const Vect2i &position, int32 frame_index, int32 mode, int closest_scale) const {
-	debugC(3, kDebugGraphics, "grTileAnimation::drawFrame([%d, %d], frame: %d, mode=%d, scale_idx: %d)", position.x, position.y, frame_index, mode, closest_scale);
+	debugC(3, kDebugGraphics, "grTileAnimation::drawFrame([%d, %d], frame: %d, mode: %d, scale_idx: %d)", position.x, position.y, frame_index, mode, closest_scale);
 
 	Vect2i frameSize = _frameSize;
 	Vect2i frameTileSize = _frameTileSize;
@@ -310,17 +310,18 @@ void grTileAnimation::drawFrame(const Vect2i &position, int32 frame_index, int32
 		frameStart = _scaleArray[closest_scale]._frameStart;
 	}
 
-	Vect2i pos0 = position - frameSize / 2;
+	int xx = position.x - frameSize.x / 2;
+	int yy = position.y - frameSize.y / 2;
 
 	int32 dx = GR_TILE_SPRITE_SIZE_X;
 	int32 dy = GR_TILE_SPRITE_SIZE_Y;
 
 	if (mode & GR_FLIP_HORIZONTAL) {
-		pos0.x += frameSize.x - GR_TILE_SPRITE_SIZE_X;
+		xx += frameSize.x - GR_TILE_SPRITE_SIZE_X;
 		dx = -dx;
 	}
 	if (mode & GR_FLIP_VERTICAL) {
-		pos0.y += frameSize.y - GR_TILE_SPRITE_SIZE_Y;
+		yy += frameSize.y - GR_TILE_SPRITE_SIZE_Y;
 		dy = -dy;
 	}
 
@@ -328,21 +329,21 @@ void grTileAnimation::drawFrame(const Vect2i &position, int32 frame_index, int32
 
 	const uint32 *index_ptr = &_frameIndex[frameStart] + frameTileSize.x * frameTileSize.y * frame_index;
 
-	Vect2i pos = pos0;
+	int x = xx, y = yy;
 	for (int32 i = 0; i < frameTileSize.y; i++) {
-		pos.x = pos0.x;
+		x = xx;
 
 		for (int32 j = 0; j < frameTileSize.x; j++) {
-			grDispatcher::instance()->putTileSpr(pos.x, pos.y, getTile(*index_ptr++), _hasAlpha, mode);
-			pos.x += dx;
+			grDispatcher::instance()->putTileSpr(x, y, getTile(*index_ptr++), _hasAlpha, mode);
+			x += dx;
 		}
 
-		pos.y += dy;
+		y += dy;
 	}
 }
 
 void grTileAnimation::drawFrame(const Vect2i &position, int frame_index, float angle, int mode) const {
-	debugC(3, kDebugGraphics, "grTileAnimation::drawFrame([%d, %d], frame: %d, angle=%f, scake: %d)", position.x, position.y, frame_index, angle, mode);
+	debugC(3, kDebugGraphics, "grTileAnimation::drawFrame([%d, %d], frame: %d, angle: %f, scale: %d)", position.x, position.y, frame_index, angle, mode);
 
 	byte *buf = decode_frame_data(frame_index, -1);
 	Vect2i pos = position - _frameSize / 2;




More information about the Scummvm-git-logs mailing list