[glutils,nostalgia,studio] Fix Xcode build errors

This commit is contained in:
2023-06-06 00:18:13 -05:00
parent 7bccfc8a00
commit 13b2df57fe
6 changed files with 34 additions and 14 deletions

View File

@@ -154,7 +154,14 @@ static void initBackgroundBufferObjects(Context *ctx, glutils::BufferSet *bg) no
const auto i = bgVertexRow(x, y);
auto vbo = &bg->vertices[i * static_cast<std::size_t>(BgVertexVboLength)];
auto ebo = &bg->elements[i * static_cast<std::size_t>(BgVertexEboLength)];
setTileBufferObject(ctx, i * BgVertexVboRows, static_cast<float>(x), static_cast<float>(y), 0, vbo, ebo);
setTileBufferObject(
ctx,
static_cast<unsigned>(i * BgVertexVboRows),
static_cast<float>(x),
static_cast<float>(y),
0,
vbo,
ebo);
}
}
}
@@ -437,7 +444,7 @@ void setBgStatus(Context *ctx, unsigned bg, bool status) noexcept {
}
void clearTileLayer(Context *ctx, unsigned bgIdx) noexcept {
void glearTileLayer(Context *ctx, unsigned bgIdx) noexcept {
auto &gctx = static_cast<GlContext&>(*ctx);
auto &bg = gctx.cbbs[static_cast<std::size_t>(bgIdx)];
initBackgroundBufferObjects(&gctx, &bg);
@@ -526,9 +533,13 @@ void setTile(Context *ctx, unsigned bgIdx, int column, int row, uint8_t tile) no
auto vbo = &bg.vertices[i * renderer::BgVertexVboLength];
auto ebo = &bg.elements[i * renderer::BgVertexEboLength];
renderer::setTileBufferObject(
ctx, i * renderer::BgVertexVboRows,
static_cast<float>(x), static_cast<float>(y),
tile, vbo, ebo);
ctx,
static_cast<unsigned>(i * renderer::BgVertexVboRows),
static_cast<float>(x),
static_cast<float>(y),
tile,
vbo,
ebo);
bg.updated = true;
}

View File

@@ -52,13 +52,14 @@ void PaletteEditorImGui::draw(turbine::Context*) noexcept {
{
const auto sz = ImVec2(70, 24);
if (ImGui::Button("Add", sz)) {
undoStack()->push(ox::make<AddColorCommand>(&m_pal, 0, m_pal.colors.size()));
const auto colorSz = static_cast<int>(m_pal.colors.size());
undoStack()->push(ox::make<AddColorCommand>(&m_pal, 0, colorSz));
}
ImGui::SameLine();
ImGui::BeginDisabled(m_selectedRow >= m_pal.colors.size());
{
if (ImGui::Button("Remove", sz)) {
undoStack()->push(ox::make<RemoveColorCommand>(&m_pal, m_pal.colors[static_cast<std::size_t>(m_selectedRow)], m_selectedRow));
undoStack()->push(ox::make<RemoveColorCommand>(&m_pal, m_pal.colors[static_cast<std::size_t>(m_selectedRow)], static_cast<int>(m_selectedRow)));
m_selectedRow = ox::min(m_pal.colors.size() - 1, m_selectedRow);
}
ImGui::SameLine();
@@ -134,7 +135,7 @@ void PaletteEditorImGui::draw(turbine::Context*) noexcept {
ImGui::InputInt("Blue", &b, 1, 5);
const auto newColor = color16(r, g, b, a);
if (c != newColor) {
undoStack()->push(ox::make<UpdateColorCommand>(&m_pal, m_selectedRow, c, newColor));
undoStack()->push(ox::make<UpdateColorCommand>(&m_pal, static_cast<int>(m_selectedRow), c, newColor));
}
}
ImGui::EndChild();

View File

@@ -279,7 +279,8 @@ struct TileSheet {
*/
[[nodiscard]]
constexpr unsigned pixelCnt(int8_t pBpp) const noexcept {
return pBpp == 4 ? pixels.size() * 2 : pixels.size();
const auto pixelsSize = static_cast<unsigned>(pixels.size());
return pBpp == 4 ? pixelsSize * 2 : pixelsSize;
}
/**