diff --git a/src/nostalgia/modules/core/src/opengl/gfx.cpp b/src/nostalgia/modules/core/src/opengl/gfx.cpp index 1d2bbcb7..d6830238 100644 --- a/src/nostalgia/modules/core/src/opengl/gfx.cpp +++ b/src/nostalgia/modules/core/src/opengl/gfx.cpp @@ -193,11 +193,11 @@ static void initSpritesBufferset(GLuint shader, glutils::BufferSet &bs) noexcept auto const posAttr = static_cast(glGetAttribLocation(shader, "vPosition")); glEnableVertexAttribArray(posAttr); glVertexAttribPointer(posAttr, 2, GL_FLOAT, GL_FALSE, SpriteVertexVboRowLength * sizeof(float), - reinterpret_cast(1 * sizeof(float))); + std::bit_cast(uintptr_t{1 * sizeof(float)})); auto const texCoordAttr = static_cast(glGetAttribLocation(shader, "vTexCoord")); glEnableVertexAttribArray(texCoordAttr); glVertexAttribPointer(texCoordAttr, 2, GL_FLOAT, GL_FALSE, SpriteVertexVboRowLength * sizeof(float), - reinterpret_cast(3 * sizeof(float))); + std::bit_cast(uintptr_t{3 * sizeof(float)})); } static void initBackgroundBufferset( @@ -220,12 +220,12 @@ static void initBackgroundBufferset( glEnableVertexAttribArray(texCoordAttr); glVertexAttribPointer( texCoordAttr, 2, GL_FLOAT, GL_FALSE, BgVertexVboRowLength * sizeof(float), - reinterpret_cast(2 * sizeof(float))); + std::bit_cast(uintptr_t{2 * sizeof(float)})); auto const heightMultAttr = static_cast(glGetAttribLocation(shader, "vTileIdx")); glEnableVertexAttribArray(heightMultAttr); glVertexAttribPointer( heightMultAttr, 1, GL_FLOAT, GL_FALSE, BgVertexVboRowLength * sizeof(float), - reinterpret_cast(4 * sizeof(float))); + std::bit_cast(uintptr_t{4 * sizeof(float)})); } static glutils::GLTexture createTexture( diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixelgrid.cpp b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixelgrid.cpp index 832cc815..27602478 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixelgrid.cpp +++ b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixelgrid.cpp @@ -50,11 +50,11 @@ void TileSheetGrid::initBufferSet(ox::Vec2 const&paneSize, TileSheet::SubSheet c const auto pt2Attr = static_cast(glGetAttribLocation(m_shader, "vPt2")); glEnableVertexAttribArray(pt2Attr); glVertexAttribPointer(pt2Attr, 2, GL_FLOAT, GL_FALSE, VertexVboRowLength * sizeof(float), - reinterpret_cast(2 * sizeof(float))); + std::bit_cast(uintptr_t{2 * sizeof(float)})); const auto colorAttr = static_cast(glGetAttribLocation(m_shader, "vColor")); glEnableVertexAttribArray(colorAttr); glVertexAttribPointer(colorAttr, 3, GL_FLOAT, GL_FALSE, VertexVboRowLength * sizeof(float), - reinterpret_cast(4 * sizeof(float))); + std::bit_cast(uintptr_t{4 * sizeof(float)})); } void TileSheetGrid::update(ox::Vec2 const&paneSize, TileSheet::SubSheet const&subsheet) noexcept { diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixels.cpp b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixels.cpp index 079a1e9f..bf471fdd 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixels.cpp +++ b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixels.cpp @@ -47,7 +47,7 @@ void TileSheetPixels::initBufferSet(ox::Vec2 const&paneSize) noexcept { const auto colorAttr = static_cast(glGetAttribLocation(m_shader, "vColor")); glEnableVertexAttribArray(colorAttr); glVertexAttribPointer(colorAttr, 3, GL_FLOAT, GL_FALSE, VertexVboRowLength * sizeof(float), - reinterpret_cast(2 * sizeof(float))); + std::bit_cast(uintptr_t{2 * sizeof(float)})); } void TileSheetPixels::update(ox::Vec2 const&paneSize) noexcept { diff --git a/src/olympic/keel/include/keel/media.hpp b/src/olympic/keel/include/keel/media.hpp index 1d3c6d4a..0652464b 100644 --- a/src/olympic/keel/include/keel/media.hpp +++ b/src/olympic/keel/include/keel/media.hpp @@ -81,7 +81,7 @@ ox::Result> readObjNoCache( ox::CRStringView assetId) noexcept { if constexpr(ox::preloadable::value) { oxRequire(addr, getPreloadAddr(ctx, assetId)); - return keel::AssetRef(reinterpret_cast(addr)); + return keel::AssetRef(std::bit_cast(uintptr_t{addr})); } else { return OxError(1); } @@ -141,7 +141,7 @@ ox::Result> readObj( #else if constexpr(ox::preloadable::value) { oxRequire(addr, getPreloadAddr(ctx, file)); - return keel::AssetRef(reinterpret_cast(addr)); + return keel::AssetRef(std::bit_cast(uintptr_t{addr})); } else { return OxError(1); }