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

Strangerke Strangerke at scummvm.org
Fri Aug 31 00:27:46 CEST 2018


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

Summary:
0a70f6f18b STARTREK: Fix an uninitialized variable in bitmap
9ac5f6c6da STARTREK: Initialize some variables in sound
ae512d3bb3 STARTREK: Initialize more variables in graphics
a6e8744159 STARTREK: remove dead code, simplify if statement by moving out code identical in both branches


Commit: 0a70f6f18b296da01fc0a1c739fb472283d3b633
    https://github.com/scummvm/scummvm/commit/0a70f6f18b296da01fc0a1c739fb472283d3b633
Author: Strangerke (strangerke at scummvm.org)
Date: 2018-08-31T00:24:00+02:00

Commit Message:
STARTREK: Fix an uninitialized variable in bitmap

Changed paths:
    engines/startrek/bitmap.cpp


diff --git a/engines/startrek/bitmap.cpp b/engines/startrek/bitmap.cpp
index 46d3a3a..c444a07 100644
--- a/engines/startrek/bitmap.cpp
+++ b/engines/startrek/bitmap.cpp
@@ -47,6 +47,7 @@ Bitmap::Bitmap(const Bitmap &bitmap) {
 
 Bitmap::Bitmap(int w, int h) : width(w), height(h), xoffset(0), yoffset(0) {
 	pixels = new byte[width * height];
+	pixelsArraySize = width * height;
 }
 
 Bitmap::~Bitmap() {


Commit: 9ac5f6c6da3821a28d74f2a8f81efd67265c2733
    https://github.com/scummvm/scummvm/commit/9ac5f6c6da3821a28d74f2a8f81efd67265c2733
Author: Strangerke (strangerke at scummvm.org)
Date: 2018-08-31T00:24:00+02:00

Commit Message:
STARTREK: Initialize some variables in sound

Changed paths:
    engines/startrek/sound.cpp


diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 4696759..f7f9338 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -35,6 +35,10 @@ namespace StarTrek {
 // Main Sound Functions
 
 Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
+	_midiDevice = MT_INVALID;
+	_midiDriver = nullptr;
+	_loopingMidiTrack = false;
+
 	if (_vm->getPlatform() == Common::kPlatformDOS || _vm->getPlatform() == Common::kPlatformMacintosh) {
 		_midiDevice = MidiDriver::detectDevice(MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32);
 		_midiDriver = MidiDriver::createMidi(_midiDevice);


Commit: ae512d3bb3130bad8305400b0e526178e1f3b218
    https://github.com/scummvm/scummvm/commit/ae512d3bb3130bad8305400b0e526178e1f3b218
Author: Strangerke (strangerke at scummvm.org)
Date: 2018-08-31T00:24:00+02:00

Commit Message:
STARTREK: Initialize more variables in graphics

Changed paths:
    engines/startrek/graphics.cpp


diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index d2e626b..31056c2 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -37,6 +37,11 @@ Graphics::Graphics(StarTrekEngine *vm) : _vm(vm), _egaMode(false) {
 	_egaData = nullptr;
 	_lutData = nullptr;
 
+	for (int i = 0; i < 32; ++i) {
+		_sprites[i] = nullptr;
+		_pushedSprites[i] = nullptr;
+	}
+
 	_screenRect = Common::Rect(SCREEN_WIDTH, SCREEN_HEIGHT);
 
 	if (ConfMan.hasKey("render_mode"))


Commit: a6e874415998cdff52ffefac9a20841d61764004
    https://github.com/scummvm/scummvm/commit/a6e874415998cdff52ffefac9a20841d61764004
Author: Strangerke (strangerke at scummvm.org)
Date: 2018-08-31T00:24:00+02:00

Commit Message:
STARTREK: remove dead code, simplify if statement by moving out code identical in both branches

Changed paths:
    engines/startrek/startrek.cpp


diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index cbbadc2..0a3a89a 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -520,15 +520,10 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
 			error("Could not open data.run");
 	}
 
+	Common::SeekableReadStream *stream;
 	if (getFeatures() & GF_DEMO && getPlatform() == Common::kPlatformDOS) {
 		assert(fileCount == 1); // Sanity check...
-		Common::SeekableReadStream *stream = dataFile->readStream(uncompressedSize);
-		delete dataFile;
-		delete dataRunFile;
-
-		byte *data = (byte *)malloc(stream->size());
-		stream->read(data, stream->size());
-		return SharedPtr<FileStream>(new FileStream(data, stream->size(), bigEndian));
+		stream = dataFile->readStream(uncompressedSize);
 	} else {
 		if (fileCount != 1) {
 			dataRunFile->seek(indexOffset);
@@ -546,20 +541,14 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
 		uncompressedSize = (getPlatform() == Common::kPlatformAmiga) ? dataFile->readUint16BE() : dataFile->readUint16LE();
 		uint16 compressedSize = (getPlatform() == Common::kPlatformAmiga) ? dataFile->readUint16BE() : dataFile->readUint16LE();
 
-		Common::SeekableReadStream *stream = decodeLZSS(dataFile->readStream(compressedSize), uncompressedSize);
-
-		delete dataFile;
-		delete dataRunFile;
-
-		byte *data = (byte *)malloc(stream->size());
-		stream->read(data, stream->size());
-		return SharedPtr<FileStream>(new FileStream(data, stream->size(), bigEndian));
+		stream = decodeLZSS(dataFile->readStream(compressedSize), uncompressedSize);
 	}
 
-	// We should not get to this point...
-	error("Could not find data for \'%s\'", filename.c_str());
-
-	return SharedPtr<FileStream>();
+	delete dataFile;
+	delete dataRunFile;
+	byte *data = (byte *)malloc(stream->size());
+	stream->read(data, stream->size());
+	return SharedPtr<FileStream>(new FileStream(data, stream->size(), bigEndian));
 }
 
 SharedPtr<FileStream> StarTrekEngine::loadFileWithParams(Common::String filename, bool unk1, bool unk2, bool unk3) {





More information about the Scummvm-git-logs mailing list