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

CSV Format with flipped tiles #13

Open
BorisTheBrave opened this issue Aug 28, 2022 · 0 comments
Open

CSV Format with flipped tiles #13

BorisTheBrave opened this issue Aug 28, 2022 · 0 comments

Comments

@BorisTheBrave
Copy link
Contributor

I had a user complain wiht the following stack trace:

Unhandled Exception: System.InvalidOperationException: There is an error in XML document (101, 4). ---> System.InvalidOperationException: There is an error in XML document (101, 4). ---> System.OverflowException: Value was either too large or too small for an Int32.
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
   at TiledLib.TmxMisc.ReadCSV(XmlReader reader, Int32 size)
   at TiledLib.Layer.TileLayer.ReadXml(XmlReader reader)
   at System.Xml.Serialization.XmlSerializationReader.ReadSerializable(IXmlSerializable serializable, Boolean wrappedAny)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderTileLayer.Read1_layer()

Inspecting their .tmx file, they had values like 3221225687 in it. That's because the user used Tiled's flip horizontal feature, which sets the high bits of the tile gid. It looks like tiled uses an unsigned format, and you expect signed, hence the overflow.

I instructed the user to change the layer format when saving the tmx, which worked around the issue, so this is not critical.

Ragath pushed a commit that referenced this issue Jan 15, 2023
Ragath pushed a commit that referenced this issue Nov 18, 2023
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