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

Map files do not seem to open properly in DOOMEdit if a period is in the file path.

Closed
TommyHanusa opened this issue Jul 19, 2020 · 7 comments

Comments

@TommyHanusa
Copy link

TommyHanusa commented Jul 19, 2020

On Windows 10 64-bit when opening a map with DOOMEdit an incorrect file will be opened.

Repro steps:

  1. Launch Dhewm3 1.5.1rc1 DOOMEdit with a shortcut using a shortcut targeted to "YOURPATH\dhewm.3\dhewm3.exe" +set r_fullscreen 0 +set r_multiSamples 0 +editor
  2. Select File>Open to open a map. The map will not be loaded or displayed.

Note:
Sometimes it will display a different map or an incorrect map (maybe the last map it correctly had open?) I'm not really sure about the behavior on this.

This was checked against game/mars_city1.map and a custom map made in DarkRadient (provided as it quicker to dmap and load.)
GuiTestmap.map.txt

@DanielGibson
Copy link
Member

DanielGibson commented Jul 20, 2020

I couldn't reproduce this problem (and neither #299) with my setup.
Can you test if the problems go away if you use a path without spaces?
If that doesn't help can you test a shorter path (like C:\doom3)?
(Please use the latest built from #300 (comment) for testing)

(I didn't get around to test this with different paths myself, it's already very late, #300 took longer than I thought)

@TommyHanusa
Copy link
Author

TommyHanusa commented Jul 20, 2020

(I didn't get around to test this with different paths myself, it's already very late, #300 took longer than I thought)

I'm reproducing the issue by having a period '.' in my path such as C:\dhewm.3
(this is kinda a larger issue since you are distributing zips with periods in their name, so if someone were to just unzip and go... they would hit this issue)

@TommyHanusa TommyHanusa changed the title Map files do not seem to open properly in DOOMEdit. Map files do not seem to open properly in DOOMEdit if a period is in the file path. Jul 20, 2020
@DanielGibson
Copy link
Member

DanielGibson commented Jul 20, 2020

Oh, good point, I somehow missed the period in the path (but did see "Doom3 Engine" with a space and vaguely remembered that some game-related tool or sth had problems with spaces in paths).

I'll investigate, thanks! :)

@TommyHanusa
Copy link
Author

TommyHanusa commented Jul 21, 2020

Oh, good point, I somehow missed the period in the path (but did see "Doom3 Engine" with a space and vaguely remembered that some game-related tool or sth had problems with spaces in paths).

Do keep in mind that File>Save Selected seems to work fine (regardless of periods and such). I'm not sure why the different saving types are, umm different.

DanielGibson added a commit that referenced this issue Jul 21, 2020
idStr::StripFileExtension() (and SetFileExtension() which uses it) and
others didn't work correctly if there was a dot in a directory name,
because they just searched from last to first char for '.', so if the
current filename didn't have an extension to cut off, they'd just cut off
at any other '.' they found.
So D:\dev\doom3.data\base\maps\bla could turn into D:\dev\doom3
(or, for SetFileExtension(), D:\dev\doom3.map)

While at it, I made most of the idStr code that explicitly checked for '\\'
and '/' (and maybe ':' for AROS) use a little "bool isDirSeparator(int c)"
function so we don't have the #ifdefs for different platforms all over
the place.
@DanielGibson
Copy link
Member

DanielGibson commented Jul 21, 2020

Can you check if this fixes your problems? dhewm3_1.5.1_RC1-editorfixes2_win32.zip

Thanks :)

DanielGibson added a commit that referenced this issue Jul 21, 2020
idStr::StripFileExtension() (and SetFileExtension() which uses it) and
others didn't work correctly if there was a dot in a directory name,
because they just searched from last to first char for '.', so if the
current filename didn't have an extension to cut off, they'd just cut off
at any other '.' they found.
So D:\dev\doom3.data\base\maps\bla could turn into D:\dev\doom3
(or, for SetFileExtension(), D:\dev\doom3.map)

While at it, I made most of the idStr code that explicitly checked for '\\'
and '/' (and maybe ':' for AROS) use a little "bool isDirSeparator(int c)"
function so we don't have the #ifdefs for different platforms all over
the place.
@TommyHanusa
Copy link
Author

TommyHanusa commented Jul 21, 2020

This issue no longer reproduces in dhewm3_1.5.1_RC1-editorfixes2_win32.zip

@DanielGibson
Copy link
Member

DanielGibson commented Jul 21, 2020

Great, thanks for the confirmation!
If you find any more editor bugs please let me know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants