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

dreammaster dreammaster at scummvm.org
Sat Sep 11 21:39:52 UTC 2021


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:
aae048203f AGS: Remove commented out debug code from plugins
b7c9f5259f AGS: Hack to fix rain display in IA KQ3


Commit: aae048203f94f7c982af00d3453432ee349ac44e
    https://github.com/scummvm/scummvm/commit/aae048203f94f7c982af00d3453432ee349ac44e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-09-11T14:39:18-07:00

Commit Message:
AGS: Remove commented out debug code from plugins

Changed paths:
    engines/ags/plugins/ags_parallax/ags_parallax.cpp
    engines/ags/plugins/ags_snow_rain/weather.cpp


diff --git a/engines/ags/plugins/ags_parallax/ags_parallax.cpp b/engines/ags/plugins/ags_parallax/ags_parallax.cpp
index 36b267f1b3..6416e6ba88 100644
--- a/engines/ags/plugins/ags_parallax/ags_parallax.cpp
+++ b/engines/ags/plugins/ags_parallax/ags_parallax.cpp
@@ -127,11 +127,6 @@ void AGSParallax::Draw(bool foreground) {
 
 void AGSParallax::pxDrawSprite(ScriptMethodParams &params) {
 	PARAMS5(int, id, int, x, int, y, int, slot, int, speed);
-#ifdef DEBUG
-	char buffer[200];
-	sprintf(buffer, "%s %d %d %d %d %d\n", "pxDrawSprite", id, x, y, slot, speed);
-	_engine->PrintDebugConsole(buffer);
-#endif
 
 	if ((id < 0) || (id >= MAX_SPRITES))
 		return;
@@ -152,11 +147,6 @@ void AGSParallax::pxDrawSprite(ScriptMethodParams &params) {
 
 void AGSParallax::pxDeleteSprite(ScriptMethodParams &params) {
 	PARAMS1(int, id);
-#ifdef DEBUG
-	char buffer[200];
-	sprintf(buffer, "%s %d\n", "pxDeleteSprite", id);
-	_engine->PrintDebugConsole(buffer);
-#endif
 
 	if ((id < 0) || (id >= MAX_SPRITES))
 		return;
diff --git a/engines/ags/plugins/ags_snow_rain/weather.cpp b/engines/ags/plugins/ags_snow_rain/weather.cpp
index 96e683ee31..0e9e707c3a 100644
--- a/engines/ags/plugins/ags_snow_rain/weather.cpp
+++ b/engines/ags/plugins/ags_snow_rain/weather.cpp
@@ -246,12 +246,6 @@ void Weather::InitializeParticles() {
 }
 
 void Weather::SetDriftRange(int min_value, int max_value) {
-#ifdef DEBUG
-	char buffer[200];
-	sprintf(buffer, "%d %s %d %d\n", (int)_mIsSnow, "SetDriftRange", min_value, max_value);
-	_engine->PrintDebugConsole(buffer);
-#endif
-
 	ClipToRange(min_value, 0, 100);
 	ClipToRange(max_value, 0, 100);
 
@@ -267,12 +261,6 @@ void Weather::SetDriftRange(int min_value, int max_value) {
 }
 
 void Weather::SetDriftSpeed(int min_value, int max_value) {
-#ifdef DEBUG
-	char buffer[200];
-	sprintf(buffer, "%d %s %d %d\n", (int)_mIsSnow, "SetDriftSpeed", min_value, max_value);
-	_engine->PrintDebugConsole(buffer);
-#endif
-
 	ClipToRange(min_value, 0, 200);
 	ClipToRange(max_value, 0, 200);
 
@@ -288,24 +276,12 @@ void Weather::SetDriftSpeed(int min_value, int max_value) {
 }
 
 void Weather::ChangeAmount(int amount) {
-#ifdef DEBUG
-	char buffer[200];
-	sprintf(buffer, "%d %s %d\n", (int)_mIsSnow, "ChangeAmount", amount);
-	_engine->PrintDebugConsole(buffer);
-#endif
-
 	ClipToRange(amount, 0, 1000);
 
 	_mTargetAmount = amount;
 }
 
 void Weather::SetView(int kind_id, int event, int view, int loop) {
-#ifdef DEBUG
-	char buffer[200];
-	sprintf(buffer, "%d %s %d %d %d %d\n", (int)_mIsSnow, "SetView", kind_id, event, view, loop);
-	_engine->PrintDebugConsole(buffer);
-#endif
-
 	AGSViewFrame *view_frame = _engine->GetViewFrame(view, loop, 0);
 	_mViews[kind_id].bitmap = _engine->GetSpriteGraphic(view_frame->pic);
 	_mViews[kind_id].is_default = false;
@@ -317,12 +293,6 @@ void Weather::SetView(int kind_id, int event, int view, int loop) {
 }
 
 void Weather::SetDefaultView(int view, int loop) {
-#ifdef DEBUG
-	char buffer[200];
-	sprintf(buffer, "%d %s %d %d\n", (int)_mIsSnow, "SetDefaultView", view, loop);
-	_engine->PrintDebugConsole(buffer);
-#endif
-
 	AGSViewFrame *view_frame = _engine->GetViewFrame(view, loop, 0);
 	BITMAP *bitmap = _engine->GetSpriteGraphic(view_frame->pic);
 
@@ -339,12 +309,6 @@ void Weather::SetDefaultView(int view, int loop) {
 }
 
 void Weather::SetTransparency(int min_value, int max_value) {
-#ifdef DEBUG
-	char buffer[200];
-	sprintf(buffer, "%d %s %d %d\n", (int)_mIsSnow, "SetTransparency", min_value, max_value);
-	_engine->PrintDebugConsole(buffer);
-#endif
-
 	ClipToRange(min_value, 0, 100);
 	ClipToRange(max_value, 0, 100);
 
@@ -364,24 +328,12 @@ void Weather::SetTransparency(int min_value, int max_value) {
 }
 
 void Weather::SetWindSpeed(int value) {
-#ifdef DEBUG
-	char buffer[200];
-	sprintf(buffer, "%d %s %d\n", (int)_mIsSnow, "SetWindSpeed", value);
-	_engine->PrintDebugConsole(buffer);
-#endif
-
 	ClipToRange(value, -200, 200);
 
 	_mWindSpeed = (float)value / 20.0f;
 }
 
 void Weather::SetBaseline(int top, int bottom) {
-#ifdef DEBUG
-	char buffer[200];
-	sprintf(buffer, "%d %s %d %d\n", (int)_mIsSnow, "SetBaseline", top, bottom);
-	_engine->PrintDebugConsole(buffer);
-#endif
-
 	if (_screenHeight > 0) {
 		ClipToRange(top, 0, _screenHeight);
 		ClipToRange(bottom, 0, _screenHeight);
@@ -399,12 +351,6 @@ void Weather::SetBaseline(int top, int bottom) {
 }
 
 void Weather::SetAmount(int amount) {
-#ifdef DEBUG
-	char buffer[200];
-	sprintf(buffer, "%d %s %d\n", (int)_mIsSnow, "SetAmount", amount);
-	_engine->PrintDebugConsole(buffer);
-#endif
-
 	ClipToRange(amount, 0, 1000);
 
 	_mAmount = _mTargetAmount = amount;
@@ -413,12 +359,6 @@ void Weather::SetAmount(int amount) {
 }
 
 void Weather::SetFallSpeed(int min_value, int max_value) {
-#ifdef DEBUG
-	char buffer[200];
-	sprintf(buffer, "%d %s %d %d\n", (int)_mIsSnow, "SetFallSpeed", min_value, max_value);
-	_engine->PrintDebugConsole(buffer);
-#endif
-
 	ClipToRange(min_value, 0, 1000);
 	ClipToRange(max_value, 0, 1000);
 


Commit: b7c9f5259f1737f6084fa110a4788ced47d7defa
    https://github.com/scummvm/scummvm/commit/b7c9f5259f1737f6084fa110a4788ced47d7defa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-09-11T14:39:18-07:00

Commit Message:
AGS: Hack to fix rain display in IA KQ3

The ags_snowrain plugin seems to have logic in it to transparently
translate 320x200 based coordinates when the game is run in
640x400 mode. Since the current plugin code is a recreation rather
than a reimplementation, I wasn't sure where to do the fixes,
so for now simply put a hack in the set baseline script, which was
all that was needed for KQ3

Changed paths:
    engines/ags/plugins/ags_snow_rain/ags_snow_rain.cpp


diff --git a/engines/ags/plugins/ags_snow_rain/ags_snow_rain.cpp b/engines/ags/plugins/ags_snow_rain/ags_snow_rain.cpp
index cd29fa368f..f4bcdf4dfd 100644
--- a/engines/ags/plugins/ags_snow_rain/ags_snow_rain.cpp
+++ b/engines/ags/plugins/ags_snow_rain/ags_snow_rain.cpp
@@ -111,6 +111,15 @@ void AGSSnowRain::srSetWindSpeed(ScriptMethodParams &params) {
 
 void AGSSnowRain::srSetBaseline(ScriptMethodParams &params) {
 	PARAMS2(int, top, int, bottom);
+
+	// FIXME: The original seems to take co-ordinates in 320x200,
+	// but still displays correctly at 640x400. So doubling must
+	// occur somewhere. For now, doing it here
+	if (_screenHeight == 400) {
+		top *= 2;
+		bottom *= 2;
+	}
+
 	_snow.SetBaseline(top, bottom);
 	_rain.SetBaseline(top, bottom);
 }




More information about the Scummvm-git-logs mailing list