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

BGM does not play on linux if name is not all lower case #100

Open
drojf opened this issue Dec 13, 2022 · 3 comments
Open

BGM does not play on linux if name is not all lower case #100

drojf opened this issue Dec 13, 2022 · 3 comments

Comments

@drojf
Copy link
Contributor

drojf commented Dec 13, 2022

Just noticed primal-beat-of-horrow_T.ogg doesn't play on Linux. Renaming it to primal-beat-of-horrow_t.ogg (with a lowercase 't') causes it to play correctly

Probably because the game is looking for 'primal-beat-of-horrow_t.ogg' and can't find it because Linux file names are case sensitive

This may be related to the BGM switching I implemented which doesn't handle different file case when looking for files (although I thought such a thing would already be handled in the engine, but I might be bypassing it)

@drojf
Copy link
Contributor Author

drojf commented Dec 13, 2022

Also worth checking if other systems are similarly affected (like loading sprites/images)

@drojf
Copy link
Contributor Author

drojf commented Dec 13, 2022

We do have handling for this already, but it assumes that all files on disk are lower case:

public string getAssetFromCascade(string filenameAnyCase, PathCascadeList cascade, out bool exists)
{
// Assume that all files are lowercase on disk, but are sometimes not fully lowercase in the game script or as args to this function
string filename = filenameAnyCase.ToLower();
exists = false;
// Use the first file that exists. If none exist, return the last one.
string relativePath = "INVALID ASSET PATH";
foreach (string assetSubFolder in cascade.paths)
{
relativePath = Path.Combine(assetSubFolder, filename);
if (File.Exists(Path.Combine(assetPath, relativePath)))
{
exists = true;
break;
}
}
return relativePath;
}

Rather than trying to fix the issue in the DLL, normalizing all files to lower case is probably the better option for now (and maybe checking all our game files are lowercase by a script or something)

drojf added a commit to 07th-mod/python-patcher that referenced this issue Dec 13, 2022
 - See 07th-mod/higurashi-assembly#100
 - Version bumped to 1.0.3 to match internal version tracking in the archive
@drojf
Copy link
Contributor Author

drojf commented Dec 13, 2022

OK, I've just fixed the two affected BGM (BIGBEAR.ogg and primal-beat-of-horrow_T.ogg).

However, I want to leave this issue open to remind us to scan our mod(s) for any upper case filenames.

drojf added a commit to 07th-mod/higurashi-bgm-matcher that referenced this issue Dec 13, 2022
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