Scet Posted May 24, 2008 Hi everyone. I'm once again working on my C# port of Doom and have a few questions. I've been going through the source code and am confused as to the difference between int and short. I know short is 2 bytes, the problem is with int, I thought it was 4 bytes, but in r_defs.h some of the structures stored in the WADs that use 2-byte fields are stored as ints. fixed_t is a typedef for int and vertex_t is stored as two fixed_ts yet in the WAD it's two shorts. Another one I don't understand is angle_t: typedef unsigned angle_t; Is this unsigned short or unsigned int? Thanks. 0 Quote Share this post Link to post
Graf Zahl Posted May 24, 2008 int and unsigned int are 4 bytes. Many values that are stored as shorts in the map are either extended internally or converted to 16.16 fixed point numbers which technically means, the value is shifted 16 bits left. 0 Quote Share this post Link to post
fraggle Posted May 24, 2008 It's also worth bearing in mind that the "long" type is also 32 bits. Long is used in several places in the original source, but on some architectures (and in C#) long is 64 bits. 0 Quote Share this post Link to post
Scet Posted May 25, 2008 I asked because I've worked on some architectures (embedded systems and 16-bit DOS programs) where int was 2-bytes in C, but being used to C# I used int everywhere thinking it would be 4-bytes. Having been written for DOS I thought Doom might have the same problem so I had to be sure. Thanks guys. 0 Quote Share this post Link to post
Graf Zahl Posted May 25, 2008 Although Doom was for DOS it was 32 bit. Even in 1993 16 bit mode was far too limited for games. 0 Quote Share this post Link to post
leileilol Posted May 25, 2008 Yeah my attempts at making real-mode 3D fpses in 1995 were horribly aggravating, having to use very low res textures and wacky hz sounds (8000hz), and even then you're lucky to have it running at all with sound and 3d and not playing like wolfenstein, trying to respect the strict 640kb limit. I sure don't miss those times (in development). Doom would have not been possible without protected mode 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.