Skip to content

Commit

Permalink
ADL: Rename rightAngles to lineArt
Browse files Browse the repository at this point in the history
  • Loading branch information
waltervn committed Mar 9, 2016
1 parent 34cb2f4 commit 1abaf60
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions engines/adl/adl.cpp
Expand Up @@ -416,8 +416,8 @@ void AdlEngine::drawItems() {
if (item->state == IDI_ITEM_MOVED) {
if (_rooms[_room].picture == _rooms[_room].curPicture) {
const Common::Point &p = _itemOffsets[dropped];
if (item->isDrawing)
_display->drawRightAngles(_drawings[item->picture - 1], p, 0, 1, 0x7f);
if (item->isLineArt)
_display->drawLineArt(_lineArt[item->picture - 1], p);
else
drawPic(item->picture, p);
++dropped;
Expand All @@ -429,8 +429,8 @@ void AdlEngine::drawItems() {

for (pic = item->roomPictures.begin(); pic != item->roomPictures.end(); ++pic) {
if (*pic == _rooms[_room].curPicture) {
if (item->isDrawing)
_display->drawRightAngles(_drawings[item->picture - 1], item->position, 0, 1, 0x7f);
if (item->isLineArt)
_display->drawLineArt(_lineArt[item->picture - 1], item->position);
else
drawPic(item->picture, item->position);
continue;
Expand Down
4 changes: 2 additions & 2 deletions engines/adl/adl.h
Expand Up @@ -138,7 +138,7 @@ struct Item {
byte noun;
byte room;
byte picture;
bool isDrawing;
bool isLineArt;
Common::Point position;
int state;
byte description;
Expand Down Expand Up @@ -188,7 +188,7 @@ class AdlEngine : public Engine {
Common::Array<Picture> _pictures;
Common::Array<Item> _inventory;
Common::Array<Common::Point> _itemOffsets;
Common::Array<Common::Array<byte> > _drawings;
Common::Array<Common::Array<byte> > _lineArt;
Commands _roomCommands;
Commands _globalCommands;

Expand Down
6 changes: 3 additions & 3 deletions engines/adl/display.cpp
Expand Up @@ -304,7 +304,7 @@ void Display::drawNextPixel(Display::PixelPos &p, byte &color, byte bits, byte q
moveY(p, bits & 2);
}

void Display::drawRightAngles(Common::Array<byte> &rightAngles, Common::Point p, byte rotation, byte scaling, byte color) {
void Display::drawLineArt(const Common::Array<byte> &lineArt, Common::Point p, byte rotation, byte scaling, byte color) {
const byte stepping[] = {
0xff, 0xfe, 0xfa, 0xf4, 0xec, 0xe1, 0xd4, 0xc5,
0xb4, 0xa1, 0x8d, 0x78, 0x61, 0x49, 0x31, 0x18,
Expand All @@ -319,8 +319,8 @@ void Display::drawRightAngles(Common::Array<byte> &rightAngles, Common::Point p,
byte xStep = stepping[rotation];
byte yStep = stepping[(rotation ^ 0xf) + 1] + 1;

for (uint i = 0; i < rightAngles.size(); ++i) {
byte b = rightAngles[i];
for (uint i = 0; i < lineArt.size(); ++i) {
byte b = lineArt[i];

do {
byte xFrac = 0x80;
Expand Down
2 changes: 1 addition & 1 deletion engines/adl/display.h
Expand Up @@ -63,7 +63,7 @@ class Display {
void drawPixel(byte x, byte y, byte color);
void drawLine(Common::Point p1, Common::Point p2, byte color);
void clear(byte color);
void drawRightAngles(Common::Array<byte> &rightAngles, Common::Point p, byte rotation, byte scaling, byte color);
void drawLineArt(const Common::Array<byte> &lineArt, Common::Point p, byte rotation = 0, byte scaling = 1, byte color = 0x7f);

private:
enum {
Expand Down
14 changes: 7 additions & 7 deletions engines/adl/hires1.cpp
Expand Up @@ -261,7 +261,7 @@ void HiRes1Engine::runGame() {
item.noun = f.readByte();
item.room = f.readByte();
item.picture = f.readByte();
item.isDrawing = f.readByte();
item.isLineArt = f.readByte();
item.position.x = f.readByte();
item.position.y = f.readByte();
item.state = f.readByte();
Expand Down Expand Up @@ -302,21 +302,21 @@ void HiRes1Engine::runGame() {
_itemOffsets.push_back(p);
}

// Load right-angle drawings
// Load right-angle line art
f.seek(0x4f00);
uint16 drawingsTotal = f.readUint16LE();
for (uint i = 0; i < drawingsTotal; ++i) {
uint16 lineArtTotal = f.readUint16LE();
for (uint i = 0; i < lineArtTotal; ++i) {
f.seek(0x4f00 + 2 + i * 2);
uint16 offset = f.readUint16LE();
f.seek(0x4f00 + offset);

Common::Array<byte> drawing;
Common::Array<byte> lineArt;
byte b = f.readByte();
while (b != 0) {
drawing.push_back(b);
lineArt.push_back(b);
b = f.readByte();
}
_drawings.push_back(drawing);
_lineArt.push_back(lineArt);
}

// Title screen shown during loading
Expand Down

0 comments on commit 1abaf60

Please sign in to comment.