Skip to content

Commit

Permalink
DREAMWEB: Move fadeDOS to vgafades.cpp, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored and bluegr committed Dec 12, 2011
1 parent ea941af commit 571fcfe
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
1 change: 1 addition & 0 deletions engines/dreamweb/dreambase.h
Expand Up @@ -152,6 +152,7 @@ class DreamBase : public SegmentManager {
void endPalToStart();
void startPalToEnd();
void palToEndPal();
void fadeDOS();
void doFade();
void fadeCalculation();
void fadeScreenUp();
Expand Down
19 changes: 0 additions & 19 deletions engines/dreamweb/stubs.cpp
Expand Up @@ -1008,25 +1008,6 @@ void DreamGenContext::showGroup() {
cx = 0;
}

void DreamGenContext::fadeDOS() {
ds = es = data.word(kBuffers);
return; //fixme later
engine->waitForVSync();
//processEvents will be called from vsync
uint8 *dst = es.ptr(kStartpal, 768);
engine->getPalette(dst, 0, 64);
for (int fade = 0; fade < 64; ++fade) {
for (int c = 0; c < 768; ++c) { //original sources decrement 768 values -> 256 colors
if (dst[c]) {
--dst[c];
}
}
engine->setPalette(dst, 0, 64);
engine->waitForVSync();
}
}


void DreamGenContext::eraseOldObs() {
if (data.byte(kNewobs) == 0)
return;
Expand Down
1 change: 0 additions & 1 deletion engines/dreamweb/stubs.h
Expand Up @@ -527,7 +527,6 @@
void dumpSymbol();
void dumpSymBox();
void dumpZoom();
void fadeDOS();
void selectLocation();
void showGroup();
void loadSpeech();
Expand Down
18 changes: 18 additions & 0 deletions engines/dreamweb/vgafades.cpp
Expand Up @@ -60,6 +60,24 @@ void DreamBase::palToEndPal() {
memcpy(endPalette(), mainPalette(), 256 * 3);
}

void DreamBase::fadeDOS() {
return; // FIXME later

engine->waitForVSync();
//processEvents will be called from vsync
uint8 *dst = startPalette();
engine->getPalette(dst, 0, 64);
for (int fade = 0; fade < 64; ++fade) {
for (int c = 0; c < 768; ++c) { //original sources decrement 768 values -> 256 colors
if (dst[c]) {
--dst[c];
}
}
engine->setPalette(dst, 0, 64);
engine->waitForVSync();
}
}

void DreamBase::doFade() {
if (data.byte(kFadedirection) == 0)
return;
Expand Down
2 changes: 1 addition & 1 deletion engines/dreamweb/vgagrafx.cpp
Expand Up @@ -202,7 +202,7 @@ void DreamBase::showPCX(const Common::String &name) {
// the color components have to be adjusted from 8 to 6 bits.

pcxFile.seek(16, SEEK_SET);
mainGamePal = getSegment(data.word(kBuffers)).ptr(kMaingamepal, 768);
mainGamePal = mainPalette();
pcxFile.read(mainGamePal, 48);

memset(mainGamePal + 48, 0xff, 720);
Expand Down

0 comments on commit 571fcfe

Please sign in to comment.