Skip to content

Commit

Permalink
DIRECTOR: Implement Shape Patterns and Borders for D3.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenhoefel committed Jan 13, 2017
1 parent 457c854 commit 6e04b36
Show file tree
Hide file tree
Showing 10 changed files with 221 additions and 43 deletions.
3 changes: 3 additions & 0 deletions engines/director/director.cpp
Expand Up @@ -51,6 +51,9 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
// Setup mixer
syncSoundSettings();

// Load Patterns
loadPatterns();

_sharedCasts = nullptr;

_currentScore = nullptr;
Expand Down
8 changes: 7 additions & 1 deletion engines/director/director.h
Expand Up @@ -34,7 +34,8 @@ class MacResManager;
}

namespace Graphics {
class MacWindowManager;
class MacWindowManager;
typedef Common::Array<byte *> MacPatterns;
}

namespace Director {
Expand Down Expand Up @@ -82,6 +83,8 @@ class DirectorEngine : public ::Engine {
const byte *getPalette() const { return _currentPalette; }
uint16 getPaletteColorCount() const { return _currentPaletteLength; }
void loadSharedCastsFrom(Common::String filename);
void loadPatterns();
Graphics::MacPatterns &getPatterns();

void loadMainArchive();
Archive *createArchive();
Expand Down Expand Up @@ -134,6 +137,9 @@ class DirectorEngine : public ::Engine {
uint16 _currentPaletteLength;
Lingo *_lingo;

Graphics::MacPatterns _director3Patterns;
Graphics::MacPatterns _director3QuickDrawPatterns;

Common::String _sharedCastFile;

private:
Expand Down
77 changes: 44 additions & 33 deletions engines/director/frame.cpp
Expand Up @@ -202,6 +202,8 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
else
sprite._trails = 0;

sprite._lineSize = (sprite._flags >> 8) & 0x03;

sprite._castId = stream->readUint16();
sprite._startPoint.y = stream->readUint16();
sprite._startPoint.x = stream->readUint16();
Expand All @@ -217,9 +219,10 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
sprite._unk3 = stream->readUint32();
}

debugC(kDebugLoading, 8, "%03d(%d)[%x,%x,%04x,%d/%d/%d/%d] script:%d",
debugC(kDebugLoading, 8, "%03d(%d)[%x,%x,%04x,%d/%d/%d/%d/%d] script:%d",
sprite._castId, sprite._enabled, sprite._x1, sprite._x2, sprite._flags,
sprite._startPoint.x, sprite._startPoint.y, sprite._width, sprite._height, sprite._scriptId);
sprite._startPoint.x, sprite._startPoint.y, sprite._width, sprite._height,
sprite._lineSize, sprite._scriptId);
}
}

Expand Down Expand Up @@ -651,30 +654,38 @@ void Frame::addDrawRect(uint16 spriteId, Common::Rect &rect) {
_drawRects.push_back(fi);
}

void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteID) {
Common::Rect r = Common::Rect(_sprites[spriteID]->_startPoint.x,
_sprites[spriteID]->_startPoint.y,
_sprites[spriteID]->_startPoint.x + _sprites[spriteID]->_width,
_sprites[spriteID]->_startPoint.y + _sprites[spriteID]->_height);
void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
Common::Rect r = Common::Rect(_sprites[spriteId]->_startPoint.x,
_sprites[spriteId]->_startPoint.y,
_sprites[spriteId]->_startPoint.x + _sprites[spriteId]->_width,
_sprites[spriteId]->_startPoint.y + _sprites[spriteId]->_height);

Graphics::Surface tmpSurface;
Graphics::ManagedSurface tmpSurface;
tmpSurface.create(r.width(), r.height(), Graphics::PixelFormat::createFormatCLUT8());
if (_vm->getVersion() <= 3 && _sprites[spriteID]->_spriteType == 0x0c) {
if (_vm->getVersion() <= 3 && _sprites[spriteId]->_spriteType == 0x0c) {
tmpSurface.fillRect(Common::Rect(r.width(), r.height()), 255);
tmpSurface.frameRect(Common::Rect(r.width(), r.height()), 0);
//TODO: don't override, work out how to display correctly.
_sprites[spriteID]->_ink = kInkTypeTransparent;
_sprites[spriteId]->_ink = kInkTypeTransparent;
} else {
tmpSurface.fillRect(Common::Rect(r.width(), r.height()), 0);
//No minus one on the pattern here! MacPlotData will do that for us!
Graphics::MacPlotData pd(&tmpSurface, &_vm->getPatterns(), _sprites[spriteId]->_castId, 1, _sprites[spriteId]->_backColor);
Common::Rect r(r.width(), r.height());
Graphics::drawFilledRect(r, _sprites[spriteId]->_foreColor, Graphics::macDrawPixel, &pd);
}

if (_sprites[spriteId]->_lineSize > 0) {
for (int rr = 0; rr < (_sprites[spriteId]->_lineSize - 1); rr++)
tmpSurface.frameRect(Common::Rect(rr, rr, r.width() - (rr * 2), r.height() - (rr * 2)), 0);
}

switch (_sprites[spriteID]->_ink) {
switch (_sprites[spriteId]->_ink) {
case kInkTypeCopy:
surface.blitFrom(tmpSurface, Common::Point(_sprites[spriteID]->_startPoint.x, _sprites[spriteID]->_startPoint.y));
surface.blitFrom(tmpSurface, Common::Point(_sprites[spriteId]->_startPoint.x, _sprites[spriteId]->_startPoint.y));
break;
case kInkTypeTransparent:
// FIXME: is it always white (last entry in pallette)?
surface.transBlitFrom(tmpSurface, Common::Point(_sprites[spriteID]->_startPoint.x, _sprites[spriteID]->_startPoint.y), _vm->getPaletteColorCount() - 1);
surface.transBlitFrom(tmpSurface, Common::Point(_sprites[spriteId]->_startPoint.x, _sprites[spriteId]->_startPoint.y), _vm->getPaletteColorCount() - 1);
break;
case kInkTypeBackgndTrans:
drawBackgndTransSprite(surface, tmpSurface, r);
Expand All @@ -689,19 +700,19 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteID) {
drawReverseSprite(surface, tmpSurface, r);
break;
default:
warning("Unhandled ink type %d", _sprites[spriteID]->_ink);
surface.blitFrom(tmpSurface, Common::Point(_sprites[spriteID]->_startPoint.x, _sprites[spriteID]->_startPoint.y));
warning("Unhandled ink type %d", _sprites[spriteId]->_ink);
surface.blitFrom(tmpSurface, Common::Point(_sprites[spriteId]->_startPoint.x, _sprites[spriteId]->_startPoint.y));
break;
}

addDrawRect(spriteID, r);
addDrawRect(spriteId, r);
}

void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId, uint16 textId) {
renderText(surface, spriteId, _vm->getMainArchive()->getResource(MKTAG('S', 'T', 'X', 'T'), textId), true);

uint16 castID = _sprites[spriteId]->_castId;
ButtonCast *button = static_cast<ButtonCast *>(_vm->_currentScore->_casts[castID]);
uint16 castId = _sprites[spriteId]->_castId;
ButtonCast *button = static_cast<ButtonCast *>(_vm->_currentScore->_casts[castId]);

uint32 rectLeft = button->initialRect.left;
uint32 rectTop = button->initialRect.top;
Expand Down Expand Up @@ -799,29 +810,29 @@ Image::ImageDecoder *Frame::getImageFrom(uint16 spriteId) {
}


void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID, uint16 castID) {
void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, uint16 castId) {
Common::SeekableSubReadStreamEndian *textStream = NULL;

if (_vm->_currentScore->_movieArchive->hasResource(MKTAG('S', 'T', 'X', 'T'), castID)) {
textStream = _vm->_currentScore->_movieArchive->getResource(MKTAG('S', 'T', 'X', 'T'), castID);
if (_vm->_currentScore->_movieArchive->hasResource(MKTAG('S', 'T', 'X', 'T'), castId)) {
textStream = _vm->_currentScore->_movieArchive->getResource(MKTAG('S', 'T', 'X', 'T'), castId);
} else if (_vm->getSharedSTXT() != nullptr) {
textStream = _vm->getSharedSTXT()->getVal(spriteID + 1024);
textStream = _vm->getSharedSTXT()->getVal(spriteId + 1024);
}

byte buf[1024];
textStream->read(buf, textStream->size());
textStream->seek(0);
Common::hexdump(buf, textStream->size());

renderText(surface, spriteID, textStream, false);
renderText(surface, spriteId, textStream, false);
}

void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID, Common::SeekableSubReadStreamEndian *textStream, bool isButtonLabel) {
void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::SeekableSubReadStreamEndian *textStream, bool isButtonLabel) {
if (textStream == NULL)
return;

uint16 castID = _sprites[spriteID]->_castId;
TextCast *textCast = static_cast<TextCast *>(_vm->_currentScore->_casts[castID]);
uint16 castId = _sprites[spriteId]->_castId;
TextCast *textCast = static_cast<TextCast *>(_vm->_currentScore->_casts[castId]);

uint32 unk1 = textStream->readUint32();
uint32 strLen = textStream->readUint32();
Expand Down Expand Up @@ -866,14 +877,14 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID, Commo
//uint32 rectLeft = textCast->initialRect.left;
//uint32 rectTop = textCast->initialRect.top;

int x = _sprites[spriteID]->_startPoint.x; // +rectLeft;
int y = _sprites[spriteID]->_startPoint.y; // +rectTop;
int x = _sprites[spriteId]->_startPoint.x; // +rectLeft;
int y = _sprites[spriteId]->_startPoint.y; // +rectTop;

int height = _sprites[spriteID]->_height;
int height = _sprites[spriteId]->_height;
if (_vm->getVersion() >= 4 && !isButtonLabel) height = textCast->initialRect.bottom;
height += textShadow;

int width = _sprites[spriteID]->_width;
int width = _sprites[spriteId]->_width;
if (_vm->getVersion() >= 4 && !isButtonLabel) width = textCast->initialRect.right;

Graphics::MacFont macFont(textCast->fontId, textCast->fontSize, textCast->textSlant);
Expand Down Expand Up @@ -911,7 +922,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID, Commo
if (textShadow > 0) {
if (borderSize == 0) textX += 1;
font->drawString(&surface, text, textX + textShadow, textY + textShadow,
width, (_sprites[spriteID]->_ink == kInkTypeReverse ? 255 : 0), (Graphics::TextAlign)alignment);
width, (_sprites[spriteId]->_ink == kInkTypeReverse ? 255 : 0), (Graphics::TextAlign)alignment);
height -= textShadow;
}
} else {
Expand All @@ -920,7 +931,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID, Commo

//TODO: the colour is wrong here... need to determine the correct colour for all versions!
font->drawString(&surface, text, textX, textY,
width, (_sprites[spriteID]->_ink == kInkTypeReverse ? 255 : 0), (Graphics::TextAlign)alignment);
width, (_sprites[spriteId]->_ink == kInkTypeReverse ? 255 : 0), (Graphics::TextAlign)alignment);

if (isButtonLabel)
return;
Expand Down
8 changes: 4 additions & 4 deletions engines/director/frame.h
Expand Up @@ -124,14 +124,14 @@ class Frame {
void playTransition(Score *score);
void playSoundChannel();
void renderSprites(Graphics::ManagedSurface &surface, bool renderTrail);
void renderText(Graphics::ManagedSurface &surface, uint16 spriteId, uint16 castID);
void renderText(Graphics::ManagedSurface &surface, uint16 spriteID, Common::SeekableSubReadStreamEndian *textStream, bool isButtonLabel);
void renderShape(Graphics::ManagedSurface &surface, uint16 spriteID);
void renderText(Graphics::ManagedSurface &surface, uint16 spriteId, uint16 castId);
void renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::SeekableSubReadStreamEndian *textStream, bool isButtonLabel);
void renderShape(Graphics::ManagedSurface &surface, uint16 spriteId);
void renderButton(Graphics::ManagedSurface &surface, uint16 spriteId, uint16 textId);
void readPaletteInfo(Common::SeekableSubReadStreamEndian &stream);
void readSprite(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size);
void readMainChannels(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size);
Image::ImageDecoder *getImageFrom(uint16 spriteID);
Image::ImageDecoder *getImageFrom(uint16 spriteId);
void drawBackgndTransSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect);
void drawMatteSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect);
void drawGhostSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect);
Expand Down
155 changes: 155 additions & 0 deletions engines/director/graphics.cpp
@@ -0,0 +1,155 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#include "director/director.h"

