Skip to content

Commit

Permalink
Rename noiseFormat -> fontFormat, etc.
Browse files Browse the repository at this point in the history
Noise textures were removed, but the font atlas used the same
format. Rename the format to match its remaining use.
  • Loading branch information
scurest authored and gonetz committed May 1, 2024
1 parent e226e98 commit ef4441c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
9 changes: 5 additions & 4 deletions src/Graphics/FramebufferTextureFormats.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ namespace graphics {
DatatypeParam lutType;
u32 lutFormatBytes;

InternalColorFormatParam noiseInternalFormat;
ColorFormatParam noiseFormat;
DatatypeParam noiseType;
u32 noiseFormatBytes;
// Used for font atlas
InternalColorFormatParam fontInternalFormat;
ColorFormatParam fontFormat;
DatatypeParam fontType;
u32 fontFormatBytes;

virtual ~FramebufferTextureFormats() {}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ struct FramebufferTextureFormatsGLES2 : public graphics::FramebufferTextureForma
colorFormatBytes = 2;
}

noiseInternalFormat = graphics::internalcolorFormat::LUMINANCE;
noiseFormat = graphics::colorFormat::LUMINANCE;
noiseType = GL_UNSIGNED_BYTE;
noiseFormatBytes = 1;
fontInternalFormat = graphics::internalcolorFormat::LUMINANCE;
fontFormat = graphics::colorFormat::LUMINANCE;
fontType = GL_UNSIGNED_BYTE;
fontFormatBytes = 1;
}
};

Expand Down Expand Up @@ -339,10 +339,10 @@ struct FramebufferTextureFormatsGLES3 : public graphics::FramebufferTextureForma
lutType = GL_UNSIGNED_INT;
lutFormatBytes = 4;

noiseInternalFormat = GL_R8;
noiseFormat = GL_RED;
noiseType = GL_UNSIGNED_BYTE;
noiseFormatBytes = 1;
fontInternalFormat = GL_R8;
fontFormat = GL_RED;
fontType = GL_UNSIGNED_BYTE;
fontFormatBytes = 1;
}
};

Expand Down Expand Up @@ -379,10 +379,10 @@ struct FramebufferTextureFormatsOpenGL : public graphics::FramebufferTextureForm
lutType = GL_UNSIGNED_INT;
lutFormatBytes = 4;

noiseInternalFormat = GL_R8;
noiseFormat = GL_RED;
noiseType = GL_UNSIGNED_BYTE;
noiseFormatBytes = 1;
fontInternalFormat = GL_R8;
fontFormat = GL_RED;
fontType = GL_UNSIGNED_BYTE;
fontFormatBytes = 1;
}
};

Expand Down
8 changes: 4 additions & 4 deletions src/TextDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,16 @@ struct Atlas {
m_pTexture->mirrorT = 0;
m_pTexture->width = w;
m_pTexture->height = h;
m_pTexture->textureBytes = m_pTexture->width * m_pTexture->height * fbTexFormats.noiseFormatBytes;
m_pTexture->textureBytes = m_pTexture->width * m_pTexture->height * fbTexFormats.fontFormatBytes;

Context::InitTextureParams initParams;
initParams.handle = m_pTexture->name;
initParams.textureUnitIndex = textureIndices::Tex[0];
initParams.width = w;
initParams.height = h;
initParams.internalFormat = fbTexFormats.noiseInternalFormat;
initParams.format = fbTexFormats.noiseFormat;
initParams.dataType = fbTexFormats.noiseType;
initParams.internalFormat = fbTexFormats.fontInternalFormat;
initParams.format = fbTexFormats.fontFormat;
initParams.dataType = fbTexFormats.fontType;
gfxContext.init2DTexture(initParams);

Context::TexParameters setParams;
Expand Down

0 comments on commit ef4441c

Please sign in to comment.