From fb6557fba29d0c16f266d3f37c4669d06f72dda9 Mon Sep 17 00:00:00 2001 From: mitchellhansen Date: Wed, 21 Feb 2018 21:30:01 -0800 Subject: [PATCH] Cleaned up includes, fixed compiler warning --- include/CLCaster.h | 1 + include/Gui.h | 2 +- include/Input.h | 12 ++++++------ include/LightController.h | 4 ++-- include/LightHandle.h | 6 +++--- include/Logger.h | 2 +- include/NetworkInput.h | 5 +++-- include/Pub_Sub.h | 11 ++--------- include/Ray.h | 2 +- include/map/ArrayMap.h | 6 +++--- include/map/Map.h | 10 +++++----- include/map/Octree.h | 5 +++-- include/util.hpp | 14 +++++++------- src/Application.cpp | 2 +- src/Input.cpp | 12 +++--------- 15 files changed, 42 insertions(+), 52 deletions(-) diff --git a/include/CLCaster.h b/include/CLCaster.h index 67c9138..a80acb6 100644 --- a/include/CLCaster.h +++ b/include/CLCaster.h @@ -1,4 +1,5 @@ #pragma once +#define CL_USE_DEPRECATED_OPENCL_1_2_APIS #include #include #include diff --git a/include/Gui.h b/include/Gui.h index 2a0a44c..635d4e4 100644 --- a/include/Gui.h +++ b/include/Gui.h @@ -1,7 +1,7 @@ #pragma once +#include #include #include -#include /** * diff --git a/include/Input.h b/include/Input.h index 6a266f8..24c59d1 100644 --- a/include/Input.h +++ b/include/Input.h @@ -1,11 +1,14 @@ #pragma once -#include +#include #include -#include "Event.hpp" #include +#include +#include +#include "Event.hpp" #include "Pub_Sub.h" #include "Gui.h" -#include +#include "Logger.h" +#include "LightHandle.h" /** * @@ -47,9 +50,6 @@ private: std::vector held_keys; std::vector held_mouse_buttons; - // TODO: What the hell was I using these for? - std::vector keyboard_flags; - std::vector mouse_flags; private: diff --git a/include/LightController.h b/include/LightController.h index 218c7a8..946162d 100644 --- a/include/LightController.h +++ b/include/LightController.h @@ -2,10 +2,10 @@ #include #include #include -#include "util.hpp" -#include "Pub_Sub.h" #include "CLCaster.h" #include "LightHandle.h" +#include "Pub_Sub.h" +#include "util.hpp" /** * Light Handle : diff --git a/include/LightHandle.h b/include/LightHandle.h index 263d3b0..ecb782d 100644 --- a/include/LightHandle.h +++ b/include/LightHandle.h @@ -1,10 +1,10 @@ #pragma once -#include -#include #include +#include +#include "Gui.h" #include "Pub_Sub.h" +#include "util.hpp" #include "Vector4.hpp" -#include "Gui.h" struct LightPrototype; diff --git a/include/Logger.h b/include/Logger.h index 8160017..2e51575 100644 --- a/include/Logger.h +++ b/include/Logger.h @@ -1,6 +1,6 @@ #pragma once -#include #include +#include #undef ERROR class Logger { diff --git a/include/NetworkInput.h b/include/NetworkInput.h index cf66e15..1a30bdf 100644 --- a/include/NetworkInput.h +++ b/include/NetworkInput.h @@ -1,8 +1,9 @@ -#include +#pragma once +#include #include +#include #include "Event.hpp" #include "Pub_Sub.h" -#include /** * diff --git a/include/Pub_Sub.h b/include/Pub_Sub.h index 13ba4ef..dc47540 100644 --- a/include/Pub_Sub.h +++ b/include/Pub_Sub.h @@ -1,23 +1,17 @@ #pragma once -#include #include -#include "Event.hpp" #include #include - +#include +#include "Event.hpp" class VrEventPublisher; /** - * * VrEventSubscriber - * */ - - - class VrEventSubscriber { public: virtual ~VrEventSubscriber(); @@ -32,7 +26,6 @@ public: // Looks for the publisher ptr and event type in the subscriptions map. If there, Removes them void unsubscribe(VrEventPublisher* publisher, vr::Event::EventType type); void unsubscribe_all(VrEventPublisher* publisher); - void unsubscribe_all(); protected: diff --git a/include/Ray.h b/include/Ray.h index bbbe534..ba8f4df 100644 --- a/include/Ray.h +++ b/include/Ray.h @@ -1,6 +1,6 @@ #pragma once -#include #include +#include #include "map/Map.h" class Ray { diff --git a/include/map/ArrayMap.h b/include/map/ArrayMap.h index 54833ad..9f963f5 100644 --- a/include/map/ArrayMap.h +++ b/include/map/ArrayMap.h @@ -1,9 +1,9 @@ #pragma once -#include #include -#include "util.hpp" -#include #include +#include +#include +#include "util.hpp" class ArrayMap { diff --git a/include/map/Map.h b/include/map/Map.h index a3a9cb9..a8decce 100644 --- a/include/map/Map.h +++ b/include/map/Map.h @@ -1,13 +1,13 @@ #pragma once -#include -#include -#include #include +#include #include -#include "util.hpp" -#include "map/Octree.h" #include +#include +#include +#include "util.hpp" #include "map/ArrayMap.h" +#include "map/Octree.h" #define _USE_MATH_DEFINES #include diff --git a/include/map/Octree.h b/include/map/Octree.h index 64d9b0e..e6a6db1 100644 --- a/include/map/Octree.h +++ b/include/map/Octree.h @@ -1,8 +1,9 @@ #pragma once -#include +#include #include +#include #include "util.hpp" -#include + struct OctState { diff --git a/include/util.hpp b/include/util.hpp index 18fc2a2..6faf77d 100644 --- a/include/util.hpp +++ b/include/util.hpp @@ -1,16 +1,16 @@ #pragma once -#include -#include +#include #include -#include +#include #include +#include #include #include -#include -#include -#include -#include #include +#include +#include +#include +#include #include "Vector4.hpp" const double PI = 3.141592653589793238463; diff --git a/src/Application.cpp b/src/Application.cpp index 0f0e129..59e8d30 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -21,7 +21,7 @@ Application::~Application() { if (window.unique()) window.reset(); else { - Logger::log("Can't release window, shared_ptr coun : " + window.use_count(), Logger::LogLevel::WARN); + Logger::log("Can't release window, shared_ptr count : " + window.use_count(), Logger::LogLevel::WARN); } //light_handle->~LightHandle(); //light_controller->~LightController(); diff --git a/src/Input.cpp b/src/Input.cpp index 8791bd9..ea187c9 100644 --- a/src/Input.cpp +++ b/src/Input.cpp @@ -1,15 +1,9 @@ #pragma once +#include #include "Input.h" -#include -#include -#include "Logger.h" -#include "LightHandle.h" -#include "imgui/imgui-SFML.h" -Input::Input() : - keyboard_flags(sf::Keyboard::Key::KeyCount, false), - mouse_flags(sf::Mouse::Button::ButtonCount, false){ +Input::Input() { } @@ -166,7 +160,7 @@ void Input::render_gui() { for (auto i : held_keys) { if (i < 0) continue; - ImGui::Text(key_strings.at(i).c_str()); + ImGui::Text("%s", key_strings.at(i).c_str()); ImGui::NextColumn(); }