namespace Director {

static byte director3Patter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},
{ 0x80, 0x80, 0x80, 0xFF, 0x80, 0x80, 0x80, 0xFF },
{ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFF },
{ 0x01, 0x82, 0x44, 0x28, 0x10, 0x28, 0x44, 0x82 },
{ 0x11, 0x82, 0x45, 0xAB, 0xD7, 0xAB, 0x45, 0x82 },
{ 0xF7, 0x7F, 0xBE, 0x5D, 0x2A, 0x5D, 0xBE, 0x7F },
{ 0xFE, 0x7D, 0xBB, 0xD7, 0xEF, 0xD7, 0xBB, 0x7D },
{ 0xFE, 0x7F, 0xBF, 0xDF, 0xEF, 0xDF, 0xBF, 0x7F },
{ 0xEE, 0x77, 0xBB, 0xDD, 0xEE, 0xDD, 0xBB, 0x77 },
{ 0x11, 0x88, 0x44, 0x22, 0x11, 0x22, 0x44, 0x88 },
{ 0x01, 0x80, 0x40, 0x20, 0x10, 0x20, 0x40, 0x80 },
{ 0x22, 0x00, 0x01, 0x22, 0x54, 0x88, 0x01, 0x00 },
{ 0xBF, 0xAF, 0xAB, 0xAA, 0xEA, 0xFA, 0xFE, 0xFF },
{ 0xFF, 0xFF, 0xBE, 0x9C, 0xAA, 0xB6, 0xBE, 0xFF }
};

static byte director3QuickDrawPatterns[][8]{ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
{ 0xDD, 0xFF, 0x77, 0xFF, 0xDD, 0xFF, 0x77, 0xFF },
{ 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77 },
{ 0xEE, 0xDD, 0xBB, 0x77, 0xEE, 0xDD, 0xBB, 0x77 },
{ 0xFF, 0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF, 0xAA },
{ 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55 },
{ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 },
{ 0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44, 0x88 },
{ 0xAA, 0x00, 0xAA, 0x00, 0xAA, 0x00, 0xAA, 0x00 },
{ 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22 },
{ 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00, 0x88 },
{ 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x04, 0x08 },
{ 0x80, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00 },
{ 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88 },
{ 0x58, 0xDF, 0x00, 0xDF, 0xDF, 0x58, 0x58, 0x58 },
{ 0xB1, 0x36, 0x06, 0x60, 0x63, 0x1B, 0x18, 0x81 },
{ 0x08, 0xFF, 0x01, 0x01, 0x01, 0xFF, 0x08, 0x08 },
{ 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00 },
{ 0x80, 0x80, 0x80, 0xFF, 0x80, 0x80, 0x80, 0x80 },
{ 0x80, 0x10, 0x02, 0x40, 0x04, 0x20, 0x09, 0x00 },
{ 0x80, 0x01, 0x82, 0x44, 0x38, 0x10, 0x20, 0x40 },
{ 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00 },
{ 0x22, 0xFF, 0x22, 0x22, 0x22, 0xFF, 0x22, 0x22 },
{ 0x00, 0x08, 0x14, 0x2A, 0x55, 0x2A, 0x14, 0x08 },
{ 0x81, 0xAA, 0x14, 0x08, 0x08, 0xAA, 0x41, 0x80 },
{ 0x3E, 0x1D, 0x88, 0xD1, 0xE3, 0xC5, 0x88, 0x5C },
{ 0xAA, 0x00, 0x80, 0x00, 0x88, 0x00, 0x80, 0x00 },
{ 0x00, 0x11, 0x82, 0x44, 0x28, 0x11, 0x00, 0x55 },
{ 0x7C, 0x10, 0x10, 0x28, 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0xE1 },
{ 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0 },
{ 0xFF, 0xFF, 0xE7, 0xC3, 0x81, 0x18, 0x3C, 0x7E },
{ 0x1F, 0x8F, 0xC7, 0xE3, 0xC7, 0x8F, 0x1F, 0x3E },
{ 0xFF, 0x2A, 0xFF, 0xC8, 0xFF, 0x65, 0xFF, 0x9D }
};

void DirectorEngine::loadPatterns() {
for (int i = 0; i < ARRAYSIZE(director3Patterns); i++)
_director3Patterns.push_back(director3Patterns[i]);

for (int i = 0; i < ARRAYSIZE(director3QuickDrawPatterns); i++)
_director3QuickDrawPatterns.push_back(director3QuickDrawPatterns[i]);
}

Graphics::MacPatterns &DirectorEngine::getPatterns() {
//TOOD: implement switch and other version patterns. (use getVersion());
return _director3QuickDrawPatterns;
}

}
1 change: 1 addition & 0 deletions engines/director/module.mk
Expand Up @@ -6,6 +6,7 @@ MODULE_OBJS = \
detection.o \
director.o \
frame.o \
graphics.o \
images.o \
movie.o \
resource.o \
Expand Down

0 comments on commit 6e04b36

Please sign in to comment.