[nostalgia] Replace C strings with ox::StringView
This commit is contained in:
@@ -85,7 +85,7 @@ ox::Error shutdownGfx(Context*) noexcept {
|
||||
return {};
|
||||
}
|
||||
|
||||
void setWindowTitle(Context*, const char*) noexcept {
|
||||
void setWindowTitle(Context*, ox::CRStringView) noexcept {
|
||||
}
|
||||
|
||||
void focusWindow(Context*) noexcept {
|
||||
@@ -210,10 +210,11 @@ ox::Error loadSpritePalette(Context *ctx, unsigned cbb, const ox::FileAddress &p
|
||||
}
|
||||
|
||||
// Do NOT use Context in the GBA version of this function.
|
||||
void puts(Context *ctx, int column, int row, const char *str) noexcept {
|
||||
for (int i = 0; str[i]; i++) {
|
||||
void puts(Context *ctx, int column, int row, ox::CRStringView str) noexcept {
|
||||
const auto col = static_cast<unsigned>(column);
|
||||
for (auto i = 0u; i < str.bytes(); i++) {
|
||||
const auto c = charMap[static_cast<unsigned>(str[i])];
|
||||
setTile(ctx, 0, column + i, row, static_cast<uint8_t>(c));
|
||||
setTile(ctx, 0, static_cast<int>(col + i), row, static_cast<uint8_t>(c));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user