SFTtech / openage

Free (as in freedom) open source clone of the Age of Empires II engine 🚀
http://openage.dev
Other
12.78k stars 1.12k forks source link

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

Closed heinezen closed 3 months ago

heinezen commented 3 months ago

https://github.com/SFTtech/openage/blob/99e355e115702acd25748158927bd81551a66df1/libopenage/renderer/resources/parser/common.cpp#L24-L29

https://github.com/SFTtech/openage/blob/99e355e115702acd25748158927bd81551a66df1/libopenage/renderer/resources/parser/parse_sprite.cpp#L199-L199

https://github.com/SFTtech/openage/blob/99e355e115702acd25748158927bd81551a66df1/libopenage/renderer/resources/parser/parse_terrain.cpp#L204-L204

https://github.com/SFTtech/openage/blob/99e355e115702acd25748158927bd81551a66df1/libopenage/renderer/resources/parser/parse_texture.cpp#L60-L60

https://github.com/SFTtech/openage/blob/99e355e115702acd25748158927bd81551a66df1/libopenage/renderer/resources/parser/parse_texture.cpp#L188-L188

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 https://github.com/SFTtech/openage/pull/1642#discussion_r1583626405_