* Copy a list of SL_VARs to/from a savegame. * These entries are copied as-is, and you as caller have to make sure things * like length-fields are calculated correctly. * @param object The object being manipulated. * @param length The length of the object in elements * @param conv VarType type of the items. */
| 1148 | * @param conv VarType type of the items. |
| 1149 | */ |
| 1150 | void SlCopy(void *object, size_t length, VarType conv) |
| 1151 | { |
| 1152 | if (_sl.action == SLA_PTRS || _sl.action == SLA_NULL) return; |
| 1153 | |
| 1154 | /* Automatically calculate the length? */ |
| 1155 | if (_sl.need_length != NL_NONE) { |
| 1156 | SlSetLength(length * SlCalcConvFileLen(conv)); |
| 1157 | /* Determine length only? */ |
| 1158 | if (_sl.need_length == NL_CALCLENGTH) return; |
| 1159 | } |
| 1160 | |
| 1161 | SlCopyInternal(object, length, conv); |
| 1162 | } |
| 1163 | |
| 1164 | /** |
| 1165 | * Return the size in bytes of a certain type of atomic array |