add TextureUnit param to SetTextureWrapping
This commit is contained in:
@@ -517,7 +517,7 @@ void Actor::SetGlobalRenderStates()
|
||||
|
||||
void Actor::SetTextureRenderStates()
|
||||
{
|
||||
DISPLAY->SetTextureWrapping( m_bTextureWrapping );
|
||||
DISPLAY->SetTextureWrapping( TextureUnit_1, m_bTextureWrapping );
|
||||
}
|
||||
|
||||
void Actor::EndDraw()
|
||||
|
||||
@@ -470,7 +470,7 @@ void NoteDisplay::DrawHoldPart( vector<Sprite*> &vpSpr, int iCol, int fYStep, fl
|
||||
DISPLAY->SetTexture( TextureUnit_1, pTexture->GetTexHandle() );
|
||||
DISPLAY->SetBlendMode( spr == vpSpr.begin() ? BLEND_NORMAL : BLEND_ADD );
|
||||
DISPLAY->SetCullMode( CULL_NONE );
|
||||
DISPLAY->SetTextureWrapping( bWrapping );
|
||||
DISPLAY->SetTextureWrapping( TextureUnit_1, bWrapping );
|
||||
queue.Draw();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
virtual int GetNumTextureUnits() = 0;
|
||||
virtual void SetTexture( TextureUnit tu, unsigned iTexture ) = 0;
|
||||
virtual void SetTextureMode( TextureUnit tu, TextureMode tm ) = 0;
|
||||
virtual void SetTextureWrapping( bool b ) = 0;
|
||||
virtual void SetTextureWrapping( TextureUnit tu, bool b ) = 0;
|
||||
virtual int GetMaxTextureSize() const = 0;
|
||||
virtual void SetTextureFiltering( TextureUnit tu, bool b ) = 0;
|
||||
|
||||
|
||||
@@ -1272,14 +1272,14 @@ void RageDisplay_D3D::ClearZBuffer()
|
||||
g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0x00000000 );
|
||||
}
|
||||
|
||||
void RageDisplay_D3D::SetTextureWrapping( bool b )
|
||||
void RageDisplay_D3D::SetTextureWrapping( TextureUnit tu, bool b )
|
||||
{
|
||||
if( g_currentTextureUnit >= (int) g_DeviceCaps.MaxSimultaneousTextures ) // not supported
|
||||
if( tu >= (int) g_DeviceCaps.MaxSimultaneousTextures ) // not supported
|
||||
return;
|
||||
|
||||
int mode = b ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP;
|
||||
g_pd3dDevice->SetTextureStageState( g_currentTextureUnit, D3DTSS_ADDRESSU, mode );
|
||||
g_pd3dDevice->SetTextureStageState( g_currentTextureUnit, D3DTSS_ADDRESSV, mode );
|
||||
g_pd3dDevice->SetTextureStageState( tu, D3DTSS_ADDRESSU, mode );
|
||||
g_pd3dDevice->SetTextureStageState( tu, D3DTSS_ADDRESSV, mode );
|
||||
}
|
||||
|
||||
void RageDisplay_D3D::SetMaterial(
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
int GetNumTextureUnits();
|
||||
void SetTexture( TextureUnit tu, unsigned iTexture );
|
||||
void SetTextureMode( TextureUnit tu, TextureMode tm );
|
||||
void SetTextureWrapping( bool b );
|
||||
void SetTextureWrapping( TextureUnit tu, bool b );
|
||||
int GetMaxTextureSize() const;
|
||||
void SetTextureFiltering( TextureUnit tu, bool b );
|
||||
bool IsZWriteEnabled() const;
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
int GetNumTextureUnits() { return 1; }
|
||||
void SetTexture( TextureUnit tu, unsigned iTexture ) { }
|
||||
void SetTextureMode( TextureUnit tu, TextureMode tm ) { }
|
||||
void SetTextureWrapping( bool b ) { }
|
||||
void SetTextureWrapping( TextureUnit tu, bool b ) { }
|
||||
int GetMaxTextureSize() const { return 2048; }
|
||||
void SetTextureFiltering( TextureUnit tu, bool b ) { }
|
||||
bool IsZWriteEnabled() const { return false; }
|
||||
|
||||
@@ -1533,8 +1533,13 @@ void RageDisplay_OGL::SetZTestMode( ZTestMode mode )
|
||||
}
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetTextureWrapping( bool b )
|
||||
void RageDisplay_OGL::SetTextureWrapping( TextureUnit tu, bool b )
|
||||
{
|
||||
/* This should be per-texture-unit state, but it's per-texture state in OpenGl,
|
||||
* so we'll behave incorrectly if the same texture is used in more than one texture
|
||||
* unit simultaneously with different wrapping. */
|
||||
SetTextureUnit( tu );
|
||||
|
||||
GLenum mode = b ? GL_REPEAT : GL_CLAMP_TO_EDGE;
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, mode );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, mode );
|
||||
@@ -1785,6 +1790,8 @@ unsigned RageDisplay_OGL::CreateTexture(
|
||||
}
|
||||
}
|
||||
|
||||
SetTextureUnit( TextureUnit_1 );
|
||||
|
||||
// allocate OpenGL texture resource
|
||||
unsigned int iTexHandle;
|
||||
glGenTextures( 1, reinterpret_cast<GLuint*>(&iTexHandle) );
|
||||
@@ -1814,7 +1821,7 @@ unsigned RageDisplay_OGL::CreateTexture(
|
||||
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, fLargestSupportedAnisotropy );
|
||||
}
|
||||
|
||||
SetTextureWrapping( false );
|
||||
SetTextureWrapping( TextureUnit_1, false );
|
||||
|
||||
glPixelStorei( GL_UNPACK_ROW_LENGTH, pImg->pitch / pImg->format->BytesPerPixel );
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
int GetNumTextureUnits();
|
||||
void SetTexture( TextureUnit tu, unsigned iTexture );
|
||||
void SetTextureMode( TextureUnit tu, TextureMode tm );
|
||||
void SetTextureWrapping( bool b );
|
||||
void SetTextureWrapping( TextureUnit tu, bool b );
|
||||
int GetMaxTextureSize() const;
|
||||
void SetTextureFiltering( TextureUnit tu, bool b );
|
||||
bool SupportsRenderToTexture() const;
|
||||
|
||||
Reference in New Issue
Block a user