Skip to content

Conversation

kobenairb
Copy link
Contributor

@kobenairb kobenairb commented Aug 22, 2023

Hi,

Please wait before to accept this PR, still in progress

This change fixes the problem of tmx2snes when it tries to check if the version of the tmj file (tiled) is supported.

This error is due to the fact that we are trying to compare versions using floats (see #238).

Here the error:
convert map tiled ... map_1_1.m16 /home/kobenairb/workspace/tests/pvsneslib-last/devkitsnes/tools/tmx2snes map_1_1.tmj tiles.map tmx2snes: Loading map: [map_1_1.tmj] tmx2snes: error 'the export version you used (1.9) is not yet supported. The tool supports only the versions from 1.9 to 1.1.'

This change includes the patch in tmx2snes to corretcly handle the version and the update of tmj files (tiled).

I used the latest version of Tiled to do this (1.10.2).

Note In version 1.10.2, it seems that the class property becomes type in the objects list. I updated tmx2snes according to this change. I will retest again in 1.9 and try to find from which minor version the change is introduced.
One possibility would be to no longer accept a version range but simply ensure that the version of the tmj file is greater than or equal to the latest version of Tiled, i.e. 1.10.2 and update our documentation. To see together.

I also updated the tmx2snes version to 1.0.1.

I think this change requires a review, I'm not convinced of the relevance of my method to transform a float into 2 integers.

I might also be better off using #define to initialize supported versions rather than magic numbers:

Version minExportSupportedVersion = {1, 9}; Version maxExportSupportedVersion = {1, 10};

I tested the impacted roms, everything seems okay to me but a double or triple check would be preferable

My apologies for the formatting of tmx2snes.c which makes reviewing more complicated.

@RetroAntho
Copy link
Collaborator

Hi!
Thanks a lot, seems to be more robust than the previous check.
I still have some doubts on the best way to check versions and compatibility.
Maybe we could also check the json format to deduce (without checking the version) if it is compatible or not but it is more hard to implement and i am not sure it will be 100% working…

@RetroAntho RetroAntho merged commit c35afcf into alekmaul:develop Aug 22, 2023
@kobenairb
Copy link
Contributor Author

Hi @RetroAntho ,

At first I was thinking of using char instead of float, split fields starting from '.' and compare them together but it's pretty dirty.

I've never used Tiled, so I'd like to hear from people with knowledge.

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

Successfully merging this pull request may close these issues.

2 participants