Added color-inversion effect in character selection screen. The effect doesn't exactly work like the original yet (Amiga only).

svn-id: r29372
This commit is contained in:
Nicola Mettifogo 2007-11-01 21:56:14 +00:00
parent 10c0f9de86
commit 1ea0b305a5
3 changed files with 22 additions and 1 deletions

View File

@ -334,6 +334,21 @@ void Gfx::floodFill(Gfx::Buffers buffer, const Common::Rect& r, byte color) {
return;
}
void Gfx::invertRect(Gfx::Buffers buffer, const Common::Rect& r) {
byte *d = (byte*)_buffers[buffer]->getBasePtr(r.left, r.top);
for (int i = 0; i < r.height(); i++) {
for (int j = 0; j < r.width(); j++) {
*d ^= 0x1F;
d++;
}
d += (_buffers[buffer]->pitch - r.width());
}
}
void Gfx::screenClip(Common::Rect& r, Common::Point& p) {
int32 x = r.left;

View File

@ -238,6 +238,7 @@ public:
void copyRect(Gfx::Buffers dstbuffer, const Common::Rect& r, byte *src, uint16 pitch);
void grabRect(byte *dst, const Common::Rect& r, Gfx::Buffers srcbuffer, uint16 pitch);
void floodFill(Gfx::Buffers buffer, const Common::Rect& r, byte color);
void invertRect(Gfx::Buffers buffer, const Common::Rect& r);
// palette
void setPalette(Palette palette);

View File

@ -350,8 +350,13 @@ int Parallaction_ns::guiGetSelectedBlock(const Common::Point &p) {
}
}
if (selection != -1) {
if ((selection != -1) && (getPlatform() == Common::kPlatformAmiga)) {
_gfx->invertRect(Gfx::kBitFront, codeTrueBlocks[selection]);
_gfx->updateScreen();
beep();
g_system->delayMillis(100);
_gfx->invertRect(Gfx::kBitFront, codeTrueBlocks[selection]);
_gfx->updateScreen();
}
return selection;