示例#1
0
        public void PatchSetFov(bool overrideEnable)
        {
            _fovHackEnabled = overrideEnable;

            Natives.WriteBytes(_handle, _setFovCall,
                               overrideEnable ? new byte[] { 0x90, 0x90, 0x90, 0x90, 0x90 } : _originalCallBytes);
        }
示例#2
0
        private void PatchFov(float newFov)
        {
            var cameraManager = Natives.ReadIntPtr(_handle, _cameraManagerPtr);
            var currentCamera = Natives.ReadIntPtr(_handle, cameraManager + CurrentCameraOffset);

            // Update the flags to indicate an FOV change has occurred
            var flags = Natives.ReadBytes(_handle, currentCamera + CameraFlagsOffset, 1);

            flags[0] |= 0x10;
            Natives.WriteBytes(_handle, currentCamera + CameraFlagsOffset, flags);

            // Update the actual FOV values
            Natives.WriteFloat(_handle, currentCamera + FovOffset1, newFov);
            Natives.WriteFloat(_handle, currentCamera + FovOffset2, newFov);
        }
示例#3
0
 private void PatchSetFov(bool overrideEnable)
 {
     Natives.WriteBytes(_handle, _setFovCall,
                        overrideEnable ? new byte[] { 0x90, 0x90, 0x90, 0x90, 0x90 } : _originalCallBytes);
 }