Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
92 lines
3.3 KiB
C++
92 lines
3.3 KiB
C++
// WBWaterNormalTexGenPAni1.cpp: implementation of the WBWaterNormalTexGenPAni1 class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#include "./WBWaterNormalTexGenPAni1.h"
|
|
#include "SceneManager.h"
|
|
//////////////////////////////////////////////////////////////////////
|
|
// Construction/Destruction
|
|
//////////////////////////////////////////////////////////////////////
|
|
WBWaterNormalTexGenPAni1::WBWaterNormalTexGenPAni1()
|
|
{
|
|
/* m_pBaseTexture = new WBTexture;
|
|
m_pEnvTexture = new WBTexture;
|
|
m_pNormalTexture = new WBTexture;
|
|
*/
|
|
|
|
char path[256];
|
|
GetCurrentDirectory(256,path);
|
|
sprintf(path,"%s\\Shaders\\WaterAni1.psh",path);
|
|
CreatePixelShaderFromFile(path);
|
|
}
|
|
|
|
WBWaterNormalTexGenPAni1::~WBWaterNormalTexGenPAni1()
|
|
{
|
|
/* if(m_pBaseTexture != NULL)
|
|
{
|
|
delete m_pBaseTexture;
|
|
m_pBaseTexture = NULL;
|
|
|
|
}
|
|
if(m_pEnvTexture != NULL)
|
|
{
|
|
delete m_pEnvTexture;
|
|
m_pEnvTexture = NULL;
|
|
|
|
}
|
|
|
|
if(m_pNormalTexture != NULL)
|
|
{
|
|
delete m_pNormalTexture;
|
|
m_pNormalTexture = NULL;
|
|
}*/
|
|
}
|
|
|
|
void WBWaterNormalTexGenPAni1::Apply() {
|
|
/*
|
|
CSceneManager::GetDevice()->SetTexture(0, m_pBaseTexture->GetTexture() );
|
|
CSceneManager::GetDevice()->SetTexture(1, m_pNormalTexture->GetTexture() );
|
|
CSceneManager::GetDevice()->SetTexture(2, m_pEnvTexture->GetTexture() );
|
|
*/
|
|
|
|
// Set Pixel Shader
|
|
CSceneManager::GetDevice()->SetPixelShader(m_dwPixelShader);
|
|
SetupPixelShaderConstants();
|
|
|
|
}
|
|
void WBWaterNormalTexGenPAni1::SetupPixelShaderConstants() {
|
|
/*CSceneManager::GetDevice()->SetTextureStageState(0,D3DTSS_MAGFILTER,D3DTEXF_LINEAR);
|
|
CSceneManager::GetDevice()->SetTextureStageState(0,D3DTSS_MINFILTER,D3DTEXF_LINEAR);
|
|
CSceneManager::GetDevice()->SetTextureStageState(0,D3DTSS_MIPFILTER,D3DTEXF_LINEAR);
|
|
|
|
|
|
CSceneManager::GetDevice()->SetTextureStageState(1,D3DTSS_MAGFILTER,D3DTEXF_LINEAR);
|
|
CSceneManager::GetDevice()->SetTextureStageState(1,D3DTSS_MINFILTER,D3DTEXF_LINEAR);
|
|
CSceneManager::GetDevice()->SetTextureStageState(1,D3DTSS_MIPFILTER,D3DTEXF_LINEAR);
|
|
|
|
CSceneManager::GetDevice()->SetTextureStageState(3,D3DTSS_MAGFILTER,D3DTEXF_LINEAR);
|
|
CSceneManager::GetDevice()->SetTextureStageState(3,D3DTSS_MINFILTER,D3DTEXF_LINEAR);
|
|
CSceneManager::GetDevice()->SetTextureStageState(3,D3DTSS_MIPFILTER,D3DTEXF_LINEAR);
|
|
|
|
// Base texture stage
|
|
CSceneManager::GetDevice()->SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
|
CSceneManager::GetDevice()->SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
|
CSceneManager::GetDevice()->SetRenderState( D3DRS_WRAP0, 0 );
|
|
|
|
// bump map texture stage
|
|
CSceneManager::GetDevice()->SetTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
|
CSceneManager::GetDevice()->SetTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
|
CSceneManager::GetDevice()->SetRenderState( D3DRS_WRAP1, 0 );
|
|
|
|
// Illumination texture
|
|
CSceneManager::GetDevice()->SetTextureStageState(2, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
|
CSceneManager::GetDevice()->SetTextureStageState(2, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
|
CSceneManager::GetDevice()->SetTextureStageState(2, D3DTSS_ADDRESSW, D3DTADDRESS_CLAMP);
|
|
CSceneManager::GetDevice()->SetRenderState( D3DRS_WRAP2, 0);
|
|
|
|
CSceneManager::GetDevice()->SetTextureStageState(3, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
|
CSceneManager::GetDevice()->SetTextureStageState(3, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
|
CSceneManager::GetDevice()->SetTextureStageState(3, D3DTSS_ADDRESSW, D3DTADDRESS_CLAMP);
|
|
*/
|
|
}
|