[Scummvm-git-logs] scummvm master -> 0348aa72fd636e64072b0e25c6768193c456fb8b
sev-
sev at scummvm.org
Fri Nov 1 18:08:40 CET 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0348aa72fd SCUMM HE: MBC: Take array type into account when sending
Commit: 0348aa72fd636e64072b0e25c6768193c456fb8b
https://github.com/scummvm/scummvm/commit/0348aa72fd636e64072b0e25c6768193c456fb8b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-11-01T18:07:19+01:00
Commit Message:
SCUMM HE: MBC: Take array type into account when sending
Changed paths:
engines/scumm/he/moonbase/net_main.cpp
diff --git a/engines/scumm/he/moonbase/net_main.cpp b/engines/scumm/he/moonbase/net_main.cpp
index d4ad67a..fa9505d 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
More information about the Scummvm-git-logs
mailing list