[olympic,nostalgia] Cleanup some reinterpret_casts
This commit is contained in:
parent
3a781f6704
commit
13ddbd981e
@ -193,11 +193,11 @@ static void initSpritesBufferset(GLuint shader, glutils::BufferSet &bs) noexcept
|
||||
auto const posAttr = static_cast<GLuint>(glGetAttribLocation(shader, "vPosition"));
|
||||
glEnableVertexAttribArray(posAttr);
|
||||
glVertexAttribPointer(posAttr, 2, GL_FLOAT, GL_FALSE, SpriteVertexVboRowLength * sizeof(float),
|
||||
reinterpret_cast<void*>(1 * sizeof(float)));
|
||||
std::bit_cast<void*>(uintptr_t{1 * sizeof(float)}));
|
||||
auto const texCoordAttr = static_cast<GLuint>(glGetAttribLocation(shader, "vTexCoord"));
|
||||
glEnableVertexAttribArray(texCoordAttr);
|
||||
glVertexAttribPointer(texCoordAttr, 2, GL_FLOAT, GL_FALSE, SpriteVertexVboRowLength * sizeof(float),
|
||||
reinterpret_cast<void*>(3 * sizeof(float)));
|
||||
std::bit_cast<void*>(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<void*>(2 * sizeof(float)));
|
||||
std::bit_cast<void*>(uintptr_t{2 * sizeof(float)}));
|
||||
auto const heightMultAttr = static_cast<GLuint>(glGetAttribLocation(shader, "vTileIdx"));
|
||||
glEnableVertexAttribArray(heightMultAttr);
|
||||
glVertexAttribPointer(
|
||||
heightMultAttr, 1, GL_FLOAT, GL_FALSE, BgVertexVboRowLength * sizeof(float),
|
||||
reinterpret_cast<void*>(4 * sizeof(float)));
|
||||
std::bit_cast<void*>(uintptr_t{4 * sizeof(float)}));
|
||||
}
|
||||
|
||||
static glutils::GLTexture createTexture(
|
||||
|
@ -50,11 +50,11 @@ void TileSheetGrid::initBufferSet(ox::Vec2 const&paneSize, TileSheet::SubSheet c
|
||||
const auto pt2Attr = static_cast<GLuint>(glGetAttribLocation(m_shader, "vPt2"));
|
||||
glEnableVertexAttribArray(pt2Attr);
|
||||
glVertexAttribPointer(pt2Attr, 2, GL_FLOAT, GL_FALSE, VertexVboRowLength * sizeof(float),
|
||||
reinterpret_cast<void*>(2 * sizeof(float)));
|
||||
std::bit_cast<void*>(uintptr_t{2 * sizeof(float)}));
|
||||
const auto colorAttr = static_cast<GLuint>(glGetAttribLocation(m_shader, "vColor"));
|
||||
glEnableVertexAttribArray(colorAttr);
|
||||
glVertexAttribPointer(colorAttr, 3, GL_FLOAT, GL_FALSE, VertexVboRowLength * sizeof(float),
|
||||
reinterpret_cast<void*>(4 * sizeof(float)));
|
||||
std::bit_cast<void*>(uintptr_t{4 * sizeof(float)}));
|
||||
}
|
||||
|
||||
void TileSheetGrid::update(ox::Vec2 const&paneSize, TileSheet::SubSheet const&subsheet) noexcept {
|
||||
|
@ -47,7 +47,7 @@ void TileSheetPixels::initBufferSet(ox::Vec2 const&paneSize) noexcept {
|
||||
const auto colorAttr = static_cast<GLuint>(glGetAttribLocation(m_shader, "vColor"));
|
||||
glEnableVertexAttribArray(colorAttr);
|
||||
glVertexAttribPointer(colorAttr, 3, GL_FLOAT, GL_FALSE, VertexVboRowLength * sizeof(float),
|
||||
reinterpret_cast<void*>(2 * sizeof(float)));
|
||||
std::bit_cast<void*>(uintptr_t{2 * sizeof(float)}));
|
||||
}
|
||||
|
||||
void TileSheetPixels::update(ox::Vec2 const&paneSize) noexcept {
|
||||
|
@ -81,7 +81,7 @@ ox::Result<keel::AssetRef<T>> readObjNoCache(
|
||||
ox::CRStringView assetId) noexcept {
|
||||
if constexpr(ox::preloadable<T>::value) {
|
||||
oxRequire(addr, getPreloadAddr(ctx, assetId));
|
||||
return keel::AssetRef<T>(reinterpret_cast<const T*>(addr));
|
||||
return keel::AssetRef<T>(std::bit_cast<const T*>(uintptr_t{addr}));
|
||||
} else {
|
||||
return OxError(1);
|
||||
}
|
||||
@ -141,7 +141,7 @@ ox::Result<keel::AssetRef<T>> readObj(
|
||||
#else
|
||||
if constexpr(ox::preloadable<T>::value) {
|
||||
oxRequire(addr, getPreloadAddr(ctx, file));
|
||||
return keel::AssetRef<T>(reinterpret_cast<const T*>(addr));
|
||||
return keel::AssetRef<T>(std::bit_cast<const T*>(uintptr_t{addr}));
|
||||
} else {
|
||||
return OxError(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user