diff options
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/paint16.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/paint32.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/picture.cpp | 46 | ||||
-rw-r--r-- | engines/sci/graphics/picture.h | 10 |
5 files changed, 32 insertions, 32 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index b9051b5afb..05c79f3ca9 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -102,7 +102,7 @@ void GfxFrameout::kernelFrameout() { int16 itemCount = 0; reg_t planeObject; GuiResourceId planePictureNr; - SciGuiPicture *planePicture = 0; + GfxPicture *planePicture = 0; int16 planePictureCels = 0; int16 planePictureCel; int16 planePriority; @@ -146,7 +146,7 @@ void GfxFrameout::kernelFrameout() { planePictureNr = GET_SEL32V(_segMan, planeObject, picture); if ((planePictureNr != 0xFFFF) && (planePictureNr != 0xFFFE)) { - planePicture = new SciGuiPicture(_resMan, 0, _screen, _palette, planePictureNr, false); + planePicture = new GfxPicture(_resMan, 0, _screen, _palette, planePictureNr, false); planePictureCels = planePicture->getSci32celCount(); } diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index 34fa344158..e058899756 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -62,7 +62,7 @@ void GfxPaint16::setEGAdrawingVisualize(bool state) { } void GfxPaint16::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId) { - SciGuiPicture *picture = new SciGuiPicture(_resMan, _ports, _screen, _palette, pictureId, _EGAdrawingVisualize); + GfxPicture *picture = new GfxPicture(_resMan, _ports, _screen, _palette, pictureId, _EGAdrawingVisualize); // do we add to a picture? if not -> clear screen with white if (!addToFlag) diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp index aad7a95e40..8d15970063 100644 --- a/engines/sci/graphics/paint32.cpp +++ b/engines/sci/graphics/paint32.cpp @@ -57,7 +57,7 @@ void GfxPaint32::fillRect(Common::Rect rect, byte color) { } void GfxPaint32::kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) { - SciGuiPicture *picture = new SciGuiPicture(_resMan, 0, _screen, _palette, pictureId, false); + GfxPicture *picture = new GfxPicture(_resMan, 0, _screen, _palette, pictureId, false); picture->draw(animationNr, mirroredFlag, addToFlag, EGApaletteNo); delete picture; diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 965471bbaa..ac96746e1b 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -33,28 +33,28 @@ namespace Sci { -SciGuiPicture::SciGuiPicture(ResourceManager *resMan, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize) +GfxPicture::GfxPicture(ResourceManager *resMan, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize) : _resMan(resMan), _ports(ports), _screen(screen), _palette(palette), _resourceId(resourceId), _EGAdrawingVisualize(EGAdrawingVisualize) { assert(resourceId != -1); initData(resourceId); } -SciGuiPicture::~SciGuiPicture() { +GfxPicture::~GfxPicture() { } -void SciGuiPicture::initData(GuiResourceId resourceId) { +void GfxPicture::initData(GuiResourceId resourceId) { _resource = _resMan->findResource(ResourceId(kResourceTypePic, resourceId), false); if (!_resource) { error("picture resource %d not found", resourceId); } } -GuiResourceId SciGuiPicture::getResourceId() { +GuiResourceId GfxPicture::getResourceId() { return _resourceId; } // TODO: subclass this -void SciGuiPicture::draw(int16 animationNr, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) { +void GfxPicture::draw(int16 animationNr, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) { uint16 headerSize; _animationNr = animationNr; @@ -79,7 +79,7 @@ void SciGuiPicture::draw(int16 animationNr, bool mirroredFlag, bool addToFlag, i } } -void SciGuiPicture::reset() { +void GfxPicture::reset() { int16 x, y; for (y = _ports->getPort()->top; y < _screen->getHeight(); y++) { for (x = 0; x < _screen->getWidth(); x++) { @@ -88,7 +88,7 @@ void SciGuiPicture::reset() { } } -void SciGuiPicture::drawSci11Vga() { +void GfxPicture::drawSci11Vga() { byte *inbuffer = _resource->data; int size = _resource->size; int has_cel = READ_LE_UINT16(inbuffer + 4); @@ -117,12 +117,12 @@ void SciGuiPicture::drawSci11Vga() { } #ifdef ENABLE_SCI32 -int16 SciGuiPicture::getSci32celCount() { +int16 GfxPicture::getSci32celCount() { byte *inbuffer = _resource->data; return inbuffer[2]; } -void SciGuiPicture::drawSci32Vga(int16 celNo) { +void GfxPicture::drawSci32Vga(int16 celNo) { byte *inbuffer = _resource->data; int size = _resource->size; int header_size = READ_LE_UINT16(inbuffer); @@ -159,7 +159,7 @@ void SciGuiPicture::drawSci32Vga(int16 celNo) { } #endif -void SciGuiPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 callerX, int16 callerY, bool hasSci32Header) { +void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 callerX, int16 callerY, bool hasSci32Header) { byte *celBitmap = NULL; byte *ptr = NULL; byte *headerPtr = inbuffer + headerPos; @@ -403,7 +403,7 @@ static const byte vector_defaultEGApriority[PIC_EGAPRIORITY_SIZE] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; -void SciGuiPicture::drawVectorData(byte *data, int dataSize) { +void GfxPicture::drawVectorData(byte *data, int dataSize) { byte pic_op; byte pic_color = _screen->getColorDefaultVectorData(); byte pic_priority = 255, pic_control = 255; @@ -647,26 +647,26 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) { error("picture vector data without terminator"); } -bool SciGuiPicture::vectorIsNonOpcode(byte pixel) { +bool GfxPicture::vectorIsNonOpcode(byte pixel) { if (pixel >= PIC_OP_FIRST) return false; return true; } -void SciGuiPicture::vectorGetAbsCoords(byte *data, int &curPos, int16 &x, int16 &y) { +void GfxPicture::vectorGetAbsCoords(byte *data, int &curPos, int16 &x, int16 &y) { byte pixel = data[curPos++]; x = data[curPos++] + ((pixel & 0xF0) << 4); y = data[curPos++] + ((pixel & 0x0F) << 8); if (_mirroredFlag) x = 319 - x; } -void SciGuiPicture::vectorGetAbsCoordsNoMirror(byte *data, int &curPos, int16 &x, int16 &y) { +void GfxPicture::vectorGetAbsCoordsNoMirror(byte *data, int &curPos, int16 &x, int16 &y) { byte pixel = data[curPos++]; x = data[curPos++] + ((pixel & 0xF0) << 4); y = data[curPos++] + ((pixel & 0x0F) << 8); } -void SciGuiPicture::vectorGetRelCoords(byte *data, int &curPos, int16 &x, int16 &y) { +void GfxPicture::vectorGetRelCoords(byte *data, int &curPos, int16 &x, int16 &y) { byte pixel = data[curPos++]; if (pixel & 0x80) { x -= ((pixel >> 4) & 7) * (_mirroredFlag ? -1 : 1); @@ -680,7 +680,7 @@ void SciGuiPicture::vectorGetRelCoords(byte *data, int &curPos, int16 &x, int16 } } -void SciGuiPicture::vectorGetRelCoordsMed(byte *data, int &curPos, int16 &x, int16 &y) { +void GfxPicture::vectorGetRelCoordsMed(byte *data, int &curPos, int16 &x, int16 &y) { byte pixel = data[curPos++]; if (pixel & 0x80) { y -= (pixel & 0x7F); @@ -695,14 +695,14 @@ void SciGuiPicture::vectorGetRelCoordsMed(byte *data, int &curPos, int16 &x, int } } -void SciGuiPicture::vectorGetPatternTexture(byte *data, int &curPos, int16 pattern_Code, int16 &pattern_Texture) { +void GfxPicture::vectorGetPatternTexture(byte *data, int &curPos, int16 pattern_Code, int16 &pattern_Texture) { if (pattern_Code & SCI_PATTERN_CODE_USE_TEXTURE) { pattern_Texture = (data[curPos++] >> 1) & 0x7f; } } // Do not replace w/ some generic code. This algo really needs to behave exactly as the one from sierra -void SciGuiPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, byte control) { +void GfxPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, byte control) { Port *curPort = _ports->getPort(); Common::Stack<Common::Point> stack; Common::Point p, p1; @@ -921,7 +921,7 @@ static const byte vectorPatternTextureOffset[128] = { 0x06, 0x6f, 0xc6, 0x4a, 0xa4, 0x75, 0x97, 0xe1 }; -void SciGuiPicture::vectorPatternBox(Common::Rect box, byte color, byte prio, byte control) { +void GfxPicture::vectorPatternBox(Common::Rect box, byte color, byte prio, byte control) { byte flag = _screen->getDrawingMask(color, prio, control); int y, x; @@ -932,7 +932,7 @@ void SciGuiPicture::vectorPatternBox(Common::Rect box, byte color, byte prio, by } } -void SciGuiPicture::vectorPatternTexturedBox(Common::Rect box, byte color, byte prio, byte control, byte texture) { +void GfxPicture::vectorPatternTexturedBox(Common::Rect box, byte color, byte prio, byte control, byte texture) { byte flag = _screen->getDrawingMask(color, prio, control); const bool *textureData = &vectorPatternTextures[vectorPatternTextureOffset[texture]]; int y, x; @@ -947,7 +947,7 @@ void SciGuiPicture::vectorPatternTexturedBox(Common::Rect box, byte color, byte } } -void SciGuiPicture::vectorPatternCircle(Common::Rect box, byte size, byte color, byte prio, byte control) { +void GfxPicture::vectorPatternCircle(Common::Rect box, byte size, byte color, byte prio, byte control) { byte flag = _screen->getDrawingMask(color, prio, control); const byte *circleData = vectorPatternCircles[size]; byte bitmap = *circleData; @@ -969,7 +969,7 @@ void SciGuiPicture::vectorPatternCircle(Common::Rect box, byte size, byte color, } } -void SciGuiPicture::vectorPatternTexturedCircle(Common::Rect box, byte size, byte color, byte prio, byte control, byte texture) { +void GfxPicture::vectorPatternTexturedCircle(Common::Rect box, byte size, byte color, byte prio, byte control, byte texture) { byte flag = _screen->getDrawingMask(color, prio, control); const byte *circleData = vectorPatternCircles[size]; byte bitmap = *circleData; @@ -995,7 +995,7 @@ void SciGuiPicture::vectorPatternTexturedCircle(Common::Rect box, byte size, byt } } -void SciGuiPicture::vectorPattern(int16 x, int16 y, byte color, byte priority, byte control, byte code, byte texture) { +void GfxPicture::vectorPattern(int16 x, int16 y, byte color, byte priority, byte control, byte code, byte texture) { byte size = code & SCI_PATTERN_CODE_PENSIZE; Common::Rect rect; diff --git a/engines/sci/graphics/picture.h b/engines/sci/graphics/picture.h index 85c2696533..f0e6cca690 100644 --- a/engines/sci/graphics/picture.h +++ b/engines/sci/graphics/picture.h @@ -33,13 +33,13 @@ namespace Sci { #define SCI_PATTERN_CODE_PENSIZE 0x07 class GfxPorts; -class Screen; -class SciPalette; +class GfxScreen; +class GfxPalette; -class SciGuiPicture { +class GfxPicture { public: - SciGuiPicture(ResourceManager *resMan, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize = false); - ~SciGuiPicture(); + GfxPicture(ResourceManager *resMan, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize = false); + ~GfxPicture(); GuiResourceId getResourceId(); void draw(int16 animationNr, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo); |