diff --git a/CMakeLists.txt b/CMakeLists.txt index 786f758a..1f39915e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ IF (WIN32) SET_TARGET_PROPERTIES(LimonEngine PROPERTIES LINK_FLAGS ${LimonEngine_LINKFLAGS} ) ENDIF() -add_library(customTriggers SHARED src/GamePlay/TriggerInterface.cpp src/GamePlay/LimonAPI.cpp src/GamePlay/updateGuiTextOnTrigger.cpp) +add_library(customTriggers SHARED src/GamePlay/TriggerInterface.cpp src/GamePlay/LimonAPI.cpp src/GamePlay/UpdateGuiTextOnTrigger.cpp) TARGET_LINK_LIBRARIES(customTriggers ${TinyXML2_LIBRARIES}) set_target_properties(customTriggers PROPERTIES VERSION ${PROJECT_VERSION}) diff --git a/src/GameObjects/TriggerObject.cpp b/src/GameObjects/TriggerObject.cpp index ae4456e1..3ce995bb 100644 --- a/src/GameObjects/TriggerObject.cpp +++ b/src/GameObjects/TriggerObject.cpp @@ -25,22 +25,22 @@ void TriggerObject::render(BulletDebugDrawer *debugDrawer) { * */ //top - debugDrawer->drawLine(boxTransform* glm::vec4( 1, 1, 1,1), boxTransform* glm::vec4( 1, 1,-1,1), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 1 -> 2 - debugDrawer->drawLine(boxTransform* glm::vec4( 1, 1,-1,1), boxTransform* glm::vec4(-1, 1,-1,1), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 2 -> 4 - debugDrawer->drawLine(boxTransform* glm::vec4(-1, 1,-1,1), boxTransform* glm::vec4(-1, 1, 1,1), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 4 -> 3 - debugDrawer->drawLine(boxTransform* glm::vec4(-1, 1, 1,1), boxTransform* glm::vec4( 1, 1, 1,1), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 3 -> 1 + debugDrawer->drawLine(glm::vec3(boxTransform* glm::vec4( 1, 1, 1,1)), glm::vec3(boxTransform* glm::vec4( 1, 1,-1,1)), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 1 -> 2 + debugDrawer->drawLine(glm::vec3(boxTransform* glm::vec4( 1, 1,-1,1)), glm::vec3(boxTransform* glm::vec4(-1, 1,-1,1)), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 2 -> 4 + debugDrawer->drawLine(glm::vec3(boxTransform* glm::vec4(-1, 1,-1,1)), glm::vec3(boxTransform* glm::vec4(-1, 1, 1,1)), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 4 -> 3 + debugDrawer->drawLine(glm::vec3(boxTransform* glm::vec4(-1, 1, 1,1)), glm::vec3(boxTransform* glm::vec4( 1, 1, 1,1)), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 3 -> 1 //bottom - debugDrawer->drawLine(boxTransform* glm::vec4( 1,-1, 1,1), boxTransform* glm::vec4( 1,-1,-1,1), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 1 -> 2 - debugDrawer->drawLine(boxTransform* glm::vec4( 1,-1,-1,1), boxTransform* glm::vec4(-1,-1,-1,1), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 2 -> 4 - debugDrawer->drawLine(boxTransform* glm::vec4(-1,-1,-1,1), boxTransform* glm::vec4(-1,-1, 1,1), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 4 -> 3 - debugDrawer->drawLine(boxTransform* glm::vec4(-1,-1, 1,1), boxTransform* glm::vec4( 1,-1, 1,1), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 3 -> 1 + debugDrawer->drawLine(glm::vec3(boxTransform* glm::vec4( 1,-1, 1,1)), glm::vec3(boxTransform* glm::vec4( 1,-1,-1,1)), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 1 -> 2 + debugDrawer->drawLine(glm::vec3(boxTransform* glm::vec4( 1,-1,-1,1)), glm::vec3(boxTransform* glm::vec4(-1,-1,-1,1)), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 2 -> 4 + debugDrawer->drawLine(glm::vec3(boxTransform* glm::vec4(-1,-1,-1,1)), glm::vec3(boxTransform* glm::vec4(-1,-1, 1,1)), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 4 -> 3 + debugDrawer->drawLine(glm::vec3(boxTransform* glm::vec4(-1,-1, 1,1)), glm::vec3(boxTransform* glm::vec4( 1,-1, 1,1)), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 3 -> 1 //sides - debugDrawer->drawLine(boxTransform* glm::vec4( 1, 1, 1,1), boxTransform* glm::vec4( 1,-1, 1,1), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 1 -> 1 - debugDrawer->drawLine(boxTransform* glm::vec4( 1, 1,-1,1), boxTransform* glm::vec4( 1,-1,-1,1), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 2 -> 2 - debugDrawer->drawLine(boxTransform* glm::vec4(-1, 1, 1,1), boxTransform* glm::vec4(-1,-1, 1,1), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 3 -> 3 - debugDrawer->drawLine(boxTransform* glm::vec4(-1, 1,-1,1), boxTransform* glm::vec4(-1,-1,-1,1), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 4 -> 4 + debugDrawer->drawLine(glm::vec3(boxTransform* glm::vec4( 1, 1, 1,1)), glm::vec3(boxTransform* glm::vec4( 1,-1, 1,1)), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 1 -> 1 + debugDrawer->drawLine(glm::vec3(boxTransform* glm::vec4( 1, 1,-1,1)), glm::vec3(boxTransform* glm::vec4( 1,-1,-1,1)), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 2 -> 2 + debugDrawer->drawLine(glm::vec3(boxTransform* glm::vec4(-1, 1, 1,1)), glm::vec3(boxTransform* glm::vec4(-1,-1, 1,1)), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 3 -> 3 + debugDrawer->drawLine(glm::vec3(boxTransform* glm::vec4(-1, 1,-1,1)), glm::vec3(boxTransform* glm::vec4(-1,-1,-1,1)), glm::vec3( 0, 0,1), glm::vec3( 0, 0,1), true);// 4 -> 4 } GameObject::ImGuiResult TriggerObject::addImGuiEditorElements(const glm::mat4 &cameraMatrix, const glm::mat4 &perspectiveMatrix) { diff --git a/src/main.cpp b/src/main.cpp index 2ac401ea..91066a5c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,8 +31,11 @@ int main(int argc, char *argv[]) { Options options; SDL2Helper sdlHelper(PROGRAM_NAME.c_str(), &options); - +#ifdef _WIN32 sdlHelper.loadSharedLibrary("libcustomTriggers.dll"); +#else + sdlHelper.loadSharedLibrary("./libcustomTriggers.so"); +#endif GLHelper glHelper(&options); glHelper.reshape();