[Scummvm-cvs-logs] SF.net SVN: scummvm:[44693] scummvm/trunk/engines/sci/gui

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Oct 6 14:33:36 CEST 2009


Revision: 44693
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44693&view=rev
Author:   thebluegr
Date:     2009-10-06 12:33:36 +0000 (Tue, 06 Oct 2009)

Log Message:
-----------
SciGuiView is only using the ResourceManager, so there's no need to pass the whole EngineState to it

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui_gfx.cpp
    scummvm/trunk/engines/sci/gui/gui_view.cpp
    scummvm/trunk/engines/sci/gui/gui_view.h

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-06 12:26:13 UTC (rev 44692)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-06 12:33:36 UTC (rev 44693)
@@ -1267,7 +1267,7 @@
 }
 
 void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo) {
-	SciGuiView *view = new SciGuiView(_s, this, _screen, viewId);
+	SciGuiView *view = new SciGuiView(_s->resMan, this, _screen, viewId);
 	Common::Rect rect(0, 0);
 	Common::Rect clipRect(0, 0);
 	if (view) {
@@ -1410,7 +1410,7 @@
 	}
 
 	// now get cel rectangle
-	view = new SciGuiView(_s, this, _screen, viewId);
+	view = new SciGuiView(_s->resMan, this, _screen, viewId);
 	view->getCelRect(loopNo, celNo, x, y, z, &celRect);
 
 	// TODO: sometimes loop is negative. Check what it means

Modified: scummvm/trunk/engines/sci/gui/gui_view.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_view.cpp	2009-10-06 12:26:13 UTC (rev 44692)
+++ scummvm/trunk/engines/sci/gui/gui_view.cpp	2009-10-06 12:33:36 UTC (rev 44693)
@@ -32,8 +32,8 @@
 
 namespace Sci {
 
-SciGuiView::SciGuiView(EngineState *state, SciGuiGfx *gfx, SciGuiScreen *screen, GuiResourceId resourceId)
-	: _s(state), _gfx(gfx), _screen(screen), _resourceId(resourceId) {
+SciGuiView::SciGuiView(ResourceManager *resMan, SciGuiGfx *gfx, SciGuiScreen *screen, GuiResourceId resourceId)
+	: _resMan(resMan), _gfx(gfx), _screen(screen), _resourceId(resourceId) {
 	assert(resourceId != -1);
 	initData(resourceId);
 }
@@ -44,7 +44,7 @@
 static const byte EGAMappingDefault[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
 
 void SciGuiView::initData(GuiResourceId resourceId) {
-	Resource *viewResource = _s->resMan->findResource(ResourceId(kResourceTypeView, resourceId), false);
+	Resource *viewResource = _resMan->findResource(ResourceId(kResourceTypeView, resourceId), false);
 	if (!viewResource) {
 		error("view resource %d not found", resourceId);
 	}
@@ -66,7 +66,7 @@
 	_EGAMapping = EGAMappingDefault;
 	_loopCount = 0;
 
-	switch (_s->resMan->getViewType()) {
+	switch (_resMan->getViewType()) {
 	case kViewEga: // View-format SCI0 (and Amiga 16 colors)
 		IsEGA = true;
 	case kViewAmiga: // View-format Amiga (32 colors)
@@ -252,7 +252,7 @@
 
 	rlePtr = _resourceData + celInfo->offsetRLE;
 	if (!celInfo->offsetLiteral) { // no additional literal data
-		if (_s->resMan->getViewType() == kViewAmiga) {
+		if (_resMan->getViewType() == kViewAmiga) {
 			// decompression for amiga views
 			while (pixelNo < pixelCount) {
 				byte = *rlePtr++;

Modified: scummvm/trunk/engines/sci/gui/gui_view.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_view.h	2009-10-06 12:26:13 UTC (rev 44692)
+++ scummvm/trunk/engines/sci/gui/gui_view.h	2009-10-06 12:33:36 UTC (rev 44693)
@@ -47,7 +47,7 @@
 
 class SciGuiView {
 public:
-	SciGuiView(EngineState *state, SciGuiGfx *gfx, SciGuiScreen *screen, GuiResourceId resourceId);
+	SciGuiView(ResourceManager *resMan, SciGuiGfx *gfx, SciGuiScreen *screen, GuiResourceId resourceId);
 	~SciGuiView();
 
 	// TODO: Remove gfx reference after putting palette things into SciGuiScreen
@@ -65,7 +65,7 @@
 	void initData(GuiResourceId resourceId);
 	void unpackCel(GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte *outPtr, uint16 pixelCount);
 
-	EngineState *_s;
+	ResourceManager *_resMan;
 	SciGuiGfx *_gfx;
 	SciGuiScreen *_screen;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list