[nostalgia/core/studio] Break out TileSheetEditor application logic
This commit is contained in:
@@ -24,7 +24,7 @@ void TileSheetPixels::draw(bool update, const geo::Vec2 &scroll) noexcept {
|
||||
if (update) {
|
||||
glutils::sendVbo(m_bufferSet);
|
||||
}
|
||||
const auto uniformScroll = static_cast<GLint>(glGetUniformLocation(m_shader, "vScroll"));
|
||||
const auto uniformScroll = glGetUniformLocation(m_shader, "vScroll");
|
||||
glUniform2f(uniformScroll, scroll.x, scroll.y);
|
||||
glDrawElements(GL_TRIANGLES, static_cast<GLsizei>(m_bufferSet.elements.size()), GL_UNSIGNED_INT, nullptr);
|
||||
}
|
||||
@@ -56,7 +56,7 @@ geo::Vec2 TileSheetPixels::pixelSize(const geo::Vec2 &paneSize) const noexcept {
|
||||
return {xmod * m_pixelSizeMod, ymod * m_pixelSizeMod};
|
||||
}
|
||||
|
||||
void TileSheetPixels::setPixelBufferObject(const geo::Vec2 &paneSize, unsigned vertexRow, float x, float y, Color16 color, float *vbo, GLuint *ebo) noexcept {
|
||||
void TileSheetPixels::setPixelBufferObject(const geo::Vec2 &paneSize, unsigned vertexRow, float x, float y, Color16 color, float *vbo, GLuint *ebo) const noexcept {
|
||||
const auto [xmod, ymod] = pixelSize(paneSize);
|
||||
x *= xmod;
|
||||
y *= -ymod;
|
||||
|
||||
Reference in New Issue
Block a user