Skip to content

Commit 1ae9f20

Browse files
committed
Protext the sprite textures again
1 parent e1a5475 commit 1ae9f20

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

source/code/puzzle_editor/PuzzleEditorState.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static void DrawBrick(int brick, int x, int y, int width, int height) {
8181

8282
sago::SagoSprite& sprite = globalData.bricks[brick];
8383
ImGui::SetCursorScreenPos({ static_cast<float>(x), static_cast<float>(y) });
84-
ImGuiWritePartOfTexture(sprite.tex.get(), sprite.imgCord.x, sprite.imgCord.y, sprite.GetWidth(), sprite.GetHeight(), width, height);
84+
ImGuiWritePartOfTexture(sprite.GetTextureHandler().get(), sprite.GetImageCord().x, sprite.GetImageCord().y, sprite.GetWidth(), sprite.GetHeight(), width, height);
8585
}
8686

8787
void PuzzleEditorState::Draw(SDL_Renderer* target) {

source/code/sago/SagoSprite.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ class SagoSprite final {
9898
int GetHeight() const;
9999
~SagoSprite() = default;
100100

101+
const TextureHandler& GetTextureHandler() const {
102+
return this->tex;
103+
}
104+
105+
const SDL_Rect& GetImageCord() const {
106+
return this->imgCord;
107+
}
108+
109+
const SDL_Rect& GetOrigin() const {
110+
return this->origin;
111+
}
112+
113+
private:
101114
TextureHandler tex;
102115
SDL_Rect imgCord = {};
103116
SDL_Rect origin = {};

0 commit comments

Comments
 (0)