diff options
| author | Paul Gilbert | 2016-11-09 20:23:50 -0500 | 
|---|---|---|
| committer | Paul Gilbert | 2016-11-09 20:23:50 -0500 | 
| commit | 56a23b9adaf806fa6d050e2cc2f11745006ac7be (patch) | |
| tree | 7103f6db0cd31de54ef64b81a019355d936aef41 | |
| parent | 939b7ed885754e2a513e8b8498715f52d14dbaa3 (diff) | |
| download | scummvm-rg350-56a23b9adaf806fa6d050e2cc2f11745006ac7be.tar.gz scummvm-rg350-56a23b9adaf806fa6d050e2cc2f11745006ac7be.tar.bz2 scummvm-rg350-56a23b9adaf806fa6d050e2cc2f11745006ac7be.zip | |
TITANIC: Fix naming and initialization of PET Room glyph images
| -rw-r--r-- | engines/titanic/pet_control/pet_rooms.cpp | 2 | ||||
| -rw-r--r-- | engines/titanic/pet_control/pet_rooms_glyphs.cpp | 72 | ||||
| -rw-r--r-- | engines/titanic/pet_control/pet_rooms_glyphs.h | 23 | 
3 files changed, 50 insertions, 47 deletions
| diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp index 815fb86786..d32667e5f7 100644 --- a/engines/titanic/pet_control/pet_rooms.cpp +++ b/engines/titanic/pet_control/pet_rooms.cpp @@ -223,7 +223,7 @@ bool CPetRooms::setupControl(CPetControl *petControl) {  	_glyphs.setup(6, this);  	_glyphs.setFlags(GFLAG_16);  	_glyphItem.setup(petControl, &_glyphs); -	_glyphItem.set38(1); +	_glyphItem.setFlag(1);  	return true;  } diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp index 47457bae4e..27034aeeb7 100644 --- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp +++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp @@ -30,15 +30,15 @@  namespace Titanic {  CPetRoomsGlyph::CPetRoomsGlyph() : CPetGlyph(), -	_roomFlags(0), _field38(0), _mode(RGM_UNASSIGNED), -	_object0(nullptr), _object1(nullptr), _object2(nullptr), _object3(nullptr), -	_object4(nullptr), _object5(nullptr), _object6(nullptr), _object7(nullptr) { +		_roomFlags(0), _mailFlag(0), _mode(RGM_UNASSIGNED), +		_chevLeftOnDim(nullptr), _chevLeftOffDim(nullptr), _chevLeftOnLit(nullptr), _chevLeftOffLit(nullptr), +		_chevRightOnDim(nullptr), _chevRightOffDim(nullptr), _chevRightOnLit(nullptr), _chevRightOffLit(nullptr) {  }  CPetRoomsGlyph::CPetRoomsGlyph(uint flags) : CPetGlyph(), -	_roomFlags(flags), _field38(0), _mode(RGM_UNASSIGNED), -	_object0(nullptr), _object1(nullptr), _object2(nullptr), _object3(nullptr), -	_object4(nullptr), _object5(nullptr), _object6(nullptr), _object7(nullptr) { +		_roomFlags(flags), _mailFlag(0), _mode(RGM_UNASSIGNED), +		_chevLeftOnDim(nullptr), _chevLeftOffDim(nullptr), _chevLeftOnLit(nullptr), _chevLeftOffLit(nullptr), +		_chevRightOnDim(nullptr), _chevRightOffDim(nullptr), _chevRightOnLit(nullptr), _chevRightOffLit(nullptr) {  }  bool CPetRoomsGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) { @@ -46,14 +46,14 @@ bool CPetRoomsGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {  		return false;  	CPetSection *section = owner->getOwner(); -	_object0 = section->getBackground(9); -	_object1 = section->getBackground(12); -	_object4 = section->getBackground(13); -	_object5 = section->getBackground(10); -	_object2 = section->getBackground(11); -	_object3 = section->getBackground(14); -	_object6 = section->getBackground(15); -	_object7 = _object6; +	_chevLeftOnDim = section->getBackground(8); +	_chevLeftOffDim = section->getBackground(9); +	_chevRightOnDim = section->getBackground(12); +	_chevRightOffDim = section->getBackground(13); +	_chevLeftOnLit = section->getBackground(10); +	_chevLeftOffLit = section->getBackground(11); +	_chevRightOnLit = section->getBackground(14); +	_chevRightOffLit = section->getBackground(15);  	return true;  } @@ -69,16 +69,16 @@ void CPetRoomsGlyph::drawAt(CScreenManager *screenManager, const Point &pt, bool  	uint roomBits = roomFlags.getRoomBits();  	// Save a copy of object pointers that may be modified -	CGameObject *obj0 = _object0; -	CGameObject *obj1 = _object1; -	CGameObject *obj4 = _object4; -	CGameObject *obj5 = _object5; - -	if (_field38 == 1 || isHighlighted_) { -		_object0 = _object2; -		_object1 = _object3; -		_object4 = _object6; -		_object5 = _object7; +	CGameObject *obj0 = _chevLeftOnDim; +	CGameObject *obj1 = _chevLeftOffDim; +	CGameObject *obj4 = _chevRightOnDim; +	CGameObject *obj5 = _chevRightOffDim; + +	if (_mailFlag || isHighlighted_) { +		_chevLeftOnDim = _chevLeftOnLit; +		_chevLeftOffDim = _chevLeftOffLit; +		_chevRightOnDim = _chevRightOnLit; +		_chevRightOffDim = _chevRightOffLit;  	}  	// Draw the images @@ -95,10 +95,10 @@ void CPetRoomsGlyph::drawAt(CScreenManager *screenManager, const Point &pt, bool  		destPt, screenManager);  	// Restore original object pointers -	_object0 = obj0; -	_object1 = obj1; -	_object4 = obj4; -	_object5 = obj5; +	_chevLeftOnDim = obj0; +	_chevLeftOffDim = obj1; +	_chevRightOnDim = obj4; +	_chevRightOffDim = obj5;  }  void CPetRoomsGlyph::selectGlyph(const Point &topLeft, const Point &pt) { @@ -124,7 +124,7 @@ bool CPetRoomsGlyph::dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) {  		if (chevron) {  			chevron->_id = _roomFlags; -			chevron->_isMail = _field38; +			chevron->_isMail = _mailFlag != 0;  			petControl->removeFromInventory(chevron, false, false);  			chevron->loadSurface(); @@ -150,9 +150,9 @@ void CPetRoomsGlyph::getTooltip(CPetText *text) {  		msg = "Your assigned room: ";  	} else if (isPreviouslyAssigned()) {  		msg = "A previously assigned room: "; -	} else if (!_field38) { +	} else if (!_mailFlag) {  		msg = "Saved Chevron: "; -	} else if (_field38 == 1 && owner->getRoomFlags() == _roomFlags) { +	} else if (_mailFlag == 1 && owner->getRoomFlags() == _roomFlags) {  		msg = "Current location: ";  	} @@ -214,15 +214,15 @@ int CPetRoomsGlyph::getSelection(const Point &topLeft, const Point &pt) {  }  void CPetRoomsGlyph::drawObjects(uint flags, const Point &pt, CScreenManager *screenManager) { -	if (_object0 && _object1 && _object4 && _object5) { +	if (_chevLeftOnDim && _chevLeftOffDim && _chevRightOnDim && _chevRightOffDim) {  		Point destPos = pt; -		((flags & 8) ? _object0 : _object5)->draw(screenManager, destPos); +		((flags & 8) ? _chevLeftOnDim : _chevRightOffDim)->draw(screenManager, destPos);  		destPos.x += 13; -		((flags & 4) ? _object4 : _object5)->draw(screenManager, destPos); +		((flags & 4) ? _chevRightOnDim : _chevRightOffDim)->draw(screenManager, destPos);  		destPos.x += 13; -		((flags & 2) ? _object0 : _object1)->draw(screenManager, destPos); +		((flags & 2) ? _chevLeftOnDim : _chevLeftOffDim)->draw(screenManager, destPos);  		destPos.x += 13; -		((flags & 1) ? _object4 : _object5)->draw(screenManager, destPos); +		((flags & 1) ? _chevRightOnDim : _chevRightOffDim)->draw(screenManager, destPos);  	}  } diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h index 1c060c511c..6c51b6f875 100644 --- a/engines/titanic/pet_control/pet_rooms_glyphs.h +++ b/engines/titanic/pet_control/pet_rooms_glyphs.h @@ -36,16 +36,16 @@ enum RoomGlyphMode {  class CPetRoomsGlyph : public CPetGlyph {  private:  	uint _roomFlags; -	int _field38; +	uint _mailFlag;  	RoomGlyphMode _mode; -	CGameObject *_object0; -	CGameObject *_object1; -	CGameObject *_object2; -	CGameObject *_object3; -	CGameObject *_object4; -	CGameObject *_object5; -	CGameObject *_object6; -	CGameObject *_object7; +	CGameObject *_chevLeftOnDim; +	CGameObject *_chevLeftOffDim; +	CGameObject *_chevLeftOnLit; +	CGameObject *_chevLeftOffLit; +	CGameObject *_chevRightOnDim; +	CGameObject *_chevRightOffDim; +	CGameObject *_chevRightOnLit; +	CGameObject *_chevRightOffLit;  private:  	/**  	 * Find the selected button under the given point, based on the buttons @@ -113,7 +113,10 @@ public:  	 */  	uint getRoomFlags() const { return _roomFlags; } -	void set38(int val) { _field38 = val; } +	/** +	 * Set mail status flag +	 */ +	void setFlag(uint val) { _mailFlag = val; }  	/**  	 * Sets the mode of the glyph | 
