diff options
author | Eugene Sandulenko | 2019-11-01 18:07:19 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-11-01 18:07:19 +0100 |
commit | 0348aa72fd636e64072b0e25c6768193c456fb8b (patch) | |
tree | 41b626eafffa77e6111ddd8c2d55d7559f6e2571 | |
parent | 0369e3b8caf1345e792059c0b5f310245e0cbb42 (diff) | |
download | scummvm-rg350-0348aa72fd636e64072b0e25c6768193c456fb8b.tar.gz scummvm-rg350-0348aa72fd636e64072b0e25c6768193c456fb8b.tar.bz2 scummvm-rg350-0348aa72fd636e64072b0e25c6768193c456fb8b.zip |
SCUMM HE: MBC: Take array type into account when sending
-rw-r--r-- | engines/scumm/he/moonbase/net_main.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/engines/scumm/he/moonbase/net_main.cpp b/engines/scumm/he/moonbase/net_main.cpp index d4ad67a977..fa9505d0b9 100644 --- a/engines/scumm/he/moonbase/net_main.cpp +++ b/engines/scumm/he/moonbase/net_main.cpp @@ -392,10 +392,32 @@ void Net::remoteSendArray(int typeOfSend, int sendTypeParam, int priority, int a int32 size = (FROM_LE_32(ah->dim1end) - FROM_LE_32(ah->dim1start) + 1) * (FROM_LE_32(ah->dim2end) - FROM_LE_32(ah->dim2start) + 1); - for (int i = 0; i < size - 1; i++) - jsonData += Common::String::format("%d, ", ah->data[i]); + for (int i = 0; i < size; i++) { + int32 data; + switch (FROM_LE_32(ah->type)) { + case ScummEngine_v100he::kByteArray: + case ScummEngine_v100he::kStringArray: + data = ah->data[i]; + break; + + case ScummEngine_v100he::kIntArray: + data = (int16)READ_LE_UINT16(ah->data + i * 2); + break; + + case ScummEngine_v100he::kDwordArray: + data = (int32)READ_LE_UINT32(ah->data + i * 4); + break; + } + + jsonData += Common::String::format("%d, ", data); + + if (i < size - 1) + jsonData += ", "; + else + jsonData += "]"; jsonData += Common::String::format("%d]", ah->data[size - 1]); + } warning("STUB: Net::remoteSendArray(%d, %d, %d, %d)", typeOfSend, sendTypeParam, priority, arrayIndex & ~0x33539000); // PN_RemoteSendArrayCommand |