Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dfranx committed Mar 18, 2020
1 parent c1b9c44 commit bbfd967
Show file tree
Hide file tree
Showing 46 changed files with 71 additions and 73 deletions.
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#include <windows.h>
#endif

#include <SDL2/SDL.h>
#include <SHADERed/EditorEngine.h>
#include <SHADERed/Engine/GeometryFactory.h>
#include <SHADERed/Objects/AudioShaderStream.h>
#include <SHADERed/Objects/Logger.h>
#include <SHADERed/Objects/Settings.h>
#include <SDL2/SDL.h>
#include <glslang/Public/ShaderLang.h>

#include <chrono>
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Engine/GLUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ namespace ed {
void CreateVAO(GLuint& geoVAO, GLuint geoVBO, const std::vector<InputLayoutItem>& ilayout, GLuint geoEBO, GLuint bufVBO, std::vector<ed::ShaderVariable::ValueType> types)
{
int fmtIndex = 0;

glDeleteVertexArrays(1, &geoVAO);
glGenVertexArrays(1, &geoVAO);

Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Engine/GeometryFactory.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <SHADERed/Engine/GLUtils.h>
#include <SHADERed/Engine/GeometryFactory.h>
#include <SHADERed/Objects/PipelineItem.h>
#include <SHADERed/Engine/GLUtils.h>

#include <GL/glew.h>
#if defined(__APPLE__)
Expand Down
7 changes: 2 additions & 5 deletions src/SHADERed/GUIManager.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <SDL2/SDL_messagebox.h>
#include <SHADERed/GUIManager.h>
#include <SHADERed/InterfaceManager.h>
#include <SHADERed/Objects/CameraSnapshots.h>
Expand Down Expand Up @@ -27,7 +28,6 @@
#include <SHADERed/UI/PreviewUI.h>
#include <SHADERed/UI/PropertyUI.h>
#include <SHADERed/UI/UIHelper.h>
#include <SDL2/SDL_messagebox.h>
#include <imgui/examples/imgui_impl_opengl3.h>
#include <imgui/examples/imgui_impl_sdl.h>
#include <imgui/imgui.h>
Expand Down Expand Up @@ -248,10 +248,7 @@ namespace ed {

SDL_free(droppedFile);
} else if (e.type == SDL_WINDOWEVENT) {
if (e.window.event == SDL_WINDOWEVENT_MOVED ||
e.window.event == SDL_WINDOWEVENT_MAXIMIZED ||
e.window.event == SDL_WINDOWEVENT_RESIZED)
{
if (e.window.event == SDL_WINDOWEVENT_MOVED || e.window.event == SDL_WINDOWEVENT_MAXIMIZED || e.window.event == SDL_WINDOWEVENT_RESIZED) {
SDL_GetWindowSize(m_wnd, &m_width, &m_height);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/InterfaceManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <SHADERed/InterfaceManager.h>
#include <SHADERed/GUIManager.h>
#include <SHADERed/InterfaceManager.h>
#include <SHADERed/Objects/ShaderTranscompiler.h>

namespace ed {
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/InterfaceManager.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#pragma once
#include <SDL2/SDL_events.h>
#include <SHADERed/Objects/DebugInformation.h>
#include <SHADERed/Objects/MessageStack.h>
#include <SHADERed/Objects/ObjectManager.h>
#include <SHADERed/Objects/PipelineManager.h>
#include <SHADERed/Objects/PluginAPI/PluginManager.h>
#include <SHADERed/Objects/ProjectParser.h>
#include <SHADERed/Objects/RenderEngine.h>
#include <SDL2/SDL_events.h>

namespace ed {
class GUIManager;
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Objects/AudioShaderStream.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <SHADERed/Objects/AudioShaderStream.h>
#include <SHADERed/Engine/GLUtils.h>
#include <SHADERed/Engine/GeometryFactory.h>
#include <SHADERed/Objects/AudioShaderStream.h>
#include <SHADERed/Objects/ShaderTranscompiler.h>
#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>
Expand Down
4 changes: 2 additions & 2 deletions src/SHADERed/Objects/Debug/PixelInformation.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace ed {
glm::vec4 DebuggerColor; // Color generated by the debugger - this way users can see if the ShaderDebugger is executing code correctly... going to leave this here until I improve ShaderDebugger

PipelineItem* Owner; // shader pass responsible for this pixel
PipelineItem* Object; // pipeline item responsible for this pixel
PipelineItem* Object; // pipeline item responsible for this pixel
std::string RenderTexture; // what render texture
int RenderTextureIndex;

Expand All @@ -37,7 +37,7 @@ namespace ed {
glm::ivec2 Coordinate; // pixel position on the texture
glm::vec2 RelativeCoordinate;

bool Fetched; // Did we fill the DebuggerColor and Vertex[] information for this pixel?
bool Fetched; // Did we fill the DebuggerColor and Vertex[] information for this pixel?
bool Discarded; // was this pixel discarded?

int VertexCount; // 1 for point, 2 for line, 3 for triangle, etc...
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Objects/Export/ExportCPP.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <SHADERed/Objects/Export/ExportCPP.h>
#include <SHADERed/Engine/GeometryFactory.h>
#include <SHADERed/Objects/Export/ExportCPP.h>
#include <SHADERed/Objects/Names.h>
#include <SHADERed/Objects/ShaderTranscompiler.h>
#include <SHADERed/Objects/SystemVariableManager.h>
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Objects/FunctionVariableManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <SHADERed/Objects/FunctionVariableManager.h>
#include <SHADERed/Objects/CameraSnapshots.h>
#include <SHADERed/Objects/FunctionVariableManager.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
Expand Down
4 changes: 2 additions & 2 deletions src/SHADERed/Objects/GizmoObject.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <SHADERed/Objects/GizmoObject.h>
#include <SHADERed/Engine/GeometryFactory.h>
#include <SHADERed/Engine/GLUtils.h>
#include <SHADERed/Engine/GeometryFactory.h>
#include <SHADERed/Engine/Ray.h>
#include <SHADERed/Objects/DefaultState.h>
#include <SHADERed/Objects/GizmoObject.h>
#include <SHADERed/Objects/Logger.h>
#include <SHADERed/Objects/SystemVariableManager.h>

Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Objects/GizmoObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace ed {
glm::vec3 *m_trans, *m_scale, *m_rota;
glm::vec3 m_tValue, m_curValue;
int m_axisSelected; // -1 = none, 0 = x, 1 = y, 2 = z
int m_axisHovered; // ^ same as here
int m_axisHovered; // ^ same as here
int m_mode; // 0 = translation, 1 = scale, 2 = rotation
float m_lastDepth;

Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Objects/HLSLFileIncluder.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace ed {
}
}

virtual ~HLSLFileIncluder() override {}
virtual ~HLSLFileIncluder() override { }

protected:
typedef char tUserDataElement;
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Objects/ObjectManager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <SHADERed/Objects/ObjectManager.h>
#include <SHADERed/Engine/GLUtils.h>
#include <SHADERed/Objects/Logger.h>
#include <SHADERed/Objects/ObjectManager.h>
#include <SHADERed/Objects/RenderEngine.h>
#include <SHADERed/Objects/Settings.h>

Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Objects/PipelineItem.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#pragma once
#include <SHADERed/Engine/Model.h>
#include <SHADERed/Options.h>
#include <SHADERed/Objects/AudioShaderStream.h>
#include <SHADERed/Objects/InputLayout.h>
#include <SHADERed/Objects/ShaderMacro.h>
#include <SHADERed/Objects/ShaderVariableContainer.h>
#include <SHADERed/Options.h>

#include <glm/glm.hpp>
#ifdef _WIN32
Expand Down
4 changes: 2 additions & 2 deletions src/SHADERed/Objects/PipelineManager.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <SHADERed/Objects/PipelineManager.h>
#include <SHADERed/Options.h>
#include <SHADERed/Objects/Logger.h>
#include <SHADERed/Objects/PipelineManager.h>
#include <SHADERed/Objects/ProjectParser.h>
#include <SHADERed/Objects/SystemVariableManager.h>
#include <SHADERed/Options.h>

int strcmpcase(const char* s1, const char* s2)
{
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Objects/PipelineManager.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <SHADERed/Options.h>
#include <SHADERed/Objects/PipelineItem.h>
#include <SHADERed/Options.h>
#include <vector>

namespace ed {
Expand Down
10 changes: 5 additions & 5 deletions src/SHADERed/Objects/PluginAPI/PluginManager.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#include <SHADERed/Objects/PluginAPI/PluginManager.h>
#include <SHADERed/GUIManager.h>
#include <SHADERed/InterfaceManager.h>
#include <SHADERed/Objects/DefaultState.h>
#include <SHADERed/Objects/Logger.h>
#include <SHADERed/Objects/PluginAPI/PluginManager.h>
#include <SHADERed/Objects/Settings.h>
#include <SHADERed/Objects/SystemVariableManager.h>
#include <SHADERed/UI/CodeEditorUI.h>
#include <SHADERed/UI/ObjectPreviewUI.h>
#include <SHADERed/UI/PinnedUI.h>
#include <SHADERed/UI/PipelineUI.h>
#include <SHADERed/UI/PreviewUI.h>
#include <SHADERed/UI/PropertyUI.h>
#include <SHADERed/UI/UIHelper.h>
#include <SHADERed/Objects/DefaultState.h>
#include <SHADERed/Objects/Logger.h>
#include <SHADERed/Objects/Settings.h>
#include <SHADERed/Objects/SystemVariableManager.h>

#include <imgui/imgui.h>
#include <algorithm>
Expand Down
4 changes: 2 additions & 2 deletions src/SHADERed/Objects/PluginAPI/PluginManager.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once
#include <SDL2/SDL.h>
#include <SHADERed/Objects/InputLayout.h>
#include <SHADERed/Objects/ShaderVariable.h>
#include <SHADERed/Objects/PluginAPI/Plugin.h>
#include <SDL2/SDL.h>
#include <SHADERed/Objects/ShaderVariable.h>
#include <string>
#include <vector>

Expand Down
10 changes: 5 additions & 5 deletions src/SHADERed/Objects/ProjectParser.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <SHADERed/Objects/ProjectParser.h>
#include <SHADERed/Objects/CameraSnapshots.h>
#include <SHADERed/Objects/DebugInformation.h>
#include <SHADERed/Objects/DefaultState.h>
Expand All @@ -10,6 +9,7 @@
#include <SHADERed/Objects/PipelineItem.h>
#include <SHADERed/Objects/PipelineManager.h>
#include <SHADERed/Objects/PluginAPI/PluginManager.h>
#include <SHADERed/Objects/ProjectParser.h>
#include <SHADERed/Objects/RenderEngine.h>
#include <SHADERed/Objects/ShaderTranscompiler.h>
#include <SHADERed/Objects/SystemVariableManager.h>
Expand Down Expand Up @@ -113,7 +113,7 @@ namespace ed {
NULL /* .colorScheme */
};
int buttonid;
if (SDL_ShowMessageBox(&messageboxdata, &buttonid) < 0) {}
if (SDL_ShowMessageBox(&messageboxdata, &buttonid) < 0) { }

if (buttonid == 0) {
// TODO: redirect to .../plugin?name=pname
Expand All @@ -139,9 +139,9 @@ namespace ed {
NULL /* .colorScheme */
};
int buttonid;
if (SDL_ShowMessageBox(&messageboxdata, &buttonid) < 0) {}
if (SDL_ShowMessageBox(&messageboxdata, &buttonid) < 0) { }

if (buttonid == 0) {}
if (buttonid == 0) { }

pluginTest = false;
} else {
Expand All @@ -165,7 +165,7 @@ namespace ed {
NULL /* .colorScheme */
};
int buttonid;
if (SDL_ShowMessageBox(&messageboxdata, &buttonid) < 0) {}
if (SDL_ShowMessageBox(&messageboxdata, &buttonid) < 0) { }

if (buttonid == 0) {
// TODO: redirect to .../plugin?name=pname
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Objects/RenderEngine.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <SHADERed/Objects/RenderEngine.h>
#include <SHADERed/Engine/GLUtils.h>
#include <SHADERed/Engine/GeometryFactory.h>
#include <SHADERed/Engine/Ray.h>
#include <SHADERed/Objects/DefaultState.h>
#include <SHADERed/Objects/Logger.h>
#include <SHADERed/Objects/ObjectManager.h>
#include <SHADERed/Objects/PipelineManager.h>
#include <SHADERed/Objects/RenderEngine.h>
#include <SHADERed/Objects/Settings.h>
#include <SHADERed/Objects/ShaderTranscompiler.h>
#include <SHADERed/Objects/SystemVariableManager.h>
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Objects/Settings.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <SHADERed/Objects/Settings.h>
#include <SHADERed/Objects/Logger.h>
#include <SHADERed/Objects/Settings.h>
#include <inih/INIReader.h>

#include <algorithm>
Expand Down
4 changes: 2 additions & 2 deletions src/SHADERed/Objects/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace ed {
void Load();
void Save();

float DPIScale; // shouldn't be changed by users
float DPIScale; // shouldn't be changed by users
float TempScale; // copy this value to DPIScale on "Ok" button press
std::string Theme;

Expand Down Expand Up @@ -74,7 +74,7 @@ namespace ed {
bool StatusBar;
int FPSLimit;
bool ApplyFPSLimitToApp; // apply FPSLimit to whole app, not only preview
bool LostFocusLimitFPS; // limit to 30FPS when app loses focus
bool LostFocusLimitFPS; // limit to 30FPS when app loses focus
int MSAA; // 1 (off), 2, 4, 8
} Preview;

Expand Down
14 changes: 7 additions & 7 deletions src/SHADERed/Objects/ShaderVariable.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <SHADERed/Options.h>
#include <SHADERed/Objects/PluginAPI/Plugin.h>
#include <SHADERed/Options.h>
#include <string.h>
#include <string>

Expand All @@ -21,22 +21,22 @@ namespace ed {
Time, // float - time elapsed since start
TimeDelta, // float - render time
FrameIndex, // uint - current frame index
ViewportSize, // vec2 - rendering window size
MousePosition, // vec2 - mouse position relative to (0,0) in the rendering window
ViewportSize, // vec2 - rendering window size
MousePosition, // vec2 - mouse position relative to (0,0) in the rendering window
View, // mat4 - a built-in camera matrix
Projection, // mat4 - a built-in projection matrix
ViewProjection, // mat4 - View*Projection matrix
Orthographic, // mat4 - an orthographic matrix
ViewProjection, // mat4 - View*Projection matrix
Orthographic, // mat4 - an orthographic matrix
ViewOrthographic, // mat4 - View*Orthographic
GeometryTransform, // mat4 - apply Scale, Rotation and Position to geometry
IsPicked, // bool - check if current item is selected
CameraPosition, // vec4 - current camera position
CameraPosition, // vec4 - current camera position
CameraPosition3, // vec3 - current camera position
CameraDirection3, // vec3 - camera view direction
KeysWASD, // vec4 - are W, A, S or D keys pressed
Mouse, // vec4 - (x,y,left,right) updated every frame
MouseButton, // vec4 - (x,y,left,right) updated only when mouse button pressed
PluginVariable, // a value that is updated by some plugin
PluginVariable, // a value that is updated by some plugin
Count
};

Expand Down
4 changes: 2 additions & 2 deletions src/SHADERed/Objects/ShaderVariableContainer.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <SHADERed/Objects/ShaderVariableContainer.h>
#include <SHADERed/Objects/FunctionVariableManager.h>
#include <SHADERed/Objects/ShaderVariableContainer.h>
#include <SHADERed/Objects/SystemVariableManager.h>
#include <iostream>
#include <regex>

namespace ed {
ShaderVariableContainer::ShaderVariableContainer() {}
ShaderVariableContainer::ShaderVariableContainer() { }
ShaderVariableContainer::~ShaderVariableContainer()
{
for (int i = 0; i < m_vars.size(); i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/Objects/ThemeContainer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <SHADERed/Objects/ThemeContainer.h>
#include <SHADERed/Objects/Logger.h>
#include <SHADERed/Objects/ThemeContainer.h>
#include <sstream>

namespace ed {
Expand Down
4 changes: 2 additions & 2 deletions src/SHADERed/UI/CodeEditorUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ namespace ed {
m_data->Renderer.RecompileFile(shaderFile.c_str());
}

void CodeEditorUI::OnEvent(const SDL_Event& e) {}
void CodeEditorUI::OnEvent(const SDL_Event& e) { }
void CodeEditorUI::Update(float delta)
{
if (m_editor.size() == 0)
Expand Down Expand Up @@ -190,7 +190,7 @@ namespace ed {
if (ImGui::BeginMenu("Code")) {
if (ImGui::MenuItem("Compile", KeyboardShortcuts::Instance().GetString("CodeUI.Compile").c_str())) m_compile(i);

if (!m_stats[i].Visible && ImGui::MenuItem("Stats", KeyboardShortcuts::Instance().GetString("CodeUI.SwitchView").c_str(), nullptr, false)) {}
if (!m_stats[i].Visible && ImGui::MenuItem("Stats", KeyboardShortcuts::Instance().GetString("CodeUI.SwitchView").c_str(), nullptr, false)) { }

if (m_stats[i].Visible && ImGui::MenuItem("Code", KeyboardShortcuts::Instance().GetString("CodeUI.SwitchView").c_str())) m_stats[i].Visible = false;
ImGui::Separator();
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/UI/CodeEditorUI.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#pragma once
#include <ImGuiColorTextEdit/TextEditor.h>
#include <SHADERed/Objects/Logger.h>
#include <SHADERed/Objects/PipelineItem.h>
#include <SHADERed/Objects/Settings.h>
#include <SHADERed/Objects/ShaderLanguage.h>
#include <SHADERed/Objects/ShaderStage.h>
#include <SHADERed/UI/Tools/StatsPage.h>
#include <SHADERed/UI/UIView.h>
#include <ImGuiColorTextEdit/TextEditor.h>
#include <imgui/examples/imgui_impl_opengl3.h>
#include <imgui/examples/imgui_impl_sdl.h>
#include <deque>
Expand Down
2 changes: 1 addition & 1 deletion src/SHADERed/UI/MessageOutputUI.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <SHADERed/UI/MessageOutputUI.h>
#include <SHADERed/Objects/Settings.h>
#include <SHADERed/Objects/ThemeContainer.h>
#include <SHADERed/Options.h>
#include <SHADERed/UI/MessageOutputUI.h>
#include <imgui/imgui.h>

namespace ed {
Expand Down
Loading

0 comments on commit bbfd967

Please sign in to comment.