Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
#5338: Remove unused legacy RadiantCameraView class
  • Loading branch information
codereader committed Sep 25, 2020
1 parent 63d92b6 commit 8704971
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 88 deletions.
10 changes: 0 additions & 10 deletions include/icamera.h
Expand Up @@ -47,13 +47,3 @@ inline ui::ICamera& GlobalCameraView()
);
return _camera;
}

class Matrix4;

class IRadiantCameraView
{
public:
virtual ~IRadiantCameraView() {}
virtual void setModelview(const Matrix4& modelview) = 0;
virtual void setFieldOfView(float fieldOfView) = 0;
};
1 change: 0 additions & 1 deletion radiant/camera/CamWnd.cpp
Expand Up @@ -147,7 +147,6 @@ CamWnd::CamWnd(wxWindow* parent) :
_id(++_maxId),
_view(true),
_camera(&_view, Callback(std::bind(&CamWnd::queueDraw, this))),
_cameraView(_camera, &_view, Callback(std::bind(&CamWnd::update, this))),
_drawing(false),
_wxGLWidget(new wxutil::GLWidget(_mainWxWidget, std::bind(&CamWnd::onRender, this), "CamWnd")),
_timer(this),
Expand Down
3 changes: 0 additions & 3 deletions radiant/camera/CamWnd.h
Expand Up @@ -16,7 +16,6 @@
#include <wx/timer.h>
#include "render/View.h"

#include "RadiantCameraView.h"
#include "Camera.h"

#include "Rectangle.h"
Expand Down Expand Up @@ -56,8 +55,6 @@ class CamWnd :
// The contained camera
Camera _camera;

RadiantCameraView _cameraView;

static ShaderPtr _faceHighlightShader;
static ShaderPtr _primitiveHighlightShader;

Expand Down
32 changes: 32 additions & 0 deletions radiant/camera/Camera.cpp
Expand Up @@ -9,6 +9,38 @@
namespace ui
{

namespace
{
const Matrix4 g_radiant2opengl = Matrix4::byColumns(
0, -1, 0, 0,
0, 0, 1, 0,
-1, 0, 0, 0,
0, 0, 0, 1
);

const Matrix4 g_opengl2radiant = Matrix4::byColumns(
0, 0, -1, 0,
-1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 0, 1
);

inline Matrix4 projection_for_camera(float near_z, float far_z, float fieldOfView, int width, int height)
{
const float half_width = near_z * tan(degrees_to_radians(fieldOfView * 0.5f));
const float half_height = half_width * (static_cast<float>(height) / static_cast<float>(width));

return Matrix4::getProjectionForFrustum(
-half_width,
half_width,
-half_height,
half_height,
near_z,
far_z
);
}
}

Vector3 Camera::_prevOrigin(0,0,0);
Vector3 Camera::_prevAngles(0,0,0);

Expand Down
70 changes: 0 additions & 70 deletions radiant/camera/RadiantCameraView.h

This file was deleted.

1 change: 0 additions & 1 deletion tools/msvc/DarkRadiant.vcxproj
Expand Up @@ -464,7 +464,6 @@
<ClInclude Include="..\..\radiant\camera\CamRenderer.h" />
<ClInclude Include="..\..\radiant\camera\CamWnd.h" />
<ClInclude Include="..\..\radiant\camera\FloatingCamWnd.h" />
<ClInclude Include="..\..\radiant\camera\RadiantCameraView.h" />
<ClInclude Include="..\..\radiant\render\OpenGLModule.h" />
<ClInclude Include="..\..\radiant\textool\Rectangle.h" />
<ClInclude Include="..\..\radiant\textool\RenderableItem.h" />
Expand Down
3 changes: 0 additions & 3 deletions tools/msvc/DarkRadiant.vcxproj.filters
Expand Up @@ -702,9 +702,6 @@
<ClInclude Include="..\..\radiant\camera\FloatingCamWnd.h">
<Filter>src\camera</Filter>
</ClInclude>
<ClInclude Include="..\..\radiant\camera\RadiantCameraView.h">
<Filter>src\camera</Filter>
</ClInclude>
<ClInclude Include="..\..\radiant\render\OpenGLModule.h">
<Filter>src\render</Filter>
</ClInclude>
Expand Down

0 comments on commit 8704971

Please sign in to comment.