type of enum from old code

Moderator
Posts: 1,140
Joined: 2005.07
Post: #1
I'm porting Wolfenstein 3D to Mac OS X (the PC version), and I noticed that a lot of the time there are enums that are read or written from the system. I want to have saves backwards compatible to the PC, so I'm swapping the bytes of the save files on big endian Macs. (as in pre-intel) I was wondering, since there is no type specified for the enums, and this was written in 1992 in the time of 16 bit processors, does that mean that they were the equivalent of today's 16 bit shorts?

Edit: what about ints? I'd imagine they'd be the same as the enums

Editx2: I noticed it's set up to read entire sets of structures at once for saved games, which would be somewhat lengthy to change. Would it be worth it to support legacy saved games, or would any game saved within the last 10 years (even using the same executable) end up using 32 bit ints etc.? Or would it stay as 16 bit since that's what it likely was compiled in?
Quote this message in a reply
Member
Posts: 131
Joined: 2004.10
Post: #2
Most compilers treat enums as int. Wolfy was way back in the dos days to I wouldn't be surprised they are 16 bit ints (shorts). I'm also not too surprised thay just save the structures as is to disk. It might be easiest to make a legacy structure to read (and write?) game data. Then move the information over to a more modern structure with applicable byte swapping.

People still have saved games for wolfenstein?! I personally wouldn't bother too much but if you want to be thorough you'd keep binary compatibility.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #3
After looking thorough it, I think it would end up breaking compatibility with modern ports of Wolf 3D, which would be worse IMO then breaking compatibility with older saves, so I won't bother. Rasp Thanks for the info, though.
Quote this message in a reply
Post Reply