From b9cdb1abb76c94723c24ca66eb8d47d96c8c5ebd Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 3 Oct 2009 20:49:18 +0000 Subject: SCI: Merge new GUI code written by m_kiewitz. This is a major rewrite of the graphics code. A slightly adapted version of the old code is still available and currently the default. The new code is selectable in sci.cpp, but is not yet finished. svn-id: r44565 --- engines/sci/gfx/gfx_driver.cpp | 15 +++++++++++++++ engines/sci/gfx/gfx_driver.h | 5 +++++ engines/sci/gfx/res_view.cpp | 6 ++++++ 3 files changed, 26 insertions(+) (limited to 'engines/sci/gfx') diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp index 15704b636c..ccf15f3e30 100644 --- a/engines/sci/gfx/gfx_driver.cpp +++ b/engines/sci/gfx/gfx_driver.cpp @@ -248,4 +248,19 @@ void GfxDriver::setPointer(gfx_pixmap_t *pointer, Common::Point *hotspot) { cursorData = 0; } +void GfxDriver::animatePalette(int fromColor, int toColor, int stepCount) { + int i; + PaletteEntry firstColor = _mode->palette->getColor(fromColor); + PaletteEntry loopColor; + for (i=fromColor+1; i<=toColor; i++) { + loopColor = _mode->palette->getColor(i); + loopColor.r = 0; + loopColor.g = 0; + loopColor.b = 0; + _mode->palette->makeSystemColor(i-1, loopColor); // loopColor.r, loopColor.g, loopColor.b); + } +// _mode->palette->setColor(toColor, firstColor.r, firstColor.g, firstColor.b); + _mode->palette->makeSystemColor(toColor, firstColor); +} + } // End of namespace Sci diff --git a/engines/sci/gfx/gfx_driver.h b/engines/sci/gfx/gfx_driver.h index ede48a6b34..1143d8e66d 100644 --- a/engines/sci/gfx/gfx_driver.h +++ b/engines/sci/gfx/gfx_driver.h @@ -228,6 +228,11 @@ public: gfx_mode_t *getMode() { return _mode; } byte *getVisual0() { return _visual[0]; } + /** + * Animates palette + */ + void animatePalette(int fromColor, int toColor, int stepCount); + private: gfx_pixmap_t *_priority[2]; byte *_visual[2]; diff --git a/engines/sci/gfx/res_view.cpp b/engines/sci/gfx/res_view.cpp index 95f6919b0c..cbe26b97d6 100644 --- a/engines/sci/gfx/res_view.cpp +++ b/engines/sci/gfx/res_view.cpp @@ -365,6 +365,12 @@ gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *reso return retval; } +// SCI1: +// [LoopCount:WORD] [MirrorMask:WORD] [??:WORD] [PaletteOffset:WORD] [LoopOffset0:WORD] [LoopOffset1:WORD]... +// Loop-data: +// [CellCount:WORD] [Unknown:WORD] [CellOffset0:WORD] [CellOffset1:WORD]... +// SCI11: +// [HeaderSize:WORD] [LoopCount:BYTE] [Unknown:BYTE] [??:WORD] [??:WORD] [PaletteOffset:WORD] gfxr_view_t *getVGAView(int id, byte *resource, int size, ViewType viewType) { uint16 palOffset = READ_LE_UINT16(resource + V1_PALETTE_OFFSET + ((viewType == kViewVga11) ? 2 : 0)); uint16 headerSize = (viewType == kViewVga11) ? READ_LE_UINT16(resource + V2_HEADER_SIZE) : 0; -- cgit v1.2.3