When Ikarus scripts allocate a struct with MEM_Alloc and access its fields through a transient instance, each field's byte position within the allocation must be computed. This requires two symbol metadata values that are available in the C++ API but not yet exposed in the C# wrapper.
void memory_instance::set_int(const zenkit::DaedalusSymbol& sym, uint16_t index, int32_t value) {
ptr32_t addr = address
+ ptr32_t(sym.offset_as_member()) // 1.
+ ptr32_t(index * sym.class_size()); // 2.
owner.mem32.writeInt(addr, value);
}
Requested C# API:
- DaedalusSymbol.OffsetAsMember
- DaedalusSymbol.ClassSize
When Ikarus scripts allocate a struct with MEM_Alloc and access its fields through a transient instance, each field's byte position within the allocation must be computed. This requires two symbol metadata values that are available in the C++ API but not yet exposed in the C# wrapper.
Reference OpenGothic (directmemory.cpp):
Requested C# API: