diff Render.h @ 194:650d96af8855

Vis overhaul; sprites can be picked by mouse
author Nomad
date Sat, 16 Feb 2013 18:32:37 +0200
parents d65528fc3bda
children 96bc024a5fed
line wrap: on
line diff
--- a/Render.h	Sat Feb 16 13:28:34 2013 +0400
+++ b/Render.h	Sat Feb 16 18:32:37 2013 +0200
@@ -56,7 +56,15 @@
   int _screenspace_y_scaler_packedfloat;
   float fov_x;
   float fov_y;
-  int sZValue;
+  union
+  {
+    int sZValue;
+    struct
+    {
+      unsigned __int16 object_pid;
+      signed __int16 actual_z;
+    };
+  };
   int field_14_actor_id;
   unsigned __int16 uHwSpriteID;
   __int16 uPalette;
@@ -73,7 +81,7 @@
 
    inline float GetFloatZ() const
  {
-  return LOWORD(sZValue) / 65535.0f + (float)HIWORD(sZValue);
+  return (float)object_pid / 65535.0f + (float)actual_z;
  }
 };
 #pragma pack(pop)