gsdx-ogl: use countof macro instead to hardcode the size

This commit is contained in:
Gregory Hainaut 2015-04-25 13:06:02 +02:00
parent 47a0026b60
commit 00e62919c5
2 changed files with 6 additions and 6 deletions

View File

@ -106,10 +106,10 @@ namespace GLState {
rt = 0; rt = 0;
ds = 0; ds = 0;
for (int i = 0; i < 4; i++) { for (size_t i = 0; i < countof(tex_unit); i++)
tex_unit[i] = 0; tex_unit[i] = 0;
for (size_t i = 0; i < countof(tex_handle); i++)
tex_handle[i] = 0; tex_handle[i] = 0;
}
ps = 0; ps = 0;
gs = 0; gs = 0;

View File

@ -263,10 +263,10 @@ GSTextureOGL::~GSTextureOGL()
GLState::rt = 0; GLState::rt = 0;
if (m_texture_id == GLState::ds) if (m_texture_id == GLState::ds)
GLState::ds = 0; GLState::ds = 0;
if (m_texture_id == GLState::tex_unit[0]) for (size_t i = 0; i < countof(GLState::tex_unit); i++) {
GLState::tex_unit[0] = 0; if (m_texture_id == GLState::tex_unit[i])
if (m_texture_id == GLState::tex_unit[1]) GLState::tex_unit[i] = 0;
GLState::tex_unit[1] = 0; }
gl_DeleteBuffers(1, &m_pbo_id); gl_DeleteBuffers(1, &m_pbo_id);
glDeleteTextures(1, &m_texture_id); glDeleteTextures(1, &m_texture_id);