-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
VideoCommon: Allow texture folders to be determined by a <gameid>.txt #8628
VideoCommon: Allow texture folders to be determined by a <gameid>.txt #8628
Conversation
3a5650a
to
0378243
Compare
Works exactly like it says it does. I noticed the following, bug or intended: The texture pack does not load if the name of the texture pack folder is set to the first three characters of the GameID, even if a .txt file is added within the folder. Testing with GameID: PZLE01 I can confirm that the .txt file for PZLE01 (NTSC-U) can either be named "PZL.txt" (Global) or "PZLE01.txt" (NTSC-U). Naming it "PZLP01.txt" (PAL) obviously does not load the texture pack. Basicially you have to give the texture pack folder any name other than the first three characters of the GameID. I don't know whatever this was intended or not, but it can seem a bit confusing when a texture pack will not load because of the texture pack folder name itself. The texture pack folder still be named with the complete GameID without a .txt file for it, but the option to name a texture pack folder with the first three GameID characters without (or with) a .txt is gone. Loading the texture pack folder named as "PZL" with a "NAC.txt" file within while loading Ocarina of Time (Virtual Console) (NACE01) does work however, so you can load a texture pack folder named with only three GameID characters as long the game that is being booted has a different GameID. Tested with the following GameID's for the Zelda 64 4K Texture Pack (https://forums.dolphin-emu.org/Thread-zelda-64-uhd-v4-1-2020-01-22):
This eliminates the need for symbolic links through Windows. It also cleans up the "Load" folder with unnecessary symbolic link folders. A nice bonus, texture packs can now be given any name the user or texture pack author would like, which makes it easier to recognize the texture pack at first glance. My only suggestion for improvement would be the following: Use a single .txt file, where each new line entry contains the GameID. Ex. "Load.txt" with the following lines Which cleans up some space within the texture pack folder itself (aka, less files). But this is just extremely nitpicking from me. The solution as it stands now is already by far a great improvement and probably doesn't really need that much refining. Having a similar concept for texture file hashes itself would be great as well (aka, one texture file that can be re-used for multiple different texture hashes), but I realize that's out of the scope for this PR. |
This comment has been minimized.
This comment has been minimized.
0378243
to
ce9e316
Compare
This comment has been minimized.
This comment has been minimized.
ce9e316
to
2c3664e
Compare
@Admentus64 - your 'not' working cases should now work. Please retest when you have time. All - I now support loading multiple texture folders, as long as they match the gameid specified. I log an error if there are any textures that were already handled by another pack. This change is to make things work nicely with dynamic input textures and resource packs. In the near future I plan to update the resource packs to properly handle ordering in this scenario (right now the ordering is based off the file system). |
I can confirm all cases I described before once again and now they all now fully work. Thus the texture pack will also load if the folder name is set to the first three characters of the GameID, with or without a corresponding .txt file. In addition I tried dropping a PZL.txt into multiple folders while prefetching textures:
In other words, you can also load textures from multiple texture pack folders. Generally it would be a bad idea for users to start dropping txt files in every folder they have (through honestly, that would be the own fault for doing so), but it actually has a nice feature to it as well, since texture pack creators could essentially split their texture pack into multiple folders. I don't see any issues anymore with this. |
7f13e02
to
8bf27a6
Compare
Thank you for reviewing @jordan-woyak . I have updated the code as requested to remove the "ScanDirectoryTree" call. This should have better performance. Let me know if/when this is ready to merge, I can squash the commits. Or any other feedback! |
if (match_gameid(file)) | ||
{ | ||
const auto directory_path = file.substr(root_directory.size()); | ||
const std::size_t first_path_separator_position = directory_path.find_first_of(DIR_SEP_CHR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self: using DIR_SEP_CHR is ok because DoFileSearch always uses DIR_SEP_CHR as the path separator
92b43ae
to
aa9b279
Compare
aa9b279
to
bba9201
Compare
Thanks for reviewing @leoetlino . Really appreciate it! I squashed the commits. |
Currently, in your "Load" folder, you have a bunch of 3 letter or possibly more folders that reference some game. Wouldn't it be nice if you instead could have a nice native language name instead? Instead of "SLS", you could have "The Last Story".
Well now you can!
You only need to put a "SLS.txt" file in your directory and that's enough to tell Dolphin that is a directory of textures for "The Last Story".
This resolves two issues, neither were made on the issue tracker as far as I know: