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

Remove string splits with \r from renderer resource parsers #1666

Closed
heinezen opened this issue Aug 3, 2024 · 0 comments · Fixed by #1667
Closed

Remove string splits with \r from renderer resource parsers #1666

heinezen opened this issue Aug 3, 2024 · 0 comments · Fixed by #1667
Labels
area: renderer Concerns our graphics renderer bug Behaving differently as it should behave improvement Enhancement of an existing component lang: c++ Done in C++ code
Milestone

Comments

@heinezen
Copy link
Member

heinezen commented Aug 3, 2024

if (args[2][args[2].size() - 1] == '\r') {
texture.path = args[2].substr(1, args[2].size() - 3);
}
else {
texture.path = args[2].substr(1, args[2].size() - 2);
}

if (line.empty() || line.substr(0, 1) == "#" || line[0] == '\r') {

if (line.empty() || line.substr(0, 1) == "#" || line[0] == '\r') {

if (args[1][args[1].size() - 1] == '\r') {

if (line.empty() || line.substr(0, 1) == "#" || line[0] == '\r') {

This should not be handled in here, but in the string splitter code, see https://github.com/SFTtech/openage/blob/master/libopenage/util/strings.cpp

I guess we need a dedicated newline function for this that first splits at \n and then checks if the generated lines end with \r to also remove those.

Originally posted by @heinezen in #1642 (comment)

@heinezen heinezen added bug Behaving differently as it should behave improvement Enhancement of an existing component lang: c++ Done in C++ code labels Aug 3, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in openage renderer Aug 3, 2024
@heinezen heinezen added the area: renderer Concerns our graphics renderer label Aug 3, 2024
@heinezen heinezen moved this from 📋 Backlog to 🔖 TODO in openage renderer Aug 3, 2024
@heinezen heinezen added this to the 0.6.0 milestone Aug 3, 2024
@heinezen heinezen linked a pull request Aug 3, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from 🔖 TODO to ✅ Done in openage renderer Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: renderer Concerns our graphics renderer bug Behaving differently as it should behave improvement Enhancement of an existing component lang: c++ Done in C++ code
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant