aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-06 12:33:36 +0000
committerFilippos Karapetis2009-10-06 12:33:36 +0000
commitdaa6f0d9a2ce86f3e7088f689878996ba0b10684 (patch)
treebacda6eaa8fbfdd41ff9495fc959b83018cae6dd /engines
parentdf29b0067e100e97f29d286178685257816f0972 (diff)
downloadscummvm-rg350-daa6f0d9a2ce86f3e7088f689878996ba0b10684.tar.gz
scummvm-rg350-daa6f0d9a2ce86f3e7088f689878996ba0b10684.tar.bz2
scummvm-rg350-daa6f0d9a2ce86f3e7088f689878996ba0b10684.zip
SciGuiView is only using the ResourceManager, so there's no need to pass the whole EngineState to it
svn-id: r44693
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gui/gui_gfx.cpp4
-rw-r--r--engines/sci/gui/gui_view.cpp10
-rw-r--r--engines/sci/gui/gui_view.h4
3 files changed, 9 insertions, 9 deletions
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index 049cac0313..26062666b2 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -1267,7 +1267,7 @@ void SciGuiGfx::drawPicture(GuiResourceId pictureId, uint16 style, bool addToFla
}
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 @@ void SciGuiGfx::SetNowSeen(reg_t objectReference) {
}
// 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
diff --git a/engines/sci/gui/gui_view.cpp b/engines/sci/gui/gui_view.cpp
index 941eb7824f..b5bd5f5380 100644
--- a/engines/sci/gui/gui_view.cpp
+++ b/engines/sci/gui/gui_view.cpp
@@ -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 @@ SciGuiView::~SciGuiView() {
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 @@ void SciGuiView::initData(GuiResourceId resourceId) {
_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 @@ void SciGuiView::unpackCel(GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte *outPt
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++;
diff --git a/engines/sci/gui/gui_view.h b/engines/sci/gui/gui_view.h
index 6f7866447a..0fd2ab244f 100644
--- a/engines/sci/gui/gui_view.h
+++ b/engines/sci/gui/gui_view.h
@@ -47,7 +47,7 @@ struct sciViewLoopInfo {
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 @@ private:
void initData(GuiResourceId resourceId);
void unpackCel(GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte *outPtr, uint16 pixelCount);
- EngineState *_s;
+ ResourceManager *_resMan;
SciGuiGfx *_gfx;
SciGuiScreen *_screen;