mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-02 12:01:15 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
ad861254be
@ -4,7 +4,7 @@ project(isle LANGUAGES CXX C VERSION 0.1)
|
|||||||
|
|
||||||
if (EMSCRIPTEN)
|
if (EMSCRIPTEN)
|
||||||
add_compile_options(-pthread)
|
add_compile_options(-pthread)
|
||||||
add_link_options(-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=2gb -sUSE_PTHREADS=1 -sPROXY_TO_PTHREAD=1 -sPTHREAD_POOL_SIZE_STRICT=0 -sFORCE_FILESYSTEM=1 -sWASMFS=1 -sEXIT_RUNTIME=1)
|
add_link_options(-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=2gb -sUSE_PTHREADS=1 -sPROXY_TO_PTHREAD=1 -sOFFSCREENCANVAS_SUPPORT=1 -sPTHREAD_POOL_SIZE_STRICT=0 -sFORCE_FILESYSTEM=1 -sWASMFS=1 -sEXIT_RUNTIME=1)
|
||||||
set(SDL_PTHREADS ON CACHE BOOL "Enable SDL pthreads" FORCE)
|
set(SDL_PTHREADS ON CACHE BOOL "Enable SDL pthreads" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -562,8 +562,10 @@
|
|||||||
<tabstop>sound3DCheckBox</tabstop>
|
<tabstop>sound3DCheckBox</tabstop>
|
||||||
<tabstop>musicCheckBox</tabstop>
|
<tabstop>musicCheckBox</tabstop>
|
||||||
<tabstop>joystickCheckBox</tabstop>
|
<tabstop>joystickCheckBox</tabstop>
|
||||||
|
<tabstop>fullscreenCheckBox</tabstop>
|
||||||
<tabstop>devicesList</tabstop>
|
<tabstop>devicesList</tabstop>
|
||||||
<tabstop>okButton</tabstop>
|
<tabstop>okButton</tabstop>
|
||||||
|
<tabstop>launchButton</tabstop>
|
||||||
<tabstop>cancelButton</tabstop>
|
<tabstop>cancelButton</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
|
|||||||
@ -49,12 +49,14 @@ if(NOT VITA)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_library(OPENGL_ES2_LIBRARY NAMES GLESv2)
|
find_library(OPENGL_ES2_LIBRARY NAMES GLESv2)
|
||||||
if(OPENGL_ES2_LIBRARY)
|
if(EMSCRIPTEN OR OPENGL_ES2_LIBRARY)
|
||||||
message(STATUS "Found OpenGL: enabling OpenGL ES 2.x renderer")
|
message(STATUS "Found OpenGL: enabling OpenGL ES 2.x renderer")
|
||||||
target_sources(miniwin PRIVATE src/d3drm/backends/opengles2/renderer.cpp)
|
target_sources(miniwin PRIVATE src/d3drm/backends/opengles2/renderer.cpp)
|
||||||
list(APPEND GRAPHICS_BACKENDS USE_OPENGLES2)
|
list(APPEND GRAPHICS_BACKENDS USE_OPENGLES2)
|
||||||
|
if(OPENGL_ES2_LIBRARY)
|
||||||
target_link_libraries(miniwin PRIVATE ${OPENGL_ES2_LIBRARY})
|
target_link_libraries(miniwin PRIVATE ${OPENGL_ES2_LIBRARY})
|
||||||
else()
|
endif()
|
||||||
|
else()
|
||||||
message(STATUS "🧩 OpenGL ES 2.x support not enabled")
|
message(STATUS "🧩 OpenGL ES 2.x support not enabled")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -1487,6 +1487,10 @@ void GXMRenderer::Draw2DImage(Uint32 textureId, const SDL_Rect& srcRect, const S
|
|||||||
sceGxmPopUserMarker(this->context);
|
sceGxmPopUserMarker(this->context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GXMRenderer::SetDither(bool dither)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void GXMRenderer::Download(SDL_Surface* target)
|
void GXMRenderer::Download(SDL_Surface* target)
|
||||||
{
|
{
|
||||||
SDL_Rect srcRect = {
|
SDL_Rect srcRect = {
|
||||||
|
|||||||
@ -321,9 +321,6 @@ void GL11_Draw2DImage(
|
|||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
GLint boundTexture = 0;
|
|
||||||
glGetIntegerv(GL_TEXTURE_BINDING_2D, &boundTexture);
|
|
||||||
|
|
||||||
float u1 = srcRect.x / cache.width;
|
float u1 = srcRect.x / cache.width;
|
||||||
float v1 = srcRect.y / cache.height;
|
float v1 = srcRect.y / cache.height;
|
||||||
float u2 = (srcRect.x + srcRect.w) / cache.width;
|
float u2 = (srcRect.x + srcRect.w) / cache.width;
|
||||||
@ -357,3 +354,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);
|
||||||
|
|||||||
@ -134,6 +134,7 @@ class GXMRenderer : 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