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

neuromancer neuromancer at users.noreply.github.com
Sun Mar 7 21:56:05 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:
cff28b3b95 PRIVATE: refactored code using decodeImage and removed old comments


Commit: cff28b3b95ddd2282b0b30ab0d3b6cef66c71408
    https://github.com/scummvm/scummvm/commit/cff28b3b95ddd2282b0b30ab0d3b6cef66c71408
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2021-03-07T18:55:51-03:00

Commit Message:
PRIVATE: refactored code using decodeImage and removed old comments

Changed paths:
    engines/private/private.cpp


diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 0e12c41631..7f6402267f 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -928,27 +928,19 @@ void PrivateEngine::loadImage(const Common::String &name, int x, int y) {
 	surf->free();
 	delete surf;
 	_image->destroy();
-	//drawScreen();
 }
 
 void PrivateEngine::drawScreenFrame() {
 	g_system->copyRectToScreen(_frame->getPixels(), _frame->pitch, 0, 0, _screenW, _screenH);
-	//surf->copyRectToSurface(*_frame, 0, 0, Common::Rect(0, 0, _screenW, _screenH));
 }
 
 
 Graphics::ManagedSurface *PrivateEngine::loadMask(const Common::String &name, int x, int y, bool drawn) {
 	debugC(1, kPrivateDebugFunction, "%s(%s,%d,%d,%d)", __FUNCTION__, name.c_str(), x, y, drawn);
-	Common::File file;
-	Common::String path = convertPath(name);
-	if (!file.open(path))
-		error("unable to load mask %s", path.c_str());
-
-	_image->loadStream(file);
 	Graphics::ManagedSurface *surf = new Graphics::ManagedSurface();
 	surf->create(_screenW, _screenH, _pixelFormat);
 	surf->fillRect(screenRect, _transparentColor);
-	Graphics::Surface *csurf = _image->getSurface()->convertTo(_pixelFormat, _image->getPalette());
+	Graphics::Surface *csurf = decodeImage(name);
 	surf->transBlitFrom(*csurf, Common::Point(x,y));
 	csurf->free();
 	delete csurf;
@@ -963,7 +955,6 @@ Graphics::ManagedSurface *PrivateEngine::loadMask(const Common::String &name, in
 
 void PrivateEngine::drawMask(Graphics::ManagedSurface *surf) {
 	_compositeSurface->transBlitFrom(surf->rawSurface(), _origin, _transparentColor);
-	//drawScreen();
 }
 
 void PrivateEngine::drawScreen() {
@@ -971,14 +962,10 @@ void PrivateEngine::drawScreen() {
 
 	if (_videoDecoder) {
 		const Graphics::Surface *frame = _videoDecoder->decodeNextFrame();
-		//frame->create(_videoDecoder->getWidth(), _videoDecoder->getHeight(), _pixelFormat);
-		//frame->copyFrom(*_videoDecoder->decodeNextFrame());
 		Graphics::Surface *cframe = frame->convertTo(_pixelFormat, _videoDecoder->getPalette());
 		Common::Point center((_screenW - _videoDecoder->getWidth())/2, (_screenH - _videoDecoder->getHeight())/2);
 		surface->transBlitFrom(*cframe, center);
-		//frame->free();
 		cframe->free();
-		//delete frame;
 		delete cframe;
 	}
 




More information about the Scummvm-git-logs mailing list