[Scummvm-git-logs] scummvm master -> 65239032a588916e5beafbc1cb334352194e6e80

bluegr noreply at scummvm.org
Thu Nov 7 20:14:24 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:
20c94619ce DGDS: Add another version of Johnny Castaway
65239032a5 DGDS: Replace numeric screen width/height values with defines


Commit: 20c94619ce0673989a6ca2c8894fd0956f9d3f94
    https://github.com/scummvm/scummvm/commit/20c94619ce0673989a6ca2c8894fd0956f9d3f94
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-07T22:13:52+02:00

Commit Message:
DGDS: Add another version of Johnny Castaway

Changed paths:
    engines/dgds/detection_tables.h


diff --git a/engines/dgds/detection_tables.h b/engines/dgds/detection_tables.h
index a589724e4a0..dc8adb35cfa 100644
--- a/engines/dgds/detection_tables.h
+++ b/engines/dgds/detection_tables.h
@@ -414,6 +414,21 @@ static const ADGameDescription gameDescriptions[] = {
 		GUIO1(GUIO_NONE)
 	},
 
+	// Johnny Castaway screensaver
+	{
+		"castaway",
+		0,
+		{
+			{"resource.map", 0, "cf6b8e845a5235b2294fba0da1174f09", 1453},
+			{"resource.001", 0, "281ea06786017820969bd7baa0cc2905", 1175278},
+			{"scrantic.exe", 0, "46ce1ae10fcfa52dd964fcfc86694509", 295952},
+			AD_LISTEND
+		},
+		Common::EN_ANY,
+		Common::kPlatformWindows,
+		ADGF_DEMO | ADGF_UNSTABLE,
+		GUIO1(GUIO_NONE)
+	},
 
 	AD_TABLE_END_MARKER
 };


Commit: 65239032a588916e5beafbc1cb334352194e6e80
    https://github.com/scummvm/scummvm/commit/65239032a588916e5beafbc1cb334352194e6e80
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-07T22:13:52+02:00

Commit Message:
DGDS: Replace numeric screen width/height values with defines

Changed paths:
    engines/dgds/dragon_native.cpp
    engines/dgds/hoc_intro.cpp
    engines/dgds/image.cpp
    engines/dgds/inventory.cpp
    engines/dgds/minigames/dragon_arcade.cpp
    engines/dgds/minigames/dragon_arcade_ttm.cpp
    engines/dgds/request.cpp
    engines/dgds/ttm.cpp


diff --git a/engines/dgds/dragon_native.cpp b/engines/dgds/dragon_native.cpp
index f62aa2f5f12..126a89aebaa 100644
--- a/engines/dgds/dragon_native.cpp
+++ b/engines/dgds/dragon_native.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "dgds/dragon_native.h"
+#include "dgds/includes.h"
 #include "dgds/globals.h"
 #include "dgds/scene.h"
 
@@ -33,7 +34,7 @@ void DragonNative::drawCountdown(FontManager::FontType fontType, int16 x, int16
 	int16 currentMins = engine->getClock().getMins();
 	const DgdsFont *fnt = engine->getFontMan()->getFont(fontType);
 	Common::String str = Common::String::format("%d", countdownEnd - currentMins);
-	fnt->drawString(&engine->_compositionBuffer, str, x, y, 320 - x, 10);
+	fnt->drawString(&engine->_compositionBuffer, str, x, y, SCREEN_WIDTH - x, 10);
 }
 
 
diff --git a/engines/dgds/hoc_intro.cpp b/engines/dgds/hoc_intro.cpp
index f0e36cc637c..8bba17c2942 100644
--- a/engines/dgds/hoc_intro.cpp
+++ b/engines/dgds/hoc_intro.cpp
@@ -42,7 +42,7 @@ void HocIntro::init() {
 		return;
 
 	_scrollCountdown2 = 137;
-	_xOffset2042 = 320;
+	_xOffset2042 = SCREEN_WIDTH;
 	_scrollCountdown1 = 150;
 	engine->_soundPlayer->loadMusic("INTRO1.SNG");
 	engine->_soundPlayer->playMusic(0);
@@ -101,8 +101,8 @@ void HocIntro::doScroll() {
 	// set clip window
 	_drawWin.top = 0;
 	_drawWin.left = MAX((int16)0, _xOffset2042);
-	_drawWin.right = 320;
-	_drawWin.bottom = 200;
+	_drawWin.right = SCREEN_WIDTH;
+	_drawWin.bottom = SCREEN_HEIGHT;
 	clean1(_scrollCountdown2);
 	clean2(_xOffset2042);
 	draw1(_scrollCountdown2);
@@ -110,8 +110,8 @@ void HocIntro::doScroll() {
 }
 
 static int16 _clipXOffset(int16 x1, int16 x2) {
-	if (x1 + x2 > 320)
-		x2 = 320 - x1;
+	if (x1 + x2 > SCREEN_WIDTH)
+		x2 = SCREEN_WIDTH - x1;
 
 	if (x2 < 0)
 		x2 = 0;
@@ -142,7 +142,7 @@ void HocIntro::doCopy(int16 x1, int16 y1, int16 x2, int16 y2) {
 	if (xx < _drawWin.left)
 		xx = _drawWin.left;
 
-	if (xx < 320) {
+	if (xx < SCREEN_WIDTH) {
 		DgdsEngine *engine = DgdsEngine::getInstance();
 		Graphics::ManagedSurface &bg = engine->getBackgroundBuffer();
 		Graphics::ManagedSurface &comp = engine->_compositionBuffer;
diff --git a/engines/dgds/image.cpp b/engines/dgds/image.cpp
index bf5da4e75c0..24b08fe6ef5 100644
--- a/engines/dgds/image.cpp
+++ b/engines/dgds/image.cpp
@@ -359,7 +359,7 @@ struct VQTDecodeState {
 	uint32 offset;
 	const byte *srcPtr;
 	byte *dstPtr;
-	uint16 rowStarts[200];
+	uint16 rowStarts[SCREEN_HEIGHT];
 };
 
 static inline byte _getVqtBits(struct VQTDecodeState *state, uint16 nbits) {
@@ -474,7 +474,7 @@ uint32 Image::loadVQT(Graphics::ManagedSurface *surf, uint32 toffset, Common::Se
 	uint32 tw = surf->w;
 	uint32 th = surf->h;
 	assert(th != 0);
-	if (th > 200)
+	if (th > SCREEN_HEIGHT)
 		error("Max VQT height supported is 200px");
 	VQTDecodeState state;
 	state.dstPtr = (byte *)surf->getPixels();
diff --git a/engines/dgds/inventory.cpp b/engines/dgds/inventory.cpp
index febbaa31a35..21bb3728033 100644
--- a/engines/dgds/inventory.cpp
+++ b/engines/dgds/inventory.cpp
@@ -220,7 +220,7 @@ void Inventory::drawItems(Graphics::ManagedSurface &surf) {
 		return;
 
 	// TODO: does this need to be adjusted ever?
-	const Common::Rect drawMask(0, 0, 320, 200);
+	const Common::Rect drawMask(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
 	int offset = _itemOffset;
 	Common::Array<GameItem> &items = engine->getGDSScene()->getGameItems();
 	for (auto & item: items) {
diff --git a/engines/dgds/minigames/dragon_arcade.cpp b/engines/dgds/minigames/dragon_arcade.cpp
index ba4bb379686..7d1a5f7abd2 100644
--- a/engines/dgds/minigames/dragon_arcade.cpp
+++ b/engines/dgds/minigames/dragon_arcade.cpp
@@ -1881,7 +1881,7 @@ void DragonArcade::moveBladeX() {
 		}
 	} else if (_scrollVelocityX > 0) {
 		if (_scrollXOffset == 282) {
-			if (_npcState[0].x < 320)
+			if (_npcState[0].x < SCREEN_WIDTH)
 				_bladeXMove = 4;
 
 		} else if (0xa0 < _npcState[0].x) {
diff --git a/engines/dgds/minigames/dragon_arcade_ttm.cpp b/engines/dgds/minigames/dragon_arcade_ttm.cpp
index b38e5733a4c..8147d5bd045 100644
--- a/engines/dgds/minigames/dragon_arcade_ttm.cpp
+++ b/engines/dgds/minigames/dragon_arcade_ttm.cpp
@@ -199,7 +199,7 @@ int16 DragonArcadeTTM::handleOperation(TTMEnviro &env, int16 page, uint16 op, by
 	case 0xA104: // DRAW FILLED RECT
 		if (_doingInit) {
 			ArcadeFloor data;
-			data.x = (page - 1) * 320 + ivals[0];
+			data.x = (page - 1) * SCREEN_WIDTH + ivals[0];
 			data.width = ivals[2];
 			data.yval = (byte)ivals[1];
 			data.flag = false;
@@ -213,7 +213,7 @@ int16 DragonArcadeTTM::handleOperation(TTMEnviro &env, int16 page, uint16 op, by
 	case 0xA114: // DRAW EMPTY RECT
 		if (_doingInit) {
 			ArcadeFloor data;
-			data.x = (page - 1) * 320 + ivals[0];
+			data.x = (page - 1) * SCREEN_WIDTH + ivals[0];
 			data.width = ivals[2];
 			data.yval = (byte)ivals[1];
 			data.flag = true;
diff --git a/engines/dgds/request.cpp b/engines/dgds/request.cpp
index fbf4d14482f..e993b960228 100644
--- a/engines/dgds/request.cpp
+++ b/engines/dgds/request.cpp
@@ -574,7 +574,7 @@ void SliderGadget::draw(Graphics::ManagedSurface *dst) const {
 
 	// Draw the slider control in the right spot
 	const Image *uiCorners = RequestData::getCorners();
-	uiCorners->drawBitmap(SLIDER_HANDLE_FRAME, x + _handleX, y, Common::Rect(0, 0, 320, 200), *dst);
+	uiCorners->drawBitmap(SLIDER_HANDLE_FRAME, x + _handleX, y, Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), *dst);
 }
 
 SliderGadget::SliderGadget() : _lock(false), _steps(0), _gadget2_i1(0),
diff --git a/engines/dgds/ttm.cpp b/engines/dgds/ttm.cpp
index 9944a8d7fbd..6da1dc54d27 100644
--- a/engines/dgds/ttm.cpp
+++ b/engines/dgds/ttm.cpp
@@ -498,7 +498,7 @@ int16 TTMInterpreter::doOpInitCreditScroll(const Image *img) {
  bool TTMInterpreter::doOpCreditsScroll(const Image *img, int16 ygap, int16 ymax, int16 xoff, int16 measuredWidth, const Common::Rect &clipRect) {
 	int nframes = img->loadedFrameCount();
 	bool scrollFinished = true;
-	int y = 200 - ymax;
+	int y = SCREEN_HEIGHT - ymax;
 	for (int i = 0; i < nframes; i++) {
 		int width = img->width(i);
 		int height = img->height(i);
@@ -511,7 +511,7 @@ int16 TTMInterpreter::doOpInitCreditScroll(const Image *img) {
 			scrollFinished = false;
 		}
 		y += ygap + height;
-		if (y > 200)
+		if (y > SCREEN_HEIGHT)
 			break;
 	}
 	return scrollFinished;
@@ -780,7 +780,7 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
 			// Speed 4 should complete fade in 2 seconds (eg, Dynamix logo fade)
 
 			// TODO: this is a pretty bad way to do it - should pump messages in this loop?
-			for (int i = 0; i < 320; i += ivals[3]) {
+			for (int i = 0; i < SCREEN_WIDTH; i += ivals[3]) {
 				int fade = MIN(i / 5, 63);
 				_vm->getGamePals()->setFade(ivals[0], ivals[1], ivals[2], fade * 4);
 				g_system->updateScreen();
@@ -801,10 +801,10 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
 		if (ivals[3] == 0) {
 			_vm->getGamePals()->setPalette();
 		} else {
-			for (int i = 320; i > 0; i -= ivals[3]) {
+			for (int i = SCREEN_WIDTH; i > 0; i -= ivals[3]) {
 				int fade = MAX(0, MIN(i / 5, 63));
 				_vm->getGamePals()->setFade(ivals[0], ivals[1], ivals[2], fade * 4);
-				if (i == 320) {
+				if (i == SCREEN_WIDTH) {
 					// update screen first to make the initial fade-in work
 					g_system->copyRectToScreen(_vm->_compositionBuffer.getPixels(), SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
 				}




More information about the Scummvm-git-logs mailing list