mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 14:18:37 +00:00
SHERLOCK: Implemented initial RT palette loading
This commit is contained in:
parent
bcc31b2a66
commit
1e291b0b25
@ -514,9 +514,7 @@ bool Scene::loadScene(const Common::String &filename) {
|
||||
} else {
|
||||
// Read in palette
|
||||
rrmStream->read(screen._cMap, PALETTE_SIZE);
|
||||
for (int idx = 0; idx < PALETTE_SIZE; ++idx)
|
||||
screen._cMap[idx] = VGA_COLOR_TRANS(screen._cMap[idx]);
|
||||
|
||||
screen.translatePalette(screen._cMap);
|
||||
Common::copy(screen._cMap, screen._cMap + PALETTE_SIZE, screen._sMap);
|
||||
|
||||
// Read in the background
|
||||
|
@ -39,7 +39,7 @@ Screen::Screen(SherlockEngine *vm) : Surface(g_system->getWidth(), g_system->get
|
||||
Common::fill(&_cMap[0], &_cMap[PALETTE_SIZE], 0);
|
||||
Common::fill(&_sMap[0], &_sMap[PALETTE_SIZE], 0);
|
||||
Common::fill(&_tMap[0], &_tMap[PALETTE_SIZE], 0);
|
||||
setFont(1);
|
||||
setFont(IS_SERRATED_SCALPEL ? 1 : 4);
|
||||
|
||||
// Rose Tattoo specific fields
|
||||
_fadeBytesRead = _fadeBytesToRead = 0;
|
||||
@ -466,4 +466,9 @@ void Screen::initScrollVars() {
|
||||
_targetScroll = 0;
|
||||
}
|
||||
|
||||
void Screen::translatePalette(byte palette[PALETTE_SIZE]) {
|
||||
for (int idx = 0; idx < PALETTE_SIZE; ++idx)
|
||||
palette[idx] = VGA_COLOR_TRANS(palette[idx]);
|
||||
}
|
||||
|
||||
} // End of namespace Sherlock
|
||||
|
@ -251,6 +251,12 @@ public:
|
||||
void setupBGArea(const byte cMap[PALETTE_SIZE]);
|
||||
|
||||
void initScrollVars();
|
||||
|
||||
/**
|
||||
* Translate a palette from 6-bit RGB values to full 8-bit values suitable for passing
|
||||
* to the underlying palette manager
|
||||
*/
|
||||
static void translatePalette(byte palette[PALETTE_SIZE]);
|
||||
};
|
||||
|
||||
} // End of namespace Sherlock
|
||||
|
@ -47,6 +47,9 @@ void TattooEngine::initialize() {
|
||||
|
||||
// Starting scene
|
||||
_scene->_goToScene = 91;
|
||||
|
||||
// Load an initial palette
|
||||
loadInitialPalette();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,6 +59,15 @@ void TattooEngine::startScene() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void TattooEngine::loadInitialPalette() {
|
||||
byte palette[768];
|
||||
Common::SeekableReadStream *stream = _res->load("room.pal");
|
||||
stream->read(palette, PALETTE_SIZE);
|
||||
_screen->translatePalette(palette);
|
||||
_screen->setPalette(palette);
|
||||
|
||||
delete stream;
|
||||
}
|
||||
|
||||
} // End of namespace Tattoo
|
||||
|
||||
|
@ -30,6 +30,11 @@ namespace Sherlock {
|
||||
namespace Tattoo {
|
||||
|
||||
class TattooEngine : public SherlockEngine {
|
||||
private:
|
||||
/**
|
||||
* Loads the initial palette for the game
|
||||
*/
|
||||
void loadInitialPalette();
|
||||
protected:
|
||||
virtual void initialize();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user