[Scummvm-git-logs] scummvm master -> 404e4e835a7516cc02f9901de23254fe102bb51d

Strangerke noreply at scummvm.org
Tue Apr 14 09:51:37 UTC 2026


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

Summary:
404e4e835a WAYNESWORLD: Implement demo1 part 4 (intro), some refactoring, introduce ABT sound files


Commit: 404e4e835a7516cc02f9901de23254fe102bb51d
    https://github.com/scummvm/scummvm/commit/404e4e835a7516cc02f9901de23254fe102bb51d
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-04-14T11:51:19+02:00

Commit Message:
WAYNESWORLD: Implement demo1 part 4 (intro), some refactoring, introduce ABT sound files

Changed paths:
    engines/waynesworld/sound.cpp
    engines/waynesworld/wwintro.cpp
    engines/waynesworld/wwintro.h
    engines/waynesworld/wwintro_demo1.cpp
    engines/waynesworld/wwintro_full.cpp


diff --git a/engines/waynesworld/sound.cpp b/engines/waynesworld/sound.cpp
index c40dc95a882..7ba2e02c975 100644
--- a/engines/waynesworld/sound.cpp
+++ b/engines/waynesworld/sound.cpp
@@ -49,6 +49,11 @@ void SoundManager::playSound(const char *filename, bool flag) {
 
 	_filename = Common::String(filename);
 
+	if (strcmpi(filename + (_filename.size() - 3), "ABT") == 0) {
+		warning("ABT files not supported yet");
+		return;
+	}
+
 	Common::File fd;
 	if (!fd.open(Common::Path(filename))) {
 		error("playSound : Enable to open %s", filename);
diff --git a/engines/waynesworld/wwintro.cpp b/engines/waynesworld/wwintro.cpp
index 0be495f805c..f6661f3ffcf 100644
--- a/engines/waynesworld/wwintro.cpp
+++ b/engines/waynesworld/wwintro.cpp
@@ -115,6 +115,78 @@ void WWIntro::setColor236(int index) {
 	g_system->getPaletteManager()->setPalette((const byte *)&newColor, 236, 1);
 }
 
+void WWIntro::sub3009A(int textId) {
+	int startPos;
+	byte textColor;
+	int textType = 0;
+	Common::String filename;
+
+	switch (textId) {
+	case 0:
+		filename = "oaw";
+		startPos = _startOawPos;
+		textColor = 147;
+		break;
+	case 1:
+		filename = "oag";
+		startPos = _startOagPos;
+		textColor = 41;
+		break;
+	default:
+		filename = "oao";
+		startPos = _startOaoPos;
+		++_startOaoPos;
+		textColor = 11;
+		textType = 1;
+		break;
+	}
+
+	Common::String displayTxt = _vm->loadString(filename.c_str(), startPos, 0);
+
+	if (textType && !(_vm->_gameDescription->flags & ADGF_DEMO))
+		_vm->_fontWW->drawText(_demoPt2Surface, displayTxt.c_str(), 0, 187, textColor);
+	else
+		_vm->_fontWW->drawText(_demoPt2Surface, displayTxt.c_str(), 0, 2, textColor);
+}
+
+void WWIntro::sub2FEFB(int arg_refreshBackgFl, int arg_wBodyIndex, int arg_gBodyIndex, int arg_wHead1Index, int arg_gHead1Index, int arg_TextId) {
+	_demoPt2Surface->fillRect(0, 0, 319, 14, 0);
+	_demoPt2Surface->fillRect(0, 185, 319, 199, 0);
+
+	if (arg_refreshBackgFl != _oldRefreshBackgFl) {
+		_demoPt2Surface->clear(0);
+		_demoPt2Surface->drawSurface(_introBackg1Image, 0, 15);
+		_oldRefreshBackgFl = arg_refreshBackgFl;
+	}
+
+	if (arg_wBodyIndex != _oldWBodyIndex) {
+		_demoPt2Surface->drawSurface(_introWbodyImage[arg_wBodyIndex], 0, 21);
+		_oldWBodyIndex = arg_wBodyIndex;
+	}
+
+	if (arg_gBodyIndex != _oldGBodyIndex) {
+		_demoPt2Surface->drawSurface(_introGbodyImage, 160, 25);
+		_oldGBodyIndex = arg_gBodyIndex;
+	}
+
+	if (arg_wHead1Index != _oldWHead1Index) {
+		_demoPt2Surface->drawSurface(_introWhead1[arg_wHead1Index], 12, 22);
+		_oldWHead1Index = arg_wHead1Index;
+	}
+
+	if (arg_gHead1Index != _oldGHead1Index) {
+		_demoPt2Surface->drawSurface(_introGhead1[arg_gHead1Index], 182, 21);
+		_oldGHead1Index = arg_gHead1Index;
+	}
+
+	if (arg_TextId != -1) {
+		sub3009A(arg_TextId);
+	}
+
+	_vm->_screen->drawSurface(_demoPt2Surface, 0, 0);
+	_vm->waitMillis(170);
+}
+
 void WWIntro::introPt3_init() {
 	_backg2Surface = new WWSurface(320, 170);
 	_logoSurface = new WWSurface(226, 134);
diff --git a/engines/waynesworld/wwintro.h b/engines/waynesworld/wwintro.h
index 17e0605fdd6..bc2b4addfc4 100644
--- a/engines/waynesworld/wwintro.h
+++ b/engines/waynesworld/wwintro.h
@@ -46,6 +46,17 @@ protected:
 	WWSurface *_outlineSurface = nullptr;
 	WWSurface *_logoSurface = nullptr;
 	WWSurface *_backg2Surface = nullptr;
+	WWSurface *_introBackg1Image = nullptr;
+	WWSurface *_introWhead1[8] = {nullptr};
+	WWSurface *_introWbodyImage[5] = {nullptr};
+	WWSurface *_introGhead1[11] = {nullptr};
+	WWSurface *_introGbodyImage = nullptr;
+	
+	int _oldRefreshBackgFl = -1;
+	int _oldWBodyIndex = -1;
+	int _oldGBodyIndex = -1;
+	int _oldWHead1Index = -1;
+	int _oldGHead1Index = -1;
 
 public:
 	WWIntro(WaynesWorldEngine *vm);
@@ -56,12 +67,20 @@ public:
 
 protected:
 	GxlArchive *_oanGxl = nullptr;
+	int _startOawPos = 0;
+	int _startOagPos = 0;
+	int _startOaoPos = 0;
+
 
 	bool initOanGxl();
 	void wwEffect(int arg0, int arg1, bool flag = false);
 	void setColor236(int index);
+	void sub2FEFB(int arg_refreshBackgFl, int arg_wBodyIndex, int arg_gBodyIndex, int arg_wHead1Index, int arg_gHead1Index, int arg_TextId);
 	void introPt3_init();
 	void introPt3_clean();
+
+private:
+	void sub3009A(int textId);
 };
 
 class WWIntro_full : public WWIntro {
@@ -72,26 +91,13 @@ public:
 	void runIntro() override;
 
 private:
-	int _startOawPos = 0;
-	int _startOagPos = 0;
-	int _startOaoPos = 0;
-
-	int _old_arg_refreshBackgFl = -1;
-	int _old_arg_wBodyIndex = -1;
-	int _old_arg_gBodyIndex = -1;
-	int _old_argWHead1Index = -1;
-	int _old_argGHead1Index = -1;
-
 	bool introPt1();
 	bool introPt3(bool flag);
 	bool introPt4();
-	void introPt5();
+	void cleanOanGxl();
 	void introPt6();
 	void introPt7();
 
-	void sub3009A(int textId);
-	void sub2FEFB(int arg_refreshBackgFl, int arg_wBodyIndex, int arg_gBodyIndex, int arg_wHead1Index, int arg_gHead1Index, int arg_TextId);
-
 	void introPt4_init();
 	bool introPt4_intro();
 	bool introPt4_displayCallInTime();
@@ -101,12 +107,6 @@ private:
 	bool introPt4_caller4();
 	void introPt4_cleanup();
 	bool introPt4_playGuitar();
-
-	WWSurface *_introBackg1Image = nullptr;
-	WWSurface *_introWbodyImage[5] = {nullptr};
-	WWSurface *_introGbodyImage = nullptr;
-	WWSurface *_introWhead1[8] = {nullptr};
-	WWSurface *_introGhead1[11] = {nullptr};
 };
 
 class WWIntro_demo1 : public WWIntro {
@@ -118,7 +118,11 @@ public:
 
 private:
 	bool introPt1();
-	bool introPt2();
+	bool introPt3();
+	bool introPt4();
+	void introPt4_init();
+	bool introPt4_intro();
+	void introPt4_cleanup();
 };
 } // End of namespace WaynesWorld
 
diff --git a/engines/waynesworld/wwintro_demo1.cpp b/engines/waynesworld/wwintro_demo1.cpp
index b8427b9c82d..8cf2c94f98b 100644
--- a/engines/waynesworld/wwintro_demo1.cpp
+++ b/engines/waynesworld/wwintro_demo1.cpp
@@ -36,13 +36,18 @@ WWIntro_demo1::~WWIntro_demo1() {
 }
 
 void WWIntro_demo1::runIntro() {
+	// continueFl is used like in the full version, but for the moment it's not possible to skip (demo is not interactive)
 	bool continueFl = initOanGxl();
 
 	if (continueFl)
-		introPt1();
+		continueFl = introPt1();
 
 	if (continueFl)
-		introPt2();
+		continueFl = introPt3();
+
+	if (continueFl)
+		continueFl = introPt4();
+
 }
 
 bool WWIntro_demo1::introPt1() {
@@ -146,7 +151,7 @@ bool WWIntro_demo1::introPt1() {
 	return true;
 }
 
-bool WWIntro_demo1::introPt2() {
+bool WWIntro_demo1::introPt3() {
 	// sub1 - Parameter is always 'true' so it has been removed and the code simplified
 	_vm->paletteFadeOut(0, 256, 64);
 	_vm->_screen->clear(0);
@@ -187,4 +192,84 @@ bool WWIntro_demo1::introPt2() {
 	return true;
 }
 
+bool WWIntro_demo1::introPt4() {
+	bool retVal = true;
+
+	introPt4_init();
+	if (!introPt4_intro()) {
+		retVal = false;
+	}
+
+	introPt4_cleanup();
+	return retVal;
+}
+
+void WWIntro_demo1::introPt4_init() {
+	_vm->_fontWW = new GFTFont();
+	_vm->_fontWW->loadFromFile("ww.gft");
+
+	while (_vm->_sound->isSFXPlaying())
+		_vm->waitMillis(30);
+
+	_introBackg1Image = new WWSurface(320, 170);
+	_vm->drawImageToSurface(_oanGxl, "backg1.pcx", _introBackg1Image, 0, 0);
+	_introWbodyImage[0] = new WWSurface(145, 118);
+	_vm->drawImageToSurface(_oanGxl, "wbody0.pcx", _introWbodyImage[0], 0, 0);
+	_introGbodyImage = new WWSurface(160, 149);
+	_vm->drawImageToSurface(_oanGxl, "gbody0.pcx", _introGbodyImage, 0, 0);
+
+	// The original is overwriting the song name (default metal1.xmi) instead of setting the musicIndex.
+	_vm->_musicIndex = 2; // metal2.xmi
+	_vm->changeMusic();
+
+	for (int i = 0; i < 8; ++i) {
+		_introWhead1[i] = new WWSurface(98, 71);
+		Common::String filename = Common::String::format("whead1%d.pcx", i);
+		_vm->drawImageToSurface(_oanGxl, filename.c_str(), _introWhead1[i], 0, 0);
+	}
+
+	for (int i = 0; i < 11; ++i) {
+		_introGhead1[i] = new WWSurface(138, 80);
+		Common::String filename = Common::String::format("ghead1%d.pcx", i);
+		_vm->drawImageToSurface(_oanGxl, filename.c_str(), _introGhead1[i], 0, 0);
+	}
+	
+	_vm->drawImageToScreen(_oanGxl, "backg1.pcx", 0, 15);
+	_vm->paletteFadeIn(0, 256, 2);
+}
+
+bool WWIntro_demo1::introPt4_intro() {
+	_vm->_sound->playSound("ok.abt", false);
+	for (int i = 0; i < 3; ++i) {
+		for (int j = 0; j < 20; ++j) {
+			sub2FEFB(1, 0, 1, _vm->getRandom(3), 9, 0);
+		}
+
+		++_startOawPos;
+	}
+
+	return true;
+}
+
+void WWIntro_demo1::introPt4_cleanup() {
+	delete _vm->_fontWW;
+	_vm->_fontWW = nullptr;
+	delete _introBackg1Image;
+	_introBackg1Image = nullptr;
+	for (int i = 0; i < 5; ++i) {
+		delete _introWbodyImage[i];
+		_introWbodyImage[i] = nullptr;
+	}
+	delete _introGbodyImage;
+	_introGbodyImage = nullptr;
+	for (int i = 0; i < 7; ++i) {
+		delete _introWhead1[i];
+		_introWhead1[i] = nullptr;
+	}
+	for (int i = 0; i < 11; ++i) {
+		delete _introGhead1[i];
+		_introGhead1[i] = nullptr;
+	}
+}
+
 } // End of namespace WaynesWorld
diff --git a/engines/waynesworld/wwintro_full.cpp b/engines/waynesworld/wwintro_full.cpp
index ab3cbb55c40..d55b4c52847 100644
--- a/engines/waynesworld/wwintro_full.cpp
+++ b/engines/waynesworld/wwintro_full.cpp
@@ -50,7 +50,7 @@ void WWIntro_full::runIntro() {
 	if (continueFl)
 		continueFl = introPt3(false);
 
-	introPt5();
+	cleanOanGxl();
 
 	if (continueFl)
 		introPt6();
@@ -271,7 +271,7 @@ bool WWIntro_full::introPt4() {
 	return retVal;
 }
 
-void WWIntro_full::introPt5() {
+void WWIntro_full::cleanOanGxl() {
 	delete _oanGxl;
 	_oanGxl = nullptr;
 }
@@ -340,78 +340,6 @@ void WWIntro_full::introPt7() {
 	_vm->_screen->clear(0);
 }
 
-void WWIntro_full::sub3009A(int textId) {
-	int startPos;
-	int textColor;
-	int textType = 0;
-	Common::String filename;
-
-	switch (textId) {
-	case 0:
-		filename = "oaw";
-		startPos = _startOawPos;
-		textColor = 147;
-		break;
-	case 1:
-		filename = "oag";
-		startPos = _startOagPos;
-		textColor = 41;
-		break;
-	default:
-		filename = "oao";
-		startPos = _startOaoPos;
-		++_startOaoPos;
-		textColor = 11;
-		textType = 1;
-		break;
-	}
-
-	Common::String displayTxt = _vm->loadString(filename.c_str(), startPos, 0);
-
-	if (textType)
-		_vm->_fontWW->drawText(_demoPt2Surface, displayTxt.c_str(), 0, 187, textColor);
-	else
-		_vm->_fontWW->drawText(_demoPt2Surface, displayTxt.c_str(), 0, 2, textColor);
-}
-
-void WWIntro_full::sub2FEFB(int arg_refreshBackgFl, int arg_wBodyIndex, int arg_gBodyIndex, int arg_wHead1Index, int arg_gHead1Index, int arg_TextId) {
-	_demoPt2Surface->fillRect(0, 0, 319, 14, 0);
-	_demoPt2Surface->fillRect(0, 185, 319, 199, 0);
-
-	if (arg_refreshBackgFl != _old_arg_refreshBackgFl) {
-		_demoPt2Surface->clear(0);
-		_demoPt2Surface->drawSurface(_introBackg1Image, 0, 15);
-		_old_arg_refreshBackgFl = arg_refreshBackgFl;
-	}
-
-	if (arg_wBodyIndex != _old_arg_wBodyIndex) {
-		_demoPt2Surface->drawSurface(_introWbodyImage[arg_wBodyIndex], 0, 21);
-		_old_arg_wBodyIndex = arg_wBodyIndex;
-	}
-
-	if (arg_gBodyIndex != _old_arg_gBodyIndex) {
-		_demoPt2Surface->drawSurface(_introGbodyImage, 160, 25);
-		_old_arg_gBodyIndex = arg_gBodyIndex;
-	}
-
-	if (arg_wHead1Index != _old_argWHead1Index) {
-		_demoPt2Surface->drawSurface(_introWhead1[arg_wHead1Index], 12, 22);
-		_old_argWHead1Index = arg_wHead1Index;
-	}
-
-	if (arg_gHead1Index != _old_argGHead1Index) {
-		_demoPt2Surface->drawSurface(_introGhead1[arg_gHead1Index], 182, 21);
-		_old_argGHead1Index = arg_gHead1Index;
-	}
-
-	if (arg_TextId != -1) {
-		sub3009A(arg_TextId);
-	}
-
-	_vm->_screen->drawSurface(_demoPt2Surface, 0, 0);
-	_vm->waitMillis(170);
-}
-
 void WWIntro_full::introPt4_init() {
 	_vm->_fontWW = new GFTFont();
 	_vm->_fontWW->loadFromFile("ww.gft");
@@ -419,7 +347,7 @@ void WWIntro_full::introPt4_init() {
 	while (_vm->_sound->isSFXPlaying())
 		_vm->waitMillis(30);
 
-	_vm->_musicIndex = 2;
+	_vm->_musicIndex = 2; // metal2.xmi
 	_vm->changeMusic();
 
 	_introBackg1Image = new WWSurface(320, 170);
@@ -801,9 +729,7 @@ bool WWIntro_full::introPt4_caller3() {
 	}
 	++_startOawPos;
 	++_startOagPos;
-	_vm->_sound->playSound("sv46.snd", false);
-	while (_vm->_sound->isSFXPlaying())
-		_vm->waitMillis(30);
+	_vm->_sound->playSound("sv46.snd", true);
 
 	for (int j = 0; j < 2; ++j) {
 		for (int i = 0; i < 15; ++i) {
@@ -893,15 +819,9 @@ bool WWIntro_full::introPt4_caller4() {
 		++_startOagPos;
 	}
 
-	_vm->_sound->playSound("sv37.snd", false);
-	while (_vm->_sound->isSFXPlaying())
-		_vm->waitMillis(30);
+	_vm->_sound->playSound("sv37.snd", true);
+	_vm->_sound->playSound("sv24.snd", true);
 	
-	_vm->_sound->playSound("sv24.snd", false);
-	
-	while (_vm->_sound->isSFXPlaying())
-		_vm->waitMillis(30);
-
 	for (int i = 0; i < 15; ++i) {
 		sub2FEFB(1, 0, 1, _vm->getRandom(3), 9, 0);
 		if (_vm->_escPressed) {
@@ -985,9 +905,7 @@ bool WWIntro_full::introPt4_caller4() {
 		}
 	}
 
-	_vm->_sound->playSound("sv45.snd", false);
-	while (_vm->_sound->isSFXPlaying())
-		_vm->waitMillis(30);
+	_vm->_sound->playSound("sv45.snd", true);
 
 	for (int j = 0; j < 3; ++j) {
 		for (int i = 0; i < 8; ++i) {




More information about the Scummvm-git-logs mailing list