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

Some directory names get truncated to 4 characters. #9

Closed
vaguerant opened this issue Sep 27, 2020 · 3 comments
Closed

Some directory names get truncated to 4 characters. #9

vaguerant opened this issue Sep 27, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@vaguerant
Copy link

I should have reported this earlier, but I figured it was probably known. Just in case, I'm making a note of it.

Some of my directories consistently have their names truncated within VGEdit (v2.0.1 from the Homebrew App Store, but the same issue occurred on the version I had installed prior also). Some examples of directories whose names are truncated:

  • wii64 (wii6)
  • install (inst)
  • haxchi (haxc)
  • genplus (genp)
  • ppsspp (ppss)
  • wiisxr (wiis)
  • DOSBox (DOSB)
  • not64 (not6)

Meanwhile, plenty of other directories are not truncated: controllers, snes9xgx, savegames, Game Backups, CSE2-enhanced-en and retroarch are several examples.

Looking at my list, the common factor appears to be directories with names whose length is between 5 and 7 characters. Anything longer or shorter seems to go without truncation.

@vgmoose vgmoose added the bug Something isn't working label Sep 27, 2020
@vgmoose
Copy link
Owner

vgmoose commented Sep 27, 2020

We used to see a similar issue in hb-appstore on wiiu where only the first 4 characters were rendered from TextElements backed with certain std::strings. rw-r-r_0644 fixed it by changing where we stored the text-to-be-rendered, so this can probably be worked around by changing where the names of the folders are stored.

Names are initially read here:

FileCard* card = new FileCard(entry->d_type == DT_DIR, entry->d_name);

Before being given to the TextElement for the card label:

vgedit/gui/FileCard.cpp

Lines 24 to 27 in fded169

// text label (centered)
CST_Color color = { 0xFF, 0xFF, 0xFF, 0xFF };
con->add((new TextElement(name, 20, &color, NORMAL, this->width)))->centerHorizontallyIn(con);
thumbIcon->centerHorizontallyIn(con);

The new instances are cleaned up by Chesto memory management, but probably the entry->d_name goes out of scope, which then raises the question how this seems to reliably work on the PC/Switch builds (maybe they are quickly turned into SDL Textures and cached before that happens).

Following TextElement init, it should try to make the cached texture before it would go out of scope (here, then here), which could point to it being another issue. It seems suspicious though that the other TextElements are ok though and don't have their sources go out of scope like that though.

@vgmoose
Copy link
Owner

vgmoose commented Sep 9, 2022

This may be fixed in the newer wuhb/rpx builds: https:/vgmoose/vgedit/actions/runs/3020169694

I'm not sure what changed though, it could be internal recent-ish Chesto changes, something unrelated when working on the 3DS port, or just a coincidence from moving to newer build tools

@vgmoose
Copy link
Owner

vgmoose commented Mar 23, 2023

I think it's fixed!

@vgmoose vgmoose closed this as completed Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants