mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
Hint texture intent to renderer
This commit is contained in:
parent
a258a89b1f
commit
b0532379cc
@ -76,7 +76,7 @@ void DirectX9Renderer::AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture*
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint32 DirectX9Renderer::GetTextureId(IDirect3DRMTexture* iTexture)
|
Uint32 DirectX9Renderer::GetTextureId(IDirect3DRMTexture* iTexture, bool isUi)
|
||||||
{
|
{
|
||||||
auto texture = static_cast<Direct3DRMTextureImpl*>(iTexture);
|
auto texture = static_cast<Direct3DRMTextureImpl*>(iTexture);
|
||||||
auto surface = static_cast<DirectDrawSurfaceImpl*>(texture->m_surface);
|
auto surface = static_cast<DirectDrawSurfaceImpl*>(texture->m_surface);
|
||||||
@ -221,7 +221,7 @@ void DirectX9Renderer::GetDesc(D3DDEVICEDESC* halDesc, D3DDEVICEDESC* helDesc)
|
|||||||
halDesc->dcmColorModel = D3DCOLORMODEL::RGB;
|
halDesc->dcmColorModel = D3DCOLORMODEL::RGB;
|
||||||
halDesc->dwFlags = D3DDD_DEVICEZBUFFERBITDEPTH;
|
halDesc->dwFlags = D3DDD_DEVICEZBUFFERBITDEPTH;
|
||||||
halDesc->dwDeviceZBufferBitDepth = DDBD_24;
|
halDesc->dwDeviceZBufferBitDepth = DDBD_24;
|
||||||
helDesc->dwDeviceRenderBitDepth = DDBD_32;
|
halDesc->dwDeviceRenderBitDepth = DDBD_32;
|
||||||
halDesc->dpcTriCaps.dwTextureCaps = D3DPTEXTURECAPS_PERSPECTIVE;
|
halDesc->dpcTriCaps.dwTextureCaps = D3DPTEXTURECAPS_PERSPECTIVE;
|
||||||
halDesc->dpcTriCaps.dwShadeCaps = D3DPSHADECAPS_ALPHAFLATBLEND;
|
halDesc->dpcTriCaps.dwShadeCaps = D3DPSHADECAPS_ALPHAFLATBLEND;
|
||||||
halDesc->dpcTriCaps.dwTextureFilterCaps = D3DPTFILTERCAPS_LINEAR;
|
halDesc->dpcTriCaps.dwTextureFilterCaps = D3DPTFILTERCAPS_LINEAR;
|
||||||
|
|||||||
@ -122,7 +122,7 @@ void OpenGL1Renderer::AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* t
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint32 OpenGL1Renderer::GetTextureId(IDirect3DRMTexture* iTexture)
|
Uint32 OpenGL1Renderer::GetTextureId(IDirect3DRMTexture* iTexture, bool isUi)
|
||||||
{
|
{
|
||||||
auto texture = static_cast<Direct3DRMTextureImpl*>(iTexture);
|
auto texture = static_cast<Direct3DRMTextureImpl*>(iTexture);
|
||||||
auto surface = static_cast<DirectDrawSurfaceImpl*>(texture->m_surface);
|
auto surface = static_cast<DirectDrawSurfaceImpl*>(texture->m_surface);
|
||||||
@ -270,7 +270,7 @@ void OpenGL1Renderer::GetDesc(D3DDEVICEDESC* halDesc, D3DDEVICEDESC* helDesc)
|
|||||||
halDesc->dcmColorModel = D3DCOLORMODEL::RGB;
|
halDesc->dcmColorModel = D3DCOLORMODEL::RGB;
|
||||||
halDesc->dwFlags = D3DDD_DEVICEZBUFFERBITDEPTH;
|
halDesc->dwFlags = D3DDD_DEVICEZBUFFERBITDEPTH;
|
||||||
halDesc->dwDeviceZBufferBitDepth = DDBD_24;
|
halDesc->dwDeviceZBufferBitDepth = DDBD_24;
|
||||||
helDesc->dwDeviceRenderBitDepth = DDBD_32;
|
halDesc->dwDeviceRenderBitDepth = DDBD_32;
|
||||||
halDesc->dpcTriCaps.dwTextureCaps = D3DPTEXTURECAPS_PERSPECTIVE;
|
halDesc->dpcTriCaps.dwTextureCaps = D3DPTEXTURECAPS_PERSPECTIVE;
|
||||||
halDesc->dpcTriCaps.dwShadeCaps = D3DPSHADECAPS_ALPHAFLATBLEND;
|
halDesc->dpcTriCaps.dwShadeCaps = D3DPSHADECAPS_ALPHAFLATBLEND;
|
||||||
halDesc->dpcTriCaps.dwTextureFilterCaps = D3DPTFILTERCAPS_LINEAR;
|
halDesc->dpcTriCaps.dwTextureFilterCaps = D3DPTFILTERCAPS_LINEAR;
|
||||||
|
|||||||
@ -239,7 +239,7 @@ void OpenGLES2Renderer::AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture*
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint32 OpenGLES2Renderer::GetTextureId(IDirect3DRMTexture* iTexture)
|
Uint32 OpenGLES2Renderer::GetTextureId(IDirect3DRMTexture* iTexture, bool isUi)
|
||||||
{
|
{
|
||||||
auto texture = static_cast<Direct3DRMTextureImpl*>(iTexture);
|
auto texture = static_cast<Direct3DRMTextureImpl*>(iTexture);
|
||||||
auto surface = static_cast<DirectDrawSurfaceImpl*>(texture->m_surface);
|
auto surface = static_cast<DirectDrawSurfaceImpl*>(texture->m_surface);
|
||||||
@ -425,7 +425,7 @@ void OpenGLES2Renderer::GetDesc(D3DDEVICEDESC* halDesc, D3DDEVICEDESC* helDesc)
|
|||||||
halDesc->dwDeviceZBufferBitDepth |= DDBD_32;
|
halDesc->dwDeviceZBufferBitDepth |= DDBD_32;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
helDesc->dwDeviceRenderBitDepth = DDBD_32;
|
halDesc->dwDeviceRenderBitDepth = DDBD_32;
|
||||||
halDesc->dpcTriCaps.dwTextureCaps = D3DPTEXTURECAPS_PERSPECTIVE;
|
halDesc->dpcTriCaps.dwTextureCaps = D3DPTEXTURECAPS_PERSPECTIVE;
|
||||||
halDesc->dpcTriCaps.dwShadeCaps = D3DPSHADECAPS_ALPHAFLATBLEND;
|
halDesc->dpcTriCaps.dwShadeCaps = D3DPSHADECAPS_ALPHAFLATBLEND;
|
||||||
halDesc->dpcTriCaps.dwTextureFilterCaps = D3DPTFILTERCAPS_LINEAR;
|
halDesc->dpcTriCaps.dwTextureFilterCaps = D3DPTFILTERCAPS_LINEAR;
|
||||||
|
|||||||
@ -533,7 +533,7 @@ SDL_GPUTexture* Direct3DRMSDL3GPURenderer::CreateTextureFromSurface(SDL_Surface*
|
|||||||
return texptr;
|
return texptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint32 Direct3DRMSDL3GPURenderer::GetTextureId(IDirect3DRMTexture* iTexture)
|
Uint32 Direct3DRMSDL3GPURenderer::GetTextureId(IDirect3DRMTexture* iTexture, bool isUi)
|
||||||
{
|
{
|
||||||
auto texture = static_cast<Direct3DRMTextureImpl*>(iTexture);
|
auto texture = static_cast<Direct3DRMTextureImpl*>(iTexture);
|
||||||
auto surface = static_cast<DirectDrawSurfaceImpl*>(texture->m_surface);
|
auto surface = static_cast<DirectDrawSurfaceImpl*>(texture->m_surface);
|
||||||
|
|||||||
@ -554,7 +554,7 @@ void Direct3DRMSoftwareRenderer::AddTextureDestroyCallback(Uint32 id, IDirect3DR
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint32 Direct3DRMSoftwareRenderer::GetTextureId(IDirect3DRMTexture* iTexture)
|
Uint32 Direct3DRMSoftwareRenderer::GetTextureId(IDirect3DRMTexture* iTexture, bool isUi)
|
||||||
{
|
{
|
||||||
auto texture = static_cast<Direct3DRMTextureImpl*>(iTexture);
|
auto texture = static_cast<Direct3DRMTextureImpl*>(iTexture);
|
||||||
auto surface = static_cast<DirectDrawSurfaceImpl*>(texture->m_surface);
|
auto surface = static_cast<DirectDrawSurfaceImpl*>(texture->m_surface);
|
||||||
|
|||||||
@ -62,7 +62,7 @@ HRESULT FrameBufferImpl::Blt(
|
|||||||
if (!surface) {
|
if (!surface) {
|
||||||
return DDERR_GENERIC;
|
return DDERR_GENERIC;
|
||||||
}
|
}
|
||||||
Uint32 textureId = DDRenderer->GetTextureId(surface->ToTexture());
|
Uint32 textureId = DDRenderer->GetTextureId(surface->ToTexture(), true);
|
||||||
SDL_Rect srcRect =
|
SDL_Rect srcRect =
|
||||||
lpSrcRect ? ConvertRect(lpSrcRect) : SDL_Rect{0, 0, surface->m_surface->w, surface->m_surface->h};
|
lpSrcRect ? ConvertRect(lpSrcRect) : SDL_Rect{0, 0, surface->m_surface->w, surface->m_surface->h};
|
||||||
SDL_Rect dstRect =
|
SDL_Rect dstRect =
|
||||||
|
|||||||
@ -31,7 +31,7 @@ class Direct3DRMRenderer : public IDirect3DDevice2 {
|
|||||||
virtual void PushLights(const SceneLight* vertices, size_t count) = 0;
|
virtual void PushLights(const SceneLight* vertices, size_t count) = 0;
|
||||||
virtual void SetProjection(const D3DRMMATRIX4D& projection, D3DVALUE front, D3DVALUE back) = 0;
|
virtual void SetProjection(const D3DRMMATRIX4D& projection, D3DVALUE front, D3DVALUE back) = 0;
|
||||||
virtual void SetFrustumPlanes(const Plane* frustumPlanes) = 0;
|
virtual void SetFrustumPlanes(const Plane* frustumPlanes) = 0;
|
||||||
virtual Uint32 GetTextureId(IDirect3DRMTexture* texture) = 0;
|
virtual Uint32 GetTextureId(IDirect3DRMTexture* texture, bool isUi = false) = 0;
|
||||||
virtual Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) = 0;
|
virtual Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) = 0;
|
||||||
int GetWidth() { return m_width; }
|
int GetWidth() { return m_width; }
|
||||||
int GetHeight() { return m_height; }
|
int GetHeight() { return m_height; }
|
||||||
|
|||||||
@ -18,7 +18,7 @@ class DirectX9Renderer : public Direct3DRMRenderer {
|
|||||||
void PushLights(const SceneLight* lightsArray, size_t count) override;
|
void PushLights(const SceneLight* lightsArray, size_t count) override;
|
||||||
void SetProjection(const D3DRMMATRIX4D& projection, D3DVALUE front, D3DVALUE back) override;
|
void SetProjection(const D3DRMMATRIX4D& projection, D3DVALUE front, D3DVALUE back) override;
|
||||||
void SetFrustumPlanes(const Plane* frustumPlanes) override;
|
void SetFrustumPlanes(const Plane* frustumPlanes) override;
|
||||||
Uint32 GetTextureId(IDirect3DRMTexture* texture) override;
|
Uint32 GetTextureId(IDirect3DRMTexture* texture, bool isUi) override;
|
||||||
Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) override;
|
Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) override;
|
||||||
void GetDesc(D3DDEVICEDESC* halDesc, D3DDEVICEDESC* helDesc) override;
|
void GetDesc(D3DDEVICEDESC* halDesc, D3DDEVICEDESC* helDesc) override;
|
||||||
const char* GetName() override;
|
const char* GetName() override;
|
||||||
|
|||||||
@ -18,7 +18,7 @@ class OpenGL1Renderer : public Direct3DRMRenderer {
|
|||||||
void PushLights(const SceneLight* lightsArray, size_t count) override;
|
void PushLights(const SceneLight* lightsArray, size_t count) override;
|
||||||
void SetProjection(const D3DRMMATRIX4D& projection, D3DVALUE front, D3DVALUE back) override;
|
void SetProjection(const D3DRMMATRIX4D& projection, D3DVALUE front, D3DVALUE back) override;
|
||||||
void SetFrustumPlanes(const Plane* frustumPlanes) override;
|
void SetFrustumPlanes(const Plane* frustumPlanes) override;
|
||||||
Uint32 GetTextureId(IDirect3DRMTexture* texture) override;
|
Uint32 GetTextureId(IDirect3DRMTexture* texture, bool isUi) override;
|
||||||
Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) override;
|
Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) override;
|
||||||
void GetDesc(D3DDEVICEDESC* halDesc, D3DDEVICEDESC* helDesc) override;
|
void GetDesc(D3DDEVICEDESC* halDesc, D3DDEVICEDESC* helDesc) override;
|
||||||
const char* GetName() override;
|
const char* GetName() override;
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class OpenGLES2Renderer : public Direct3DRMRenderer {
|
|||||||
void PushLights(const SceneLight* lightsArray, size_t count) override;
|
void PushLights(const SceneLight* lightsArray, size_t count) override;
|
||||||
void SetProjection(const D3DRMMATRIX4D& projection, D3DVALUE front, D3DVALUE back) override;
|
void SetProjection(const D3DRMMATRIX4D& projection, D3DVALUE front, D3DVALUE back) override;
|
||||||
void SetFrustumPlanes(const Plane* frustumPlanes) override;
|
void SetFrustumPlanes(const Plane* frustumPlanes) override;
|
||||||
Uint32 GetTextureId(IDirect3DRMTexture* texture) override;
|
Uint32 GetTextureId(IDirect3DRMTexture* texture, bool isUi) override;
|
||||||
Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) override;
|
Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) override;
|
||||||
void GetDesc(D3DDEVICEDESC* halDesc, D3DDEVICEDESC* helDesc) override;
|
void GetDesc(D3DDEVICEDESC* halDesc, D3DDEVICEDESC* helDesc) override;
|
||||||
const char* GetName() override;
|
const char* GetName() override;
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class Direct3DRMSDL3GPURenderer : public Direct3DRMRenderer {
|
|||||||
static Direct3DRMRenderer* Create(DWORD width, DWORD height);
|
static Direct3DRMRenderer* Create(DWORD width, DWORD height);
|
||||||
~Direct3DRMSDL3GPURenderer() override;
|
~Direct3DRMSDL3GPURenderer() override;
|
||||||
void PushLights(const SceneLight* vertices, size_t count) override;
|
void PushLights(const SceneLight* vertices, size_t count) override;
|
||||||
Uint32 GetTextureId(IDirect3DRMTexture* texture) override;
|
Uint32 GetTextureId(IDirect3DRMTexture* texture, bool isUi) override;
|
||||||
Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) override;
|
Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) override;
|
||||||
void SetProjection(const D3DRMMATRIX4D& projection, D3DVALUE front, D3DVALUE back) override;
|
void SetProjection(const D3DRMMATRIX4D& projection, D3DVALUE front, D3DVALUE back) override;
|
||||||
void SetFrustumPlanes(const Plane* frustumPlanes) override;
|
void SetFrustumPlanes(const Plane* frustumPlanes) override;
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class Direct3DRMSoftwareRenderer : public Direct3DRMRenderer {
|
|||||||
Direct3DRMSoftwareRenderer(DWORD width, DWORD height);
|
Direct3DRMSoftwareRenderer(DWORD width, DWORD height);
|
||||||
~Direct3DRMSoftwareRenderer() override;
|
~Direct3DRMSoftwareRenderer() override;
|
||||||
void PushLights(const SceneLight* vertices, size_t count) override;
|
void PushLights(const SceneLight* vertices, size_t count) override;
|
||||||
Uint32 GetTextureId(IDirect3DRMTexture* texture) override;
|
Uint32 GetTextureId(IDirect3DRMTexture* texture, bool isUi) override;
|
||||||
Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) override;
|
Uint32 GetMeshId(IDirect3DRMMesh* mesh, const MeshGroup* meshGroup) override;
|
||||||
void SetProjection(const D3DRMMATRIX4D& projection, D3DVALUE front, D3DVALUE back) override;
|
void SetProjection(const D3DRMMATRIX4D& projection, D3DVALUE front, D3DVALUE back) override;
|
||||||
void SetFrustumPlanes(const Plane* frustumPlanes) override;
|
void SetFrustumPlanes(const Plane* frustumPlanes) override;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user