diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 3e4252f44..f2b66acb0 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -319,7 +319,7 @@ int CEditor::DoButton_DraggableEx(const void *pID, const char *pText, int Checke return UI()->DoDraggableButtonLogic(pID, Checked, pRect, pClicked, pAbrupted); } -void CEditor::RenderBackground(CUIRect View, IGraphics::CTextureHandle Texture, float Size, float Brightness) +void CEditor::RenderBackground(CUIRect View, IGraphics::CTextureHandle Texture, float Size, float Brightness) const { Graphics()->TextureSet(Texture); Graphics()->BlendNormal(); @@ -1547,7 +1547,7 @@ void CEditor::DoPointDrag(const std::shared_ptr &pLayer, CQuad *pQu pQuad->m_aPoints[PointIndex].y = m_QuadDragOriginalPoints[QuadIndex][PointIndex].y + OffsetY; } -CEditor::EAxis CEditor::GetDragAxis(int OffsetX, int OffsetY) +CEditor::EAxis CEditor::GetDragAxis(int OffsetX, int OffsetY) const { if(Input()->ShiftIsPressed()) if(absolute(OffsetX) < absolute(OffsetY)) @@ -1558,7 +1558,7 @@ CEditor::EAxis CEditor::GetDragAxis(int OffsetX, int OffsetY) return EAxis::AXIS_NONE; } -void CEditor::DrawAxis(EAxis Axis, CPoint &OriginalPoint, CPoint &Point) +void CEditor::DrawAxis(EAxis Axis, CPoint &OriginalPoint, CPoint &Point) const { if(Axis == EAxis::AXIS_NONE) return; @@ -1892,7 +1892,7 @@ void CEditor::ComputeAABBAlignments(const std::shared_ptr &pLayer, vAlignments.insert(vAlignments.end(), vAlignmentsY.begin(), vAlignmentsY.end()); } -void CEditor::DrawPointAlignments(const std::vector &vAlignments, int OffsetX, int OffsetY) +void CEditor::DrawPointAlignments(const std::vector &vAlignments, int OffsetX, int OffsetY) const { if(!g_Config.m_EdAlignQuads) return; @@ -1916,7 +1916,7 @@ void CEditor::DrawPointAlignments(const std::vector &vAlignments } } -void CEditor::DrawAABB(const SAxisAlignedBoundingBox &AABB, int OffsetX, int OffsetY) +void CEditor::DrawAABB(const SAxisAlignedBoundingBox &AABB, int OffsetX, int OffsetY) const { // Drawing an AABB is simply converting the points from fixed to float // Then making lines out of quads and drawing them @@ -2006,7 +2006,7 @@ void CEditor::ApplyAlignments(const std::vector &vAlignments, in OffsetY += AdjustY; } -void CEditor::ApplyAxisAlignment(int &OffsetX, int &OffsetY) +void CEditor::ApplyAxisAlignment(int &OffsetX, int &OffsetY) const { // This is used to preserve axis alignment when pressing `Shift` // Should be called before any other computation @@ -8361,7 +8361,7 @@ void CEditor::Reset(bool CreateDefault) m_MapSettingsCommandContext.Reset(); } -int CEditor::GetTextureUsageFlag() +int CEditor::GetTextureUsageFlag() const { return Graphics()->Uses2DTextureArrays() ? IGraphics::TEXLOAD_TO_2D_ARRAY_TEXTURE : IGraphics::TEXLOAD_TO_3D_TEXTURE; } diff --git a/src/game/editor/editor.h b/src/game/editor/editor.h index ad997ce34..dfbd47766 100644 --- a/src/game/editor/editor.h +++ b/src/game/editor/editor.h @@ -288,7 +288,7 @@ class CEditor : public IEditor IGraphics::CTextureHandle m_SwitchTexture; IGraphics::CTextureHandle m_TuneTexture; - int GetTextureUsageFlag(); + int GetTextureUsageFlag() const; enum EPreviewState { @@ -823,7 +823,7 @@ public: template int RenderEditBoxDropdown(SEditBoxDropdownContext *pDropdown, CUIRect View, CLineInput *pLineInput, int x, float MaxHeight, bool AutoWidth, const std::vector &vData, const FDropdownRenderCallback &fnMatchCallback); - void RenderBackground(CUIRect View, IGraphics::CTextureHandle Texture, float Size, float Brightness); + void RenderBackground(CUIRect View, IGraphics::CTextureHandle Texture, float Size, float Brightness) const; SEditResult UiDoValueSelector(void *pID, CUIRect *pRect, const char *pLabel, int Current, int Min, int Max, int Step, float Scale, const char *pToolTip, bool IsDegree = false, bool IsHex = false, int corners = IGraphics::CORNER_ALL, const ColorRGBA *pColor = nullptr, bool ShowValue = true); @@ -919,9 +919,9 @@ public: void DoQuad(int LayerIndex, const std::shared_ptr &pLayer, CQuad *pQuad, int Index); void PreparePointDrag(const std::shared_ptr &pLayer, CQuad *pQuad, int QuadIndex, int PointIndex); void DoPointDrag(const std::shared_ptr &pLayer, CQuad *pQuad, int QuadIndex, int PointIndex, int OffsetX, int OffsetY); - EAxis GetDragAxis(int OffsetX, int OffsetY); - void DrawAxis(EAxis Axis, CPoint &OriginalPoint, CPoint &Point); - void DrawAABB(const SAxisAlignedBoundingBox &AABB, int OffsetX = 0, int OffsetY = 0); + EAxis GetDragAxis(int OffsetX, int OffsetY) const; + void DrawAxis(EAxis Axis, CPoint &OriginalPoint, CPoint &Point) const; + void DrawAABB(const SAxisAlignedBoundingBox &AABB, int OffsetX = 0, int OffsetY = 0) const; ColorRGBA GetButtonColor(const void *pID, int Checked); // Alignment methods @@ -945,10 +945,10 @@ public: void ComputePointAlignments(const std::shared_ptr &pLayer, CQuad *pQuad, int QuadIndex, int PointIndex, int OffsetX, int OffsetY, std::vector &vAlignments, bool Append = false) const; void ComputePointsAlignments(const std::shared_ptr &pLayer, bool Pivot, int OffsetX, int OffsetY, std::vector &vAlignments) const; void ComputeAABBAlignments(const std::shared_ptr &pLayer, const SAxisAlignedBoundingBox &AABB, int OffsetX, int OffsetY, std::vector &vAlignments) const; - void DrawPointAlignments(const std::vector &vAlignments, int OffsetX, int OffsetY); + void DrawPointAlignments(const std::vector &vAlignments, int OffsetX, int OffsetY) const; void QuadSelectionAABB(const std::shared_ptr &pLayer, SAxisAlignedBoundingBox &OutAABB); void ApplyAlignments(const std::vector &vAlignments, int &OffsetX, int &OffsetY); - void ApplyAxisAlignment(int &OffsetX, int &OffsetY); + void ApplyAxisAlignment(int &OffsetX, int &OffsetY) const; bool ReplaceImage(const char *pFilename, int StorageType, bool CheckDuplicate); static bool ReplaceImageCallback(const char *pFilename, int StorageType, void *pUser);