Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arsd.declarativeloader: Cannot define fixed size embedded arrays #467

Open
naydef opened this issue Dec 10, 2024 · 0 comments
Open

arsd.declarativeloader: Cannot define fixed size embedded arrays #467

naydef opened this issue Dec 10, 2024 · 0 comments

Comments

@naydef
Copy link
Contributor

naydef commented Dec 10, 2024

I'm trying to use this module to load files, where some part of their structure is unknown, so I need to add padding.

The following does not work:

struct WusFile
{
    struct SndEntry
    {
        int len;
        byte[0xC] pad1;
        byte[0x12] pad2;
        @NumElements!len short[] sample;
    }

    int cnt;
    @NumElements!cnt SndEntry[] snd;
}

The error message:

arsd/declarativeloader.d(159): Error: no property `Field` for `t` of type `wus_extract.WusFile.SndEntry`
wusExtract.d(10):        struct `SndEntry` defined here
arsd/declarativeloader.d(197): Error: template instance `arsd.declarativeloader.loadFrom!(SndEntry, ubyte[])` error instantiating
wusExtract.d(38):        instantiated from here: `loadFrom!(WusFile, ubyte[])`

I didn't find something in the module that can allow this. (Didn't try hard enough, though)
I tried using @NumElements!54 byte[] pad;, but not working, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant