Ejemplo n.º 1
0
 public DS2GXLightManager GetLightManager()
 {
     if (LightManager == null || !LightManager.IsValid())
     {
         Debug.Log("KatanaMainApp: " + String.Format("0x{0:X16}", KatanaMainApp.ReadUInt64(0x0)));
         Debug.Log("KatanaDrawSystem: " + String.Format("0x{0:X16}", KatanaDrawSystem.ReadUInt64(0x0)));
         Debug.Log("GXLightManager Pointer: " + String.Format("0x{0:X16}", KatanaDrawSystem.ReadUInt64(0x1D20)));
         LightManager = new DS2GXLightManager(this, KatanaDrawSystem, 0x1D20);
         if (!LightManager.IsValid())
         {
             return(null);
         }
     }
     return(LightManager);
 }
Ejemplo n.º 2
0
    public List <DS3GXLightBase> GetLights()
    {
        if (!IsValid())
        {
            return(null);
        }
        PHPointer             arrayBase = Hook.CreateChildPointer(BasePointer, Offset + 0x10);
        PHPointer             arrayTail = Hook.CreateChildPointer(BasePointer, Offset + 0x18);
        long                  size      = (arrayTail.Resolve().ToInt64() - arrayBase.Resolve().ToInt64()) / 8;
        List <DS3GXLightBase> lights    = new List <DS3GXLightBase>();

        for (int i = 0; i < size; i++)
        {
            PHPointer light  = Hook.CreateChildPointer(arrayBase, i * 8);
            ulong     vtable = light.ReadUInt64(0);
            if (vtable == 0x143D3A7D8)
            {
                lights.Add(new DS3GXPointLight(Hook, light, i));
            }
            else if (vtable == 0x143D3A8B8)
            {
                lights.Add(new DS3GXSpotLight(Hook, light, i));
            }
        }
        return(lights);
    }
Ejemplo n.º 3
0
 public bool IsValid()
 {
     if (!Hook.Hooked)
     {
         return(false);
     }
     if (BasePointer == null)
     {
         return(false);
     }
     // See if vtable pointer is valid
     if (BasePointer.ReadUInt64(Offset) != 0x1411D77F8)
     {
         Debug.Log("Lightman base: " + String.Format("0x{0:X8}", BasePointer.Resolve().ToInt64()));
         Debug.Log("Lightman invalid pointer: " + String.Format("0x{0:X8}", BasePointer.ReadUInt64(0x0)));
         return(false);
     }
     return(true);
 }