FREESCAPE: renamed shaders filenames and added them into shader.dat

This commit is contained in:
neuromancer 2023-04-02 08:50:05 +02:00
parent 1af55ed1dc
commit 4f29dd4299
8 changed files with 17 additions and 2 deletions

View File

@ -522,6 +522,9 @@ endif
ifdef ENABLE_HPL1 ifdef ENABLE_HPL1
DIST_FILES_SHADERS+=$(wildcard $(srcdir)/engines/hpl1/engine/impl/shaders/*) DIST_FILES_SHADERS+=$(wildcard $(srcdir)/engines/hpl1/engine/impl/shaders/*)
endif endif
ifdef ENABLE_FREESCAPE
DIST_FILES_SHADERS+=$(wildcard $(srcdir)/engines/freescape/shaders/*)
endif
endif endif
.PHONY: all clean distclean plugins dist-src clean-toplevel manual .PHONY: all clean distclean plugins dist-src clean-toplevel manual

View File

@ -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.fragment");
files.push_back("engines/wintermute/base/gfx/opengl/shaders/wme_sprite.vertex"); 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("icons/scummvm.icns");
files.push_back("AUTHORS"); files.push_back("AUTHORS");
files.push_back("COPYING"); files.push_back("COPYING");

View File

@ -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.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" shaders/hpl1_refract_water.vertex FILE "engines/hpl1/engine/impl/shaders/hpl1_refract_water.vertex"
#endif #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
#endif #endif

View File

@ -75,13 +75,13 @@ void OpenGLShaderRenderer::init() {
_verts = (Vertex *)malloc(sizeof(Vertex) * kVertexArraySize); _verts = (Vertex *)malloc(sizeof(Vertex) * kVertexArraySize);
static const char *triangleAttributes[] = { "position", nullptr }; 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); _triangleVBO = OpenGL::Shader::createBuffer(GL_ARRAY_BUFFER, sizeof(Vertex) * kVertexArraySize, _verts, GL_DYNAMIC_DRAW);
// TODO: Check if 3 * sizeof(float) == sizeof(Vertex) // TODO: Check if 3 * sizeof(float) == sizeof(Vertex)
_triangleShader->enableVertexAttribute("position", _triangleVBO, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), 0); _triangleShader->enableVertexAttribute("position", _triangleVBO, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), 0);
static const char *bitmapAttributes[] = { "position", "texcoord", nullptr }; 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); _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("position", _bitmapVBO, 2, GL_FLOAT, GL_TRUE, 2 * sizeof(float), 0);
_bitmapShader->enableVertexAttribute("texcoord", _bitmapVBO, 2, GL_FLOAT, GL_TRUE, 2 * sizeof(float), 0); _bitmapShader->enableVertexAttribute("texcoord", _bitmapVBO, 2, GL_FLOAT, GL_TRUE, 2 * sizeof(float), 0);