Bug Day 301: GetBoundFor Y set wrong

Hi,

I believe there is a bug in GetBoundFor that might exaggerate the problems with sorting: the Ymin and Ymax overwrite the previous error instead of adding to it.

1
2
SpriteBound.YMin = -0.5f*Height;
SpriteBound.YMax = 0.5f*Height;


should be

1
2
SpriteBound.YMin += -0.5f*Height;
SpriteBound.YMax += 0.5f*Height;


Happy coding,
Mox
Ack! Yes, that is not good at all :)

- Casey
I was wondering about a line that slipped into handmade_entity.cpp:
1
2
r32 TempZ = EntityTransform.OffsetP.z;
s32 RelativeLayer = ConvertToLayerRelative(WorldMode, &TempZ);

If I'm not mistaken, ConvertToLayerRelative is supposed to modify the transform's Z offset in place. Here, that modification is being lost in a temporary.
Yes, that is intentional. Since we are temporarily looking at the Z/Y sorting stuff, we don't want to flatten everything down to layers, which is what it would do if we passed the actual Z there.

Once we're ready to deal with the layers again, we'll remove the temporary.

- Casey