mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-20 22:21:15 +00:00
Implement dithering where relevant
This commit is contained in:
parent
ba14b48284
commit
16a5c42147
@ -600,6 +600,10 @@ void Citro3DRenderer::Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, con
|
|||||||
C3D_ImmDrawEnd();
|
C3D_ImmDrawEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Citro3DRenderer::SetDither(bool dither)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void Citro3DRenderer::Download(SDL_Surface* target)
|
void Citro3DRenderer::Download(SDL_Surface* target)
|
||||||
{
|
{
|
||||||
MINIWIN_NOT_IMPLEMENTED();
|
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);
|
Actual_Draw2DImage(m_textures[textureId].dxTexture, srcRect, dstRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DirectX9Renderer::SetDither(bool dither)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void DirectX9Renderer::Download(SDL_Surface* target)
|
void DirectX9Renderer::Download(SDL_Surface* target)
|
||||||
{
|
{
|
||||||
Actual_Download(target);
|
Actual_Download(target);
|
||||||
|
|||||||
@ -357,3 +357,13 @@ void GL11_Download(SDL_Surface* target)
|
|||||||
glFinish();
|
glFinish();
|
||||||
glReadPixels(0, 0, target->w, target->h, GL_RGBA, GL_UNSIGNED_BYTE, target->pixels);
|
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 bottom,
|
||||||
float top
|
float top
|
||||||
);
|
);
|
||||||
|
void GL11_SetDither(bool dither);
|
||||||
void GL11_Download(SDL_Surface* target);
|
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);
|
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)
|
void OpenGL1Renderer::Download(SDL_Surface* target)
|
||||||
{
|
{
|
||||||
GL11_Download(m_renderedImage);
|
GL11_Download(m_renderedImage);
|
||||||
|
|||||||
@ -706,3 +706,13 @@ void OpenGLES2Renderer::Download(SDL_Surface* target)
|
|||||||
|
|
||||||
SDL_DestroySurface(bufferClone);
|
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);
|
SDL_SetGPUScissor(m_renderPass, &fullViewport);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Direct3DRMSDL3GPURenderer::SetDither(bool dither)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void Direct3DRMSDL3GPURenderer::Download(SDL_Surface* target)
|
void Direct3DRMSDL3GPURenderer::Download(SDL_Surface* target)
|
||||||
{
|
{
|
||||||
if (!m_cmdbuf) {
|
if (!m_cmdbuf) {
|
||||||
|
|||||||
@ -788,6 +788,10 @@ void Direct3DRMSoftwareRenderer::Draw2DImage(Uint32 textureId, const SDL_Rect& s
|
|||||||
SDL_LockSurface(surface);
|
SDL_LockSurface(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Direct3DRMSoftwareRenderer::SetDither(bool dither)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void Direct3DRMSoftwareRenderer::Download(SDL_Surface* target)
|
void Direct3DRMSoftwareRenderer::Download(SDL_Surface* target)
|
||||||
{
|
{
|
||||||
SDL_Rect srcRect = {
|
SDL_Rect srcRect = {
|
||||||
|
|||||||
@ -84,9 +84,7 @@ D3DRMRENDERQUALITY Direct3DRMDevice2Impl::GetQuality()
|
|||||||
|
|
||||||
HRESULT Direct3DRMDevice2Impl::SetDither(BOOL dither)
|
HRESULT Direct3DRMDevice2Impl::SetDither(BOOL dither)
|
||||||
{
|
{
|
||||||
if (dither) {
|
m_renderer->SetDither(dither);
|
||||||
MINIWIN_NOT_IMPLEMENTED();
|
|
||||||
}
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,6 +53,7 @@ class Direct3DRMRenderer : public IDirect3DDevice2 {
|
|||||||
virtual void Flip() = 0;
|
virtual void Flip() = 0;
|
||||||
virtual void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) = 0;
|
virtual void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) = 0;
|
||||||
virtual void Download(SDL_Surface* target) = 0;
|
virtual void Download(SDL_Surface* target) = 0;
|
||||||
|
virtual void SetDither(bool dither) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_width, m_height;
|
int m_width, m_height;
|
||||||
|
|||||||
@ -50,6 +50,7 @@ class Citro3DRenderer : public Direct3DRMRenderer {
|
|||||||
void Flip() override;
|
void Flip() override;
|
||||||
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
||||||
void Download(SDL_Surface* target) override;
|
void Download(SDL_Surface* target) override;
|
||||||
|
void SetDither(bool dither) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class DirectX9Renderer : public Direct3DRMRenderer {
|
|||||||
void Flip() override;
|
void Flip() override;
|
||||||
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
||||||
void Download(SDL_Surface* target) override;
|
void Download(SDL_Surface* target) override;
|
||||||
|
void SetDither(bool dither) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class OpenGL1Renderer : public Direct3DRMRenderer {
|
|||||||
void Flip() override;
|
void Flip() override;
|
||||||
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
||||||
void Download(SDL_Surface* target) override;
|
void Download(SDL_Surface* target) override;
|
||||||
|
void SetDither(bool dither) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
||||||
|
|||||||
@ -57,6 +57,7 @@ class OpenGLES2Renderer : public Direct3DRMRenderer {
|
|||||||
void Flip() override;
|
void Flip() override;
|
||||||
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
||||||
void Download(SDL_Surface* target) override;
|
void Download(SDL_Surface* target) override;
|
||||||
|
void SetDither(bool dither) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
||||||
|
|||||||
@ -67,6 +67,7 @@ class Direct3DRMSDL3GPURenderer : public Direct3DRMRenderer {
|
|||||||
void Flip() override;
|
void Flip() override;
|
||||||
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
||||||
void Download(SDL_Surface* target) override;
|
void Download(SDL_Surface* target) override;
|
||||||
|
void SetDither(bool dither) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Direct3DRMSDL3GPURenderer(
|
Direct3DRMSDL3GPURenderer(
|
||||||
|
|||||||
@ -49,6 +49,7 @@ class Direct3DRMSoftwareRenderer : public Direct3DRMRenderer {
|
|||||||
void Flip() override;
|
void Flip() override;
|
||||||
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
void Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const SDL_Rect& dstRect) override;
|
||||||
void Download(SDL_Surface* target) override;
|
void Download(SDL_Surface* target) override;
|
||||||
|
void SetDither(bool dither) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ClearZBuffer();
|
void ClearZBuffer();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user