This patch for non-Windows systems makeobjs will change to try case-insensitive search if failed to open the image file.
Some dat files created on Windows don't consider case of image names.
Since it causes a png file not found error to running makeobj with such dat files on non-Windows systems, I propose the patch.
This would be very helpful patch. I continually struggle with pak designers that are case insensitive.
Sent from my ONEPLUS A3003 using Tapatalk
I get a 404 error when trying to actually see the attachment?
Quote from: prissi on March 17, 2017, 04:03:22 AM
I get a 404 error when trying to actually see the attachment?
Me too. Since it is an attachment to the post, that is something for Isaac to look into.
If SMF had some reasonable way of handling attachments. After the last forum problem when I tried to find out how they worked and nobody at SMF would deign to tell me, attachments are magic: when they go wrong, they just go wrong. :(
I attached the patch again.
Is this OK?
edit:
I could get this attachment.
It's good now ;)
Not sure this will always work. I think I have seen case sensitive file systems with : as separator, like MAC HFS. Also strcaselesscmp is a macro STRCMPI (I think) for good reasons, since this function is system dependend. What does libgen?
_MSC_VER is not equivalent with Windows. It should probably check for _WIN32 like the rest of Simutrans.
Quote from: prissi on March 18, 2017, 12:30:02 PM
I think I have seen case sensitive file systems with : as separator, like MAC HFS.
I confirmed with https://en.wikipedia.org/wiki/Path_(computing) (https://en.wikipedia.org/wiki/Path_(computing)) and Makefile.
I think that it is only old Mac to a system that path separator is not / and relating with Simutrans. Does Simutrans support it yet?
Quote from: prissi on March 18, 2017, 12:30:02 PM
Also strcaselesscmp is a macro STRCMPI (I think) for good reasons, since this function is system dependend.
Quote from: Ters on March 18, 2017, 12:46:30 PM
_MSC_VER is not equivalent with Windows. It should probably check for _WIN32 like the rest of Simutrans.
That's right.
Quote from: prissi on March 18, 2017, 12:30:02 PM
What does libgen?
It is garbage and not need.
I initially used basename() and dirname().
Quote from: dechimal on March 19, 2017, 04:59:59 PM
Does Simutrans support it yet?
I believe Simutrans never supported that.
I corrected the patch.
The updates are:
- Change the macro of Windows detection from _MSC_VER to _WIN32.
- Delete include directive of libgen.h.
I didn't change the path separator since support for old Mac seems unnecessary.
I noticed that it was not considered to filename automatic normalization of Mac HFS+.
However, I cannot correct because I have no Mac...
Edit:
Support for its normalization is not need, since it does not increase files that cannot be opened.
This is indeed very useful patch. I have seen several addon makers who use only windows, and thus are not aware that there are case-sensitive OS's. I hope it will be accepted to both simutrans standard and extended.
Incorporated in r8572, thank you very much.