Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #347 from q4a/remove-unused
Browse files Browse the repository at this point in the history
Remove unused code
  • Loading branch information
espkk authored Mar 21, 2022
2 parents 2241904 + 58fcb29 commit abdce36
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 139 deletions.
2 changes: 0 additions & 2 deletions src/libs/common/include/dx9render.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ class VDX9RENDER : public SERVICE
virtual void SetLoadTextureEnable(bool bEnable = true) = 0;
virtual IDirect3DBaseTexture9 *GetBaseTexture(int32_t iTexture) = 0;

virtual IDirect3DBaseTexture9 *CreateTextureFromFileInMemory(const char *pFile, uint32_t dwSize) = 0;

virtual bool PushRenderTarget() = 0;
virtual bool PopRenderTarget() = 0;
virtual bool SetRenderTarget(IDirect3DCubeTexture9 *pCubeTex, uint32_t dwFaceType, uint32_t dwLevel,
Expand Down
44 changes: 0 additions & 44 deletions src/libs/renderer/src/s_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,6 @@ DX9RENDER::DX9RENDER()
progressFramesCountX = 8;
progressFramesCountY = 8;

bVideoCapture = false;
bPreparedCapture = false;
iCaptureFrameIndex = 0;

vViewRelationPos = CVECTOR(0.f, 0.f, 0.f);
vWordRelationPos = -vViewRelationPos;
bUseLargeBackBuffer = false;
Expand Down Expand Up @@ -610,14 +606,6 @@ bool DX9RENDER::Init()
if (progressFramesCountY > 64)
progressFramesCountY = 64;

// videocapture section
fFixedFPS = ini->GetFloat("VideoCapture", "FPS", 25);
if (fFixedFPS == 0.0f)
fFixedFPS = 25.0f;
const int32_t iCapBuffers = ini->GetInt("VideoCapture", "Buffers", 0);
for (int32_t i = 0; i < iCapBuffers; i++)
aCaptureBuffers.push_back(new char[sizeof(uint32_t) * screen_size.x * screen_size.y]);

CreateSphere();
auto *pScriptRender = static_cast<VDATA *>(core.GetScriptVariable("Render"));
ATTRIBUTES *pARender = pScriptRender->GetAClass();
Expand All @@ -638,8 +626,6 @@ bool DX9RENDER::Init()
return false;
}

dwCaptureBuffersReady = 0;

uint16_t *pI = &qi[0];
// setup ibuffer
for (int32_t y = 0; y < 31; y++)
Expand Down Expand Up @@ -699,18 +685,6 @@ DX9RENDER::~DX9RENDER()

STORM_DELETE(DX9sphereVertex);
ReleaseDevice();

if (bPreparedCapture)
{
STORM_DELETE(lpbi);
ReleaseDC(static_cast<HWND>(core.GetAppHWND()), hDesktopDC);
DeleteDC(hCaptureDC);
DeleteObject(hCaptureBitmap);
}
for (const auto &buffer : aCaptureBuffers)
delete buffer;

// aCaptureBuffers.DelAllWithPointers();
}

bool DX9RENDER::InitDevice(bool windowed, HWND _hwnd, int32_t width, int32_t height)
Expand Down Expand Up @@ -1293,9 +1267,6 @@ bool DX9RENDER::DX9EndScene()
if (bMakeShoot)
MakeScreenShot();

if (bVideoCapture)
MakeCapture();

const HRESULT hRes = d3d9->Present(nullptr, nullptr, nullptr, nullptr);

if (hRes == D3DERR_DEVICELOST)
Expand Down Expand Up @@ -4470,21 +4441,6 @@ void DX9RENDER::SetLoadTextureEnable(bool bEnable)
bLoadTextureEnabled = bEnable;
}

IDirect3DBaseTexture9 *DX9RENDER::CreateTextureFromFileInMemory(const char *pFile, uint32_t dwSize)
{
if (!pFile || !dwSize)
return nullptr;

IDirect3DTexture9 *pTexture = nullptr;
auto *pTga = (TGA_H *)pFile;
const D3DFORMAT d3dFormat = (pTga->bpp == 16) ? D3DFMT_DXT1 : D3DFMT_DXT3;
D3DXCreateTextureFromFileInMemoryEx(static_cast<LPDIRECT3DDEVICE9>(GetD3DDevice()), pFile, dwSize, D3DX_DEFAULT,
D3DX_DEFAULT, 1, 0, d3dFormat, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0,
nullptr, nullptr, &pTexture);

return pTexture;
}

IDirect3DVolumeTexture9 *DX9RENDER::CreateVolumeTexture(uint32_t Width, uint32_t Height, uint32_t Depth,
uint32_t Levels, uint32_t Usage, D3DFORMAT Format, D3DPOOL Pool)
{
Expand Down
17 changes: 0 additions & 17 deletions src/libs/renderer/src/s_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,6 @@ class DX9RENDER : public VDX9RENDER
const char *pTechniqueName = "DXVector") override;
IDirect3DBaseTexture9 *GetBaseTexture(int32_t iTexture) override;

IDirect3DBaseTexture9 *CreateTextureFromFileInMemory(const char *pFile, uint32_t dwSize) override;

bool PushRenderTarget() override;
bool PopRenderTarget() override;
bool SetRenderTarget(IDirect3DCubeTexture9 *pCubeTex, uint32_t dwFaceType, uint32_t dwLevel,
Expand Down Expand Up @@ -485,17 +483,6 @@ class DX9RENDER : public VDX9RENDER
bool MakeAvi;
IDirect3DSurface9 *ImageBuffer;

// VideoCapture section
HDC hDesktopDC, hCaptureDC;
HBITMAP hCaptureBitmap;
LPBITMAPINFO lpbi;
int32_t iCaptureFrameIndex;
bool bPreparedCapture;
bool bVideoCapture;
float fFixedFPS;
std::vector<char *> aCaptureBuffers;
uint32_t dwCaptureBuffersReady;

//-------- post process

struct QuadVertex
Expand Down Expand Up @@ -598,8 +585,4 @@ class DX9RENDER : public VDX9RENDER

bool TextureLoad(int32_t texid);
bool TextureLoadUsingD3DX(const char *path, int32_t texid);

bool MakeCapture();
void SaveCaptureBuffers();
void PrepareCapture();
};
76 changes: 0 additions & 76 deletions src/libs/renderer/src/screenshot.cpp

This file was deleted.

0 comments on commit abdce36

Please sign in to comment.