From f96dbd52c793a6b96bee8ecde0148ae85dd9fd9e Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 31 Dec 2014 10:10:32 +0100 Subject: ACCESS: MM - Implement some more tex palette handling --- engines/access/martian/martian_room.cpp | 5 +++++ engines/access/player.cpp | 4 +++- engines/access/player.h | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/engines/access/martian/martian_room.cpp b/engines/access/martian/martian_room.cpp index dfc0dbcd5e..c4f38d8f99 100644 --- a/engines/access/martian/martian_room.cpp +++ b/engines/access/martian/martian_room.cpp @@ -82,7 +82,12 @@ void MartianRoom::reloadRoom1() { setWallCodes(); buildScreen(); _vm->copyBF2Vid(); + + // warning("TODO: setManPalette"); + Common::copy(_vm->_player->_manPal1 + 0x2A0, _vm->_player->_manPal1 + 0x2A0 + 0x42, _vm->_screen->_manPal); + // + _vm->_events->showCursor(); _vm->_player->_frame = 0; _vm->_oldRects.clear(); diff --git a/engines/access/player.cpp b/engines/access/player.cpp index 41c5b47daf..fe555ec49a 100644 --- a/engines/access/player.cpp +++ b/engines/access/player.cpp @@ -140,7 +140,8 @@ void Player::load() { _playerSprites = _playerSprites1; if (_manPal1) { - Common::copy(_manPal1 + 0x270, _manPal1 + 0x270 + 0x60, _vm->_screen->_manPal); + // Those values are from MM as Amazon doesn't use it + Common::copy(_manPal1 + 0x2A0, _manPal1 + 0x2A0 + 0x42, _vm->_screen->_manPal); } else { Common::fill(_vm->_screen->_manPal, _vm->_screen->_manPal + 0x60, 0); } @@ -149,6 +150,7 @@ void Player::load() { void Player::loadTexPalette() { Resource *_texPal = _vm->_files->loadFile("TEXPAL.COL"); int size = _texPal->_size; + assert(size == 768); _manPal1 = new byte[size]; memcpy(_manPal1, _texPal->data(), size); } diff --git a/engines/access/player.h b/engines/access/player.h index 1e66a72a95..db88892d7c 100644 --- a/engines/access/player.h +++ b/engines/access/player.h @@ -56,7 +56,6 @@ protected: int _diagUpWalkMin, _diagUpWalkMax; int _diagDownWalkMin, _diagDownWalkMax; SpriteResource *_playerSprites1; - byte *_manPal1; int _scrollEnd; int _inactiveYOff; @@ -82,6 +81,7 @@ public: Direction _playerDirection; SpriteResource *_playerSprites; // Fields in original Player structure + byte *_manPal1; byte *_monData; int *_walkOffRight; int *_walkOffLeft; -- cgit v1.2.3