QodotPlugin / qodot-plugin

(LEGACY) Quake .map support for Godot 3.x
MIT License
974 stars 70 forks source link

Automatic map format recognition #29

Closed Shfty closed 4 years ago

Shfty commented 4 years ago

Errors are spammed to the console for every face in the map, causing the editor to lock until they finish.

Ideally the distinction between valve-format UVs and everything else should be automatic, but the practical solution right now is to have the geo generation process cancel itself and print a warning to the user.

Shfty commented 4 years ago

An 'automatic' format taking hints from TrenchBroom's .map header seems like a good compromise between advanced detection and basic user error prevention. Simply output a warning and fail to build if the header isn't present.

Still need to prevent an editor lock if a mis-parse happens though.

Shfty commented 4 years ago

I've added automatic UV format recognition in the latest commit.

I'm shifting this task to generalized automatic recognition, since figuring out the bitmask format shouldn't be too big of a jump from here.

Shfty commented 4 years ago

Since the bitmask values are stored at the end of each face and aren't used by the default Qodot implementation, I'm tempted to dump them all into an array and nix map format distinction entirely.

Shfty commented 4 years ago

Implemented in the latest commit- QodotMapReader now parses any remaining params stored after texture scale as integer bitmasks and stores them in the bitmask_params property in QuakeFace.

This means Qodot doesn't have to care about the specifics of the format, but the data is parsed and available should a game-code implementation need it.