Doom-Utils / deutex

WAD composer for Doom, Heretic, Hexen, and Strife
Other
61 stars 17 forks source link

File overrides not supported for [texture] section #37

Closed fragglet closed 7 years ago

fragglet commented 7 years ago

The config parser allows you to specify a filename explicitly for most sections. For example you can do this:

[musics]
D_E1M1 = D_C1M1

You can't do this when specifying a texture lump in the [textures] section; it has to conform to the name of the lump.

This used to be annoying for Freedoom, but is slightly moot now, since we generate our own texture lump.

Voros2 commented 7 years ago

I'm surprised it doesn't. This wouldn't be related to the fact that Deutex always looks for the TEXTURE lumps in the IWAD first, would it?

Voros2 commented 7 years ago

Here's some rough code I wrote that should make Deutex not look for the TEXTURE lumps in the IWAD unless specified via -iwad. Problem is IDK what to do with the PNAME section.

fragglet commented 7 years ago

Friendly head-up: It's usually more helpful to link to the commit rather than the file. Otherwise it's very hard to know what you changed.

fragglet commented 7 years ago

But, I think you commented on the wrong bug? Your change looks like it's related to #7 and probably unrelated to this issue.

Voros2 commented 7 years ago

Chances are they are both related.

fragglet commented 7 years ago

I see no reason to think so.

fragglet commented 7 years ago

Confirmed. It's an unrelated issue. CMPOmakePWAD() does this:

        while (TXTentryParse
               (name, filenam, &X, &Y, &Repeat, TXT, false) == true) {

TXTentryParse() is a standard function that parses lines from the config file. The filenam variable is populated, but the value isn't actually used. It goes on to just construct the filename ignoring it:

            if (MakeFileName
                (file, DataDir, "TEXTURES", "", name, "TXT") == true) {
                Detail("CM52", "Reading texture file %s", fname(file));
                TXUreadTexFile(file, true);

There's also a ton of duplicated code that's identical between TEXTURE1 and TEXTURE2. This is a horrible codebase.

Voros2 commented 7 years ago

Then simply changing name to filenam should fix it. That's how the other composing functions do it.

chungy commented 7 years ago

This is a horrible codebase.

Yes it is. ;)

chungy commented 7 years ago

Fixed as of a2339720b6df26924726bce1252b903410e140d1