Skip to content

Commit

Permalink
BREAKING CHANGES: BuiltIn component renames!
Browse files Browse the repository at this point in the history
Version Bump -> 1.0.1
removed workflow files until i figure it out privately
renamed MQQS to better name
added image type
added vsync flag back
fixed focus bug with vector 3 component
added vector 2 component
added component flavours for simple components
added SeparateXY component for vector 2
reworked textfield into the new flavour system
simplified components into just their header
added more questscript nodes
fixed a bug that cause rectangle selection to select more than shown
  • Loading branch information
gk646 committed May 12, 2024
1 parent 128e2f4 commit 081657f
Show file tree
Hide file tree
Showing 41 changed files with 660 additions and 842 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/RunTestsGNU-Linux.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/RunTestsWindows.yml

This file was deleted.

5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE) # Build as shared lib

option(RN_ENABLE_SANITIZER "Set to compile with adress sanitizer (MSVC)") # set(RN_ENABLE_SANITIZER ON)
option(RN_BUILD_TESTS "Set to compile the test executable") # set(RN_BUILD_TESTS ON)
option(RN_BUILD_RELEASES "Set to build the release archives") # set(RN_BUILD_RELEASES ON)

#set(RN_BUILD_TESTS ON)

# Compiler options for MSVC and GCC
include(cmake/CompilerOptions.cmake)
Expand All @@ -30,7 +32,8 @@ add_subdirectory(src/plugins)
add_subdirectory(src/import)

# Add all built targets here
add_dependencies(raynodes MQQS BuiltIns)
add_dependencies(raynodes QuestScript BuiltIns)


if (RN_BUILD_TESTS)
enable_testing()
Expand Down
File renamed without changes.
12 changes: 4 additions & 8 deletions src/external/cxstructs/include/cxutil/cxstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

