summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor-main.cpp13
-rw-r--r--editor/editor.cpp17
2 files changed, 15 insertions, 15 deletions
diff --git a/editor/editor-main.cpp b/editor/editor-main.cpp
index 4e26472..a037ca6 100644
--- a/editor/editor-main.cpp
+++ b/editor/editor-main.cpp
@@ -1,5 +1,6 @@
#include <csignal>
+#include "pk.h"
#include "arg-handler.hpp"
#include "plugins.hpp"
#include "editor.hpp"
@@ -21,12 +22,12 @@ int main(int argc, char *argv[]) {
{
pkeSettings.isSimulationPaused = true;
pkeSettings.isShowingEditor = true;
- LoadedPkePlugins.Push({
- .OnInit = PkeEditor_Init,
- .OnTick = PkeEditor_Tick,
- .OnTeardown = PkeEditor_Teardown,
- .OnImGuiRender = PkeEditor_RecordImGui,
- });
+ PKEPluginInterface itfc;
+ itfc.OnInit = PkeEditor_Init;
+ itfc.OnTick = PkeEditor_Tick;
+ itfc.OnTeardown = PkeEditor_Teardown;
+ itfc.OnImGuiRender = PkeEditor_RecordImGui;
+ pk_arr_append(&LoadedPkePlugins, &itfc);
}
// run
PkeArgs_Parse(argc, argv);
diff --git a/editor/editor.cpp b/editor/editor.cpp
index 14b2777..685d402 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -2,7 +2,6 @@
#include "editor.hpp"
#include "BulletCollision/NarrowPhaseCollision/btRaycastCallback.h"
-#include "array.hpp"
#include "asset-manager.hpp"
#include "camera.hpp"
#include "ecs.hpp"
@@ -1662,22 +1661,22 @@ void RecordImGuiSceneEditor() {
ImGui::Spacing();
if (selectedEntity != nullptr) {
- static PkeArray<CompGrBinds *> entGrBinds;
- static PkeArray<CompInstance *> entInstances;
+ static pk_arr_t<CompGrBinds *> entGrBinds;
+ static pk_arr_t<CompInstance *> entInstances;
static EntityType *entType;
bool reset = false;
if (entGrBinds.next > 0) {
- if (entGrBinds.data[0]->entHandle != selectedEntity->entHandle) {
+ if (entGrBinds[0]->entHandle != selectedEntity->entHandle) {
reset = true;
}
} else if (entInstances.next > 0) {
- if (entInstances.data[0]->entHandle != selectedEntity->entHandle) {
+ if (entInstances[0]->entHandle != selectedEntity->entHandle) {
reset = true;
}
}
if (reset) {
- PkeArray_SoftReset(&entGrBinds);
- PkeArray_SoftReset(&entInstances);
+ pk_arr_clear(&entGrBinds);
+ pk_arr_clear(&entInstances);
entType = nullptr;
}
if (entGrBinds.next == 0)
@@ -1699,10 +1698,10 @@ void RecordImGuiSceneEditor() {
}
ImGui::Text("%s: %08x %08x", "Entity Handle: ", selectedEntity->entHandle.bucketIndex, selectedEntity->entHandle.itemIndex);
for (int64_t i = 0; i < entGrBinds.next; ++i) {
- RecordImGui_CompGrBinds(true, entGrBinds.data[i]);
+ RecordImGui_CompGrBinds(true, entGrBinds[i]);
}
for (int64_t i = 0; i < entInstances.next; ++i) {
- RecordImGui_CompInstPos(false, entInstances.data[i]);
+ RecordImGui_CompInstPos(false, entInstances[i]);
}
}