mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Revert "Remove redundunt glTexParameter calls."
Commit was based on wrong assumption that glTexParameters sets parameter for current texture. Actually it sets parameter for current TMU. glTextureParameter sets parameter per texture, but it is OGL 4.5 This reverts commit 0526d284ef377981cf45bf764dd8c0e7ea571f6e.
This commit is contained in:
parent
43eac44f91
commit
62aa6495ec
20
Textures.cpp
20
Textures.cpp
|
@ -459,8 +459,6 @@ void TextureCache::init()
|
||||||
|
|
||||||
glBindTexture( GL_TEXTURE_2D, m_pDummy->glName );
|
glBindTexture( GL_TEXTURE_2D, m_pDummy->glName );
|
||||||
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, dummyTexture );
|
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, dummyTexture );
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
||||||
|
|
||||||
m_cachedBytes = m_pDummy->textureBytes;
|
m_cachedBytes = m_pDummy->textureBytes;
|
||||||
activateDummy( 0 );
|
activateDummy( 0 );
|
||||||
|
@ -1098,8 +1096,13 @@ u32 _calculateCRC(u32 t, const TextureParams & _params)
|
||||||
return crc;
|
return crc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureCache::_setTextureParameters(CachedTexture *_pTexture)
|
void TextureCache::activateTexture(u32 _t, CachedTexture *_pTexture)
|
||||||
{
|
{
|
||||||
|
glActiveTexture(GL_TEXTURE0 + _t);
|
||||||
|
|
||||||
|
// Bind the cached texture
|
||||||
|
glBindTexture( GL_TEXTURE_2D, _pTexture->glName );
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, _pTexture->max_level);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, _pTexture->max_level);
|
||||||
// Set filter mode. Almost always bilinear, but check anyways
|
// Set filter mode. Almost always bilinear, but check anyways
|
||||||
if ((gDP.otherMode.textureFilter == G_TF_BILERP) || (gDP.otherMode.textureFilter == G_TF_AVERAGE) || ((gSP.objRendermode&G_OBJRM_BILERP) != 0) || (config.texture.forceBilinear)) {
|
if ((gDP.otherMode.textureFilter == G_TF_BILERP) || (gDP.otherMode.textureFilter == G_TF_AVERAGE) || ((gSP.objRendermode&G_OBJRM_BILERP) != 0) || (config.texture.forceBilinear)) {
|
||||||
|
@ -1123,15 +1126,9 @@ void TextureCache::_setTextureParameters(CachedTexture *_pTexture)
|
||||||
|
|
||||||
if (video().getRender().getRenderState() == OGLRender::rsTriangle && config.texture.maxAnisotropyF > 0.0f)
|
if (video().getRender().getRenderState() == OGLRender::rsTriangle && config.texture.maxAnisotropyF > 0.0f)
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, config.texture.maxAnisotropyF);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, config.texture.maxAnisotropyF);
|
||||||
}
|
|
||||||
|
|
||||||
void TextureCache::activateTexture(u32 _t, CachedTexture *_pTexture)
|
|
||||||
{
|
|
||||||
glActiveTexture(GL_TEXTURE0 + _t);
|
|
||||||
_pTexture->lastDList = RSP.DList;
|
_pTexture->lastDList = RSP.DList;
|
||||||
|
|
||||||
// Bind the cached texture
|
|
||||||
glBindTexture( GL_TEXTURE_2D, _pTexture->glName );
|
|
||||||
current[_t] = _pTexture;
|
current[_t] = _pTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1141,7 +1138,8 @@ void TextureCache::activateDummy(u32 _t)
|
||||||
|
|
||||||
glBindTexture( GL_TEXTURE_2D, m_pDummy->glName );
|
glBindTexture( GL_TEXTURE_2D, m_pDummy->glName );
|
||||||
|
|
||||||
current[_t] = m_pDummy;
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
|
||||||
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureCache::_updateBackground()
|
void TextureCache::_updateBackground()
|
||||||
|
@ -1217,7 +1215,6 @@ void TextureCache::_updateBackground()
|
||||||
|
|
||||||
_loadBackground(pCurrent);
|
_loadBackground(pCurrent);
|
||||||
activateTexture(0, pCurrent);
|
activateTexture(0, pCurrent);
|
||||||
_setTextureParameters(pCurrent);
|
|
||||||
|
|
||||||
m_cachedBytes += pCurrent->textureBytes;
|
m_cachedBytes += pCurrent->textureBytes;
|
||||||
current[0] = pCurrent;
|
current[0] = pCurrent;
|
||||||
|
@ -1364,7 +1361,6 @@ void TextureCache::update(u32 _t)
|
||||||
|
|
||||||
_load(_t, pCurrent);
|
_load(_t, pCurrent);
|
||||||
activateTexture( _t, pCurrent );
|
activateTexture( _t, pCurrent );
|
||||||
_setTextureParameters(pCurrent);
|
|
||||||
|
|
||||||
m_cachedBytes += pCurrent->textureBytes;
|
m_cachedBytes += pCurrent->textureBytes;
|
||||||
current[_t] = pCurrent;
|
current[_t] = pCurrent;
|
||||||
|
|
|
@ -74,7 +74,6 @@ private:
|
||||||
|
|
||||||
void _checkCacheSize();
|
void _checkCacheSize();
|
||||||
CachedTexture * _addTexture(u32 _crc32);
|
CachedTexture * _addTexture(u32 _crc32);
|
||||||
void _setTextureParameters(CachedTexture *_pTexture);
|
|
||||||
void _load(u32 _tile, CachedTexture *_pTexture);
|
void _load(u32 _tile, CachedTexture *_pTexture);
|
||||||
bool _loadHiresTexture(u32 _tile, CachedTexture *_pTexture);
|
bool _loadHiresTexture(u32 _tile, CachedTexture *_pTexture);
|
||||||
void _loadBackground(CachedTexture *pTexture);
|
void _loadBackground(CachedTexture *pTexture);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user