Skip to content

Commit 09b370c

Browse files
committed
add CCS-specific scrshooter behavior
1 parent 8b1e3d7 commit 09b370c

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/libs/xinterface/src/scr_shoter/scr_shoter.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include "core.h"
55
#include "string_compare.hpp"
66

7-
#define SS_TEXTURE_WIDTH 128
8-
#define SS_TEXTURE_HEIGHT 128
7+
#define SS_TEXTURE_WIDTH 256
8+
#define SS_TEXTURE_HEIGHT 256
99
#define SS_TEXTURE_FONECOLOR 0xFF000000
1010

1111
uint32_t GetA8R8G8B8_FromFMT(void *p, uint32_t fmt)
@@ -122,8 +122,7 @@ bool SCRSHOTER::MakeScreenShot()
122122
// create a new screen shot
123123
if (hr == D3D_OK)
124124
{
125-
textureIndex_ =
126-
rs->TextureCreate(SS_TEXTURE_WIDTH, SS_TEXTURE_HEIGHT, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED);
125+
textureIndex_ = rs->TextureCreate(SS_TEXTURE_WIDTH, SS_TEXTURE_HEIGHT, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED);
127126
texture_ = static_cast<IDirect3DTexture9 *>(rs->GetTextureFromID(textureIndex_));
128127
}
129128

@@ -168,9 +167,9 @@ bool SCRSHOTER::MakeScreenShot()
168167
pRenderTarg->Release();
169168

170169
// Add a texture with a frame to the shot
171-
const int nTextureID = rs->TextureCreate("interfaces\\EmptyBorder.tga");
172-
if (nTextureID >= 0)
173-
{
170+
//const int nTextureID = core.GetTargetEngineVersion() >= storm::ENGINE_VERSION::TO_EACH_HIS_OWN ? -1 : rs->TextureCreate("interfaces\\EmptyBorder.tga");
171+
const int nTextureID = -1;
172+
174173
IDirect3DTexture9 *pScrShotTex = nullptr;
175174
if (D3D_OK == rs->CreateTexture(SS_TEXTURE_WIDTH, SS_TEXTURE_HEIGHT, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8,
176175
D3DPOOL_DEFAULT, &pScrShotTex))
@@ -208,9 +207,12 @@ bool SCRSHOTER::MakeScreenShot()
208207
rs->TextureSet(0, textureIndex_);
209208
rs->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, BI_SCRSHOTER_VERTEX_FORMAT, 2, vert,
210209
sizeof(BI_SCRSHOTER_VERTEX), "battle_icons");
210+
if (nTextureID >= 0)
211+
{
211212
rs->TextureSet(0, nTextureID);
212213
rs->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, BI_SCRSHOTER_VERTEX_FORMAT, 2, vert,
213214
sizeof(BI_SCRSHOTER_VERTEX), "battle_icons");
215+
}
214216
rs->SetRenderTarget(pOldRenderTarg, pStencil);
215217
}
216218
if (pRenderTarg)
@@ -232,8 +234,7 @@ bool SCRSHOTER::MakeScreenShot()
232234
rs->Release(pScrShotTex);
233235
}
234236

235-
rs->TextureRelease(nTextureID);
236-
}
237+
if (nTextureID >= 0) rs->TextureRelease(nTextureID);
237238

238239
return hr == D3D_OK;
239240
}

0 commit comments

Comments
 (0)