Tools: compress_sword1 better handling of directory layout
|Reported by:||criezy||Owned by:||sev-|
I find the way the current compress_sword1 tool handles input and output directories too restrictive. It forces the speech files to be in a SPEECH subdirectory and the music files to be in a MUSIC subdirectory in both input and output directories. Furthermore when using the GUI we have to select a cluster file that is at the root of the game directory, which means the cluster files (or at least one of them) cannot be in a CLUSTER sub-directory.
This patch proposes to fix these issues to let more flexibility in the layout of the input and output directories, which is more in line with what the Sword1 engine in ScummVM accepts. It does three things: 1) GUI accept as input the swordres.rif file, which means the cluster file can now be in a CLUSTER sub-directory. 2) If the speech and music files are not in a SPEECH and MUSIC sub-directory respectively, it looks for them at the root of the input directory. One side effect is that when using --speech-only with the CLI we can now directly give the speech cluster file as input to the tool. 3) If the SPEECH and/or MUSIC sub-directories do not exist in the output directory, the corresponding files are created directly at the root of the output directory.
Concerning point 3, there are alternatives solutions, such as creating the MUSIC and SPEECH sub-directories if they do not exist in the output directory. The choice I made has the advantage to create the files in the same location as the uncompressed files if the input and output directories are the same (unless the SPEECH subdirectory is read-only for example, or this subdirectory exists but does not contain the uncompressed speech files).
Ticket imported from: #2929082. Ticket imported from: patches/1239.