From 4f29dd4299e8db3fe98f8f987f158f38a65fd35f Mon Sep 17 00:00:00 2001 From: neuromancer Date: Sun, 2 Apr 2023 08:50:05 +0200 Subject: [PATCH] FREESCAPE: renamed shaders filenames and added them into shader.dat --- Makefile.common | 3 +++ devtools/create_project/xcode.cpp | 6 ++++++ dists/scummvm.rc | 6 ++++++ engines/freescape/gfx_opengl_shaders.cpp | 4 ++-- .../shaders/{bitmap.fragment => freescape_bitmap.fragment} | 0 .../shaders/{bitmap.vertex => freescape_bitmap.vertex} | 0 .../{triangle.fragment => freescape_triangle.fragment} | 0 .../shaders/{triangle.vertex => freescape_triangle.vertex} | 0 8 files changed, 17 insertions(+), 2 deletions(-) rename engines/freescape/shaders/{bitmap.fragment => freescape_bitmap.fragment} (100%) rename engines/freescape/shaders/{bitmap.vertex => freescape_bitmap.vertex} (100%) rename engines/freescape/shaders/{triangle.fragment => freescape_triangle.fragment} (100%) rename engines/freescape/shaders/{triangle.vertex => freescape_triangle.vertex} (100%) diff --git a/Makefile.common b/Makefile.common index 833100a684c..82fea459b0f 100644 --- a/Makefile.common +++ b/Makefile.common @@ -522,6 +522,9 @@ endif ifdef ENABLE_HPL1 DIST_FILES_SHADERS+=$(wildcard $(srcdir)/engines/hpl1/engine/impl/shaders/*) endif +ifdef ENABLE_FREESCAPE +DIST_FILES_SHADERS+=$(wildcard $(srcdir)/engines/freescape/shaders/*) +endif endif .PHONY: all clean distclean plugins dist-src clean-toplevel manual diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 7662c8f24ca..c66ae4d5905 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -1083,6 +1083,12 @@ XcodeProvider::ValueList& XcodeProvider::getResourceFiles(const BuildSetup &setu files.push_back("engines/wintermute/base/gfx/opengl/shaders/wme_sprite.fragment"); files.push_back("engines/wintermute/base/gfx/opengl/shaders/wme_sprite.vertex"); } + if (CONTAINS_DEFINE(setup.defines, "ENABLE_FREESCAPE")) { + files.push_back("engines/freescape/shaders/freescape_bitmap.fragment"); + files.push_back("engines/freescape/shaders/freescape_bitmap.vertex"); + files.push_back("engines/freescape/shaders/freescape_triangle.fragment"); + files.push_back("engines/freescape/shaders/freescape_triange.vertex"); + } files.push_back("icons/scummvm.icns"); files.push_back("AUTHORS"); files.push_back("COPYING"); diff --git a/dists/scummvm.rc b/dists/scummvm.rc index 83cf898f0eb..c6765a447f3 100644 --- a/dists/scummvm.rc +++ b/dists/scummvm.rc @@ -281,6 +281,12 @@ shaders/hpl1_refract_special.fragment FILE "engines/hpl1/engi shaders/hpl1_refract_water.fragment FILE "engines/hpl1/engine/impl/shaders/hpl1_refract_water.fragment" shaders/hpl1_refract_water.vertex FILE "engines/hpl1/engine/impl/shaders/hpl1_refract_water.vertex" #endif +#if PLUGIN_ENABLED_STATIC(FREESCAPE) +shaders/freescape_bitmap.fragment FILE "engines/freescape/shaders/freescape_bitmap.fragment" +shaders/freescape_bitmap.vertex FILE "engines/freescape/shaders/freescape_bitmap.vertex" +shaders/freescape_triangle.fragment FILE "engines/freescape/shaders/freescape_cube.fragment" +shaders/freescape_triangle.vertex FILE "engines/freescape/shaders/freescape_cube.vertex" +#endif #endif #endif diff --git a/engines/freescape/gfx_opengl_shaders.cpp b/engines/freescape/gfx_opengl_shaders.cpp index a30c22935db..b6799bbfcfa 100644 --- a/engines/freescape/gfx_opengl_shaders.cpp +++ b/engines/freescape/gfx_opengl_shaders.cpp @@ -75,13 +75,13 @@ void OpenGLShaderRenderer::init() { _verts = (Vertex *)malloc(sizeof(Vertex) * kVertexArraySize); static const char *triangleAttributes[] = { "position", nullptr }; - _triangleShader = OpenGL::Shader::fromFiles("triangle", triangleAttributes); + _triangleShader = OpenGL::Shader::fromFiles("freescape_triangle", triangleAttributes); _triangleVBO = OpenGL::Shader::createBuffer(GL_ARRAY_BUFFER, sizeof(Vertex) * kVertexArraySize, _verts, GL_DYNAMIC_DRAW); // TODO: Check if 3 * sizeof(float) == sizeof(Vertex) _triangleShader->enableVertexAttribute("position", _triangleVBO, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), 0); static const char *bitmapAttributes[] = { "position", "texcoord", nullptr }; - _bitmapShader = OpenGL::Shader::fromFiles("bitmap", bitmapAttributes); + _bitmapShader = OpenGL::Shader::fromFiles("freescape_bitmap", bitmapAttributes); _bitmapVBO = OpenGL::Shader::createBuffer(GL_ARRAY_BUFFER, sizeof(bitmapVertices), bitmapVertices); _bitmapShader->enableVertexAttribute("position", _bitmapVBO, 2, GL_FLOAT, GL_TRUE, 2 * sizeof(float), 0); _bitmapShader->enableVertexAttribute("texcoord", _bitmapVBO, 2, GL_FLOAT, GL_TRUE, 2 * sizeof(float), 0); diff --git a/engines/freescape/shaders/bitmap.fragment b/engines/freescape/shaders/freescape_bitmap.fragment similarity index 100% rename from engines/freescape/shaders/bitmap.fragment rename to engines/freescape/shaders/freescape_bitmap.fragment diff --git a/engines/freescape/shaders/bitmap.vertex b/engines/freescape/shaders/freescape_bitmap.vertex similarity index 100% rename from engines/freescape/shaders/bitmap.vertex rename to engines/freescape/shaders/freescape_bitmap.vertex diff --git a/engines/freescape/shaders/triangle.fragment b/engines/freescape/shaders/freescape_triangle.fragment similarity index 100% rename from engines/freescape/shaders/triangle.fragment rename to engines/freescape/shaders/freescape_triangle.fragment diff --git a/engines/freescape/shaders/triangle.vertex b/engines/freescape/shaders/freescape_triangle.vertex similarity index 100% rename from engines/freescape/shaders/triangle.vertex rename to engines/freescape/shaders/freescape_triangle.vertex