Skip to content

Commit ac18bca

Browse files
committed
RenderedTarget: Declare textureManager() with const
1 parent 2ce28bd commit ac18bca

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/renderedtarget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ QPointF RenderedTarget::mapFromScratchToLocal(const QPointF &point) const
778778
return localPoint;
779779
}
780780

781-
CpuTextureManager *RenderedTarget::textureManager()
781+
CpuTextureManager *RenderedTarget::textureManager() const
782782
{
783783
if (!m_textureManager)
784784
m_textureManager = std::make_shared<CpuTextureManager>();

src/renderedtarget.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class RenderedTarget : public IRenderedTarget
123123
QPointF transformPoint(double scratchX, double scratchY, double originX, double originY, double sinRot, double cosRot) const;
124124
QPointF mapFromStageWithOriginPoint(const QPointF &scenePoint) const;
125125
QPointF mapFromScratchToLocal(const QPointF &point) const;
126-
CpuTextureManager *textureManager();
126+
CpuTextureManager *textureManager() const;
127127
QRectF touchingBounds() const;
128128
QRectF candidatesBounds(const QRectF &targetRect, const std::vector<libscratchcpp::Target *> &candidates, std::vector<IRenderedTarget *> &dst) const;
129129
QRectF candidatesBounds(const QRectF &targetRect, const std::vector<libscratchcpp::Sprite *> &candidates, std::vector<IRenderedTarget *> &dst) const;
@@ -141,8 +141,8 @@ class RenderedTarget : public IRenderedTarget
141141
Skin *m_skin = nullptr;
142142
Texture m_texture;
143143
Texture m_oldTexture;
144-
Texture m_cpuTexture; // without stage scale
145-
std::shared_ptr<CpuTextureManager> m_textureManager; // NOTE: Use textureManager()!
144+
Texture m_cpuTexture; // without stage scale
145+
mutable std::shared_ptr<CpuTextureManager> m_textureManager; // NOTE: Use textureManager()!
146146
std::unique_ptr<QOpenGLFunctions> m_glF;
147147
std::unordered_map<ShaderManager::Effect, double> m_graphicEffects;
148148
double m_size = 1;

0 commit comments

Comments
 (0)