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

svn-id: r44693
This commit is contained in:
Filippos Karapetis 2009-10-06 12:33:36 +00:00
parent df29b0067e
commit daa6f0d9a2
3 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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++;

View File

@ -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;