Source Code: Pope XVI Question

Status
Not open for further replies.

Pyro the Magma Fox

Totally not using Hydreigon
p_setup.c said:
P_SpawnMobj(04220000000*-1, 0554000000*-1, ONFLOORZ, MT_PXVI)->angle = ANGLE_270;
That's the part in the source code that says about the 'position' of XVI, I presume, but I don't know what those 11 numbers are for. What are they for?
 
Code:
[U]p_mobj.c[/U]
mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
...so x and y positions, obviously.

What bothers me is that those are fairly obviously outside the [-32768, 32767] range that x/y coordinates are allowed to be. It's not hex, because that's even worse in terms of how far outside the range it is. Even octal is out of range. I tried truncating the x value to that range, but I get -5,888, when the actual position is closer to -8,768. I have no idea how that value is formed, shy of looking into it further...

I suppose it might have to do with however fixed_t variables are stored. Seems to just be INT32, but hell if I know if it's parsed differently.
 
What bothers me is that those are fairly obviously outside the [-32768, 32767] range that x/y coordinates are allowed to be.

Coordinates use a fixed-point decimal system, first sixteen bits being before the decimal point and the last sixteen bits being after. Divide by 65,536 and you'll end up with the right number.

It comes out to [-8768, -1456].
 
Yeah, Monster Iestyn clued me into that earlier. I had been doing mod 65536 instead of divided by 65536, and that obviously wasn't working. Thanks anyway.

(Why octal? An attempt to obfuscate his location?)
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top