Index: source/graphics/ShaderProgram.cpp =================================================================== --- source/graphics/ShaderProgram.cpp +++ source/graphics/ShaderProgram.cpp @@ -83,7 +83,7 @@ return true; } - virtual void Reload() + void Reload() override { Unload(); @@ -115,7 +115,7 @@ m_IsValid = false; } - virtual void Bind() + void Bind() override { glEnable(GL_VERTEX_PROGRAM_ARB); glEnable(GL_FRAGMENT_PROGRAM_ARB); @@ -125,7 +125,7 @@ BindClientStates(); } - virtual void Unbind() + void Unbind() override { glDisable(GL_VERTEX_PROGRAM_ARB); glDisable(GL_FRAGMENT_PROGRAM_ARB); @@ -153,7 +153,7 @@ return it->second; } - virtual Binding GetTextureBinding(texture_id_t id) + Binding GetTextureBinding(texture_id_t id) override { frag_index_pair_t fPair = GetUniformFragmentIndex(id); int index = fPair.first; @@ -163,7 +163,7 @@ return Binding((int)fPair.second, index); } - virtual void BindTexture(texture_id_t id, Handle tex) + void BindTexture(texture_id_t id, Handle tex) override { frag_index_pair_t fPair = GetUniformFragmentIndex(id); int index = fPair.first; @@ -176,7 +176,7 @@ } } - virtual void BindTexture(texture_id_t id, GLuint tex) + void BindTexture(texture_id_t id, GLuint tex) override { frag_index_pair_t fPair = GetUniformFragmentIndex(id); int index = fPair.first; @@ -187,19 +187,19 @@ } } - virtual void BindTexture(Binding id, Handle tex) + void BindTexture(Binding id, Handle tex) override { int index = id.second; if (index != -1) ogl_tex_bind(tex, index); } - virtual Binding GetUniformBinding(uniform_id_t id) + Binding GetUniformBinding(uniform_id_t id) override { return Binding(GetUniformVertexIndex(id), GetUniformFragmentIndex(id).first); } - virtual void Uniform(Binding id, float v0, float v1, float v2, float v3) + void Uniform(Binding id, float v0, float v1, float v2, float v3) override { if (id.first != -1) pglProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, (GLuint)id.first, v0, v1, v2, v3); @@ -208,7 +208,7 @@ pglProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, (GLuint)id.second, v0, v1, v2, v3); } - virtual void Uniform(Binding id, const CMatrix3D& v) + void Uniform(Binding id, const CMatrix3D& v) override { if (id.first != -1) { @@ -227,19 +227,19 @@ } } - virtual void Uniform(Binding id, size_t count, const CMatrix3D* v) + void Uniform(Binding id, size_t count, const CMatrix3D* v) override { ENSURE(count == 1); Uniform(id, v[0]); } - virtual void Uniform(Binding id, size_t count, const float* v) + void Uniform(Binding id, size_t count, const float* v) override { ENSURE(count == 4); Uniform(id, v[0], v[1], v[2], v[3]); } - virtual std::vector GetFileDependencies() const override + std::vector GetFileDependencies() const override { return {m_VertexFile, m_FragmentFile}; } @@ -428,7 +428,7 @@ return true; } - virtual void Reload() + void Reload() override { Unload(); @@ -508,7 +508,7 @@ // The shader objects can be reused and don't need to be deleted here } - virtual void Bind() + void Bind() override { pglUseProgramObjectARB(m_Program); @@ -516,7 +516,7 @@ pglEnableVertexAttribArrayARB(it->second); } - virtual void Unbind() + void Unbind() override { pglUseProgramObjectARB(0); @@ -526,7 +526,7 @@ // TODO: should unbind textures, probably } - virtual Binding GetTextureBinding(texture_id_t id) + Binding GetTextureBinding(texture_id_t id) override { std::map >::iterator it = m_Samplers.find(CStrIntern(id)); if (it == m_Samplers.end()) @@ -535,7 +535,7 @@ return Binding((int)it->second.first, it->second.second); } - virtual void BindTexture(texture_id_t id, Handle tex) + void BindTexture(texture_id_t id, Handle tex) override { std::map >::iterator it = m_Samplers.find(CStrIntern(id)); if (it == m_Samplers.end()) @@ -547,7 +547,7 @@ glBindTexture(it->second.first, h); } - virtual void BindTexture(texture_id_t id, GLuint tex) + void BindTexture(texture_id_t id, GLuint tex) override { std::map >::iterator it = m_Samplers.find(CStrIntern(id)); if (it == m_Samplers.end()) @@ -557,7 +557,7 @@ glBindTexture(it->second.first, tex); } - virtual void BindTexture(Binding id, Handle tex) + void BindTexture(Binding id, Handle tex) override { if (id.second == -1) return; @@ -568,7 +568,7 @@ glBindTexture(id.first, h); } - virtual Binding GetUniformBinding(uniform_id_t id) + Binding GetUniformBinding(uniform_id_t id) override { std::map >::iterator it = m_Uniforms.find(id); if (it == m_Uniforms.end()) @@ -577,7 +577,7 @@ return Binding(it->second.first, (int)it->second.second); } - virtual void Uniform(Binding id, float v0, float v1, float v2, float v3) + void Uniform(Binding id, float v0, float v1, float v2, float v3) override { if (id.first != -1) { @@ -594,7 +594,7 @@ } } - virtual void Uniform(Binding id, const CMatrix3D& v) + void Uniform(Binding id, const CMatrix3D& v) override { if (id.first != -1) { @@ -605,7 +605,7 @@ } } - virtual void Uniform(Binding id, size_t count, const CMatrix3D* v) + void Uniform(Binding id, size_t count, const CMatrix3D* v) override { if (id.first != -1) { @@ -616,7 +616,7 @@ } } - virtual void Uniform(Binding id, size_t count, const float* v) + void Uniform(Binding id, size_t count, const float* v) override { if (id.first != -1) { @@ -630,31 +630,31 @@ // Map the various fixed-function Pointer functions onto generic vertex attributes // (matching the attribute indexes from ShaderManager's ParseAttribSemantics): - virtual void VertexPointer(GLint size, GLenum type, GLsizei stride, const void* pointer) + void VertexPointer(GLint size, GLenum type, GLsizei stride, const void* pointer) override { pglVertexAttribPointerARB(0, size, type, GL_FALSE, stride, pointer); m_ValidStreams |= STREAM_POS; } - virtual void NormalPointer(GLenum type, GLsizei stride, const void* pointer) + void NormalPointer(GLenum type, GLsizei stride, const void* pointer) override { pglVertexAttribPointerARB(2, 3, type, (type == GL_FLOAT ? GL_FALSE : GL_TRUE), stride, pointer); m_ValidStreams |= STREAM_NORMAL; } - virtual void ColorPointer(GLint size, GLenum type, GLsizei stride, const void* pointer) + void ColorPointer(GLint size, GLenum type, GLsizei stride, const void* pointer) override { pglVertexAttribPointerARB(3, size, type, (type == GL_FLOAT ? GL_FALSE : GL_TRUE), stride, pointer); m_ValidStreams |= STREAM_COLOR; } - virtual void TexCoordPointer(GLenum texture, GLint size, GLenum type, GLsizei stride, const void* pointer) + void TexCoordPointer(GLenum texture, GLint size, GLenum type, GLsizei stride, const void* pointer) override { pglVertexAttribPointerARB(8 + texture - GL_TEXTURE0, size, type, GL_FALSE, stride, pointer); m_ValidStreams |= STREAM_UV0 << (texture - GL_TEXTURE0); } - virtual void VertexAttribPointer(attrib_id_t id, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer) + void VertexAttribPointer(attrib_id_t id, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer) override { std::map::iterator it = m_VertexAttribs.find(id); if (it != m_VertexAttribs.end()) @@ -663,7 +663,7 @@ } } - virtual void VertexAttribIPointer(attrib_id_t id, GLint size, GLenum type, GLsizei stride, const void* pointer) + void VertexAttribIPointer(attrib_id_t id, GLint size, GLenum type, GLsizei stride, const void* pointer) override { std::map::iterator it = m_VertexAttribs.find(id); if (it != m_VertexAttribs.end()) @@ -676,7 +676,7 @@ } } - virtual std::vector GetFileDependencies() const + std::vector GetFileDependencies() const override { return m_FileDependencies; } Index: source/lobby/XmppClient.cpp =================================================================== --- source/lobby/XmppClient.cpp +++ source/lobby/XmppClient.cpp @@ -36,8 +36,6 @@ #include "scriptinterface/ScriptExtraHeaders.h" // StructuredClone #include "scriptinterface/ScriptInterface.h" -#include - #include //debug Index: source/lobby/glooxwrapper/glooxwrapper.h =================================================================== --- source/lobby/glooxwrapper/glooxwrapper.h +++ source/lobby/glooxwrapper/glooxwrapper.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -79,6 +79,12 @@ #include +// Gloox leaves some #define up, we need to undefine them. +#undef lookup +#undef lookup2 +#undef deflookup +#undef deflookup2 + #if OS_WIN #define GLOOXWRAPPER_API __declspec(dllexport) #else Index: source/scriptinterface/ScriptExtraHeaders.h =================================================================== --- source/scriptinterface/ScriptExtraHeaders.h +++ source/scriptinterface/ScriptExtraHeaders.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2016 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -47,6 +47,7 @@ #include "jsfriendapi.h" +#include "js/AllocPolicy.h" #include "js/Array.h" #include "js/ArrayBuffer.h" #include "js/CompilationAndEvaluation.h" @@ -54,6 +55,7 @@ #include "js/ContextOptions.h" #include "js/ForOfIterator.h" #include "js/GCAPI.h" +#include "js/GCHashTable.h" #include "js/JSON.h" #include "js/SourceText.h" #include "js/StructuredClone.h" Index: source/simulation2/helpers/Render.cpp =================================================================== --- source/simulation2/helpers/Render.cpp +++ source/simulation2/helpers/Render.cpp @@ -66,7 +66,7 @@ static void ConstructCircleOrClosedArc( const CSimContext& context, float x, float z, float radius, - bool isCircle, + const bool isCircle, float start, float end, SOverlayLine& overlay, bool floating, float heightOffset) { Index: source/simulation2/serialization/BinarySerializer.h =================================================================== --- source/simulation2/serialization/BinarySerializer.h +++ source/simulation2/serialization/BinarySerializer.h @@ -22,8 +22,7 @@ #include "lib/byte_order.h" -#include "js/AllocPolicy.h" -#include "js/GCHashTable.h" +#include "scriptinterface/ScriptExtraHeaders.h" #include #include