diff options
author | Vladimir Menshakov | 2011-06-10 10:43:13 +0400 |
---|---|---|
committer | Alyssa Milburn | 2011-06-15 17:33:56 +0200 |
commit | 8a72645c16a76937eaa5faf824fe5ae2eef8bebe (patch) | |
tree | 045627639008f3f384016deb64252a2fb2862578 /engines/dreamweb | |
parent | 4c54bf9799329da3a030d4df524c8e2b87b7a7fa (diff) | |
download | scummvm-rg350-8a72645c16a76937eaa5faf824fe5ae2eef8bebe.tar.gz scummvm-rg350-8a72645c16a76937eaa5faf824fe5ae2eef8bebe.tar.bz2 scummvm-rg350-8a72645c16a76937eaa5faf824fe5ae2eef8bebe.zip |
DREAMWEB: added setPalette instead of showgroup + framenm
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreamweb.cpp | 30 | ||||
-rw-r--r-- | engines/dreamweb/dreamweb.h | 1 |
2 files changed, 20 insertions, 11 deletions
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 68370ffa17..5480aa6ff5 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -217,6 +217,14 @@ void DreamWebEngine::fadeDos() { waitForVSync(); } } +void DreamWebEngine::setPalette() { + PaletteManager *palette = _system->getPaletteManager(); + unsigned n = (uint16)_context.cx; + uint8 *colors = _context.ds.ptr(_context.si, n * 3); + palette->setPalette(colors, _context.al, n); + _context.si += n * 3; + _context.cx = 0; +} } // End of namespace DreamWeb @@ -271,7 +279,16 @@ void multidump(Context &context) { } void frameoutnm(Context &context) { - ::error("frameoutnm"); + unsigned w = (uint8)context.cl, h = (uint8)context.ch; + unsigned pitch = (uint16)context.dx; + unsigned src = (uint16)context.si; + unsigned dst = (uint16)context.di + (uint16)context.bx * pitch; + //debug(1, "framenm %ux%u[pitch: %u] -> segment: %04x->%04x", w, h, pitch, (uint16)context.ds, (uint16)context.es); + for(unsigned y = 0; y < h; ++y) { + uint8 *src_p = context.ds.ptr(src + w * y, w); + uint8 *dst_p = context.es.ptr(dst + pitch * y, w); + memcpy(src_p, dst_p, w); + } } void seecommandtail(Context &context) { @@ -534,16 +551,7 @@ void mode640x480(Context &context) { } void showgroup(Context &context) { - debug(1, "setting palette entries %u, %u colors, ds: %04x", (uint8)context.al, (uint16)context.cx, (uint16)context.ds); - for(unsigned idx = context.al; context.cx--; ++idx) { - context._lodsb(); - unsigned r = context.al; - context._lodsb(); - unsigned g = context.al; - context._lodsb(); - unsigned b = context.al; - //debug(1, "%u -> (%u,%u,%u)", idx, r, g, b); - } + engine()->setPalette(); } void fadedos(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index ed4359f645..1e9ace932b 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -85,6 +85,7 @@ public: void mouseCall(); //fill mouse pos and button state void processEvents(); void setGraphicsMode(); + void setPalette(); void fadeDos(); private: |