[Scummvm-git-logs] scummvm master -> 0f11df130b2d7f864daf35a66357fcc05c99a674

mduggan mgithub at guarana.org
Mon Apr 27 10:54:33 UTC 2020


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:
c948f65c82 ULTIMA8: JANITORIAL: typo in messages
0f11df130b ULTIMA8: Load more crusader data


Commit: c948f65c8278f7dce53d7bc5ff6d514828057160
    https://github.com/scummvm/scummvm/commit/c948f65c8278f7dce53d7bc5ff6d514828057160
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2020-04-27T19:51:23+09:00

Commit Message:
ULTIMA8: JANITORIAL: typo in messages

Changed paths:
    engines/ultima/ultima8/games/u8_game.cpp
    engines/ultima/ultima8/world/item_sorter.cpp


diff --git a/engines/ultima/ultima8/games/u8_game.cpp b/engines/ultima/ultima8/games/u8_game.cpp
index 0c071b7e23..cee3db478b 100644
--- a/engines/ultima/ultima8/games/u8_game.cpp
+++ b/engines/ultima/ultima8/games/u8_game.cpp
@@ -74,7 +74,7 @@ bool U8Game::loadFiles() {
 	pout << "Load Palette" << Std::endl;
 	Common::SeekableReadStream *pf = FileSystem::get_instance()->ReadFile("@game/static/u8pal.pal");
 	if (!pf) {
-		perr << "Unabl-e to load static/u8pal.pal." << Std::endl;
+		perr << "Unable to load static/u8pal.pal." << Std::endl;
 		return false;
 	}
 	pf->seek(4); // seek past header
diff --git a/engines/ultima/ultima8/world/item_sorter.cpp b/engines/ultima/ultima8/world/item_sorter.cpp
index e493b20979..51563dd219 100644
--- a/engines/ultima/ultima8/world/item_sorter.cpp
+++ b/engines/ultima/ultima8/world/item_sorter.cpp
@@ -634,7 +634,7 @@ void ItemSorter::AddItem(int32 x, int32 y, int32 z, uint32 shapeNum, uint32 fram
 	si->_frame = frame_num;
 	const ShapeFrame *_frame = si->_shape->getFrame(si->_frame);
 	if (!_frame) {
-		perr << "Invalid _shape: " << si->_shapeNum << "," << si->_frame
+		perr << "Invalid shape: " << si->_shapeNum << "," << si->_frame
 		     << Std::endl;
 		return;
 	}


Commit: 0f11df130b2d7f864daf35a66357fcc05c99a674
    https://github.com/scummvm/scummvm/commit/0f11df130b2d7f864daf35a66357fcc05c99a674
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2020-04-27T19:53:42+09:00

Commit Message:
ULTIMA8: Load more crusader data

Changed paths:
    engines/ultima/ultima8/audio/sound_flex.cpp
    engines/ultima/ultima8/games/game_data.cpp
    engines/ultima/ultima8/games/remorse_game.cpp
    engines/ultima/ultima8/graphics/palette_manager.h


diff --git a/engines/ultima/ultima8/audio/sound_flex.cpp b/engines/ultima/ultima8/audio/sound_flex.cpp
index 5b35b6e76f..1864c1e091 100644
--- a/engines/ultima/ultima8/audio/sound_flex.cpp
+++ b/engines/ultima/ultima8/audio/sound_flex.cpp
@@ -24,6 +24,7 @@
 
 #include "ultima/ultima8/audio/sound_flex.h"
 #include "ultima/ultima8/audio/sonarc_audio_sample.h"
+#include "ultima/ultima8/audio/raw_audio_sample.h"
 #include "ultima/ultima8/filesys/idata_source.h"
 
 namespace Ultima {
@@ -63,7 +64,13 @@ void SoundFlex::cache(uint32 index) {
 
 	if (!buf || !size) return;
 
-	_samples[index] = new SonarcAudioSample(buf, size);
+	if (Std::strncmp(reinterpret_cast<const char *>(buf), "ASFX", 4) == 0) {
+		// After the 32 byte header, ASFX (crusader audio) is just raw data in stereo
+		// TODO: Check that 22050/stereo is correct (seems like it?)
+		_samples[index] = new RawAudioSample(buf + 32, size - 32, 22050, true, true);
+	} else {
+		_samples[index] = new SonarcAudioSample(buf, size);
+	}
 }
 
 void SoundFlex::uncache(uint32 index) {
diff --git a/engines/ultima/ultima8/games/game_data.cpp b/engines/ultima/ultima8/games/game_data.cpp
index 33912ed4f4..b16aaad126 100644
--- a/engines/ultima/ultima8/games/game_data.cpp
+++ b/engines/ultima/ultima8/games/game_data.cpp
@@ -612,13 +612,12 @@ void GameData::loadRemorseData() {
 	dummyrs = filesystem->ReadFile("@data/empty.flx");
 	_soundFlex = new SoundFlex(dummyrs);
 	delete dummyrs;
-#if 0
+
 	Common::SeekableReadStream *sndflx = filesystem->ReadFile("@game/sound/sound.flx");
 	if (!sndflx)
 		error("Unable to load sound/sound.flx");
 
 	_soundFlex = new SoundFlex(sndflx);
-#endif
 
 	loadTranslation();
 }
diff --git a/engines/ultima/ultima8/games/remorse_game.cpp b/engines/ultima/ultima8/games/remorse_game.cpp
index a692d96570..e1c09bae76 100644
--- a/engines/ultima/ultima8/games/remorse_game.cpp
+++ b/engines/ultima/ultima8/games/remorse_game.cpp
@@ -52,19 +52,39 @@ RemorseGame::~RemorseGame() {
 
 }
 
-bool RemorseGame::loadFiles() {
-	// Load palette
-	pout << "Load Palette" << Std::endl;
-	Common::SeekableReadStream *pf = FileSystem::get_instance()->ReadFile("@game/static/gamepal.pal");
+static bool loadPalette(const char *path, PaletteManager::PalIndex index) {
+	Common::SeekableReadStream *pf = FileSystem::get_instance()->ReadFile(path);
 	if (!pf) {
 		perr << "Unable to load static/gamepal.pal." << Std::endl;
 		return false;
 	}
 
 	Common::MemoryReadStream xfds(U8XFormPal, 1024);
-	PaletteManager::get_instance()->load(PaletteManager::Pal_Game, *pf, xfds);
+	PaletteManager::get_instance()->load(index, *pf, xfds);
 	delete pf;
 
+	return true;
+}
+
+bool RemorseGame::loadFiles() {
+	// Load palette
+	pout << "Load Palettes" << Std::endl;
+
+	if (!loadPalette("@game/static/gamepal.pal", PaletteManager::Pal_Game))
+		return false;
+	if (GAME_IS_REGRET) {
+		if (!loadPalette("@game/static/cred.pal", PaletteManager::Pal_Cred))
+			return false;
+	}
+	if (!loadPalette("@game/static/diff.pal", PaletteManager::Pal_Diff))
+		return false;
+	if (!loadPalette("@game/static/misc.pal", PaletteManager::Pal_Misc))
+		return false;
+	if (!loadPalette("@game/static/misc2.pal", PaletteManager::Pal_Misc2))
+		return false;
+	if (!loadPalette("@game/static/star.pal", PaletteManager::Pal_Star))
+		return false;
+
 	pout << "Load GameData" << Std::endl;
 	GameData::get_instance()->loadRemorseData();
 
diff --git a/engines/ultima/ultima8/graphics/palette_manager.h b/engines/ultima/ultima8/graphics/palette_manager.h
index 898cfadf42..bf6a827280 100644
--- a/engines/ultima/ultima8/graphics/palette_manager.h
+++ b/engines/ultima/ultima8/graphics/palette_manager.h
@@ -43,6 +43,11 @@ public:
 	enum PalIndex {
 		Pal_Game = 0,
 		Pal_Movie = 1,
+		Pal_Diff = 2,	// Crusaders only
+		Pal_Misc = 3,	// Crusaders only
+		Pal_Misc2 = 4,	// Crusaders only
+		Pal_Star = 5,	// Crusaders only
+		Pal_Cred = 6,	// Crusader: No regret only
 		Pal_JPFontStart = 16
 	};
 




More information about the Scummvm-git-logs mailing list