namespace cxstructs {
// Pads the given string "arg" inside "buff" with the "padSymbol" - optional prefix and suffix
inline void str_pad(char* buff, const int size, const char* arg, const char padSymbol,
const char* prefix = nullptr, const char* suffix = nullptr) {
inline void str_pad(char* buff, const int size, const char* arg, const char padSymbol, const char* prefix = nullptr,
const char* suffix = nullptr) {
int currPos = 0;
std::memset(buff, 0, size);

Expand All @@ -40,14 +40,10 @@ inline void str_pad(char* buff, const int size, const char* arg, const char padS
currPos += snprintf(buff + currPos, size - currPos, "%s", arg);
currPos = currPos > size ? size : currPos;
}
if (suffix && currPos < size) {
snprintf(buff + currPos, size - currPos, "%s", suffix);
}
if (suffix && currPos < size) { snprintf(buff + currPos, size - currPos, "%s", suffix); }

for (int i = currPos; i < size - 1; i++) {
if (buff[i] == '\0') {
buff[i] = padSymbol;
}
if (buff[i] == '\0') { buff[i] = padSymbol; }
}
buff[size - 1] = '\0';
}
Expand Down
76 changes: 0 additions & 76 deletions src/external/raylib/CONTRIBUTING.md

This file was deleted.

54 changes: 41 additions & 13 deletions src/plugins/BuiltIns/BuiltIns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,58 @@

#include "components/MathC.h"
#include "components/DisplayC.h"
#include "components/NumberOutputC.h"
#include "components/NumberFieldC.h"
#include "components/SeparateXYC.h"
#include "components/SeparateXYZC.h"
#include "components/StringToNumberC.h"
#include "components/TextInputC.h"
#include "components/TextOutC.h"
#include "components/Vec3OutC.h"
#include "components/TextFieldC.h"
#include "components/Vec2C.h"
#include "components/Vec3C.h"

void BuiltIns::registerComponents(ComponentRegister& cr) {
cr.registerComponent<MathC>("BI_MathOp");
cr.registerComponent<DisplayC>("BI_Display");
cr.registerComponent<StringToNumberC>("BI_StrToNum");
cr.registerComponent<TextOutputC>("BI_TextOut");
cr.registerComponent<TextInputC>("BI_TextIn");
cr.registerComponent<NumberOutputC>("BI_NumberOut");
cr.registerComponent<SeparateXYZC>("BI_SeparateXYZ");
cr.registerComponent<Vec3OutC>("BI_Vec3Out");
cr.registerComponent<SeparateXYC>("BI_SeparateXY");

// NumberField - different flavours
cr.registerComponent<NumberFieldC<IN_AND_OUT>>("BI_Number");
cr.registerComponent<NumberFieldC<INPUT_ONLY>>("BI_Number_In");
cr.registerComponent<NumberFieldC<OUTPUT_ONLY>>("BI_Number_Out");

// Textfield - different flavours
cr.registerComponent<TextFieldC<IN_AND_OUT>>("BI_Text");
cr.registerComponent<TextFieldC<INPUT_ONLY>>("BI_Text_In");
cr.registerComponent<TextFieldC<OUTPUT_ONLY>>("BI_Text_Out");

// Vector 3 - different flavours
cr.registerComponent<Vec3C<IN_AND_OUT>>("BI_Vec3");
cr.registerComponent<Vec3C<INPUT_ONLY>>("BI_Vec3_In");
cr.registerComponent<Vec3C<OUTPUT_ONLY>>("BI_Vec3_Out");

// Vector 2 - different flavours
cr.registerComponent<Vec2C<IN_AND_OUT>>("BI_Vec2");
cr.registerComponent<Vec2C<INPUT_ONLY>>("BI_Vec2_In");
cr.registerComponent<Vec2C<OUTPUT_ONLY>>("BI_Vec2_Out");
}

// IMPORTANT :: DONT CHANGE ORDER -> Will invalidate all saves made
// TODO properly manage that -> maybe register with a number region?
void BuiltIns::registerNodes(NodeRegister& nr) {
// Misc
nr.registerNode("MathOp", {{"Operation", "BI_MathOp"}});
nr.registerNode("TextField", {{"TextField", "BI_TextOut"}});
nr.registerNode("StringToNum", {{"Converter", "BI_StrToNum"}});
nr.registerNode("Display", {{"Display", "BI_Display"}});
nr.registerNode("NumberField", {{"Number", "BI_NumberOut"}});
nr.registerNode("SeparateXYZ", {{"Vector", "BI_SeparateXYZ"}});
nr.registerNode("Vector 3", {{"Vector3", "BI_Vec3Out"}});

// Conversion
nr.registerNode("StringToNum", {{"Converter", "BI_StrToNum"}});
nr.registerNode("SeparateXYZ", {{"Separator", "BI_SeparateXYZ"}});
nr.registerNode("SeparateXY", {{"Separator", "BI_SeparateXY"}});

// Data Input
nr.registerNode("TextField", {{"Text", "BI_Text_Out"}});
nr.registerNode("NumberField", {{"Number", "BI_Number_Out"}});
nr.registerNode("Vector3", {{"Vec3", "BI_Vec3_Out"}});
nr.registerNode("Vector2", {{"Vec2", "BI_Vec2_Out"}});

}
8 changes: 0 additions & 8 deletions src/plugins/BuiltIns/components/DisplayC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,4 @@ void DisplayC::onCreate(EditorContext& ec, Node& /**/) {
addPinOutput(STRING);
addPinOutput(FLOAT);
addPinOutput(INTEGER);
}

void DisplayC::save(FILE* /**/) {
/*No state*/
}

void DisplayC::load(FILE* /**/) {
/*No state*/
}
2 changes: 0 additions & 2 deletions src/plugins/BuiltIns/components/DisplayC.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ struct DisplayC final : Component {
Component* clone() override { return new DisplayC(*this); };
void draw(EditorContext& ec, Node& parent) override;
void update(EditorContext& ec, Node& parent) override;
void save(FILE* file) override;
void load(FILE* file) override;
void onCreate(EditorContext& ec, Node& parent) override;
};
#endif //RAYNODES_SRC_COMPONENT_COMPONENTS_DISPLAYC_H_
Loading

0 comments on commit 081657f

Please sign in to comment.