From 6f39bdd045bdb899f2e89001ecf2bda80b3ac2a0 Mon Sep 17 00:00:00 2001 From: XProger Date: Thu, 18 Oct 2018 06:26:27 +0300 Subject: [PATCH] update d3d9 version --- src/cache.h | 5 ----- src/gapi_d3d9.h | 5 +++-- src/texture.h | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/cache.h b/src/cache.h index 935a9b6..d052fc2 100644 --- a/src/cache.h +++ b/src/cache.h @@ -770,12 +770,7 @@ struct WaterCache { Core::setBlendMode(bmAdd); Core::setCullMode(cmBack); Core::setDepthWrite(false); - //Core::setDepthTest(false); - //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - //game->getMesh()->renderBox(); game->getMesh()->renderWaterVolume(item.to); - //glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - //Core::setDepthTest(true); Core::setDepthWrite(true); Core::setCullMode(cmFront); Core::setBlendMode(bmNone); diff --git a/src/gapi_d3d9.h b/src/gapi_d3d9.h index bfe8650..b9c3371 100644 --- a/src/gapi_d3d9.h +++ b/src/gapi_d3d9.h @@ -226,6 +226,7 @@ namespace GAPI { int bpp; D3DFORMAT format; } formats[FMT_MAX] = { + { 8, D3DFMT_L8 }, { 32, D3DFMT_A8R8G8B8 }, { 16, D3DFMT_R5G6B5 }, { 16, D3DFMT_A1R5G5B5 }, @@ -296,8 +297,8 @@ namespace GAPI { bool mipmaps = (Core::settings.detail.filter > Core::Settings::MEDIUM) && (opt & OPT_MIPMAPS); bool aniso = filter && mipmaps && (Core::support.maxAniso > 0); - device->SetSamplerState(sampler, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP); - device->SetSamplerState(sampler, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP); + device->SetSamplerState(sampler, D3DSAMP_ADDRESSU, (opt & OPT_REPEAT) ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP); + device->SetSamplerState(sampler, D3DSAMP_ADDRESSV, (opt & OPT_REPEAT) ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP); if (aniso) { device->SetSamplerState(sampler, D3DSAMP_MINFILTER, D3DTEXF_ANISOTROPIC); diff --git a/src/texture.h b/src/texture.h index 48b635c..9c51f2b 100644 --- a/src/texture.h +++ b/src/texture.h @@ -55,7 +55,7 @@ struct Texture : GAPI::Texture { } #endif -#ifdef _DEBUG +#if defined(_DEBUG) && defined(_OS_WIN) && defined(_GAPI_GL) void dump(const char *fileName) { bind(0); int size = width *height * 4;