Removed unused clean-shader functionality (which is now done by
shader.?pp), removed global shader name variable.
This commit is contained in:
parent
51fb693455
commit
2f287fbee6
@ -90,8 +90,6 @@
|
||||
|
||||
*/
|
||||
|
||||
#define SHADER_NAMES
|
||||
|
||||
#include "graphics/shaders.hpp"
|
||||
|
||||
#include "graphics/callbacks.hpp"
|
||||
@ -111,9 +109,13 @@ bool Shaders::m_has_been_initialised = false;
|
||||
video::IShaderConstantSetCallBack *Shaders::m_callbacks[ES_COUNT];
|
||||
int Shaders::m_shaders[ES_COUNT];
|
||||
|
||||
using namespace video;
|
||||
// Use macro FOREACH_SHADER from shaders.hpp to create an array
|
||||
// with all shader names.
|
||||
#define STR(a) #a,
|
||||
const char *Shaders::shader_names[] = { FOREACH_SHADER(STR) };
|
||||
#undef STR
|
||||
|
||||
std::vector<void(*)()> CleanTable;
|
||||
using namespace video;
|
||||
|
||||
void Shaders::init()
|
||||
{
|
||||
@ -305,19 +307,9 @@ void Shaders::loadShaders()
|
||||
}
|
||||
|
||||
initGL();
|
||||
CleanTable.clear();
|
||||
SharedGPUObjects::init();
|
||||
} // loadShaders
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** C
|
||||
*/
|
||||
void Shaders::killShaders()
|
||||
{
|
||||
for (unsigned i = 0; i < CleanTable.size(); i++)
|
||||
CleanTable[i]();
|
||||
} // killShaders
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void Shaders::check(const int num)
|
||||
{
|
||||
|
@ -52,24 +52,19 @@ class ParticleSystemProxy;
|
||||
ACT(ES_DISPLACE) \
|
||||
|
||||
#define ENUM(a) a,
|
||||
#define STR(a) #a,
|
||||
|
||||
enum ShaderType
|
||||
{
|
||||
FOREACH_SHADER(ENUM)
|
||||
|
||||
ES_COUNT
|
||||
};
|
||||
#undef ENUM
|
||||
|
||||
#ifdef SHADER_NAMES
|
||||
static const char *shader_names[] = {
|
||||
FOREACH_SHADER(STR)
|
||||
};
|
||||
#endif
|
||||
|
||||
class Shaders
|
||||
{
|
||||
private:
|
||||
static const char *shader_names[];
|
||||
static bool m_has_been_initialised;
|
||||
|
||||
static int m_shaders[ES_COUNT];
|
||||
@ -99,11 +94,6 @@ public:
|
||||
{
|
||||
return m_has_been_initialised ? m_callbacks[num] : NULL;
|
||||
} // getCallback
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
void killShaders();
|
||||
|
||||
// ========================================================================
|
||||
/** Shader to draw a colored line.
|
||||
@ -166,8 +156,4 @@ public:
|
||||
|
||||
}; // class Shaders
|
||||
|
||||
#undef ENUM
|
||||
#undef STR
|
||||
#undef FOREACH_SHADER
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user