Skip to content

Commit

Permalink
just need defs
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhumbert committed Dec 16, 2023
1 parent 83bdf08 commit 2dfc8db
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 80 deletions.
134 changes: 67 additions & 67 deletions compile_commands.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/red4ext/Extensions/InkMaskWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <RED4ext/Common.hpp>
#include <RED4ext/RTTISystem.hpp>
#include <RED4ext/Scripting/Natives/Generated/ink/MaskWidget.hpp>
#include <RED4ext/Scripting/Natives/Generated/red/ResourceReferenceScriptToken.hpp>
#include <RED4ext/Scripting/Utils.hpp>
#include <RedLib.hpp>

Expand Down
1 change: 1 addition & 0 deletions src/red4ext/Extensions/InkShapeWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "LoadResRef.hpp"
#include <RED4ext/Common.hpp>
#include <RED4ext/RTTISystem.hpp>
#include <RED4ext/Scripting/Natives/Generated/red/ResourceReferenceScriptToken.hpp>
#include <RED4ext/Scripting/Natives/Generated/ink/ShapeWidget.hpp>
#include <RedLib.hpp>

Expand Down
6 changes: 3 additions & 3 deletions src/red4ext/Extensions/MeshComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void IPlacedComponent::SetParentTransform(RED4ext::CName bindName, RED4ext::CNam
}

void Entity::AddComponent(RED4ext::Handle<RED4ext::ent::IComponent> componentToAdd) {
RED4ext::ent::VisualControllerComponent *vcc = NULL;
RED4ext::ent::VisualControllerComponent *vcc = nullptr;
auto rtti = RED4ext::CRTTISystem::Get();
auto vccClass = rtti->GetClass("entVisualControllerComponent");

Expand Down Expand Up @@ -68,7 +68,7 @@ void Entity::AddComponent(RED4ext::Handle<RED4ext::ent::IComponent> componentToA
//}

void Entity::AddSlot(RED4ext::CName boneName, RED4ext::CName slotName, RED4ext::Vector3 relativePosition, RED4ext::Quaternion relativeRotation) {
RED4ext::ent::SlotComponent *slotComponent = NULL;
RED4ext::ent::SlotComponent *slotComponent = nullptr;
auto rtti = RED4ext::CRTTISystem::Get();

for (auto const &handle : this->componentsStorage.components) {
Expand All @@ -81,7 +81,7 @@ void Entity::AddSlot(RED4ext::CName boneName, RED4ext::CName slotName, RED4ext::
}
}

if (slotComponent != NULL) {
if (slotComponent != nullptr) {
auto slot = reinterpret_cast<RED4ext::ent::Slot *>(rtti->GetClass("entSlot")->CreateInstance());
slot->boneName = boneName;
slot->slotName = slotName;
Expand Down
3 changes: 2 additions & 1 deletion src/red4ext/Extensions/MeshComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <RED4ext/Scripting/Natives/Generated/ent/MeshComponent.hpp>
#include <RED4ext/Scripting/Natives/Generated/red/ResourceReferenceScriptToken.hpp>
#include <RED4ext/Scripting/Natives/vehicleChassisComponent.hpp>
#include <RED4ext/Scripting/Natives/entEntity.hpp>
//#include "FlightConfiguration.hpp"

class MeshComponent : public Engine::RTTIExpansion<MeshComponent, RED4ext::ent::MeshComponent> {
Expand Down Expand Up @@ -40,7 +41,7 @@ class Entity : public Engine::RTTIExpansion<Entity, RED4ext::ent::Entity> {
/// AddSlot
void AddSlot(RED4ext::CName boneName, RED4ext::CName slotName, RED4ext::Vector3 relativePosition,
RED4ext::Quaternion relativeRotation);
private:
private:
friend Descriptor;

inline static void OnExpand(Descriptor *aType, RED4ext::CRTTISystem *) {
Expand Down
1 change: 1 addition & 0 deletions src/red4ext/Flight/Log.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#include "Utils/FlightModule.hpp"
#include <RED4ext/Scripting/Natives/Generated/red/ResourceReferenceScriptToken.hpp>
#include <RedLib.hpp>

struct FlightLog : RED4ext::IScriptable {
Expand Down
15 changes: 8 additions & 7 deletions src/red4ext/Hooks/VisualEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@

// post 2.0
/// @pattern 48 89 5C 24 08 48 89 54 24 10 57 48 83 EC 50 48 8B F9 45 84 C0 75 09 44 38 81 60 01 00 00 75 6A
RED4ext::vehicle::MaterialFx * __fastcall GetFxForMaterial(RED4ext::CName material, bool isBackWheel);
RED4ext::vehicle::MaterialFx * __fastcall GetFxForMaterial(RED4ext::vehicle::Unk570 *unk570, RED4ext::CName material, bool isBackWheel);

// post 2.0
/// @pattern 48 8B C4 48 89 58 08 48 89 70 10 48 89 78 18 4C 89 48 20 55 41 54 41 55 41 56 41 57 48 8D 68 A8
/// @nth 0/2
bool __fastcall TireTrackEffectStart(RED4ext::vehicle::Unk570::Unk30 *a2, RED4ext::vehicle::MaterialFx *fxLookup, RED4ext::Transform *a4, RED4ext::Transform *a5, bool physicalMaterialChange, bool conditionChange, bool condition);
bool __fastcall TireTrackEffectStart(RED4ext::vehicle::Unk570 *unk570, RED4ext::vehicle::Unk570::Unk30 *a2, RED4ext::vehicle::MaterialFx *fxLookup, RED4ext::Transform *a4, RED4ext::Transform *a5, bool physicalMaterialChange, bool conditionChange, bool condition);

// post 2.0
/// @pattern 48 8B C4 48 89 58 08 48 89 70 10 48 89 78 18 4C 89 48 20 55 41 54 41 55 41 56 41 57 48 8D 68 A8
/// @nth 1/2
bool __fastcall SkidMarkEffectStart(RED4ext::vehicle::Unk570::Unk30 *unk30, RED4ext::vehicle::MaterialFx *fxLookup, RED4ext::Transform *a4, RED4ext::Transform *a5, bool physicalMaterialChange, bool conditionChange, bool condition);
bool __fastcall SkidMarkEffectStart(RED4ext::vehicle::Unk570 *unk570, RED4ext::vehicle::Unk570::Unk30 *unk30, RED4ext::vehicle::MaterialFx *fxLookup, RED4ext::Transform *a4, RED4ext::Transform *a5, bool physicalMaterialChange, bool conditionChange, bool condition);

struct FlightStatus {
uint8_t isActive : 1;
Expand All @@ -31,7 +31,7 @@ struct FlightStatus {

// replace tire tracks & skid marks with our own effects
REGISTER_FLIGHT_HOOK(RED4ext::vehicle::MaterialFx * __fastcall, GetFxForMaterial, RED4ext::vehicle::Unk570 *unk570,
RED4ext::CName material, char isBackWheel) {
RED4ext::CName material, bool isBackWheel) {
auto og = GetFxForMaterial_Original(unk570, material, isBackWheel);
RED4ext::vehicle::MaterialFx * fx = og;
auto fc = FlightComponent::Get(unk570->vehicle);
Expand All @@ -42,12 +42,13 @@ REGISTER_FLIGHT_HOOK(RED4ext::vehicle::MaterialFx * __fastcall, GetFxForMaterial
if (fc->active && fc->configuration) {
fx = new RED4ext::vehicle::MaterialFx();
// *fx = fc->configuration->ExecuteFunction<RED4ext::vehicle::MaterialFx>("GetEffectForMaterial", material, *og).value();
*fx = RED4ext::ExecuteFunction<RED4ext::vehicle::MaterialFx>(
fc->configuration,
RED4ext::ExecuteFunction(
(RED4ext::ScriptInstance*)fc->configuration.instance,
fc->configuration->nativeType->GetFunction("GetEffectForMaterial"),
(void*)fx,
material,
*og
).value();
);

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "FlightSettings.hpp"
#include <RED4ext/Common.hpp>
#include <RED4ext/Scripting/Natives/Generated/vehicle/TPPCameraComponent.hpp>
#include <RED4ext/Scripting/Natives/vehiclePhysics.hpp>

// gets the location for the camera to look at

Expand Down
2 changes: 1 addition & 1 deletion src/red4ext/stdafx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

#include <RED4ext/Common.hpp>
#include <spdlog/spdlog.h>
#include <RED4ext/Definitions.hpp>
// #include <RED4ext/Definitions.hpp>

0 comments on commit 2dfc8db

Please sign in to comment.