Skip to content

Commit

Permalink
pie_SetRadar: Add null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Nov 2, 2022
1 parent 5098fee commit d946c8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ivis_opengl/pieblitfunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,10 @@ void pie_SetRadar(gfx_api::gfxFloat x, gfx_api::gfxFloat y, gfx_api::gfxFloat wi
{
for (size_t i = 0; i < NUM_RADAR_TEXTURES; ++i)
{
if (radarGfx[i] == nullptr)
{
continue;
}
radarGfx[i]->makeTexture(twidth, theight, gfx_api::pixel_format::FORMAT_RGBA8_UNORM_PACK8, std::string("mem::radarTexture[") + std::to_string(i) + "]");
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); // Want GL_LINEAR (or GL_LINEAR_MIPMAP_NEAREST) for min filter, but GL_NEAREST for mag filter. // TODO: Add a gfx_api::sampler_type to handle this case? bilinear, but nearest for mag?
gfx_api::gfxFloat texcoords[] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f };
Expand Down

0 comments on commit d946c8a

Please sign in to comment.