Jump to content
  • Advertisement
  • entries
  • comments
  • views

Map editor nears completion

Sign in to follow this  


Not far of finished now on the map editor. The Open, Save and Save As stuff is all working. You've got to love GetOpenFileName et al. Only minor gripe I have is that if I set a default extension in the OPENFILENAME structure, I don't seem to be able to save a file without the extension.

Map's native format is just .txt to keep it simple and flexible, so I set up an OPENFILENAME structure for GetSaveFileName with "txt" as the default extension. Unfortunatley I found that even if I set the filter to *.*, it was still appending .txt to the files and when I tried test.xxx, it returned a file called test.xxx.txt, which is a bit annoying.

I can't parse out the extension afterwards since there is no way of knowing whether the extension was appended automatically or typed by the user and I don't want to not provide a default extension since I want .txt appended if the user doesn't type an extension.

Thinking about this as I type (the main reason for gibbering all this nonsense in a journal after all), a solution could be to not provide a default extension but to examine the filename after the dialog is done and manually append an extension if none is provided. That would work. Surely though the standard dialog must have a built in solution for this, although I always struggle to create a file with Notepad without a .txt extension so perhaps not.

Anyway, the current task is putting the New dialog together. Stuff like this, I really miss the ease of Builder for click-dragging stuff together but it is a small price to pay.

I think when it is done, I'm going to create a mini-site on my GameDev webspace and put it on there for release. I don't really think I should put tools like this in the Showcase but enough people expressed an interest in creating levels for Orc that I want it available somewhere. It will work as a level editor for the next project as well.

Still, all in I'd call this experiment with using the Win32 API directly a resounding success and I can't see me running Builder much in the future. Builder has been a very good basis to move onto Win32 since it wraps it quite closely but it is a lot more satisfying to grapple with the API directly.
Sign in to follow this  


Recommended Comments

Thanks keeb. Nice to know people are still willing to participate in Orc.

I'll announce in the journal when the level editor is available, but I'll drop you a PM as well. If anyone else wants to be notified, PM me or post here.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!