Skip to content

Commit 34f0fd9

Browse files
committed
Updated Pipe
1 parent a6c8949 commit 34f0fd9

22 files changed

+48
-48
lines changed

Libs/AST/Include/AST/Components/CNamespace.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ namespace rift::ast
9595
}
9696
p::Tag operator[](p::i32 index) const
9797
{
98-
Check(index >= 0 && index < scopeCount);
98+
P_Check(index >= 0 && index < scopeCount);
9999
return scopes[index];
100100
}
101101
operator bool() const

Libs/AST/Include/AST/TypeRef.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace rift::ast
2020
{
2121
if (!IsNone(typeId))
2222
{
23-
Ensure(ast.Has<CDeclType>(typeId));
23+
P_Ensure(ast.Has<CDeclType>(typeId));
2424
}
2525
}
2626

Libs/AST/Include/Compiler/Backend.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace rift
2121

2222
virtual void Build(Compiler& compiler)
2323
{
24-
CheckMsg(false, "Backend '{}' tried to run but Build() is not implemented.",
24+
P_CheckMsg(false, "Backend '{}' tried to run but Build() is not implemented.",
2525
GetName().AsString());
2626
}
2727
};

Libs/AST/Include/Module.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace rift
4343
template<typename ModuleType>
4444
void AddDependency()
4545
{
46-
EnsureMsg(state == State::Uninitialized,
46+
P_EnsureMsg(state == State::Uninitialized,
4747
"Should not add dependencies outside of the constructor");
4848

4949
EnableModule<ModuleType>();

Libs/AST/Src/AST/Systems/LoadSystem.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ namespace rift::ast::LoadSystem
202202

203203
void DeserializeModules(Tree& ast, p::TView<Id> moduleIds, p::TView<p::String> strings)
204204
{
205-
Check(moduleIds.Size() == strings.Size());
205+
P_Check(moduleIds.Size() == strings.Size());
206206

207207
for (p::i32 i = 0; i < moduleIds.Size(); ++i)
208208
{
@@ -212,7 +212,7 @@ namespace rift::ast::LoadSystem
212212

213213
void DeserializeTypes(Tree& ast, p::TView<Id> typeIds, p::TView<p::String> strings)
214214
{
215-
Check(typeIds.Size() == strings.Size());
215+
P_Check(typeIds.Size() == strings.Size());
216216

217217
for (p::i32 i = 0; i < typeIds.Size(); ++i)
218218
{

Libs/AST/Src/AST/Utils/Expressions.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ namespace rift::ast
105105
const p::i32 index = inputs.pinIds.FindIndex([&input](Id pinId) {
106106
return input.pinId == pinId;
107107
});
108-
if (index != p::NO_INDEX && Ensure(index < inputs.linkedOutputs.Size()))
108+
if (index != p::NO_INDEX && P_Ensure(index < inputs.linkedOutputs.Size()))
109109
{
110110
inputs.linkedOutputs[index] = output;
111111
return true;
@@ -124,7 +124,7 @@ namespace rift::ast
124124

125125
// Find pin index
126126
const p::i32 index = inputs.pinIds.FindIndex(input.pinId);
127-
if (index != p::NO_INDEX && Ensure(index < inputs.linkedOutputs.Size())) [[likely]]
127+
if (index != p::NO_INDEX && P_Ensure(index < inputs.linkedOutputs.Size())) [[likely]]
128128
{
129129
ExprOutput& linked = inputs.linkedOutputs[index];
130130
linked = {};

Libs/AST/Src/AST/Utils/Namespaces.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace rift::ast
3434
ns.scopes[scopeIndex] = GetName(access, idChain[i]);
3535
++scopeIndex;
3636
}
37-
CheckMsg(i < 0, "Not enough scopes to cover this namespace");
37+
P_CheckMsg(i < 0, "Not enough scopes to cover this namespace");
3838
return ns;
3939
}
4040

Libs/AST/Src/AST/Utils/Statements.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace rift::ast
2626

2727
bool TryConnectStmt(Tree& ast, Id outputPin, Id inputNode)
2828
{
29-
if (!Ensure(!IsNone(outputPin) && !IsNone(inputNode)))
29+
if (!P_Ensure(!IsNone(outputPin) && !IsNone(inputNode)))
3030
{
3131
return false;
3232
}
@@ -113,7 +113,7 @@ namespace rift::ast
113113
// Input node is always the same id as linkId
114114
auto* inputComp = ast.TryGet<CStmtInput>(linkId);
115115
if (inputComp
116-
&& EnsureMsg(!IsNone(inputComp->linkOutputNode),
116+
&& P_EnsureMsg(!IsNone(inputComp->linkOutputNode),
117117
"Trying to disconnect a unexistant link")) [[likely]]
118118
{
119119
// We expect the other side to have outputs component

Libs/AST/Src/AST/Utils/TransactionUtils.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace rift::ast::Transactions
3232

3333
bool PreChange(const TransactionAccess& access, p::TView<const Id> entityIds)
3434
{
35-
if (!EnsureMsg(!gActiveTransaction.active,
35+
if (!P_EnsureMsg(!gActiveTransaction.active,
3636
"Tried to record a transaction while another is already being recorded"))
3737
{
3838
return false;
@@ -60,7 +60,7 @@ namespace rift::ast::Transactions
6060

6161
void PostChange()
6262
{
63-
if (EnsureMsg(gActiveTransaction.active,
63+
if (P_EnsureMsg(gActiveTransaction.active,
6464
"Cant finish a transaction while none is being recorded"))
6565
{
6666
gActiveTransaction = {};

Libs/AST/Src/AST/Utils/TypeUtils.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace rift::ast
8383

8484
void SerializeType(Tree& ast, Id id, String& data)
8585
{
86-
if (!Ensure(ast.Has<CDeclType>(id)))
86+
if (!P_Ensure(ast.Has<CDeclType>(id)))
8787
{
8888
return;
8989
}
@@ -376,7 +376,7 @@ namespace rift::ast
376376
ast.Add<CExprOutputs>(id).Add(id); // Types gets resolved by a system later
377377

378378
const Id typeId = p::GetIdParent(ast, declId);
379-
Check(!IsNone(typeId));
379+
P_Check(!IsNone(typeId));
380380
auto& declRefExpr = ast.Add<CExprDeclRef>(id);
381381
declRefExpr.ownerName = ast.Get<CNamespace>(typeId).name;
382382
declRefExpr.name = ast.Get<CNamespace>(declId).name;

Libs/AST/Src/Rift.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace rift
1313

1414
void EnableModule(p::ClassType* type)
1515
{
16-
Check(Module::GetStaticType()->IsParentOf(type));
16+
P_Check(Module::GetStaticType()->IsParentOf(type));
1717

1818
if (!gModules.Contains(type))
1919
{

Libs/Backends/MIR/Compiler/Src/IRGeneration.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,9 @@ namespace rift::MIR
301301
{
302302
const auto& outputs = access.Get<const ast::CStmtOutputs>(id);
303303
const auto& connectedIds = outputs.linkInputNodes;
304-
Check(connectedIds.Size() == 2);
304+
P_Check(connectedIds.Size() == 2);
305305
const auto& exprInputs = access.Get<const ast::CExprInputs>(id);
306-
Check(exprInputs.linkedOutputs.Size() == 1);
306+
P_Check(exprInputs.linkedOutputs.Size() == 1);
307307

308308
code->append("if (");
309309
AddExpr(exprInputs.linkedOutputs.First());
@@ -322,7 +322,7 @@ namespace rift::MIR
322322
compiler.Error("Call to an unknown function");
323323
return;
324324
}
325-
if (!Ensure(access.Has<const CMIRFunctionSignature>(functionId)))
325+
if (!P_Ensure(access.Has<const CMIRFunctionSignature>(functionId)))
326326
{
327327
compiler.Error(p::Strings::Format(
328328
"Call to an invalid function: '{}'", ast::GetFullName(access, functionId)));

Libs/Editor/Include/Utils/NodesInternal.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ namespace rift::Nodes
190190
private:
191191
T* GetByIndex(u32 index)
192192
{
193-
Check(data.IsValidIndex(index));
193+
P_Check(data.IsValidIndex(index));
194194
return data.Data() + index;
195195
}
196196
};
@@ -561,7 +561,7 @@ namespace rift::Nodes
561561
if (objects.availableIds.IsEmpty())
562562
{
563563
index = objects.pool.Size();
564-
Check(objects.pool.Size() == objects.inUse.Size());
564+
P_Check(objects.pool.Size() == objects.inUse.Size());
565565
const i32 newSize = objects.pool.Size() + 1;
566566
objects.pool.Resize(newSize);
567567
objects.inUse.Resize(newSize);

Libs/Editor/Src/DockSpaceLayout.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ namespace rift::editor
3434
ImGuiDockNodeFlags& DockSpaceLayout::Builder::GetNodeLocalFlags(Tag nodeId)
3535
{
3636
const ImGuiID dockNodeId = layout.GetDockNodeId(nodeId);
37-
Check(dockNodeId > 0);
37+
P_Check(dockNodeId > 0);
3838
return ImGui::DockBuilderGetNode(dockNodeId)->LocalFlags;
3939
}
4040

4141
ImGuiDockNodeFlags& DockSpaceLayout::Builder::GetNodeSharedFlags(Tag nodeId)
4242
{
4343
const ImGuiID dockNodeId = layout.GetDockNodeId(nodeId);
44-
Check(dockNodeId > 0);
44+
P_Check(dockNodeId > 0);
4545
return ImGui::DockBuilderGetNode(dockNodeId)->SharedFlags;
4646
}
4747

Libs/Editor/Src/Systems/EditorSystem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ namespace rift::editor::EditorSystem
218218

219219
void DrawProject(ast::Tree& ast)
220220
{
221-
if (!Ensure(ast.HasStatic<SEditor>()))
221+
if (!P_Ensure(ast.HasStatic<SEditor>()))
222222
{
223223
return;
224224
}

Libs/Editor/Src/Utils/FunctionGraph.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ namespace rift::editor::Graph
594594
PopExecutionPinStyle();
595595

596596
auto& inputs = access.Get<const ast::CExprInputs>(id);
597-
if (!Ensure(inputs.pinIds.Size() == 1))
597+
if (!P_Ensure(inputs.pinIds.Size() == 1))
598598
{
599599
continue;
600600
}
@@ -613,7 +613,7 @@ namespace rift::editor::Graph
613613
UI::BeginGroup();
614614
{
615615
auto& outputs = access.Get<const ast::CStmtOutputs>(id);
616-
if (!Ensure(outputs.pinIds.Size() == 2))
616+
if (!P_Ensure(outputs.pinIds.Size() == 2))
617617
{
618618
continue;
619619
}
@@ -685,7 +685,7 @@ namespace rift::editor::Graph
685685
{
686686
pinIds.Clear(false);
687687
p::GetIdChildren(access, id, pinIds);
688-
if (!Ensure(pinIds.Size() >= 2))
688+
if (!P_Ensure(pinIds.Size() >= 2))
689689
{
690690
continue;
691691
}
@@ -738,7 +738,7 @@ namespace rift::editor::Graph
738738
{
739739
if (const auto* outputs = access.TryGet<const ast::CStmtOutputs>(outputId))
740740
{
741-
if (EnsureMsg(outputs->linkInputNodes.Size() == outputs->pinIds.Size(),
741+
if (P_EnsureMsg(outputs->linkInputNodes.Size() == outputs->pinIds.Size(),
742742
"Inputs and pins must match. Graph might be corrupted."))
743743
{
744744
for (i32 i = 0; i < outputs->linkInputNodes.Size(); ++i)
@@ -770,7 +770,7 @@ namespace rift::editor::Graph
770770
for (ast::Id nodeId : FindIdsWith<ast::CExprInputs>(access, children))
771771
{
772772
const auto& inputs = access.Get<const ast::CExprInputs>(nodeId);
773-
if (!EnsureMsg(inputs.pinIds.Size() == inputs.linkedOutputs.Size(),
773+
if (!P_EnsureMsg(inputs.pinIds.Size() == inputs.linkedOutputs.Size(),
774774
"Inputs are invalid. The graph might be corrupted.")) [[likely]]
775775
{
776776
continue;

Libs/Editor/Src/Utils/FunctionGraphContextMenu.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace rift::editor::Graph
8181

8282
void DrawNodesContextMenu(ast::Tree& ast, ast::Id typeId, TView<ast::Id> nodeIds)
8383
{
84-
Check(!nodeIds.IsEmpty());
84+
P_Check(!nodeIds.IsEmpty());
8585
const bool canEditBody = ast::HasFunctionBodies(ast, typeId);
8686

8787
if (canEditBody && UI::MenuItem("Delete"))
@@ -113,7 +113,7 @@ namespace rift::editor::Graph
113113

114114
void DrawLinksContextMenu(ast::Tree& ast, ast::Id typeId, TView<ast::Id> linkIds)
115115
{
116-
Check(!linkIds.IsEmpty());
116+
P_Check(!linkIds.IsEmpty());
117117
const bool canEditBody = ast::HasFunctionBodies(ast, typeId);
118118

119119
ast::Id firstLinkId = linkIds[0];

Libs/Editor/Src/Utils/ModuleUtils.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace rift::editor
99
{
1010
void OpenModuleEditor(p::TAccessRef<TWrite<CModuleEditor>, ast::CModule> access, ast::Id id)
1111
{
12-
Check(access.Has<ast::CModule>(id));
12+
P_Check(access.Has<ast::CModule>(id));
1313
if (auto* editor = access.TryGet<CModuleEditor>(id))
1414
{
1515
editor->pendingFocus = true;
@@ -22,7 +22,7 @@ namespace rift::editor
2222

2323
void CloseModuleEditor(p::TAccessRef<TWrite<CModuleEditor>, ast::CModule> access, ast::Id id)
2424
{
25-
Check(access.Has<ast::CModule>(id));
25+
P_Check(access.Has<ast::CModule>(id));
2626
access.Remove<CModuleEditor>(id);
2727
}
2828

Libs/Editor/Src/Utils/Nodes.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace rift::Nodes
2929
EditorContext& GetEditorContext()
3030
{
3131
// No editor context was set! Did you forget to call Nodes::CreateContext()?
32-
Check(gNodes->EditorCtx != nullptr);
32+
P_Check(gNodes->EditorCtx != nullptr);
3333
return *gNodes->EditorCtx;
3434
}
3535

@@ -58,7 +58,7 @@ namespace rift::Nodes
5858
// Calculates the closest point along each bezier curve segment.
5959
v2 GetClosestPointOnCubicBezier(const i32 numSegments, const v2& p, const CubicBezier& cb)
6060
{
61-
Ensure(numSegments > 0);
61+
P_Ensure(numSegments > 0);
6262
v2 pLast = cb.p0;
6363
v2 pClosest;
6464
float pClosestDist = FLT_MAX;
@@ -2545,7 +2545,7 @@ namespace rift::Nodes
25452545

25462546
bool IsPinActive()
25472547
{
2548-
Check(HasFlag(gNodes->currentScope, Scope::Node));
2548+
P_Check(HasFlag(gNodes->currentScope, Scope::Node));
25492549

25502550
if (!gNodes->activePin)
25512551
{
@@ -2557,7 +2557,7 @@ namespace rift::Nodes
25572557

25582558
bool IsAnyPinActive(Id* const pinId)
25592559
{
2560-
Check(!HasAnyFlags(gNodes->currentScope, (Scope::Node | Scope::Pin)));
2560+
P_Check(!HasAnyFlags(gNodes->currentScope, (Scope::Node | Scope::Pin)));
25612561

25622562
if (!gNodes->activePin)
25632563
{
@@ -2599,8 +2599,8 @@ namespace rift::Nodes
25992599
bool IsLinkDropped(Id* outputId, Id* inputId, bool includingDetachedLinks)
26002600
{
26012601
// Call this function after EndNodeEditor()!
2602-
Check(gNodes->currentScope != Scope::None);
2603-
Check(outputId != nullptr);
2602+
P_Check(gNodes->currentScope != Scope::None);
2603+
P_Check(outputId != nullptr);
26042604

26052605
const EditorContext& editor = GetEditorContext();
26062606

@@ -2628,7 +2628,7 @@ namespace rift::Nodes
26282628

26292629
bool IsLinkCreated(Id& outputPinId, Id& inputPinId, bool* createdFromSnap)
26302630
{
2631-
Check(gNodes->currentScope == Scope::None);
2631+
P_Check(gNodes->currentScope == Scope::None);
26322632

26332633
if ((gNodes->UIState & UIState_LinkCreated) != 0)
26342634
{
@@ -2654,7 +2654,7 @@ namespace rift::Nodes
26542654
bool IsLinkCreated(ast::Id& outputNodeId, Id& outputPinId, ast::Id& inputNodeId, Id& inputPinId,
26552655
bool* createdFromSnap)
26562656
{
2657-
Check(gNodes->currentScope == Scope::None);
2657+
P_Check(gNodes->currentScope == Scope::None);
26582658

26592659
if ((gNodes->UIState & UIState_LinkCreated) != 0)
26602660
{
@@ -2681,7 +2681,7 @@ namespace rift::Nodes
26812681

26822682
bool IsLinkDestroyed(Id& linkId)
26832683
{
2684-
Check(gNodes->currentScope == Scope::None);
2684+
P_Check(gNodes->currentScope == Scope::None);
26852685

26862686
const bool linkDestroyed = gNodes->DeletedLinkIdx.IsValid();
26872687
if (linkDestroyed)

Libs/Editor/Src/Utils/TypeUtils.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace rift::editor
1010
{
1111
void OpenType(p::TAccessRef<TWrite<CTypeEditor>, ast::CDeclType> access, ast::Id id)
1212
{
13-
Check(access.Has<ast::CDeclType>(id));
13+
P_Check(access.Has<ast::CDeclType>(id));
1414
if (auto* editor = access.TryGet<CTypeEditor>(id))
1515
{
1616
editor->pendingFocus = true;
@@ -23,7 +23,7 @@ namespace rift::editor
2323

2424
void CloseType(p::TAccessRef<TWrite<CTypeEditor>, ast::CDeclType> access, ast::Id id)
2525
{
26-
Check(access.Has<ast::CDeclType>(id));
26+
P_Check(access.Has<ast::CDeclType>(id));
2727
access.Remove<CTypeEditor>(id);
2828
}
2929

0 commit comments

Comments
 (0)