diff options
| author | Bendegúz Nagy | 2016-07-11 13:12:40 +0200 | 
|---|---|---|
| committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 | 
| commit | 1baf135c2f3ea0214f539242935aa8a8d0705f1d (patch) | |
| tree | c2d86c10bcdce63562afb955dd00ab66ae9c42dd /engines | |
| parent | 9c79d02a1fb7c30cd47a8c0392b05642f2be12a3 (diff) | |
| download | scummvm-rg350-1baf135c2f3ea0214f539242935aa8a8d0705f1d.tar.gz scummvm-rg350-1baf135c2f3ea0214f539242935aa8a8d0705f1d.tar.bz2 scummvm-rg350-1baf135c2f3ea0214f539242935aa8a8d0705f1d.zip  | |
DM: Add missing code to command turn party
Diffstat (limited to 'engines')
| -rw-r--r-- | engines/dm/eventman.cpp | 25 | ||||
| -rw-r--r-- | engines/dm/gfx.cpp | 52 | 
2 files changed, 39 insertions, 38 deletions
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index f57f98688e..4f3ffc5e74 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -649,19 +649,20 @@ void EventManager::f380_processCommandQueue() {  }  void EventManager::f365_commandTurnParty(CommandType cmdType) { -	_vm->_g321_stopWaitingForPlayerInput = true; - -	// MISSING CODE: highlight turn left/right buttons - -	// MISSING CODE: processing stairs - -	// MISSING CODE: process sensors - -	// DUMMY CODE: should call F0284_CHAMPION_SetPartyDirection instead -	direction &partyDir = _vm->_dungeonMan->_g308_partyDir; -	(cmdType == k1_CommandTurnLeft) ? turnDirLeft(partyDir) : turnDirRight(partyDir); +	uint16 L1114_ui_Square; -	// MISSING CODE: process sensors +	_vm->_g321_stopWaitingForPlayerInput = true; +	if (cmdType == k1_CommandTurnLeft) { +		warning(false, "MISSING CODE: F0362_COMMAND_HighlightBoxEnable"); +	} else { +	} +	if (Square(L1114_ui_Square = _vm->_dungeonMan->f151_getSquare(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY).toByte()).getType() == k3_ElementTypeStairs) { +		f364_commandTakeStairs(getFlag(L1114_ui_Square, k0x0004_StairsUp)); +		return; +	} +	_vm->_movsens->f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, Thing::_party, true, false); +	_vm->_championMan->f284_setPartyDirection(M21_normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + ((cmdType == k2_CommandTurnRight) ? 1 : 3))); +	_vm->_movsens->f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, Thing::_party, true, true);  }  void EventManager::f366_commandMoveParty(CommandType cmdType) { diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index bf07cd655a..853571873a 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -1376,44 +1376,44 @@ void DisplayMan::f111_drawDoor(uint16 doorThingIndex, uint16 doorState, int16* d  void DisplayMan::f109_drawDoorOrnament(int16 doorOrnOrdinal, int16 viewDoorOrnIndex) {  	static byte g200_palChangesDoorOrn_D3[16] = {0, 120, 10, 30, 40, 30, 0, 60, 30, 90, 100, 110, 0, 20, 0, 130}; // @ G0200_auc_Graphic558_PaletteChanges_DoorOrnament_D3  	static byte g201PalChangesDoorOrn_D2[16] = {0, 10, 20, 30, 40, 30, 60, 70, 50, 90, 100, 110, 120, 130, 140, 150}; // @ G0201_auc_Graphic558_PaletteChanges_DoorOrnament_D2 +#define AP0120_i_Height doorOrnOrdinal +#define AP0121_i_ByteWidth viewDoorOrnIndex +	int16 L0104_i_NativeBitmapIndex; +	int16 coordSetGreenToad; +	uint16* coordSetOrangeElk; +	byte* L0107_puc_Multiple; +#define AL0107_puc_Bitmap        L0107_puc_Multiple +	byte* L0108_puc_Bitmap_Native; -#define height doorOrnOrdinal -#define byteWidth viewDoorOrnIndex -  	if (doorOrnOrdinal) {  		doorOrnOrdinal--; -		int16 nativeBitmapIndex = _g103_currMapDoorOrnInfo[doorOrnOrdinal][k0_NativeBitmapIndex]; -		int16 coordSetGreenToad = _g103_currMapDoorOrnInfo[doorOrnOrdinal][k1_CoordinateSet]; -		uint16 *coordSetOrangeElk = g207_doorOrnCoordSets[coordSetGreenToad][viewDoorOrnIndex]; -		byte *bitmap = nullptr; +		L0104_i_NativeBitmapIndex = _g103_currMapDoorOrnInfo[doorOrnOrdinal][k0_NativeBitmapIndex]; +		coordSetOrangeElk = &g207_doorOrnCoordSets[coordSetGreenToad = _g103_currMapDoorOrnInfo[doorOrnOrdinal][k1_CoordinateSet]][viewDoorOrnIndex][0];  		if (viewDoorOrnIndex == k2_ViewDoorOrnament_D1LCR) { -			bitmap = f489_getNativeBitmapOrGraphic(nativeBitmapIndex); -			byteWidth = 48; -			height = 88; +			AL0107_puc_Bitmap = f489_getNativeBitmapOrGraphic(L0104_i_NativeBitmapIndex); +			AP0121_i_ByteWidth = k48_byteWidth; +			AP0120_i_Height = 88;  		} else {  			if (!f491_isDerivedBitmapInCache(doorOrnOrdinal = k68_DerivedBitmapFirstDoorOrnament_D3 + (doorOrnOrdinal * 2) + viewDoorOrnIndex)) { -				uint16 *coordSetRedEagle = g207_doorOrnCoordSets[coordSetGreenToad][k2_ViewDoorOrnament_D1LCR]; -				byte* bitmapNative = f489_getNativeBitmapOrGraphic(nativeBitmapIndex); -				f129_blitToBitmapShrinkWithPalChange(bitmapNative, -													 f492_getDerivedBitmap(doorOrnOrdinal), -													 coordSetRedEagle[4] << 1, coordSetRedEagle[5], -													 coordSetOrangeElk[2] - coordSetOrangeElk[0] + 1, -													 coordSetOrangeElk[5], -													 (viewDoorOrnIndex == k0_ViewDoorOrnament_D3LCR) ? g200_palChangesDoorOrn_D3 : g201PalChangesDoorOrn_D2); +				uint16 *coordSetRedEagle = &g207_doorOrnCoordSets[coordSetGreenToad][k2_ViewDoorOrnament_D1LCR][0]; +				L0108_puc_Bitmap_Native = f489_getNativeBitmapOrGraphic(L0104_i_NativeBitmapIndex); +				f129_blitToBitmapShrinkWithPalChange(L0108_puc_Bitmap_Native, f492_getDerivedBitmap(doorOrnOrdinal), coordSetRedEagle[4] << 1, coordSetRedEagle[5], coordSetOrangeElk[1] - coordSetOrangeElk[0] + 1, coordSetOrangeElk[5], (viewDoorOrnIndex == k0_ViewDoorOrnament_D3LCR) ? g200_palChangesDoorOrn_D3 : g201PalChangesDoorOrn_D2);  				f493_addDerivedBitmap(doorOrnOrdinal);  			} -			bitmap = f492_getDerivedBitmap(doorOrnOrdinal); +			AL0107_puc_Bitmap = f492_getDerivedBitmap(doorOrnOrdinal);  			if (viewDoorOrnIndex == k0_ViewDoorOrnament_D3LCR) { -				byteWidth = 24; -				height = 41; +				AP0121_i_ByteWidth = k24_byteWidth; +				AP0120_i_Height = 41;  			} else { -				byteWidth = 32; -				height = 61; +				AP0121_i_ByteWidth = k32_byteWidth; +				AP0120_i_Height = 61;  			}  		} -		f132_blitToBitmap(bitmap, _g74_tmpBitmap, -						  *(Box *)coordSetOrangeElk, 0, 0, coordSetOrangeElk[4], byteWidth, k9_ColorGold, coordSetOrangeElk[5], height); +		{ +			Box box(coordSetOrangeElk[0], coordSetOrangeElk[1], coordSetOrangeElk[2], coordSetOrangeElk[3]); +			f132_blitToBitmap(AL0107_puc_Bitmap, _g74_tmpBitmap, box, 0, 0, coordSetOrangeElk[4], AP0121_i_ByteWidth, k9_ColorGold, coordSetOrangeElk[5], AP0120_i_Height); +		}  	}  } @@ -1448,7 +1448,7 @@ void DisplayMan::f21_blitToScreen(byte *bitmap, int16* box, int16 byteWidth, Col  	f21_blitToScreen(bitmap, &actualBox, byteWidth, transparent, height);  } -void DisplayMan::f21_blitToScreen(byte* bitmap, Box* box, int16 viewDoorOrnIndex, Color transparent, int16 doorOrnOrdinal) { +void DisplayMan::f21_blitToScreen(byte* bitmap, Box* box, int16 byteWidth, Color transparent, int16 height) {  	_g578_useByteBoxCoordinates = false;  	f132_blitToBitmap(bitmap, _g348_bitmapScreen, *box, 0, 0, byteWidth, k112_byteWidthViewport, transparent, height, k136_heightViewport);  }  | 
