(array: Il2Cpp.Array)
| 220 | } |
| 221 | |
| 222 | function logArray(array: Il2Cpp.Array): void { |
| 223 | const length = array.length; |
| 224 | const elementType = safeArrayElementType(array); |
| 225 | const elementSize = safeArrayElementSize(array); |
| 226 | log(`[lfs] array length=${length} elementType=${elementType} elementSize=${elementSize}`, "yellow"); |
| 227 | |
| 228 | if (length === 0) { |
| 229 | return; |
| 230 | } |
| 231 | |
| 232 | const indices = getArrayDisplayIndices(length); |
| 233 | let omitted = false; |
| 234 | const indexWidth = Math.max(3, String(length - 1).length); |
| 235 | const typeWidth = clamp(elementType.length, 12, 44); |
| 236 | |
| 237 | for (const index of indices) { |
| 238 | if (index === -1) { |
| 239 | if (!omitted) { |
| 240 | log(`[lfs] ... ${length - ARRAY_HEAD_ELEMENTS - ARRAY_TAIL_ELEMENTS} elements omitted ...`, "yellow"); |
| 241 | omitted = true; |
| 242 | } |
| 243 | continue; |
| 244 | } |
| 245 | |
| 246 | logArrayElement(array, index, indexWidth, typeWidth); |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | function logArrayElement(array: Il2Cpp.Array, index: number, indexWidth: number, typeWidth: number): void { |
| 251 | const pointer = getArrayElementPointer(array, index); |
no test coverage detected