Skip to content

Commit

Permalink
fixed a few clang format issues and missed variable renames in window…
Browse files Browse the repository at this point in the history
…s code
  • Loading branch information
Katana-Steel committed Mar 28, 2023
1 parent 8460982 commit 2701c87
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions runtime/render_a/src/sys/d3d/d3d_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#include "d3d_shell.h"
#include "colorops.h"
#include "rendererframestats.h"
#include <windows_base.h>
#include <d3d9types.h>


// Globals.
Expand Down Expand Up @@ -370,6 +368,7 @@ struct tex {
uint32 iDstLvl;
TextureMipData *pSrcMip;
D3DFORMAT D3DSrcFormat;
CTextureManager *ctm;
};

struct cube_tex : public tex {
Expand All @@ -390,13 +389,13 @@ HRESULT copyCubeTexture(const cube_tex& t )
SrcRect.right = t.pSrcMip->m_Width;
SrcRect.bottom = t.pSrcMip->m_Height;
#ifdef _WINDOWS
uint32 SrcPitch = GetPitch(t.D3DSrcFormat,t.pSrcMip->m_Width);
uint32 SrcPitch = t.ctm->GetPitch(t.D3DSrcFormat,t.pSrcMip->m_Width);
LPDIRECT3DSURFACE9 pDstSurface = nullptr;
t.pD3DDstTexture->GetCubeMapSurface(t.i,t.iDstLvl,&pDstSurface);
if (!pDstSurface)
return S_FALSE;
HRESULT hResult;
LT_MEM_TRACK_ALLOC(hResult = D3DXLoadSurfaceFromMemory(pDstSurface,NULL,NULL,pSrcData,t.D3DSrcFormat,SrcPitch,NULL,&t.SrcRect,D3DX_FILTER_NONE,0), LT_MEM_TYPE_RENDERER);
LT_MEM_TRACK_ALLOC(hResult = D3DXLoadSurfaceFromMemory(pDstSurface,NULL,NULL,pSrcData,t.D3DSrcFormat,SrcPitch,NULL,&SrcRect,D3DX_FILTER_NONE,0), LT_MEM_TYPE_RENDERER);

pDstSurface->Release();
return hResult;
Expand All @@ -418,14 +417,14 @@ HRESULT copyNormalTexture(const norm_tex& t)
SrcRect.right = t.pSrcMip->m_Width;
SrcRect.bottom = t.pSrcMip->m_Height;
#ifdef _WINDOWS
uint32 SrcPitch = GetPitch(t.D3DSrcFormat,t.pSrcMip->m_Width);
uint32 SrcPitch = t.ctm->GetPitch(t.D3DSrcFormat,t.pSrcMip->m_Width);
LPDIRECT3DSURFACE9 pDstSurface = nullptr;
t.pD3DDstTexture->GetSurfaceLevel(t.iDstLvl,&pDstSurface);
if (!pDstSurface)
return S_FALSE;

HRESULT hResult;
LT_MEM_TRACK_ALLOC(hResult = D3DXLoadSurfaceFromMemory(pDstSurface,NULL,NULL,pSrcData,t.D3DSrcFormat,SrcPitch,NULL,&t.SrcRect,D3DX_FILTER_NONE,0), LT_MEM_TYPE_RENDERER);
LT_MEM_TRACK_ALLOC(hResult = D3DXLoadSurfaceFromMemory(pDstSurface,NULL,NULL,pSrcData,t.D3DSrcFormat,SrcPitch,NULL,&SrcRect,D3DX_FILTER_NONE,0), LT_MEM_TYPE_RENDERER);

pDstSurface->Release();
return hResult;
Expand All @@ -447,7 +446,8 @@ bool CTextureManager::UploadRTexture(TextureData* pSrcTexture, uint32 iSrcLvl, R
iSrcLvl,
iDstLvl,
&pSrcTexture->m_Mips[iSrcLvl],
QueryDDFormat1(pSrcTexture->m_Header.GetBPPIdent(), pSrcTexture->m_Header.m_IFlags)
QueryDDFormat1(pSrcTexture->m_Header.GetBPPIdent(), pSrcTexture->m_Header.m_IFlags),
this
};

if (pDstTexture->IsCubeMap())
Expand Down

0 comments on commit 2701c87

Please sign in to comment.