From 6b6afdfc59de781bd913f0788e629d402e53e4da Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 18 May 2023 08:23:24 -0400 Subject: [PATCH] compiling --- .../Extensions/VehicleChassisComponent.cpp | 43 ++++++++++--------- .../Extensions/VehicleDriveToPointEvent.cpp | 26 +++++------ .../Extensions/VehicleTPPCameraComponent.cpp | 41 +++++++++--------- src/redscript/Extensions/VehicleObject.reds | 4 +- .../Extensions/vehicleTPPCameraComponent.reds | 42 +++++++++--------- src/redscript/Flight/FlightStats.reds | 2 +- src/redscript/Flight/FlightSystem.reds | 4 +- src/redscript/Flight/FlightThrusterFX.reds | 4 +- 8 files changed, 85 insertions(+), 81 deletions(-) diff --git a/src/red4ext/Extensions/VehicleChassisComponent.cpp b/src/red4ext/Extensions/VehicleChassisComponent.cpp index 6f246d26..7eb051ff 100644 --- a/src/red4ext/Extensions/VehicleChassisComponent.cpp +++ b/src/red4ext/Extensions/VehicleChassisComponent.cpp @@ -1,23 +1,24 @@ -#include "Red/TypeInfo/Macros/Definition.hpp" -#include -#include -#include -#include -#include -#include -#include +// #include "Red/TypeInfo/Macros/Definition.hpp" +// #include +// #include +// #include +// #include +// #include +// #include +// #include -struct VehicleChassisComponent : RED4ext::vehicle::ChassisComponent { - RED4ext::Transform GetComOffset() { - auto hpsb = this->collisionResource.Fetch().GetPtr()->bodies[0]; - return hpsb->params.comOffset; - } - RTTI_IMPL_TYPEINFO(VehicleChassisComponent); - RTTI_IMPL_ALLOCATOR(); -}; +// struct VehicleChassisComponent : RED4ext::vehicle::ChassisComponent { +// RED4ext::Transform GetComOffset() { +// auto hpsb = this->collisionResource.Fetch().GetPtr()->bodies[0]; +// return hpsb->params.comOffset; +// } +// RTTI_IMPL_TYPEINFO(VehicleChassisComponent); +// RTTI_FWD_CONSTRUCTOR(); +// // RTTI_IMPL_ALLOCATOR(); +// }; -RTTI_DEFINE_CLASS(VehicleChassisComponent, "vehicleChassisComponent", { - // RTTI_ABSTRACT(); - RTTI_PARENT(RED4ext::ent::IPlacedComponent); - RTTI_METHOD(VehicleChassisComponent::GetComOffset); -}); \ No newline at end of file +// RTTI_DEFINE_CLASS(VehicleChassisComponent, "vehicleChassisComponent", { +// // RTTI_ABSTRACT(); +// RTTI_PARENT(RED4ext::ent::IPlacedComponent); +// RTTI_METHOD(GetComOffset); +// }); \ No newline at end of file diff --git a/src/red4ext/Extensions/VehicleDriveToPointEvent.cpp b/src/red4ext/Extensions/VehicleDriveToPointEvent.cpp index 250050e1..5a7a4ae8 100644 --- a/src/red4ext/Extensions/VehicleDriveToPointEvent.cpp +++ b/src/red4ext/Extensions/VehicleDriveToPointEvent.cpp @@ -1,15 +1,15 @@ -#include "Red/TypeInfo/Macros/Definition.hpp" -#include -#include -#include -#include +// #include "Red/TypeInfo/Macros/Definition.hpp" +// #include +// #include +// #include +// #include -struct VehicleDriveToPointEvent : RED4ext::vehicle::DriveToPointEvent { -}; +// struct VehicleDriveToPointEvent : RED4ext::vehicle::DriveToPointEvent { +// }; -RTTI_DEFINE_CLASS(VehicleDriveToPointEvent, "vehicleDriveToPointEvent", { - RTTI_PARENT(RED4ext::red::Event); - RTTI_PROPERTY(VehicleDriveToPointEvent::targetPos); - RTTI_PROPERTY(VehicleDriveToPointEvent::useTraffic); - RTTI_PROPERTY(VehicleDriveToPointEvent::speedInTraffic); -}); \ No newline at end of file +// RTTI_DEFINE_CLASS(VehicleDriveToPointEvent, "vehicleDriveToPointEvent", { +// RTTI_PARENT(RED4ext::red::Event); +// RTTI_PROPERTY(VehicleDriveToPointEvent::targetPos); +// RTTI_PROPERTY(VehicleDriveToPointEvent::useTraffic); +// RTTI_PROPERTY(VehicleDriveToPointEvent::speedInTraffic); +// }); \ No newline at end of file diff --git a/src/red4ext/Extensions/VehicleTPPCameraComponent.cpp b/src/red4ext/Extensions/VehicleTPPCameraComponent.cpp index cfa6f860..e620c81e 100644 --- a/src/red4ext/Extensions/VehicleTPPCameraComponent.cpp +++ b/src/red4ext/Extensions/VehicleTPPCameraComponent.cpp @@ -1,22 +1,23 @@ -#include "Red/TypeInfo/Macros/Definition.hpp" -#include -#include -#include -#include +// #include "Red/TypeInfo/Macros/Definition.hpp" +// #include +// #include +// #include +// #include -struct VehicleTPPCameraComponent : RED4ext::vehicle::TPPCameraComponent { - RTTI_IMPL_TYPEINFO(VehicleTPPCameraComponent); - RTTI_IMPL_ALLOCATOR(); -}; +// struct VehicleTPPCameraComponent : RED4ext::vehicle::TPPCameraComponent { +// RTTI_IMPL_TYPEINFO(VehicleTPPCameraComponent); +// RTTI_FWD_CONSTRUCTOR(); +// // RTTI_IMPL_ALLOCATOR(); +// }; -RTTI_DEFINE_CLASS(VehicleTPPCameraComponent, "vehicleTPPCameraComponent", { - // RTTI_ABSTRACT(); - RTTI_PARENT(RED4ext::game::CameraComponent); - RTTI_PROPERTY(VehicleTPPCameraComponent::drivingDirectionCompensationSpeedCoef); - RTTI_PROPERTY(VehicleTPPCameraComponent::drivingDirectionCompensationAngleSmooth); - RTTI_PROPERTY(VehicleTPPCameraComponent::lockedCamera); - RTTI_PROPERTY(VehicleTPPCameraComponent::initialTransform); - RTTI_PROPERTY(VehicleTPPCameraComponent::pitch); - RTTI_PROPERTY(VehicleTPPCameraComponent::yaw); - RTTI_PROPERTY(VehicleTPPCameraComponent::data); -}); \ No newline at end of file +// RTTI_DEFINE_CLASS(RED4ext::vehicle::TPPCameraComponent, "vehicleTPPCameraComponent", { +// // RTTI_ABSTRACT(); +// RTTI_PARENT(RED4ext::game::CameraComponent); +// RTTI_PROPERTY(drivingDirectionCompensationSpeedCoef); +// RTTI_PROPERTY(drivingDirectionCompensationAngleSmooth); +// RTTI_PROPERTY(lockedCamera); +// RTTI_PROPERTY(initialTransform); +// RTTI_PROPERTY(pitch); +// RTTI_PROPERTY(yaw); +// RTTI_PROPERTY(data); +// }); \ No newline at end of file diff --git a/src/redscript/Extensions/VehicleObject.reds b/src/redscript/Extensions/VehicleObject.reds index c58bdafa..d8351660 100644 --- a/src/redscript/Extensions/VehicleObject.reds +++ b/src/redscript/Extensions/VehicleObject.reds @@ -34,8 +34,8 @@ public func GetLocalToWorld() -> Matrix { return WorldTransform.ToMatrix(this.GetWorldTransform()); } -@addField(VehicleObject) -public let chassis: ref; +// @addField(VehicleObject) +// public let chassis: ref; @addField(VehicleObject) @runtimeProperty("offset", "0x24C") diff --git a/src/redscript/Extensions/vehicleTPPCameraComponent.reds b/src/redscript/Extensions/vehicleTPPCameraComponent.reds index 672de1f3..4845cb00 100644 --- a/src/redscript/Extensions/vehicleTPPCameraComponent.reds +++ b/src/redscript/Extensions/vehicleTPPCameraComponent.reds @@ -1,19 +1,19 @@ -public native class vehicleChassisComponent extends IPlacedComponent { - public native func GetComOffset() -> Transform; -} - -native class vehicleTPPCameraComponent extends CameraComponent { - // public native let isInAir: Bool; - public native let drivingDirectionCompensationAngleSmooth: Float; - public native let drivingDirectionCompensationSpeedCoef: Float; - public native let lockedCamera: Bool; - public native let initialTransform: WorldTransform; - public native let pitch: Float; - public native let yaw: Float; - // public native let pitchDelta: Float; // positive moves camera down - // public native let yawDelta: Float; // positive moves camera right - // public native let chassis: ref; -} +// public native class vehicleChassisComponent extends IPlacedComponent { +// public native func GetComOffset() -> Transform; +// } + +// native class vehicleTPPCameraComponent extends CameraComponent { +// // public native let isInAir: Bool; +// public native let drivingDirectionCompensationAngleSmooth: Float; +// public native let drivingDirectionCompensationSpeedCoef: Float; +// public native let lockedCamera: Bool; +// public native let initialTransform: WorldTransform; +// public native let pitch: Float; +// public native let yaw: Float; +// // public native let pitchDelta: Float; // positive moves camera down +// // public native let yawDelta: Float; // positive moves camera right +// // public native let chassis: ref; +// } // @addMethod(vehicleChassisComponent) // protected cb func OnRequestComponents(ri: EntityRequestComponentsInterface) -> Bool { @@ -22,11 +22,11 @@ native class vehicleTPPCameraComponent extends CameraComponent { // } -public native class vehicleDriveToPointEvent extends Event { - public native let targetPos: Vector3; - public native let useTraffic: Bool; - public native let speedInTraffic: Float; -} +// public native class vehicleDriveToPointEvent extends Event { +// public native let targetPos: Vector3; +// public native let useTraffic: Bool; +// public native let speedInTraffic: Float; +// } // public importonly class EffectSpawnerComponent extends IVisualComponent { // public native func AddEffect() -> Void; diff --git a/src/redscript/Flight/FlightStats.reds b/src/redscript/Flight/FlightStats.reds index 8a5ad78b..0445d76e 100644 --- a/src/redscript/Flight/FlightStats.reds +++ b/src/redscript/Flight/FlightStats.reds @@ -44,7 +44,7 @@ public class FlightStats { public static func Create(vehicle: wref) -> ref { let self: ref = new FlightStats(); self.vehicle = vehicle; - self.vehicle.chassis = self.vehicle.FindComponentByName(n"Chassis") as vehicleChassisComponent; + // self.vehicle.chassis = self.vehicle.FindComponentByName(n"Chassis") as vehicleChassisComponent; self.reset = false; self.UpdateStatic(); // self.d_position = self.vehicle.GetWorldPosition() + self.s_centerOfMass; diff --git a/src/redscript/Flight/FlightSystem.reds b/src/redscript/Flight/FlightSystem.reds index 5969e33c..cf12cc11 100644 --- a/src/redscript/Flight/FlightSystem.reds +++ b/src/redscript/Flight/FlightSystem.reds @@ -23,7 +23,7 @@ public native class FlightSystem extends IGameSystem { public let ctlr: ref; public let stats: ref; // public let fx: ref; - public let tppCamera: wref; + // public let tppCamera: wref; public let playerComponent: wref; public func Setup(player: ref) -> Void { @@ -36,7 +36,7 @@ public native class FlightSystem extends IGameSystem { // FlightLog.Info("[FlightSystem] FlightAudio Created"); // } this.ctlr = FlightController.GetInstance(); - this.tppCamera = player.FindComponentByName(n"vehicleTPPCamera") as vehicleTPPCameraComponent; + // this.tppCamera = player.FindComponentByName(n"vehicleTPPCamera") as vehicleTPPCameraComponent; // this.soundListener = this.tppCamera; } diff --git a/src/redscript/Flight/FlightThrusterFX.reds b/src/redscript/Flight/FlightThrusterFX.reds index 8aba0c4c..b4b90d28 100644 --- a/src/redscript/Flight/FlightThrusterFX.reds +++ b/src/redscript/Flight/FlightThrusterFX.reds @@ -81,7 +81,9 @@ public abstract class IFlightThrusterFX extends IScriptable { public class RegularFlightThrusterFX extends IFlightThrusterFX { public func Create(thruster: ref) -> ref { super.Create(thruster); - this.SetResource(r"user\\jackhumbert\\effects\\flame.effect"); + // needs work still + // this.SetResource(r"user\\jackhumbert\\effects\\flame.effect"); + this.SetResource(r"user\\jackhumbert\\effects\\ion_thruster.effect"); return this; }