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

neuromancer neuromancer at users.noreply.github.com
Sat Oct 30 12:28:20 UTC 2021


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

Summary:
a14662a5ef PRIVATE: optimized VSimage drawing and removed old palette indexes


Commit: a14662a5ef17fe56f7333c4bbec5090115f9fcc3
    https://github.com/scummvm/scummvm/commit/a14662a5ef17fe56f7333c4bbec5090115f9fcc3
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2021-10-30T14:28:03+02:00

Commit Message:
PRIVATE: optimized VSimage drawing and removed old palette indexes

Changed paths:
    engines/private/private.cpp
    engines/private/private.h


diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index fd1de5bfa1..ab31895c52 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -62,8 +62,6 @@ PrivateEngine::PrivateEngine(OSystem *syst, const ADGameDescription *gd)
 	_pausedSetting = "";
 	_modified = false;
 	_mode = -1;
-	_paletteIndex = 0;
-	_colorToIndex.clear();
 	_toTake = false;
 
 	// Movies
@@ -246,9 +244,6 @@ Common::Error PrivateEngine::run() {
 			switch (event.type) {
 			case Common::EVENT_KEYDOWN:
 				if (event.kbd.keycode == Common::KEYCODE_ESCAPE && _videoDecoder) {
-					_paletteIndex = 0;
-					_colorToIndex.clear();
-					_indexToColor.clear();
 					skipVideo();
 				}
 				break;
@@ -309,18 +304,13 @@ Common::Error PrivateEngine::run() {
 			continue;
 		}
 
-		if (!_nextVS.empty() && (_currentSetting == getMainDesktopSetting())) {
+		if (!_nextVS.empty() && _currentVS.empty() && (_currentSetting == getMainDesktopSetting())) {
 			loadImage(_nextVS, 160, 120);
 			drawScreen();
+			_currentVS = _nextVS;
 		}
 
 		if (_videoDecoder && !_videoDecoder->isPaused()) {
-			_colorToIndex.clear();
-			_indexToColor.clear();
-			_paletteIndex = 0;
-			_colorToIndex[0x0000FF00] = _transparentColor;
-			_indexToColor[_transparentColor] = 0x0000FF00;
-
 			if (_videoDecoder->getCurFrame() == 0)
 				stopSound(true);
 			if (_videoDecoder->endOfVideo()) {
@@ -337,16 +327,12 @@ Common::Error PrivateEngine::run() {
 
 		if (!_nextSetting.empty()) {
 			removeTimer();
-			_paletteIndex = 0;
-			_colorToIndex.clear();
-			_indexToColor.clear();
-			_colorToIndex[0x0000FF00] = _transparentColor;
-			_indexToColor[_transparentColor] = 0x0000FF00;
 			debugC(1, kPrivateDebugFunction, "Executing %s", _nextSetting.c_str());
 			clearAreas();
 			_currentSetting = _nextSetting;
 			Settings::g_setts->load(_nextSetting);
 			_nextSetting = "";
+			_currentVS = "";
 			Gen::g_vm->run();
 			changeCursor("default");
 			drawScreen();
diff --git a/engines/private/private.h b/engines/private/private.h
index b615720406..6de65bb585 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -202,12 +202,6 @@ public:
 	Graphics::Surface *decodeImage(const Common::String &file);
 	const byte *decodePalette(const Common::String &name);
 	void loadImage(const Common::String &file, int x, int y);
-	void composeImagePalette(Graphics::Surface *surf, const byte *palette);
-	void composeImagePalette(const Graphics::Surface *surf, const byte *palette);
-	void includePalette(const byte *palette, int start);
-	int _paletteIndex;
-	Common::HashMap <uint32, int> _colorToIndex;
-	Common::HashMap <int, uint32> _indexToColor;
 	void drawScreenFrame(const byte *videoPalette);
 
 	// Cursors
@@ -228,6 +222,7 @@ public:
 	Graphics::Surface *_mframeImage;
 	byte *_framePalette;
 	Common::String _nextVS;
+	Common::String _currentVS;
 	Common::Point _origin;
 	void drawScreen();
 




More information about the Scummvm-git-logs mailing list