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

sev- sev at scummvm.org
Mon Dec 26 19:13:36 CET 2016


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:
d4313bf6b5 FULLPIPE: Decrease header dependency


Commit: d4313bf6b50fe57f949ccb6dfd9f2accd885ed94
    https://github.com/scummvm/scummvm/commit/d4313bf6b50fe57f949ccb6dfd9f2accd885ed94
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-12-26T19:13:28+01:00

Commit Message:
FULLPIPE: Decrease header dependency

Changed paths:
    engines/fullpipe/detection.cpp
    engines/fullpipe/fullpipe.cpp
    engines/fullpipe/fullpipe.h
    engines/fullpipe/gfx.cpp
    engines/fullpipe/gfx.h
    engines/fullpipe/modal.cpp
    engines/fullpipe/scene.cpp


diff --git a/engines/fullpipe/detection.cpp b/engines/fullpipe/detection.cpp
index 8f4de11..e22bcd3 100644
--- a/engines/fullpipe/detection.cpp
+++ b/engines/fullpipe/detection.cpp
@@ -25,6 +25,8 @@
 #include "engines/advancedDetector.h"
 #include "common/file.h"
 
+#include "graphics/surface.h"
+
 #include "fullpipe/fullpipe.h"
 #include "fullpipe/gameloader.h"
 
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 10c1744..9c474d1 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -28,6 +28,7 @@
 #include "audio/mixer.h"
 
 #include "engines/util.h"
+#include "graphics/surface.h"
 
 #include "fullpipe/fullpipe.h"
 #include "fullpipe/gameloader.h"
@@ -285,7 +286,8 @@ Common::Error FullpipeEngine::run() {
 	// Initialize backend
 	initGraphics(800, 600, true, &format);
 
-	_backgroundSurface.create(800, 600, format);
+	_backgroundSurface = new Graphics::Surface;
+	_backgroundSurface->create(800, 600, format);
 
 	_origFormat = new Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
 
@@ -502,7 +504,9 @@ void FullpipeEngine::cleanup() {
 	stopAllSoundStreams();
 
 	delete _origFormat;
-	_backgroundSurface.free();
+	_backgroundSurface->free();
+
+	delete _backgroundSurface;
 }
 
 void FullpipeEngine::updateScreen() {
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index b00da62..3733bed 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -30,8 +30,6 @@
 #include "common/savefile.h"
 #include "common/system.h"
 
-#include "graphics/transparent_surface.h"
-
 #include "engines/engine.h"
 
 #include "gui/debugger.h"
@@ -123,7 +121,7 @@ public:
 
 	void updateEvents();
 
-	Graphics::Surface _backgroundSurface;
+	Graphics::Surface *_backgroundSurface;
 	Graphics::PixelFormat *_origFormat;
 
 	GameLoader *_gameLoader;
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 4dec4b6..ea07621 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -30,6 +30,7 @@
 #include "fullpipe/gameloader.h"
 
 #include "common/memstream.h"
+#include "graphics/transparent_surface.h"
 
 namespace Fullpipe {
 
@@ -677,8 +678,8 @@ void Picture::displayPicture() {
 	if (!_dataSize)
 		return;
 
-	g_fp->_backgroundSurface.fillRect(Common::Rect(0, 0, 800, 600), 0);
-	g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface.getBasePtr(0, 0), g_fp->_backgroundSurface.pitch, 0, 0, 800, 600);
+	g_fp->_backgroundSurface->fillRect(Common::Rect(0, 0, 800, 600), 0);
+	g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface->getBasePtr(0, 0), g_fp->_backgroundSurface->pitch, 0, 0, 800, 600);
 
 	draw(0, 0, 0, 0);
 
@@ -858,8 +859,8 @@ void Bitmap::putDib(int x, int y, int32 *palette, byte alpha) {
 
 	int alphac = TS_ARGB(0xff, alpha, 0xff, 0xff);
 
-	_surface->blit(g_fp->_backgroundSurface, x1, y1, _flipping, &sub, alphac);
-	g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface.getBasePtr(x1, y1), g_fp->_backgroundSurface.pitch, x1, y1, sub.width(), sub.height());
+	_surface->blit(*g_fp->_backgroundSurface, x1, y1, _flipping, &sub, alphac);
+	g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface->getBasePtr(x1, y1), g_fp->_backgroundSurface->pitch, x1, y1, sub.width(), sub.height());
 }
 
 bool Bitmap::putDibRB(int32 *palette) {
@@ -1255,7 +1256,7 @@ DynamicPhase *Shadows::findSize(int width, int height) {
 
 void FullpipeEngine::drawAlphaRectangle(int x1, int y1, int x2, int y2, int alpha) {
 	for (int y = y1; y < y2; y++) {
-		uint32 *ptr = (uint32 *)g_fp->_backgroundSurface.getBasePtr(x1, y);
+		uint32 *ptr = (uint32 *)g_fp->_backgroundSurface->getBasePtr(x1, y);
 
 		for (int x = x1; x < x2; x++) {
 			uint32 color = *ptr;
@@ -1274,8 +1275,8 @@ void FullpipeEngine::sceneFade(Scene *sc, bool direction) {
 		int ticks = g_fp->_system->getMillis();
 		sc->draw();
 
-		drawAlphaRectangle(0, 0, g_fp->_backgroundSurface.w, g_fp->_backgroundSurface.h, direction ? dim : 255 - dim);
-		g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface.getBasePtr(0, 0), g_fp->_backgroundSurface.pitch, 0, 0, 800, 600);
+		drawAlphaRectangle(0, 0, g_fp->_backgroundSurface->w, g_fp->_backgroundSurface->h, direction ? dim : 255 - dim);
+		g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface->getBasePtr(0, 0), g_fp->_backgroundSurface->pitch, 0, 0, 800, 600);
 
 		g_fp->_system->updateScreen();
 		ticks = g_fp->_system->getMillis() - ticks;
diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h
index 566586f..1b4b4d3 100644
--- a/engines/fullpipe/gfx.h
+++ b/engines/fullpipe/gfx.h
@@ -23,6 +23,11 @@
 #ifndef FULLPIPE_GFX_H
 #define FULLPIPE_GFX_H
 
+namespace Graphics {
+	struct Surface;
+	struct TransparentSurface;
+}
+
 namespace Fullpipe {
 
 class DynamicPhase;
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index 147012b..3faa035 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -33,6 +33,7 @@
 #include "fullpipe/objectnames.h"
 
 #include "graphics/palette.h"
+#include "graphics/surface.h"
 #include "video/avi_decoder.h"
 
 #include "engines/savestate.h"
diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp
index b525818..efd07b9 100644
--- a/engines/fullpipe/scene.cpp
+++ b/engines/fullpipe/scene.cpp
@@ -31,6 +31,7 @@
 #include "fullpipe/constants.h"
 
 #include "common/algorithm.h"
+#include "graphics/surface.h"
 
 namespace Fullpipe {
 
@@ -534,7 +535,7 @@ void Scene::draw() {
 	updateScrolling();
 
 	// Clean previous stuff
-	g_fp->_backgroundSurface.fillRect(Common::Rect(0, 0, 800, 600), 0);
+	g_fp->_backgroundSurface->fillRect(Common::Rect(0, 0, 800, 600), 0);
 
 	drawContent(60000, 0, true);
 





More information about the Scummvm-git-logs mailing list