diff --git a/standard/inc/StdD3D.h b/standard/inc/StdD3D.h index 0cec7a72d..2dbdb75c0 100644 --- a/standard/inc/StdD3D.h +++ b/standard/inc/StdD3D.h @@ -144,10 +144,8 @@ class CStdD3D : public CStdDDraw bool RestoreDeviceObjects(); // restore device dependent objects bool InvalidateDeviceObjects(); // free device dependent objects bool DeleteDeviceObjects(); // free device dependent objects - bool StoreStateBlock(); void SetTexture(); void ResetTexture(); - bool RestoreStateBlock(); bool DeviceReady() { return !!lpDevice; } BOOL CreateStateBlock(IDirect3DStateBlock9 **pBlock, bool fTransparent, bool fSolid, bool fBaseTex, bool fAdditive, bool fMod2); // capture state blocks for blitting diff --git a/standard/inc/StdDDraw2.h b/standard/inc/StdDDraw2.h index 31f9922b1..364a217fa 100644 --- a/standard/inc/StdDDraw2.h +++ b/standard/inc/StdDDraw2.h @@ -350,10 +350,8 @@ class CStdDDraw void GetZoom(ZoomData *r) { r->Zoom=Zoom; r->X=ZoomX; r->Y=ZoomY; } void ApplyZoom(float & X, float & Y); void RemoveZoom(float & X, float & Y); - virtual bool StoreStateBlock() = 0; virtual void SetTexture() = 0; virtual void ResetTexture() = 0; - virtual bool RestoreStateBlock() = 0; // device objects virtual bool RestoreDeviceObjects() = 0; // restore device dependant objects diff --git a/standard/inc/StdGL.h b/standard/inc/StdGL.h index 3a4b57c4a..a40ff9d9b 100644 --- a/standard/inc/StdGL.h +++ b/standard/inc/StdGL.h @@ -133,10 +133,8 @@ class CStdGL : public CStdDDraw // device objects bool RestoreDeviceObjects(); // restore device dependent objects bool InvalidateDeviceObjects(); // free device dependent objects - bool StoreStateBlock(); void SetTexture(); void ResetTexture(); - bool RestoreStateBlock(); #ifdef _WIN32 bool DeviceReady() { return !!MainCtx.hrc; } #elif defined(USE_X11) diff --git a/standard/inc/StdNoGfx.h b/standard/inc/StdNoGfx.h index ac27ac8d2..40e4c39cb 100644 --- a/standard/inc/StdNoGfx.h +++ b/standard/inc/StdNoGfx.h @@ -44,10 +44,8 @@ public: virtual void PerformPix(SURFACE, float, float, DWORD) { } virtual bool ApplyGammaRamp(D3DGAMMARAMP &, bool ) { return true; } virtual bool SaveDefaultGammaRamp(CStdWindow *) { return true; } - virtual bool StoreStateBlock() { return true; } virtual void SetTexture() { } virtual void ResetTexture() { } - virtual bool RestoreStateBlock() { return true; } virtual bool InitDeviceObjects() { return true; } virtual bool RestoreDeviceObjects() { return true; } virtual bool InvalidateDeviceObjects() { return true; } diff --git a/standard/src/StdD3D.cpp b/standard/src/StdD3D.cpp index ce2d022f3..cc1bdd49d 100644 --- a/standard/src/StdD3D.cpp +++ b/standard/src/StdD3D.cpp @@ -1176,15 +1176,6 @@ BOOL CStdD3D::CreateStateBlock(IDirect3DStateBlock9 **pBlock, bool fTransparent, return lpDevice->EndStateBlock(pBlock) == D3D_OK; } -bool CStdD3D::StoreStateBlock() - { - // FIXME: saving the current state is an expensive operation in D3D9 - return false; - SafeRelease(pSavedState); - if (lpDevice) lpDevice->CreateStateBlock(D3DSBT_ALL, &pSavedState); - return true; - } - void CStdD3D::SetTexture() { } @@ -1194,15 +1185,6 @@ void CStdD3D::ResetTexture() if (Active) lpDevice->SetTexture(0, NULL); } -bool CStdD3D::RestoreStateBlock() - { - // FIXME: saving the current state is an expensive operation in D3D9 - return false; - assert(pSavedState); - if (lpDevice) pSavedState->Apply(); - return true; - } - bool CStdD3D::ApplyGammaRamp(D3DGAMMARAMP &ramp, bool fForce) { if (!lpDevice || (!Active && !fForce)) return false; diff --git a/standard/src/StdDDraw2.cpp b/standard/src/StdDDraw2.cpp index 07a221714..23fbcb125 100644 --- a/standard/src/StdDDraw2.cpp +++ b/standard/src/StdDDraw2.cpp @@ -949,8 +949,6 @@ BOOL CStdDDraw::Blit(SURFACE sfcSource, float fx, float fy, float fwdt, float fh CBltData BltData; // pass down pTransform BltData.pTransform=pTransform; - // store current state - StoreStateBlock(); // blit with basesfc? bool fBaseSfc=false; if (sfcSource->pMainSfc) if (sfcSource->pMainSfc->ppTex) fBaseSfc=true; @@ -964,8 +962,9 @@ BOOL CStdDDraw::Blit(SURFACE sfcSource, float fx, float fy, float fwdt, float fh // calc stretch regarding texture size and indent float scaleX2 = scaleX * iTexSize; float scaleY2 = scaleY * iTexSize; - // blit from all these textures + // Enable textures SetTexture(); + // blit from all these textures for (int iY=iTexY; iY