mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-09-20 18:32:37 -04:00
Implement dithering where relevant (#473)
This commit is contained in:
parent
cca65ba178
commit
55c13cd140
@ -600,6 +600,10 @@ void Citro3DRenderer::Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, con
|
||||
C3D_ImmDrawEnd();
|
||||
}
|
||||
|
||||
void Citro3DRenderer::SetDither(bool dither)
|
||||
{
|
||||
}
|
||||
|
||||
void Citro3DRenderer::Download(SDL_Surface* target)
|
||||
{
|
||||
MINIWIN_NOT_IMPLEMENTED();
|
||||
|
@ -278,6 +278,10 @@ void DirectX9Renderer::Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, co
|
||||
Actual_Draw2DImage(m_textures[textureId].dxTexture, srcRect, dstRect);
|
||||
}
|
||||
|
||||
void DirectX9Renderer::SetDither(bool dither)
|
||||
{
|
||||
}
|
||||
|
||||
void DirectX9Renderer::Download(SDL_Surface* target)
|
||||
{
|
||||
Actual_Download(target);
|
||||
|
@ -354,3 +354,13 @@ void GL11_Download(SDL_Surface* target)
|
||||
glFinish();
|
||||
glReadPixels(0, 0, target->w, target->h, GL_RGBA, GL_UNSIGNED_BYTE, target->pixels);
|
||||
}
|
||||
|
||||
void GL11_SetDither(bool dither)
|
||||
{
|
||||
if (dither) {
|
||||
glEnable(GL_DITHER);
|
||||
}
|
||||
else {
|
||||
glDisable(GL_DITHER);
|
||||
}
|
||||
}
|
||||
|
@ -87,4 +87,5 @@ void GL11_Draw2DImage(
|
||||
float bottom,
|
||||
float top
|
||||
);
|
||||
void GL11_SetDither(bool dither);
|
||||
void GL11_Download(SDL_Surface* target);
|
||||
|
@ -384,6 +384,11 @@ void OpenGL1Renderer::Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, con
|
||||
GL11_Draw2DImage(m_textures[textureId], srcRect, dstRect, left, right, bottom, top);
|
||||
}
|
||||
|
||||
void OpenGL1Renderer::SetDither(bool dither)
|
||||
{
|
||||
GL11_SetDither(dither);
|
||||
}
|
||||
|
||||
void OpenGL1Renderer::Download(SDL_Surface* target)
|
||||
{
|
||||
GL11_Download(m_renderedImage);
|
||||
|
@ -706,3 +706,13 @@ void OpenGLES2Renderer::Download(SDL_Surface* target)
|
||||
|
||||
SDL_DestroySurface(bufferClone);
|
||||
}
|
||||
|
||||
void OpenGLES2Renderer::SetDither(bool dither)
|
||||
{
|
||||
if (dither) {
|
||||
glEnable(GL_DITHER);
|
||||
}
|
||||
else {
|
||||
glDisable(GL_DITHER);
|
||||
}
|
||||
}
|
||||
|
@ -942,6 +942,10 @@ void Direct3DRMSDL3GPURenderer::Draw2DImage(Uint32 textureId, const SDL_Rect& sr
|
||||
SDL_SetGPUScissor(m_renderPass, &fullViewport);
|
||||
}
|
||||
|
||||
void Direct3DRMSDL3GPURenderer::SetDither(bool dither)
|
||||
{
|
||||
}
|
||||
|
||||
void Direct3DRMSDL3GPURenderer::Download(SDL_Surface* target)
|
||||
{
|
||||
if (!m_cmdbuf) {
|
||||
|
@ -788,6 +788,10 @@ void Direct3DRMSoftwareRenderer::Draw2DImage(Uint32 textureId, const SDL_Rect& s
|
||||
SDL_LockSurface(surface);
|
||||
}
|
||||
|
||||
void Direct3DRMSoftwareRenderer::SetDither(bool dither)
|
||||
{
|
||||
}
|
||||
|
||||
void Direct3DRMSoftwareRenderer::Download(SDL_Surface* target)
|
||||
{
|
||||
SDL_Rect srcRect = {
|
||||
|
@ -84,9 +84,7 @@ D3DRMRENDERQUALITY Direct3DRMDevice2Impl::GetQuality()
|
||||
|
||||
HRESULT Direct3DRMDevice2Impl::SetDither(BOOL dither)
|
||||
{
|
||||
if (dither) {
|
||||
MINIWIN_NOT_IMPLEMENTED();
|
||||
}
|
||||
m_renderer->SetDither(dither);
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,7 @@ public:
|
||||
virtual void Flip() = 0;
|
||||
virtual void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) = 0;
|
||||
virtual void Download(SDL_Surface* target) = 0;
|
||||
virtual void SetDither(bool dither) = 0;
|
||||
|
||||
protected:
|
||||
int m_width, m_height;
|
||||
|
@ -50,6 +50,7 @@ public:
|
||||
void Flip() override;
|
||||
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
||||
void Download(SDL_Surface* target) override;
|
||||
void SetDither(bool dither) override;
|
||||
|
||||
private:
|
||||
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
||||
|
@ -36,6 +36,7 @@ public:
|
||||
void Flip() override;
|
||||
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
||||
void Download(SDL_Surface* target) override;
|
||||
void SetDither(bool dither) override;
|
||||
|
||||
private:
|
||||
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
||||
|
@ -36,6 +36,7 @@ public:
|
||||
void Flip() override;
|
||||
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
||||
void Download(SDL_Surface* target) override;
|
||||
void SetDither(bool dither) override;
|
||||
|
||||
private:
|
||||
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
void Flip() override;
|
||||
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
||||
void Download(SDL_Surface* target) override;
|
||||
void SetDither(bool dither) override;
|
||||
|
||||
private:
|
||||
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
||||
|
@ -67,6 +67,7 @@ public:
|
||||
void Flip() override;
|
||||
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
||||
void Download(SDL_Surface* target) override;
|
||||
void SetDither(bool dither) override;
|
||||
|
||||
private:
|
||||
Direct3DRMSDL3GPURenderer(
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
void Flip() override;
|
||||
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
||||
void Download(SDL_Surface* target) override;
|
||||
void SetDither(bool dither) override;
|
||||
|
||||
private:
|
||||
void ClearZBuffer();
|
||||
|
Loading…
x
Reference in New Issue
Block a user