Changeset 27111

Timestamp:
Oct 4, 2022, 10:25:39 PM (22 months ago)
Author:
Vladislav Belov
Message:

Removes GUI dependency from Canvas2D.

Initially the GetDefaultGuiMatrix function was added in rP1904 and renamed in rP10985.

Location:
ps/trunk/source
Files:
2 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/graphics/Canvas2D.cpp

    r27110 r27111  
    2424#include "graphics/TextRenderer.h"
    2525#include "graphics/TextureManager.h"
    26 #include "gui/GUIMatrix.h"
    2726#include "maths/Rect.h"
    2827#include "maths/Vector2D.h"
     
    9089{
    9190public:
    92     Impl(Renderer::Backend::IDeviceCommandContext* deviceCommandContext)
    93         : DeviceCommandContext(deviceCommandContext)
     91    Impl(
     92        const uint32_t widthInPixels, const uint32_t heightInPixels, const float scale,
     93        Renderer::Backend::IDeviceCommandContext* deviceCommandContext)
     94        : WidthInPixels(widthInPixels), HeightInPixels(heightInPixels),
     95        Scale(scale), DeviceCommandContext(deviceCommandContext)
    9496    {
    9597    }
     
    115117        BindingSlots.tex = shader->GetBindingSlot(str_tex);
    116118
    117         const CMatrix3D transform = GetDefaultGuiMatrix();
     119        const CMatrix3D transform = Get();
    118120        DeviceCommandContext->SetUniform(
    119121            BindingSlots.transform, transform.AsFloatArray());
     
    128130        Tech.reset();
    129131    }
     132
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
    130156
    131157    Renderer::Backend::IDeviceCommandContext* DeviceCommandContext = nullptr;
     
    138164
    139165CCanvas2D::CCanvas2D(
     166
    140167    Renderer::Backend::IDeviceCommandContext* deviceCommandContext)
    141     : m(std::make_unique<Impl>(deviceCommandContext))
     168    : m(std::make_unique<Impl>(deviceCommandContext))
    142169{
    143170
     
    414441        m->BindingSlots.grayscaleFactor, 0.0f);
    415442
    416     textRenderer.Render(m->DeviceCommandContext, m->Tech->GetShader(), GetDefaultGuiMatrix());
     443    textRenderer.Render(m->DeviceCommandContext, m->Tech->GetShader(), ());
    417444}
    418445
  • ps/trunk/source/graphics/Canvas2D.h

    r27109 r27111  
    3636{
    3737public:
    38     CCanvas2D(Renderer::Backend::IDeviceCommandContext* deviceCommandContext);
     38    CCanvas2D(
     39        const uint32_t widthInPixels, const uint32_t heightInPixels, const float scale,
     40        Renderer::Backend::IDeviceCommandContext* deviceCommandContext);
    3941    ~CCanvas2D();
    4042
  • ps/trunk/source/gui/GUIRenderer.cpp

    r26365 r27111  
    2424#include "gui/CGUI.h"
    2525#include "gui/CGUISprite.h"
    26 #include "gui/GUIMatrix.h"
    2726#include "gui/SettingTypes/CGUIColor.h"
    2827#include "i18n/L10n.h"
  • ps/trunk/source/gui/ObjectTypes/CChart.cpp

    r26479 r27111  
    2121
    2222#include "graphics/Canvas2D.h"
    23 #include "gui/GUIMatrix.h"
    2423#include "gui/SettingTypes/CGUIList.h"
    2524#include "gui/SettingTypes/CGUISeries.h"
  • ps/trunk/source/ps/ProfileViewer.cpp

    r26480 r27111  
    2323#include "graphics/FontMetrics.h"
    2424#include "graphics/TextRenderer.h"
    25 #include "gui/GUIMatrix.h"
    2625#include "lib/external_libraries/libsdl.h"
    2726#include "maths/Size2D.h"
  • ps/trunk/source/renderer/Renderer.cpp

    r26920 r27111  
    492492void CRenderer::RenderFrame2D(const bool renderGUI, const bool renderLogger)
    493493{
    494     CCanvas2D canvas(m->deviceCommandContext.get());
     494    CCanvas2D canvas(m->deviceCommandContext.get());
    495495
    496496    m->sceneRenderer.RenderTextOverlays(canvas);
  • ps/trunk/source/renderer/ShadowMap.cpp

    r26983 r27111  
    2323#include "graphics/LightEnv.h"
    2424#include "graphics/ShaderManager.h"
    25 #include "gui/GUIMatrix.h"
    2625#include "lib/bits.h"
    2726#include "maths/BoundingBoxAligned.h"
  • ps/trunk/source/tools/atlas/GameInterface/ActorViewer.cpp

    r26850 r27111  
    4444#include "ps/GameSetup/Config.h"
    4545#include "ps/ProfileViewer.h"
     46
    4647#include "renderer/Renderer.h"
    4748#include "renderer/RenderingOptions.h"
     
    6263#include "simulation2/helpers/Render.h"
    6364
     65
     66
    6467struct ActorViewerImpl : public Scene
    6568{
     
    531534
    532535    {
    533         CCanvas2D canvas(g_Renderer.GetDeviceCommandContext());
     536        CCanvas2D canvas(g_Renderer.GetDeviceCommandContext());
    534537        g_Logger->Render(canvas);
    535538        g_ProfileViewer.RenderProfile(canvas);
Note: See TracChangeset for help on using the changeset viewer.