Commit 3b9e1eab by Nicolas Capens

Fix D3D8, D3D9, and GL builds.

Bug swiftshader:63 Bug swiftshader:31 Change-Id: I59d08cbc8379e2c30984b9ec0ed4d49317633ce8 Reviewed-on: https://swiftshader-review.googlesource.com/10048Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent fc2b84d5
...@@ -30,27 +30,27 @@ namespace D3D8 ...@@ -30,27 +30,27 @@ namespace D3D8
public: public:
Direct3D8(int version, const HINSTANCE instance); Direct3D8(int version, const HINSTANCE instance);
virtual ~Direct3D8(); ~Direct3D8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3D8 methods // IDirect3D8 methods
long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat); long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat) override;
long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapaterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat); long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapaterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat) override;
long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType); long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType) override;
long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed); long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed) override;
long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice8 **returnedDeviceInterface); long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice8 **returnedDeviceInterface) override;
long __stdcall EnumAdapterModes(unsigned int adapter, unsigned int index, D3DDISPLAYMODE *mode); long __stdcall EnumAdapterModes(unsigned int adapter, unsigned int index, D3DDISPLAYMODE *mode) override;
unsigned int __stdcall GetAdapterCount(); unsigned int __stdcall GetAdapterCount() override;
long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode); long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode) override;
long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER8 *identifier); long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER8 *identifier) override;
unsigned int __stdcall GetAdapterModeCount(unsigned int adapter); unsigned int __stdcall GetAdapterModeCount(unsigned int adapter) override;
HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter); HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter) override;
long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS8 *caps); long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS8 *caps) override;
long __stdcall RegisterSoftwareDevice(void *initializeFunction); long __stdcall RegisterSoftwareDevice(void *initializeFunction) override;
private: private:
void loadSystemD3D8(); void loadSystemD3D8();
......
...@@ -135,7 +135,7 @@ namespace D3D8 ...@@ -135,7 +135,7 @@ namespace D3D8
return LOD; return LOD;
} }
long Direct3DBaseTexture8::SetLOD(long newLOD) unsigned long Direct3DBaseTexture8::SetLOD(unsigned long newLOD)
{ {
TRACE(""); TRACE("");
......
...@@ -31,27 +31,27 @@ namespace D3D8 ...@@ -31,27 +31,27 @@ namespace D3D8
public: public:
Direct3DBaseTexture8(Direct3DDevice8 *device, D3DRESOURCETYPE type, unsigned long levels, unsigned long usage); Direct3DBaseTexture8(Direct3DDevice8 *device, D3DRESOURCETYPE type, unsigned long levels, unsigned long usage);
virtual ~Direct3DBaseTexture8(); ~Direct3DBaseTexture8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource8 methods // IDirect3DResource8 methods
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetDevice(IDirect3DDevice8 **device); long __stdcall GetDevice(IDirect3DDevice8 **device) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture8 methods // IDirect3DBaseTexture8 methods
unsigned long __stdcall GetLevelCount(); unsigned long __stdcall GetLevelCount() override;
unsigned long __stdcall GetLOD(); unsigned long __stdcall GetLOD() override;
long __stdcall SetLOD(long newLOD); unsigned long __stdcall SetLOD(unsigned long newLOD) override;
// Intenal methods // Intenal methods
sw::Resource *getResource() const; sw::Resource *getResource() const;
......
...@@ -30,34 +30,34 @@ namespace D3D8 ...@@ -30,34 +30,34 @@ namespace D3D8
public: public:
Direct3DCubeTexture8(Direct3DDevice8 *device, unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool); Direct3DCubeTexture8(Direct3DDevice8 *device, unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
virtual ~Direct3DCubeTexture8(); ~Direct3DCubeTexture8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource8 methods // IDirect3DResource8 methods
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetDevice(IDirect3DDevice8 **device); long __stdcall GetDevice(IDirect3DDevice8 **device) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture methods // IDirect3DBaseTexture methods
unsigned long __stdcall GetLevelCount(); unsigned long __stdcall GetLevelCount() override;
unsigned long __stdcall GetLOD(); unsigned long __stdcall GetLOD() override;
unsigned long __stdcall SetLOD(unsigned long newLOD); unsigned long __stdcall SetLOD(unsigned long newLOD) override;
// IDirect3DCubeTexture8 methods // IDirect3DCubeTexture8 methods
long __stdcall AddDirtyRect(D3DCUBEMAP_FACES face, const RECT *dirtyRect); long __stdcall AddDirtyRect(D3DCUBEMAP_FACES face, const RECT *dirtyRect) override;
long __stdcall GetCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level , IDirect3DSurface8 **cubeMapSurface); long __stdcall GetCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level , IDirect3DSurface8 **cubeMapSurface) override;
long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description); long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description) override;
long __stdcall LockRect(D3DCUBEMAP_FACES face, unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags); long __stdcall LockRect(D3DCUBEMAP_FACES face, unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags) override;
long __stdcall UnlockRect(D3DCUBEMAP_FACES face, unsigned int level); long __stdcall UnlockRect(D3DCUBEMAP_FACES face, unsigned int level) override;
// Internal methods // Internal methods
Direct3DSurface8 *getInternalCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level); Direct3DSurface8 *getInternalCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level);
......
...@@ -81,7 +81,7 @@ namespace D3D8 ...@@ -81,7 +81,7 @@ namespace D3D8
pixelShaderHandle = 0; pixelShaderHandle = 0;
lightsDirty = true; lightsDirty = true;
for(int i = 0; i < 16; i++) for(int i = 0; i < 16; i++)
{ {
dataStream[i] = 0; dataStream[i] = 0;
...@@ -176,13 +176,13 @@ namespace D3D8 ...@@ -176,13 +176,13 @@ namespace D3D8
swapChain[i] = 0; swapChain[i] = 0;
} }
} }
if(depthStencil) if(depthStencil)
{ {
depthStencil->unbind(); depthStencil->unbind();
depthStencil = 0; depthStencil = 0;
} }
if(renderTarget) if(renderTarget)
{ {
renderTarget->unbind(); renderTarget->unbind();
...@@ -270,7 +270,7 @@ namespace D3D8 ...@@ -270,7 +270,7 @@ namespace D3D8
return Unknown::AddRef(); return Unknown::AddRef();
} }
unsigned long Direct3DDevice8::Release() unsigned long Direct3DDevice8::Release()
{ {
TRACE(""); TRACE("");
...@@ -311,7 +311,7 @@ namespace D3D8 ...@@ -311,7 +311,7 @@ namespace D3D8
TRACE(""); TRACE("");
stateRecorder[token]->Capture(); stateRecorder[token]->Capture();
return D3D_OK; return D3D_OK;
} }
...@@ -488,7 +488,7 @@ namespace D3D8 ...@@ -488,7 +488,7 @@ namespace D3D8
sourceSurface->UnlockRect(); sourceSurface->UnlockRect();
destinationSurface->UnlockRect(); destinationSurface->UnlockRect();
} }
return D3D_OK; return D3D_OK;
} }
...@@ -678,7 +678,7 @@ namespace D3D8 ...@@ -678,7 +678,7 @@ namespace D3D8
pixelShader[index]->AddRef(); pixelShader[index]->AddRef();
*handle = index; *handle = index;
return D3D_OK; return D3D_OK;
} }
...@@ -708,7 +708,7 @@ namespace D3D8 ...@@ -708,7 +708,7 @@ namespace D3D8
} }
(*surface)->AddRef(); (*surface)->AddRef();
return D3D_OK; return D3D_OK;
} }
...@@ -778,7 +778,7 @@ namespace D3D8 ...@@ -778,7 +778,7 @@ namespace D3D8
} }
(*vertexBuffer)->AddRef(); (*vertexBuffer)->AddRef();
return D3D_OK; return D3D_OK;
} }
...@@ -865,7 +865,7 @@ namespace D3D8 ...@@ -865,7 +865,7 @@ namespace D3D8
stateRecorder[token]->unbind(); stateRecorder[token]->unbind();
stateRecorder[token] = 0; stateRecorder[token] = 0;
return D3D_OK; return D3D_OK;
} }
...@@ -936,7 +936,7 @@ namespace D3D8 ...@@ -936,7 +936,7 @@ namespace D3D8
bindData(indexData, baseVertexIndex); bindData(indexData, baseVertexIndex);
renderer->draw(drawType, indexOffset, primitiveCount); renderer->draw(drawType, indexOffset, primitiveCount);
return D3D_OK; return D3D_OK;
} }
...@@ -965,7 +965,7 @@ namespace D3D8 ...@@ -965,7 +965,7 @@ namespace D3D8
} }
int length = (minIndex + numVertices) * vertexStreamZeroStride; int length = (minIndex + numVertices) * vertexStreamZeroStride;
Direct3DVertexBuffer8 *vertexBuffer = new Direct3DVertexBuffer8(this, length, 0, 0, D3DPOOL_DEFAULT); Direct3DVertexBuffer8 *vertexBuffer = new Direct3DVertexBuffer8(this, length, 0, 0, D3DPOOL_DEFAULT);
unsigned char *data; unsigned char *data;
...@@ -1098,7 +1098,7 @@ namespace D3D8 ...@@ -1098,7 +1098,7 @@ namespace D3D8
length *= vertexStreamZeroStride; length *= vertexStreamZeroStride;
CreateVertexBuffer(length, 0, 0, D3DPOOL_DEFAULT, &vertexBuffer); CreateVertexBuffer(length, 0, 0, D3DPOOL_DEFAULT, &vertexBuffer);
unsigned char *data; unsigned char *data;
vertexBuffer->Lock(0, 0, &data, 0); vertexBuffer->Lock(0, 0, &data, 0);
memcpy(data, vertexStreamZeroData, length); memcpy(data, vertexStreamZeroData, length);
...@@ -1131,7 +1131,7 @@ namespace D3D8 ...@@ -1131,7 +1131,7 @@ namespace D3D8
SetStreamSource(0, 0, 0); SetStreamSource(0, 0, 0);
vertexBuffer->Release(); vertexBuffer->Release();
return D3D_OK; return D3D_OK;
} }
...@@ -1344,7 +1344,7 @@ namespace D3D8 ...@@ -1344,7 +1344,7 @@ namespace D3D8
swapChain[0]->screenshot(description.pBits); swapChain[0]->screenshot(description.pBits);
destSurface->UnlockRect(); destSurface->UnlockRect();
return D3D_OK; return D3D_OK;
} }
...@@ -1401,7 +1401,7 @@ namespace D3D8 ...@@ -1401,7 +1401,7 @@ namespace D3D8
case 6: UNIMPLEMENTED(); // FIXME: D3DDEVINFOID_D3DVERTEXSTATS case 6: UNIMPLEMENTED(); // FIXME: D3DDEVINFOID_D3DVERTEXSTATS
case 7: return E_FAIL; case 7: return E_FAIL;
} }
return D3D_OK; return D3D_OK;
} }
...@@ -1561,7 +1561,7 @@ namespace D3D8 ...@@ -1561,7 +1561,7 @@ namespace D3D8
*renderTarget = this->renderTarget; *renderTarget = this->renderTarget;
this->renderTarget->AddRef(); this->renderTarget->AddRef();
return D3D_OK; return D3D_OK;
} }
...@@ -1575,7 +1575,7 @@ namespace D3D8 ...@@ -1575,7 +1575,7 @@ namespace D3D8
} }
*streamData = dataStream[streamNumber]; *streamData = dataStream[streamNumber];
if(dataStream[streamNumber]) if(dataStream[streamNumber])
{ {
dataStream[streamNumber]->AddRef(); dataStream[streamNumber]->AddRef();
...@@ -1596,7 +1596,7 @@ namespace D3D8 ...@@ -1596,7 +1596,7 @@ namespace D3D8
} }
*texture = this->texture[stage]; *texture = this->texture[stage];
if(this->texture[stage]) if(this->texture[stage])
{ {
this->texture[stage]->AddRef(); this->texture[stage]->AddRef();
...@@ -1739,7 +1739,7 @@ namespace D3D8 ...@@ -1739,7 +1739,7 @@ namespace D3D8
light.Direction.y = 0; light.Direction.y = 0;
light.Direction.z = 1; light.Direction.z = 1;
light.Range = 0; light.Range = 0;
light.Falloff = 0; light.Falloff = 0;
light.Attenuation0 = 0; light.Attenuation0 = 0;
light.Attenuation1 = 0; light.Attenuation1 = 0;
light.Attenuation2 = 0; light.Attenuation2 = 0;
...@@ -1879,13 +1879,13 @@ namespace D3D8 ...@@ -1879,13 +1879,13 @@ namespace D3D8
swapChain[0]->unbind(); swapChain[0]->unbind();
swapChain[0] = 0; swapChain[0] = 0;
} }
if(depthStencil) if(depthStencil)
{ {
depthStencil->unbind(); depthStencil->unbind();
depthStencil = 0; depthStencil = 0;
} }
if(renderTarget) if(renderTarget)
{ {
renderTarget->unbind(); renderTarget->unbind();
...@@ -2047,7 +2047,7 @@ namespace D3D8 ...@@ -2047,7 +2047,7 @@ namespace D3D8
delete cursor; delete cursor;
showCursor = false; showCursor = false;
return D3D_OK; return D3D_OK;
} }
long Direct3DDevice8::ResourceManagerDiscardBytes(unsigned long bytes) long Direct3DDevice8::ResourceManagerDiscardBytes(unsigned long bytes)
...@@ -2133,11 +2133,6 @@ namespace D3D8 ...@@ -2133,11 +2133,6 @@ namespace D3D8
sw::FrameBuffer::setCursorPosition(point.x, point.y); sw::FrameBuffer::setCursorPosition(point.x, point.y);
} }
void Direct3DDevice8::SetCursorPosition(unsigned int x, unsigned int y, unsigned long flags)
{
SetCursorPosition((int)x, (int)y, flags);
}
long Direct3DDevice8::SetCursorProperties(unsigned int x0, unsigned int y0, IDirect3DSurface8 *cursorBitmap) long Direct3DDevice8::SetCursorProperties(unsigned int x0, unsigned int y0, IDirect3DSurface8 *cursorBitmap)
{ {
TRACE(""); TRACE("");
...@@ -2154,7 +2149,7 @@ namespace D3D8 ...@@ -2154,7 +2149,7 @@ namespace D3D8
cursorBitmap->LockRect(&lock, 0, 0); cursorBitmap->LockRect(&lock, 0, 0);
delete cursor; delete cursor;
cursor = new sw::Surface(0, desc.Width, desc.Height, 1, sw::FORMAT_A8R8G8B8, false, false); cursor = sw::Surface::create(0, desc.Width, desc.Height, 1, sw::FORMAT_A8R8G8B8, false, false);
void *buffer = cursor->lockExternal(0, 0, 0, sw::LOCK_DISCARD, sw::PUBLIC); void *buffer = cursor->lockExternal(0, 0, 0, sw::LOCK_DISCARD, sw::PUBLIC);
memcpy(buffer, lock.pBits, desc.Width * desc.Height * sizeof(unsigned int)); memcpy(buffer, lock.pBits, desc.Width * desc.Height * sizeof(unsigned int));
...@@ -2179,7 +2174,7 @@ namespace D3D8 ...@@ -2179,7 +2174,7 @@ namespace D3D8
} }
swapChain[0]->setGammaRamp((sw::GammaRamp*)ramp, flags & D3DSGR_CALIBRATE); swapChain[0]->setGammaRamp((sw::GammaRamp*)ramp, flags & D3DSGR_CALIBRATE);
return; return;
} }
...@@ -2333,7 +2328,7 @@ namespace D3D8 ...@@ -2333,7 +2328,7 @@ namespace D3D8
renderState[state] = value; renderState[state] = value;
switch(state) switch(state)
{ {
case D3DRS_ZENABLE: case D3DRS_ZENABLE:
switch(value) switch(value)
{ {
...@@ -2488,7 +2483,7 @@ namespace D3D8 ...@@ -2488,7 +2483,7 @@ namespace D3D8
ASSERT(false); ASSERT(false);
} }
break; break;
case D3DRS_CULLMODE: case D3DRS_CULLMODE:
switch(value) switch(value)
{ {
case D3DCULL_NONE: case D3DCULL_NONE:
...@@ -3098,10 +3093,10 @@ namespace D3D8 ...@@ -3098,10 +3093,10 @@ namespace D3D8
{ {
stateRecorder.back()->setStreamSource(stream, vertexBuffer, stride); stateRecorder.back()->setStreamSource(stream, vertexBuffer, stride);
} }
return D3D_OK; return D3D_OK;
} }
long Direct3DDevice8::SetTexture(unsigned long stage, IDirect3DBaseTexture8 *iBaseTexture) long Direct3DDevice8::SetTexture(unsigned long stage, IDirect3DBaseTexture8 *iBaseTexture)
{ {
TRACE(""); TRACE("");
...@@ -3301,7 +3296,7 @@ namespace D3D8 ...@@ -3301,7 +3296,7 @@ namespace D3D8
renderer->setSecondArgument(stage, sw::TextureStage::SOURCE_TEXTURE); renderer->setSecondArgument(stage, sw::TextureStage::SOURCE_TEXTURE);
break; break;
case D3DTA_TFACTOR: case D3DTA_TFACTOR:
renderer->setSecondArgument(stage, sw::TextureStage::SOURCE_TFACTOR); renderer->setSecondArgument(stage, sw::TextureStage::SOURCE_TFACTOR);
break; break;
case D3DTA_SPECULAR: case D3DTA_SPECULAR:
renderer->setSecondArgument(stage, sw::TextureStage::SOURCE_SPECULAR); renderer->setSecondArgument(stage, sw::TextureStage::SOURCE_SPECULAR);
...@@ -3928,14 +3923,14 @@ namespace D3D8 ...@@ -3928,14 +3923,14 @@ namespace D3D8
Direct3DVertexShader8 *shader = vertexShader[index]; Direct3DVertexShader8 *shader = vertexShader[index];
renderer->setVertexShader(shader->getVertexShader()); renderer->setVertexShader(shader->getVertexShader());
declaration = shader->getDeclaration(); declaration = shader->getDeclaration();
FVF = 0; FVF = 0;
} }
else else
{ {
renderer->setVertexShader(0); renderer->setVertexShader(0);
declaration = 0; declaration = 0;
FVF = handle; FVF = handle;
} }
} }
...@@ -3993,7 +3988,7 @@ namespace D3D8 ...@@ -3993,7 +3988,7 @@ namespace D3D8
{ {
stateRecorder.back()->setViewport(viewport); stateRecorder.back()->setViewport(viewport);
} }
return D3D_OK; return D3D_OK;
} }
...@@ -4160,7 +4155,7 @@ namespace D3D8 ...@@ -4160,7 +4155,7 @@ namespace D3D8
RECT sRect; RECT sRect;
RECT dRect; RECT dRect;
if(sourceRect && destPoint) if(sourceRect && destPoint)
{ {
sRect.left = sourceRect->left; sRect.left = sourceRect->left;
...@@ -4237,14 +4232,14 @@ namespace D3D8 ...@@ -4237,14 +4232,14 @@ namespace D3D8
for(unsigned int y = 0; y < height; y++) for(unsigned int y = 0; y < height; y++)
{ {
memcpy(destinationLock.pBits, sourceLock.pBits, bytes); memcpy(destinationLock.pBits, sourceLock.pBits, bytes);
(byte*&)sourceLock.pBits += sourceLock.Pitch; (byte*&)sourceLock.pBits += sourceLock.Pitch;
(byte*&)destinationLock.pBits += destinationLock.Pitch; (byte*&)destinationLock.pBits += destinationLock.Pitch;
} }
sourceSurface->UnlockRect(); sourceSurface->UnlockRect();
destinationSurface->UnlockRect(); destinationSurface->UnlockRect();
return D3D_OK; return D3D_OK;
} }
...@@ -4296,7 +4291,7 @@ namespace D3D8 ...@@ -4296,7 +4291,7 @@ namespace D3D8
if(FVF & D3DFVF_PSIZE) stride += 4; if(FVF & D3DFVF_PSIZE) stride += 4;
if(FVF & D3DFVF_DIFFUSE) stride += 4; if(FVF & D3DFVF_DIFFUSE) stride += 4;
if(FVF & D3DFVF_SPECULAR) stride += 4; if(FVF & D3DFVF_SPECULAR) stride += 4;
switch((FVF & D3DFVF_TEXCOUNT_MASK) >> D3DFVF_TEXCOUNT_SHIFT) switch((FVF & D3DFVF_TEXCOUNT_MASK) >> D3DFVF_TEXCOUNT_SHIFT)
{ {
case 8: stride += 4 + 4 * ((1 + (FVF >> 30)) % 4); case 8: stride += 4 + 4 * ((1 + (FVF >> 30)) % 4);
...@@ -4428,25 +4423,25 @@ namespace D3D8 ...@@ -4428,25 +4423,25 @@ namespace D3D8
{ {
renderer->setInputStream(sw::BlendIndices, attribute.define((char*&)buffer - 4, sw::STREAMTYPE_INDICES, 1)); renderer->setInputStream(sw::BlendIndices, attribute.define((char*&)buffer - 4, sw::STREAMTYPE_INDICES, 1));
} }
if(FVF & D3DFVF_NORMAL) if(FVF & D3DFVF_NORMAL)
{ {
renderer->setInputStream(sw::Normal, attribute.define(buffer, sw::STREAMTYPE_FLOAT, 3)); renderer->setInputStream(sw::Normal, attribute.define(buffer, sw::STREAMTYPE_FLOAT, 3));
(char*&)buffer += 12; (char*&)buffer += 12;
} }
if(FVF & D3DFVF_PSIZE) if(FVF & D3DFVF_PSIZE)
{ {
renderer->setInputStream(sw::PointSize, attribute.define(buffer, sw::STREAMTYPE_FLOAT, 1)); renderer->setInputStream(sw::PointSize, attribute.define(buffer, sw::STREAMTYPE_FLOAT, 1));
(char*&)buffer += 4; (char*&)buffer += 4;
} }
if(FVF & D3DFVF_DIFFUSE) if(FVF & D3DFVF_DIFFUSE)
{ {
renderer->setInputStream(sw::Color0, attribute.define(buffer, sw::STREAMTYPE_COLOR, 4)); renderer->setInputStream(sw::Color0, attribute.define(buffer, sw::STREAMTYPE_COLOR, 4));
(char*&)buffer += 4; (char*&)buffer += 4;
} }
if(FVF & D3DFVF_SPECULAR) if(FVF & D3DFVF_SPECULAR)
{ {
renderer->setInputStream(sw::Color1, attribute.define(buffer, sw::STREAMTYPE_COLOR, 4)); renderer->setInputStream(sw::Color1, attribute.define(buffer, sw::STREAMTYPE_COLOR, 4));
...@@ -4633,7 +4628,7 @@ namespace D3D8 ...@@ -4633,7 +4628,7 @@ namespace D3D8
renderer->setLightDiffuse(active, diffuse); renderer->setLightDiffuse(active, diffuse);
renderer->setLightSpecular(active, specular); renderer->setLightSpecular(active, specular);
renderer->setLightAmbient(active, ambient); renderer->setLightAmbient(active, ambient);
if(l.Type == D3DLIGHT_DIRECTIONAL) if(l.Type == D3DLIGHT_DIRECTIONAL)
{ {
// goto next; // FIXME // goto next; // FIXME
...@@ -4734,7 +4729,7 @@ namespace D3D8 ...@@ -4734,7 +4729,7 @@ namespace D3D8
if(baseTexture && textureUsed) if(baseTexture && textureUsed)
{ {
int levelCount = baseTexture->getInternalLevelCount(); int levelCount = baseTexture->getInternalLevelCount();
int textureLOD = baseTexture->GetLOD(); int textureLOD = baseTexture->GetLOD();
int stageLOD = textureStageState[stage][D3DTSS_MAXMIPLEVEL]; int stageLOD = textureStageState[stage][D3DTSS_MAXMIPLEVEL];
int LOD = textureLOD > stageLOD ? textureLOD : stageLOD; int LOD = textureLOD > stageLOD ? textureLOD : stageLOD;
...@@ -4849,7 +4844,7 @@ namespace D3D8 ...@@ -4849,7 +4844,7 @@ namespace D3D8
sw::FrameBuffer::setCursorImage(cursor); sw::FrameBuffer::setCursorImage(cursor);
HCURSOR oldCursor = SetCursor(nullCursor); HCURSOR oldCursor = SetCursor(nullCursor);
if(oldCursor != nullCursor) if(oldCursor != nullCursor)
{ {
win32Cursor = oldCursor; win32Cursor = oldCursor;
...@@ -4906,7 +4901,7 @@ namespace D3D8 ...@@ -4906,7 +4901,7 @@ namespace D3D8
sourceVolume->UnlockBox(); sourceVolume->UnlockBox();
destinationVolume->UnlockBox(); destinationVolume->UnlockBox();
return D3D_OK; return D3D_OK;
} }
......
...@@ -31,28 +31,28 @@ namespace D3D8 ...@@ -31,28 +31,28 @@ namespace D3D8
public: public:
Direct3DIndexBuffer8(Direct3DDevice8 *device, unsigned int length, unsigned long usage, D3DFORMAT format, D3DPOOL pool); Direct3DIndexBuffer8(Direct3DDevice8 *device, unsigned int length, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
virtual ~Direct3DIndexBuffer8(); ~Direct3DIndexBuffer8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource8 methods // IDirect3DResource8 methods
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetDevice(IDirect3DDevice8 **device); long __stdcall GetDevice(IDirect3DDevice8 **device) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DIndexBuffer8 methods // IDirect3DIndexBuffer8 methods
long __stdcall GetDesc(D3DINDEXBUFFER_DESC *description); long __stdcall GetDesc(D3DINDEXBUFFER_DESC *description) override;
long __stdcall Lock(unsigned int offset, unsigned int size, unsigned char **data, unsigned long flags); long __stdcall Lock(unsigned int offset, unsigned int size, unsigned char **data, unsigned long flags) override;
long __stdcall Unlock(); long __stdcall Unlock() override;
// Internal methods // Internal methods
sw::Resource *getResource() const; sw::Resource *getResource() const;
bool is32Bit() const; bool is32Bit() const;
......
...@@ -28,14 +28,13 @@ namespace D3D8 ...@@ -28,14 +28,13 @@ namespace D3D8
public: public:
Direct3DPixelShader8(Direct3DDevice8 *device, const unsigned long *shaderToken); Direct3DPixelShader8(Direct3DDevice8 *device, const unsigned long *shaderToken);
virtual ~Direct3DPixelShader8(); ~Direct3DPixelShader8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DPixelShader8 methods
void __stdcall GetFunction(void *data, unsigned int *size); void __stdcall GetFunction(void *data, unsigned int *size);
// Internal methods // Internal methods
......
...@@ -30,22 +30,22 @@ namespace D3D8 ...@@ -30,22 +30,22 @@ namespace D3D8
public: public:
Direct3DResource8(Direct3DDevice8 *device, D3DRESOURCETYPE type, unsigned int size); Direct3DResource8(Direct3DDevice8 *device, D3DRESOURCETYPE type, unsigned int size);
virtual ~Direct3DResource8(); ~Direct3DResource8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource8 methods // IDirect3DResource8 methods
long __stdcall GetDevice(IDirect3DDevice8 **device); long __stdcall GetDevice(IDirect3DDevice8 **device) override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// Internal methods // Internal methods
static unsigned int getMemoryUsage(); static unsigned int getMemoryUsage();
......
...@@ -33,14 +33,13 @@ namespace D3D8 ...@@ -33,14 +33,13 @@ namespace D3D8
public: public:
Direct3DStateBlock8(Direct3DDevice8 *device, D3DSTATEBLOCKTYPE type); Direct3DStateBlock8(Direct3DDevice8 *device, D3DSTATEBLOCKTYPE type);
virtual ~Direct3DStateBlock8(); ~Direct3DStateBlock8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DStateBlock8 methods
long __stdcall Apply(); long __stdcall Apply();
long __stdcall Capture(); long __stdcall Capture();
long __stdcall GetDevice(IDirect3DDevice8 **device); long __stdcall GetDevice(IDirect3DDevice8 **device);
...@@ -75,13 +74,13 @@ namespace D3D8 ...@@ -75,13 +74,13 @@ namespace D3D8
void capturePixelRenderStates(); void capturePixelRenderStates();
void capturePixelTextureStates(); void capturePixelTextureStates();
void capturePixelShaderStates(); void capturePixelShaderStates();
// Vertex states // Vertex states
void captureVertexRenderStates(); void captureVertexRenderStates();
void captureVertexTextureStates(); void captureVertexTextureStates();
void captureLightStates(); void captureLightStates();
void captureVertexShaderStates(); void captureVertexShaderStates();
// All (remaining) states // All (remaining) states
void captureTextures(); void captureTextures();
void captureVertexTextures(); void captureVertexTextures();
......
...@@ -70,6 +70,16 @@ namespace D3D8 ...@@ -70,6 +70,16 @@ namespace D3D8
resource->Release(); resource->Release();
} }
void *Direct3DSurface8::lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client)
{
return Surface::lockInternal(x, y, z, lock, client);
}
void Direct3DSurface8::unlockInternal()
{
Surface::unlockInternal();
}
long Direct3DSurface8::QueryInterface(const IID &iid, void **object) long Direct3DSurface8::QueryInterface(const IID &iid, void **object)
{ {
TRACE(""); TRACE("");
......
...@@ -31,22 +31,26 @@ namespace D3D8 ...@@ -31,22 +31,26 @@ namespace D3D8
public: public:
Direct3DSurface8(Direct3DDevice8 *device, Unknown *container, int width, int height, D3DFORMAT format, D3DPOOL pool, D3DMULTISAMPLE_TYPE multiSample, bool lockable, unsigned long usage); Direct3DSurface8(Direct3DDevice8 *device, Unknown *container, int width, int height, D3DFORMAT format, D3DPOOL pool, D3DMULTISAMPLE_TYPE multiSample, bool lockable, unsigned long usage);
virtual ~Direct3DSurface8(); ~Direct3DSurface8() override;
// Surface methods
void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override;
void unlockInternal() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DSurface8 methods // IDirect3DSurface8 methods
long __stdcall GetDevice(IDirect3DDevice8 **device); long __stdcall GetDevice(IDirect3DDevice8 **device) override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
long __stdcall GetContainer(const IID &iid, void **container); long __stdcall GetContainer(const IID &iid, void **container) override;
long __stdcall GetDesc(D3DSURFACE_DESC *desc); long __stdcall GetDesc(D3DSURFACE_DESC *desc) override;
long __stdcall LockRect(D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long Flags); long __stdcall LockRect(D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long Flags) override;
long __stdcall UnlockRect(); long __stdcall UnlockRect() override;
// Internal methods // Internal methods
static sw::Format translateFormat(D3DFORMAT format); static sw::Format translateFormat(D3DFORMAT format);
......
...@@ -30,20 +30,20 @@ namespace D3D8 ...@@ -30,20 +30,20 @@ namespace D3D8
public: public:
Direct3DSwapChain8(Direct3DDevice8 *device, D3DPRESENT_PARAMETERS *presentParameters); Direct3DSwapChain8(Direct3DDevice8 *device, D3DPRESENT_PARAMETERS *presentParameters);
virtual ~Direct3DSwapChain8(); ~Direct3DSwapChain8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DSwapChain8 methods // IDirect3DSwapChain8 methods
long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion); long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion) override;
long __stdcall GetBackBuffer(unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface8 **backBuffer); long __stdcall GetBackBuffer(unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface8 **backBuffer) override;
// Internal methods // Internal methods
void reset(D3DPRESENT_PARAMETERS *presentParameters); void reset(D3DPRESENT_PARAMETERS *presentParameters);
void screenshot(void *destBuffer); void screenshot(void *destBuffer);
void setGammaRamp(sw::GammaRamp *gammaRamp, bool calibrate); void setGammaRamp(sw::GammaRamp *gammaRamp, bool calibrate);
void getGammaRamp(sw::GammaRamp *gammaRamp); void getGammaRamp(sw::GammaRamp *gammaRamp);
......
...@@ -27,37 +27,37 @@ namespace D3D8 ...@@ -27,37 +27,37 @@ namespace D3D8
{ {
class Direct3DTexture8 : public IDirect3DTexture8, public Direct3DBaseTexture8 class Direct3DTexture8 : public IDirect3DTexture8, public Direct3DBaseTexture8
{ {
public: public:
Direct3DTexture8(Direct3DDevice8 *device, unsigned int width, unsigned int height, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool); Direct3DTexture8(Direct3DDevice8 *device, unsigned int width, unsigned int height, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
virtual ~Direct3DTexture8(); ~Direct3DTexture8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource8 methods // IDirect3DResource8 methods
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetDevice(IDirect3DDevice8 **device); long __stdcall GetDevice(IDirect3DDevice8 **device) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture methods // IDirect3DBaseTexture methods
unsigned long __stdcall GetLevelCount(); unsigned long __stdcall GetLevelCount() override;
unsigned long __stdcall GetLOD(); unsigned long __stdcall GetLOD() override;
unsigned long __stdcall SetLOD(unsigned long newLOD); unsigned long __stdcall SetLOD(unsigned long newLOD) override;
// IDirect3DTexture8 methods // IDirect3DTexture8 methods
long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description); long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description) override;
long __stdcall LockRect(unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags); long __stdcall LockRect(unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags) override;
long __stdcall GetSurfaceLevel(unsigned int level, IDirect3DSurface8 **surface); long __stdcall GetSurfaceLevel(unsigned int level, IDirect3DSurface8 **surface) override;
long __stdcall UnlockRect(unsigned int level); long __stdcall UnlockRect(unsigned int level) override;
long __stdcall AddDirtyRect(const RECT *dirtyRect); long __stdcall AddDirtyRect(const RECT *dirtyRect) override;
// Internal methods // Internal methods
Direct3DSurface8 *getInternalSurfaceLevel(unsigned int level); Direct3DSurface8 *getInternalSurfaceLevel(unsigned int level);
......
...@@ -31,27 +31,27 @@ namespace D3D8 ...@@ -31,27 +31,27 @@ namespace D3D8
public: public:
Direct3DVertexBuffer8(Direct3DDevice8 *device, unsigned int length, unsigned long usage, long FVF, D3DPOOL pool); Direct3DVertexBuffer8(Direct3DDevice8 *device, unsigned int length, unsigned long usage, long FVF, D3DPOOL pool);
virtual ~Direct3DVertexBuffer8(); ~Direct3DVertexBuffer8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource8 methods // IDirect3DResource8 methods
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetDevice(IDirect3DDevice8 **device); long __stdcall GetDevice(IDirect3DDevice8 **device) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DVertexBuffer8 methods // IDirect3DVertexBuffer8 methods
long __stdcall Lock(unsigned int offset, unsigned int size, unsigned char **data, unsigned long flags); long __stdcall Lock(unsigned int offset, unsigned int size, unsigned char **data, unsigned long flags) override;
long __stdcall Unlock(); long __stdcall Unlock() override;
long __stdcall GetDesc(D3DVERTEXBUFFER_DESC *description); long __stdcall GetDesc(D3DVERTEXBUFFER_DESC *description) override;
// Internal methods // Internal methods
int getLength() const; int getLength() const;
......
...@@ -28,12 +28,12 @@ namespace D3D8 ...@@ -28,12 +28,12 @@ namespace D3D8
public: public:
Direct3DVertexDeclaration8(Direct3DDevice8 *device, const unsigned long *vertexElements); Direct3DVertexDeclaration8(Direct3DDevice8 *device, const unsigned long *vertexElements);
virtual ~Direct3DVertexDeclaration8(); ~Direct3DVertexDeclaration8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// Internal methods // Internal methods
const unsigned long *getDeclaration() const; const unsigned long *getDeclaration() const;
......
...@@ -29,12 +29,12 @@ namespace D3D8 ...@@ -29,12 +29,12 @@ namespace D3D8
public: public:
Direct3DVertexShader8(Direct3DDevice8 *device, const unsigned long *declaration, const unsigned long *shaderToken); Direct3DVertexShader8(Direct3DDevice8 *device, const unsigned long *declaration, const unsigned long *shaderToken);
virtual ~Direct3DVertexShader8(); ~Direct3DVertexShader8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// Internal methods // Internal methods
const sw::VertexShader *getVertexShader() const; const sw::VertexShader *getVertexShader() const;
......
...@@ -33,6 +33,16 @@ namespace D3D8 ...@@ -33,6 +33,16 @@ namespace D3D8
resource->Release(); resource->Release();
} }
void *Direct3DVolume8::lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client)
{
return Surface::lockInternal(x, y, z, lock, client);
}
void Direct3DVolume8::unlockInternal()
{
Surface::unlockInternal();
}
long __stdcall Direct3DVolume8::QueryInterface(const IID &iid, void **object) long __stdcall Direct3DVolume8::QueryInterface(const IID &iid, void **object)
{ {
TRACE(""); TRACE("");
......
...@@ -32,22 +32,26 @@ namespace D3D8 ...@@ -32,22 +32,26 @@ namespace D3D8
public: public:
Direct3DVolume8(Direct3DDevice8 *device, Direct3DVolumeTexture8 *container, int width, int height, int depth, D3DFORMAT format, D3DPOOL pool, bool locakble, unsigned long usage); Direct3DVolume8(Direct3DDevice8 *device, Direct3DVolumeTexture8 *container, int width, int height, int depth, D3DFORMAT format, D3DPOOL pool, bool locakble, unsigned long usage);
virtual ~Direct3DVolume8(); ~Direct3DVolume8() override;
// Surface methods
void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override;
void unlockInternal() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DVolume8 methods // IDirect3DVolume8 methods
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
long __stdcall GetContainer(const IID &iid, void **container); long __stdcall GetContainer(const IID &iid, void **container) override;
long __stdcall GetDesc(D3DVOLUME_DESC *description); long __stdcall GetDesc(D3DVOLUME_DESC *description) override;
long __stdcall GetDevice(IDirect3DDevice8 **device); long __stdcall GetDevice(IDirect3DDevice8 **device) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
long __stdcall LockBox(D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags); long __stdcall LockBox(D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags) override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall UnlockBox(); long __stdcall UnlockBox() override;
private: private:
static sw::Format translateFormat(D3DFORMAT format); static sw::Format translateFormat(D3DFORMAT format);
......
...@@ -30,34 +30,34 @@ namespace D3D8 ...@@ -30,34 +30,34 @@ namespace D3D8
public: public:
Direct3DVolumeTexture8(Direct3DDevice8 *device, unsigned int width, unsigned int height, unsigned int depth, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool); Direct3DVolumeTexture8(Direct3DDevice8 *device, unsigned int width, unsigned int height, unsigned int depth, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
virtual ~Direct3DVolumeTexture8(); ~Direct3DVolumeTexture8() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource8 methods // IDirect3DResource8 methods
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetDevice(IDirect3DDevice8 **device); long __stdcall GetDevice(IDirect3DDevice8 **device) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture methods // IDirect3DBaseTexture methods
unsigned long __stdcall GetLevelCount(); unsigned long __stdcall GetLevelCount() override;
unsigned long __stdcall GetLOD(); unsigned long __stdcall GetLOD() override;
unsigned long __stdcall SetLOD(unsigned long newLOD); unsigned long __stdcall SetLOD(unsigned long newLOD) override;
// IDirect3DVolumeTexture8 methods // IDirect3DVolumeTexture8 methods
long __stdcall GetLevelDesc(unsigned int level, D3DVOLUME_DESC *description); long __stdcall GetLevelDesc(unsigned int level, D3DVOLUME_DESC *description) override;
long __stdcall GetVolumeLevel(unsigned int level, IDirect3DVolume8 **volume); long __stdcall GetVolumeLevel(unsigned int level, IDirect3DVolume8 **volume) override;
long __stdcall LockBox(unsigned int level, D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags); long __stdcall LockBox(unsigned int level, D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags) override;
long __stdcall UnlockBox(unsigned int level); long __stdcall UnlockBox(unsigned int level) override;
long __stdcall AddDirtyBox(const D3DBOX *dirtyBox); long __stdcall AddDirtyBox(const D3DBOX *dirtyBox) override;
// Internal methods // Internal methods
Direct3DVolume8 *getInternalVolumeLevel(unsigned int level); Direct3DVolume8 *getInternalVolumeLevel(unsigned int level);
......
...@@ -29,28 +29,28 @@ namespace D3D9 ...@@ -29,28 +29,28 @@ namespace D3D9
public: public:
Direct3D9(int version, const HINSTANCE instance); Direct3D9(int version, const HINSTANCE instance);
virtual ~Direct3D9(); ~Direct3D9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3D9 methods // IDirect3D9 methods
long __stdcall RegisterSoftwareDevice(void *initializeFunction); long __stdcall RegisterSoftwareDevice(void *initializeFunction) override;
unsigned int __stdcall GetAdapterCount(); unsigned int __stdcall GetAdapterCount() override;
long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER9 *identifier); long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER9 *identifier) override;
unsigned int __stdcall GetAdapterModeCount(unsigned int adapter, D3DFORMAT format); unsigned int __stdcall GetAdapterModeCount(unsigned int adapter, D3DFORMAT format) override;
long __stdcall EnumAdapterModes(unsigned int adapter, D3DFORMAT format, unsigned int index, D3DDISPLAYMODE *mode); long __stdcall EnumAdapterModes(unsigned int adapter, D3DFORMAT format, unsigned int index, D3DDISPLAYMODE *mode) override;
long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode); long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode) override;
long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed); long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed) override;
long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat); long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat) override;
long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long *qualityLevels); long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long *qualityLevels) override;
long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat); long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat) override;
long __stdcall CheckDeviceFormatConversion(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT sourceFormat, D3DFORMAT targetFormat); long __stdcall CheckDeviceFormatConversion(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT sourceFormat, D3DFORMAT targetFormat) override;
long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS9 *caps); long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS9 *caps) override;
HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter); HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter) override;
long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice9 **returnedDeviceInterface); long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice9 **returnedDeviceInterface) override;
protected: protected:
// Creation parameters // Creation parameters
......
...@@ -29,35 +29,35 @@ namespace D3D9 ...@@ -29,35 +29,35 @@ namespace D3D9
public: public:
Direct3D9Ex(int version, const HINSTANCE instance); Direct3D9Ex(int version, const HINSTANCE instance);
virtual ~Direct3D9Ex(); ~Direct3D9Ex() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3D9 methods // IDirect3D9 methods
long __stdcall RegisterSoftwareDevice(void *initializeFunction); long __stdcall RegisterSoftwareDevice(void *initializeFunction) override;
unsigned int __stdcall GetAdapterCount(); unsigned int __stdcall GetAdapterCount() override;
long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER9 *identifier); long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER9 *identifier) override;
unsigned int __stdcall GetAdapterModeCount(unsigned int adapter, D3DFORMAT format); unsigned int __stdcall GetAdapterModeCount(unsigned int adapter, D3DFORMAT format) override;
long __stdcall EnumAdapterModes(unsigned int adapter, D3DFORMAT format, unsigned int index, D3DDISPLAYMODE *mode); long __stdcall EnumAdapterModes(unsigned int adapter, D3DFORMAT format, unsigned int index, D3DDISPLAYMODE *mode) override;
long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode); long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode) override;
long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed); long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed) override;
long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat); long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat) override;
long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long *qualityLevels); long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long *qualityLevels) override;
long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat); long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat) override;
long __stdcall CheckDeviceFormatConversion(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT sourceFormat, D3DFORMAT targetFormat); long __stdcall CheckDeviceFormatConversion(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT sourceFormat, D3DFORMAT targetFormat) override;
long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS9 *caps); long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS9 *caps) override;
HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter); HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter) override;
long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice9 **returnedDeviceInterface); long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice9 **returnedDeviceInterface) override;
// IDirect3D9Ex methods // IDirect3D9Ex methods
unsigned int __stdcall GetAdapterModeCountEx(unsigned int adapter, const D3DDISPLAYMODEFILTER *filter); unsigned int __stdcall GetAdapterModeCountEx(unsigned int adapter, const D3DDISPLAYMODEFILTER *filter) override;
long __stdcall EnumAdapterModesEx(unsigned int adapter, const D3DDISPLAYMODEFILTER *filter, unsigned int index, D3DDISPLAYMODEEX *mode); long __stdcall EnumAdapterModesEx(unsigned int adapter, const D3DDISPLAYMODEFILTER *filter, unsigned int index, D3DDISPLAYMODEEX *mode) override;
long __stdcall GetAdapterDisplayModeEx(unsigned int adapter, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation); long __stdcall GetAdapterDisplayModeEx(unsigned int adapter, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation) override;
long __stdcall CreateDeviceEx(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, DWORD behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, D3DDISPLAYMODEEX *fullscreenDisplayMode, IDirect3DDevice9Ex **returnedDeviceInterface); long __stdcall CreateDeviceEx(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, DWORD behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, D3DDISPLAYMODEEX *fullscreenDisplayMode, IDirect3DDevice9Ex **returnedDeviceInterface) override;
long __stdcall GetAdapterLUID(unsigned int adapter, LUID *luid); long __stdcall GetAdapterLUID(unsigned int adapter, LUID *luid) override;
private: private:
void loadSystemD3D9ex(); void loadSystemD3D9ex();
......
...@@ -31,30 +31,30 @@ namespace D3D9 ...@@ -31,30 +31,30 @@ namespace D3D9
public: public:
Direct3DBaseTexture9(Direct3DDevice9 *device, D3DRESOURCETYPE type, D3DFORMAT format, D3DPOOL pool, unsigned long levels, unsigned long usage); Direct3DBaseTexture9(Direct3DDevice9 *device, D3DRESOURCETYPE type, D3DFORMAT format, D3DPOOL pool, unsigned long levels, unsigned long usage);
virtual ~Direct3DBaseTexture9(); ~Direct3DBaseTexture9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource9 methods // IDirect3DResource9 methods
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture9 methods // IDirect3DBaseTexture9 methods
unsigned long __stdcall SetLOD(unsigned long newLOD); unsigned long __stdcall SetLOD(unsigned long newLOD) override;
unsigned long __stdcall GetLOD(); unsigned long __stdcall GetLOD() override;
unsigned long __stdcall GetLevelCount(); unsigned long __stdcall GetLevelCount() override;
long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType); long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType) override;
D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType(); D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType() override;
void __stdcall GenerateMipSubLevels(); void __stdcall GenerateMipSubLevels() override;
// Intenal methods // Intenal methods
sw::Resource *getResource() const; sw::Resource *getResource() const;
......
...@@ -30,37 +30,37 @@ namespace D3D9 ...@@ -30,37 +30,37 @@ namespace D3D9
public: public:
Direct3DCubeTexture9(Direct3DDevice9 *device, unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool); Direct3DCubeTexture9(Direct3DDevice9 *device, unsigned int edgeLength, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
virtual ~Direct3DCubeTexture9(); ~Direct3DCubeTexture9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource9 methods // IDirect3DResource9 methods
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture9 methods // IDirect3DBaseTexture9 methods
unsigned long __stdcall SetLOD(unsigned long newLOD); unsigned long __stdcall SetLOD(unsigned long newLOD) override;
unsigned long __stdcall GetLOD(); unsigned long __stdcall GetLOD() override;
unsigned long __stdcall GetLevelCount(); unsigned long __stdcall GetLevelCount() override;
long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType); long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType) override;
D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType(); D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType() override;
void __stdcall GenerateMipSubLevels(); void __stdcall GenerateMipSubLevels() override;
// IDirect3DCubeTexture9 methods // IDirect3DCubeTexture9 methods
long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description); long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description) override;
long __stdcall GetCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level, IDirect3DSurface9 **cubeMapSurface); long __stdcall GetCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level, IDirect3DSurface9 **cubeMapSurface) override;
long __stdcall LockRect(D3DCUBEMAP_FACES face, unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags); long __stdcall LockRect(D3DCUBEMAP_FACES face, unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags) override;
long __stdcall UnlockRect(D3DCUBEMAP_FACES face, unsigned int level); long __stdcall UnlockRect(D3DCUBEMAP_FACES face, unsigned int level) override;
long __stdcall AddDirtyRect(D3DCUBEMAP_FACES face, const RECT *dirtyRect); long __stdcall AddDirtyRect(D3DCUBEMAP_FACES face, const RECT *dirtyRect) override;
// Internal methods // Internal methods
Direct3DSurface9 *getInternalCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level); Direct3DSurface9 *getInternalCubeMapSurface(D3DCUBEMAP_FACES face, unsigned int level);
......
...@@ -2659,7 +2659,7 @@ namespace D3D9 ...@@ -2659,7 +2659,7 @@ namespace D3D9
void *bitmap = cursorSurface->lockExternal(0, 0, 0, sw::LOCK_READONLY, sw::PUBLIC); void *bitmap = cursorSurface->lockExternal(0, 0, 0, sw::LOCK_READONLY, sw::PUBLIC);
delete cursor; delete cursor;
cursor = new sw::Surface(0, width, height, 1, sw::FORMAT_A8R8G8B8, false, false); cursor = sw::Surface::create(0, width, height, 1, sw::FORMAT_A8R8G8B8, false, false);
void *buffer = cursor->lockExternal(0, 0, 0, sw::LOCK_DISCARD, sw::PUBLIC); void *buffer = cursor->lockExternal(0, 0, 0, sw::LOCK_DISCARD, sw::PUBLIC);
memcpy(buffer, bitmap, width * height * sizeof(unsigned int)); memcpy(buffer, bitmap, width * height * sizeof(unsigned int));
......
...@@ -31,28 +31,28 @@ namespace D3D9 ...@@ -31,28 +31,28 @@ namespace D3D9
public: public:
Direct3DIndexBuffer9(Direct3DDevice9 *device, unsigned int length, unsigned long usage, D3DFORMAT format, D3DPOOL pool); Direct3DIndexBuffer9(Direct3DDevice9 *device, unsigned int length, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
virtual ~Direct3DIndexBuffer9(); ~Direct3DIndexBuffer9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource9 methods // IDirect3DResource9 methods
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DIndexBuffer9 methods // IDirect3DIndexBuffer9 methods
long __stdcall GetDesc(D3DINDEXBUFFER_DESC *description); long __stdcall GetDesc(D3DINDEXBUFFER_DESC *description) override;
long __stdcall Lock(unsigned int offset, unsigned int size, void **data, unsigned long flags); long __stdcall Lock(unsigned int offset, unsigned int size, void **data, unsigned long flags) override;
long __stdcall Unlock(); long __stdcall Unlock() override;
// Internal methods // Internal methods
sw::Resource *getResource() const; sw::Resource *getResource() const;
bool is32Bit() const; bool is32Bit() const;
......
...@@ -30,16 +30,16 @@ namespace D3D9 ...@@ -30,16 +30,16 @@ namespace D3D9
public: public:
Direct3DPixelShader9(Direct3DDevice9 *device, const unsigned long *shaderToken); Direct3DPixelShader9(Direct3DDevice9 *device, const unsigned long *shaderToken);
virtual ~Direct3DPixelShader9(); ~Direct3DPixelShader9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DPixelShader9 methods // IDirect3DPixelShader9 methods
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
long __stdcall GetFunction(void *data, unsigned int *size); long __stdcall GetFunction(void *data, unsigned int *size) override;
// Internal methods // Internal methods
const sw::PixelShader *getPixelShader() const; const sw::PixelShader *getPixelShader() const;
......
...@@ -30,19 +30,19 @@ namespace D3D9 ...@@ -30,19 +30,19 @@ namespace D3D9
public: public:
Direct3DQuery9(Direct3DDevice9 *device, D3DQUERYTYPE type); Direct3DQuery9(Direct3DDevice9 *device, D3DQUERYTYPE type);
virtual ~Direct3DQuery9(); ~Direct3DQuery9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DQuery9 methods // IDirect3DQuery9 methods
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
D3DQUERYTYPE __stdcall GetType(); D3DQUERYTYPE __stdcall GetType() override;
unsigned long __stdcall GetDataSize(); unsigned long __stdcall GetDataSize() override;
long __stdcall Issue(unsigned long flags); long __stdcall Issue(unsigned long flags) override;
long __stdcall GetData(void *data, unsigned long size, unsigned long flags); long __stdcall GetData(void *data, unsigned long size, unsigned long flags) override;
private: private:
// Creation parameters // Creation parameters
......
...@@ -30,22 +30,22 @@ namespace D3D9 ...@@ -30,22 +30,22 @@ namespace D3D9
public: public:
Direct3DResource9(Direct3DDevice9 *device, D3DRESOURCETYPE type, D3DPOOL pool, unsigned int size); Direct3DResource9(Direct3DDevice9 *device, D3DRESOURCETYPE type, D3DPOOL pool, unsigned int size);
virtual ~Direct3DResource9(); ~Direct3DResource9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource9 methods // IDirect3DResource9 methods
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// Internal methods // Internal methods
static unsigned int getMemoryUsage(); static unsigned int getMemoryUsage();
......
...@@ -37,17 +37,17 @@ namespace D3D9 ...@@ -37,17 +37,17 @@ namespace D3D9
public: public:
Direct3DStateBlock9(Direct3DDevice9 *device, D3DSTATEBLOCKTYPE type); Direct3DStateBlock9(Direct3DDevice9 *device, D3DSTATEBLOCKTYPE type);
virtual ~Direct3DStateBlock9(); ~Direct3DStateBlock9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DStateBlock9 methods // IDirect3DStateBlock9 methods
long __stdcall Apply(); long __stdcall Apply() override;
long __stdcall Capture(); long __stdcall Capture() override;
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
// Internal methods // Internal methods
void lightEnable(unsigned long index, int enable); void lightEnable(unsigned long index, int enable);
......
...@@ -85,6 +85,16 @@ namespace D3D9 ...@@ -85,6 +85,16 @@ namespace D3D9
{ {
} }
void *Direct3DSurface9::lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client)
{
return Surface::lockInternal(x, y, z, lock, client);
}
void Direct3DSurface9::unlockInternal()
{
Surface::unlockInternal();
}
long Direct3DSurface9::QueryInterface(const IID &iid, void **object) long Direct3DSurface9::QueryInterface(const IID &iid, void **object)
{ {
CriticalSection cs(device); CriticalSection cs(device);
......
...@@ -30,30 +30,34 @@ namespace D3D9 ...@@ -30,30 +30,34 @@ namespace D3D9
public: public:
Direct3DSurface9(Direct3DDevice9 *device, Unknown *container, int width, int height, D3DFORMAT format, D3DPOOL pool, D3DMULTISAMPLE_TYPE multiSample, unsigned int quality, bool lockableOverride, unsigned long usage); Direct3DSurface9(Direct3DDevice9 *device, Unknown *container, int width, int height, D3DFORMAT format, D3DPOOL pool, D3DMULTISAMPLE_TYPE multiSample, unsigned int quality, bool lockableOverride, unsigned long usage);
virtual ~Direct3DSurface9(); ~Direct3DSurface9() override;
// Surface methods
void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override;
void unlockInternal() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource9 methods // IDirect3DResource9 methods
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DSurface9 methods // IDirect3DSurface9 methods
long __stdcall GetDC(HDC *deviceContext); long __stdcall GetDC(HDC *deviceContext) override;
long __stdcall ReleaseDC(HDC deviceContext); long __stdcall ReleaseDC(HDC deviceContext) override;
long __stdcall LockRect(D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long Flags); long __stdcall LockRect(D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long Flags) override;
long __stdcall UnlockRect(); long __stdcall UnlockRect() override;
long __stdcall GetContainer(const IID &iid, void **container); long __stdcall GetContainer(const IID &iid, void **container) override;
long __stdcall GetDesc(D3DSURFACE_DESC *desc); long __stdcall GetDesc(D3DSURFACE_DESC *desc) override;
// Internal methods // Internal methods
static sw::Format translateFormat(D3DFORMAT format); static sw::Format translateFormat(D3DFORMAT format);
......
...@@ -32,21 +32,21 @@ namespace D3D9 ...@@ -32,21 +32,21 @@ namespace D3D9
public: public:
Direct3DSwapChain9(Direct3DDevice9 *device, D3DPRESENT_PARAMETERS *presentParameters); Direct3DSwapChain9(Direct3DDevice9 *device, D3DPRESENT_PARAMETERS *presentParameters);
virtual ~Direct3DSwapChain9(); ~Direct3DSwapChain9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DSwapChain9 methods // IDirect3DSwapChain9 methods
long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion, unsigned long flags); long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion, unsigned long flags) override;
long __stdcall GetFrontBufferData(IDirect3DSurface9 *destSurface); long __stdcall GetFrontBufferData(IDirect3DSurface9 *destSurface) override;
long __stdcall GetBackBuffer(unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface9 **backBuffer); long __stdcall GetBackBuffer(unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface9 **backBuffer) override;
long __stdcall GetRasterStatus(D3DRASTER_STATUS *rasterStatus); long __stdcall GetRasterStatus(D3DRASTER_STATUS *rasterStatus) override;
long __stdcall GetDisplayMode(D3DDISPLAYMODE *displayMode); long __stdcall GetDisplayMode(D3DDISPLAYMODE *displayMode) override;
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
long __stdcall GetPresentParameters(D3DPRESENT_PARAMETERS *presentParameters); long __stdcall GetPresentParameters(D3DPRESENT_PARAMETERS *presentParameters) override;
// Internal methods // Internal methods
void reset(D3DPRESENT_PARAMETERS *presentParameters); void reset(D3DPRESENT_PARAMETERS *presentParameters);
......
...@@ -27,40 +27,40 @@ namespace D3D9 ...@@ -27,40 +27,40 @@ namespace D3D9
class Direct3DTexture9 : public IDirect3DTexture9, public Direct3DBaseTexture9 class Direct3DTexture9 : public IDirect3DTexture9, public Direct3DBaseTexture9
{ {
public: public:
Direct3DTexture9(Direct3DDevice9 *device, unsigned int width, unsigned int height, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool); Direct3DTexture9(Direct3DDevice9 *device, unsigned int width, unsigned int height, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
virtual ~Direct3DTexture9(); ~Direct3DTexture9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource9 methods // IDirect3DResource9 methods
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture9 methods // IDirect3DBaseTexture9 methods
unsigned long __stdcall SetLOD(unsigned long newLOD); unsigned long __stdcall SetLOD(unsigned long newLOD) override;
unsigned long __stdcall GetLOD(); unsigned long __stdcall GetLOD() override;
unsigned long __stdcall GetLevelCount(); unsigned long __stdcall GetLevelCount() override;
long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType); long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType) override;
D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType(); D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType() override;
void __stdcall GenerateMipSubLevels(); void __stdcall GenerateMipSubLevels() override;
// IDirect3DTexture9 methods // IDirect3DTexture9 methods
long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description); long __stdcall GetLevelDesc(unsigned int level, D3DSURFACE_DESC *description) override;
long __stdcall GetSurfaceLevel(unsigned int level, IDirect3DSurface9 **surface); long __stdcall GetSurfaceLevel(unsigned int level, IDirect3DSurface9 **surface) override;
long __stdcall LockRect(unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags); long __stdcall LockRect(unsigned int level, D3DLOCKED_RECT *lockedRect, const RECT *rect, unsigned long flags) override;
long __stdcall UnlockRect(unsigned int level); long __stdcall UnlockRect(unsigned int level) override;
long __stdcall AddDirtyRect(const RECT *dirtyRect); long __stdcall AddDirtyRect(const RECT *dirtyRect) override;
// Internal methods // Internal methods
Direct3DSurface9 *getInternalSurfaceLevel(unsigned int level); Direct3DSurface9 *getInternalSurfaceLevel(unsigned int level);
......
...@@ -31,27 +31,27 @@ namespace D3D9 ...@@ -31,27 +31,27 @@ namespace D3D9
public: public:
Direct3DVertexBuffer9(Direct3DDevice9 *device, unsigned int length, unsigned long usage, long FVF, D3DPOOL pool); Direct3DVertexBuffer9(Direct3DDevice9 *device, unsigned int length, unsigned long usage, long FVF, D3DPOOL pool);
virtual ~Direct3DVertexBuffer9(); ~Direct3DVertexBuffer9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource9 methods // IDirect3DResource9 methods
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DVertexBuffer9 methods // IDirect3DVertexBuffer9 methods
long __stdcall Lock(unsigned int offset, unsigned int size, void **data, unsigned long flags); long __stdcall Lock(unsigned int offset, unsigned int size, void **data, unsigned long flags) override;
long __stdcall Unlock(); long __stdcall Unlock() override;
long __stdcall GetDesc(D3DVERTEXBUFFER_DESC *description); long __stdcall GetDesc(D3DVERTEXBUFFER_DESC *description) override;
// Internal methods // Internal methods
int getLength() const; int getLength() const;
......
...@@ -29,16 +29,16 @@ namespace D3D9 ...@@ -29,16 +29,16 @@ namespace D3D9
Direct3DVertexDeclaration9(Direct3DDevice9 *device, const D3DVERTEXELEMENT9 *vertexElements); Direct3DVertexDeclaration9(Direct3DDevice9 *device, const D3DVERTEXELEMENT9 *vertexElements);
Direct3DVertexDeclaration9(Direct3DDevice9 *device, unsigned long FVF); Direct3DVertexDeclaration9(Direct3DDevice9 *device, unsigned long FVF);
virtual ~Direct3DVertexDeclaration9(); ~Direct3DVertexDeclaration9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DVertexDeclaration9 methods // IDirect3DVertexDeclaration9 methods
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
long __stdcall GetDeclaration(D3DVERTEXELEMENT9 *declaration, unsigned int *numElements); long __stdcall GetDeclaration(D3DVERTEXELEMENT9 *declaration, unsigned int *numElements) override;
// Internal methods // Internal methods
unsigned long getFVF() const; unsigned long getFVF() const;
...@@ -50,7 +50,7 @@ namespace D3D9 ...@@ -50,7 +50,7 @@ namespace D3D9
// Creation parameters // Creation parameters
Direct3DDevice9 *const device; Direct3DDevice9 *const device;
D3DVERTEXELEMENT9 *vertexElement; D3DVERTEXELEMENT9 *vertexElement;
int numElements; int numElements;
unsigned long FVF; unsigned long FVF;
bool preTransformed; bool preTransformed;
......
...@@ -30,16 +30,16 @@ namespace D3D9 ...@@ -30,16 +30,16 @@ namespace D3D9
public: public:
Direct3DVertexShader9(Direct3DDevice9 *device, const unsigned long *shaderToken); Direct3DVertexShader9(Direct3DDevice9 *device, const unsigned long *shaderToken);
virtual ~Direct3DVertexShader9(); ~Direct3DVertexShader9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DVertexShader9 methods // IDirect3DVertexShader9 methods
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
long __stdcall GetFunction(void *data, unsigned int *size); long __stdcall GetFunction(void *data, unsigned int *size) override;
// Internal methods // Internal methods
const sw::VertexShader *getVertexShader() const; const sw::VertexShader *getVertexShader() const;
......
...@@ -41,6 +41,16 @@ namespace D3D9 ...@@ -41,6 +41,16 @@ namespace D3D9
resource->unbind(); resource->unbind();
} }
void *Direct3DVolume9::lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client)
{
return Surface::lockInternal(x, y, z, lock, client);
}
void Direct3DVolume9::unlockInternal()
{
Surface::unlockInternal();
}
long __stdcall Direct3DVolume9::QueryInterface(const IID &iid, void **object) long __stdcall Direct3DVolume9::QueryInterface(const IID &iid, void **object)
{ {
CriticalSection cs(device); CriticalSection cs(device);
......
...@@ -32,22 +32,26 @@ namespace D3D9 ...@@ -32,22 +32,26 @@ namespace D3D9
public: public:
Direct3DVolume9(Direct3DDevice9 *device, Direct3DVolumeTexture9 *container, int width, int height, int depth, D3DFORMAT format, D3DPOOL pool, unsigned long usage); Direct3DVolume9(Direct3DDevice9 *device, Direct3DVolumeTexture9 *container, int width, int height, int depth, D3DFORMAT format, D3DPOOL pool, unsigned long usage);
virtual ~Direct3DVolume9(); ~Direct3DVolume9() override;
// Surface methods
void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override;
void unlockInternal() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DVolume9 methods // IDirect3DVolume9 methods
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
long __stdcall GetContainer(const IID &iid, void **container); long __stdcall GetContainer(const IID &iid, void **container) override;
long __stdcall GetDesc(D3DVOLUME_DESC *description); long __stdcall GetDesc(D3DVOLUME_DESC *description) override;
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
long __stdcall LockBox(D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags); long __stdcall LockBox(D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags) override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall UnlockBox(); long __stdcall UnlockBox() override;
private: private:
static sw::Format translateFormat(D3DFORMAT format); static sw::Format translateFormat(D3DFORMAT format);
......
...@@ -30,37 +30,37 @@ namespace D3D9 ...@@ -30,37 +30,37 @@ namespace D3D9
public: public:
Direct3DVolumeTexture9(Direct3DDevice9 *device, unsigned int width, unsigned int height, unsigned int depth, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool); Direct3DVolumeTexture9(Direct3DDevice9 *device, unsigned int width, unsigned int height, unsigned int depth, unsigned int levels, unsigned long usage, D3DFORMAT format, D3DPOOL pool);
virtual ~Direct3DVolumeTexture9(); ~Direct3DVolumeTexture9() override;
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// IDirect3DResource9 methods // IDirect3DResource9 methods
long __stdcall GetDevice(IDirect3DDevice9 **device); long __stdcall GetDevice(IDirect3DDevice9 **device) override;
long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags); long __stdcall SetPrivateData(const GUID &guid, const void *data, unsigned long size, unsigned long flags) override;
long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size); long __stdcall GetPrivateData(const GUID &guid, void *data, unsigned long *size) override;
long __stdcall FreePrivateData(const GUID &guid); long __stdcall FreePrivateData(const GUID &guid) override;
unsigned long __stdcall SetPriority(unsigned long newPriority); unsigned long __stdcall SetPriority(unsigned long newPriority) override;
unsigned long __stdcall GetPriority(); unsigned long __stdcall GetPriority() override;
void __stdcall PreLoad(); void __stdcall PreLoad() override;
D3DRESOURCETYPE __stdcall GetType(); D3DRESOURCETYPE __stdcall GetType() override;
// IDirect3DBaseTexture9 methods // IDirect3DBaseTexture9 methods
unsigned long __stdcall SetLOD(unsigned long newLOD); unsigned long __stdcall SetLOD(unsigned long newLOD) override;
unsigned long __stdcall GetLOD(); unsigned long __stdcall GetLOD() override;
unsigned long __stdcall GetLevelCount(); unsigned long __stdcall GetLevelCount() override;
long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType); long __stdcall SetAutoGenFilterType(D3DTEXTUREFILTERTYPE filterType) override;
D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType(); D3DTEXTUREFILTERTYPE __stdcall GetAutoGenFilterType() override;
void __stdcall GenerateMipSubLevels(); void __stdcall GenerateMipSubLevels() override;
// IDirect3DVolumeTexture9 methods // IDirect3DVolumeTexture9 methods
long __stdcall GetLevelDesc(unsigned int level, D3DVOLUME_DESC *description); long __stdcall GetLevelDesc(unsigned int level, D3DVOLUME_DESC *description) override;
long __stdcall GetVolumeLevel(unsigned int level, IDirect3DVolume9 **volume); long __stdcall GetVolumeLevel(unsigned int level, IDirect3DVolume9 **volume) override;
long __stdcall LockBox(unsigned int level, D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags); long __stdcall LockBox(unsigned int level, D3DLOCKED_BOX *lockedVolume, const D3DBOX *box, unsigned long flags) override;
long __stdcall UnlockBox(unsigned int level); long __stdcall UnlockBox(unsigned int level) override;
long __stdcall AddDirtyBox(const D3DBOX *dirtyBox); long __stdcall AddDirtyBox(const D3DBOX *dirtyBox) override;
// Internal methods // Internal methods
Direct3DVolume9 *getInternalVolumeLevel(unsigned int level); Direct3DVolume9 *getInternalVolumeLevel(unsigned int level);
......
...@@ -27,9 +27,9 @@ namespace D3D9 ...@@ -27,9 +27,9 @@ namespace D3D9
virtual ~Unknown(); virtual ~Unknown();
// IUnknown methods // IUnknown methods
long __stdcall QueryInterface(const IID &iid, void **object); long __stdcall QueryInterface(const IID &iid, void **object) override;
unsigned long __stdcall AddRef(); unsigned long __stdcall AddRef() override;
unsigned long __stdcall Release(); unsigned long __stdcall Release() override;
// Internal methods // Internal methods
virtual void bind(); virtual void bind();
......
...@@ -71,6 +71,16 @@ namespace gl ...@@ -71,6 +71,16 @@ namespace gl
unlockExternal(); unlockExternal();
} }
void *Image::lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client)
{
return Surface::lockInternal(x, y, z, lock, client);
}
void Image::unlockInternal()
{
Surface::unlockInternal();
}
int Image::getWidth() int Image::getWidth()
{ {
return width; return width;
......
...@@ -39,6 +39,9 @@ namespace gl ...@@ -39,6 +39,9 @@ namespace gl
unsigned int getPitch() const; unsigned int getPitch() const;
void unlock(); void unlock();
void *lockInternal(int x, int y, int z, sw::Lock lock, sw::Accessor client) override;
void unlockInternal() override;
int getWidth(); int getWidth();
int getHeight(); int getHeight();
GLenum getFormat(); GLenum getFormat();
...@@ -53,7 +56,7 @@ namespace gl ...@@ -53,7 +56,7 @@ namespace gl
static sw::Format selectInternalFormat(GLenum format, GLenum type); static sw::Format selectInternalFormat(GLenum format, GLenum type);
private: private:
virtual ~Image(); ~Image() override;
void loadAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, int inputPitch, const void *input, void *buffer) const; void loadAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, int inputPitch, const void *input, void *buffer) const;
void loadAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, int inputPitch, const void *input, void *buffer) const; void loadAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, int inputPitch, const void *input, void *buffer) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment