From dc1ead2af409813b795c565c6c46b7f3dcbeacbd Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Wed, 17 Mar 2021 21:45:34 -0500 Subject: [PATCH] [nostalgia/core/userland] Cleanup --- src/nostalgia/core/userland/gfx.cpp | 6 ++++++ src/nostalgia/core/userland/gfx_opengl.cpp | 6 ------ src/nostalgia/core/userland/glutils.hpp | 6 +++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/nostalgia/core/userland/gfx.cpp b/src/nostalgia/core/userland/gfx.cpp index 6386dd1b..20741830 100644 --- a/src/nostalgia/core/userland/gfx.cpp +++ b/src/nostalgia/core/userland/gfx.cpp @@ -70,4 +70,10 @@ ox::Error loadBgTileSheet(Context *ctx, return renderer::loadBgTexture(ctx, section, pixels.data(), width, height); } +void puts(Context *ctx, int column, int row, const char *str) { + for (int i = 0; str[i]; ++i) { + setTile(ctx, 0, column + i, row, static_cast(charMap[static_cast(str[i])])); + } +} + } diff --git a/src/nostalgia/core/userland/gfx_opengl.cpp b/src/nostalgia/core/userland/gfx_opengl.cpp index 69706c82..61e86ab1 100644 --- a/src/nostalgia/core/userland/gfx_opengl.cpp +++ b/src/nostalgia/core/userland/gfx_opengl.cpp @@ -216,12 +216,6 @@ void draw(Context *ctx) { } } -void puts(Context *ctx, int column, int row, const char *str) { - for (int i = 0; str[i]; ++i) { - setTile(ctx, 0, column + i, row, static_cast(charMap[static_cast(str[i])])); - } -} - void clearTileLayer(Context *ctx, int layer) { const auto id = ctx->rendererData(); auto bg = id->backgrounds[static_cast(layer)]; diff --git a/src/nostalgia/core/userland/glutils.hpp b/src/nostalgia/core/userland/glutils.hpp index 13cc0828..0adae2f9 100644 --- a/src/nostalgia/core/userland/glutils.hpp +++ b/src/nostalgia/core/userland/glutils.hpp @@ -21,7 +21,11 @@ struct Texture { GLuint width = 0; GLuint height = 0; - constexpr operator GLuint() const noexcept { + constexpr operator GLuint&() noexcept { + return texId; + } + + constexpr operator const GLuint&() const noexcept { return texId; }