Removed unnecessary tabs from empty lines

This commit is contained in:
Alexander Szpakowski
2013-01-07 06:21:15 -04:00
parent 0968fa6f11
commit 88af7239c3
7 changed files with 128 additions and 137 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ bool Graphics::setMode(int width, int height, bool fullscreen, bool vsync, int f
height = currentWindow->getHeight(); height = currentWindow->getHeight();
// Okay, setup OpenGL. // Okay, setup OpenGL.
initializeContext(); initializeContext();
// Enable blending // Enable blending
+23 -23
View File
@@ -38,44 +38,44 @@ void initializeContext()
{ {
if (contextInitialized) if (contextInitialized)
return; return;
contextInitialized = true; contextInitialized = true;
textureUnits.clear(); textureUnits.clear();
// initialize multiple texture unit support, if available // initialize multiple texture unit support, if available
if (GLEE_ARB_multitexture || GLEE_VERSION_1_3) if (GLEE_ARB_multitexture || GLEE_VERSION_1_3)
{ {
GLint maxtextureunits; GLint maxtextureunits;
glGetIntegerv(GL_MAX_TEXTURE_UNITS, &maxtextureunits); glGetIntegerv(GL_MAX_TEXTURE_UNITS, &maxtextureunits);
// shaders/GL2.0 added "Texture Image Units." Total max texture units is the greater of the two // shaders/GL2.0 added "Texture Image Units." Total max texture units is the greater of the two
if (GLEE_VERSION_2_0 || GLEE_ARB_vertex_shader) if (GLEE_VERSION_2_0 || GLEE_ARB_vertex_shader)
{ {
GLint maxtextureimageunits; GLint maxtextureimageunits;
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxtextureimageunits); glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxtextureimageunits);
if (maxtextureimageunits > maxtextureunits) if (maxtextureimageunits > maxtextureunits)
maxtextureunits = maxtextureimageunits; maxtextureunits = maxtextureimageunits;
} }
textureUnits.resize(maxtextureunits, 0); textureUnits.resize(maxtextureunits, 0);
GLenum activetextureunit; GLenum activetextureunit;
glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint *)&activetextureunit); glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint *)&activetextureunit);
curTextureUnitIndex = activetextureunit - GL_TEXTURE0; curTextureUnitIndex = activetextureunit - GL_TEXTURE0;
for (size_t i = 0; i < textureUnits.size(); ++i) for (size_t i = 0; i < textureUnits.size(); ++i)
{ {
if (GLEE_VERSION_1_3) if (GLEE_VERSION_1_3)
glActiveTexture(GL_TEXTURE0 + i); glActiveTexture(GL_TEXTURE0 + i);
else else
glActiveTextureARB(GL_TEXTURE0 + i); glActiveTextureARB(GL_TEXTURE0 + i);
glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) &textureUnits[i]); glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) &textureUnits[i]);
} }
if (GLEE_VERSION_1_3) if (GLEE_VERSION_1_3)
glActiveTexture(activetextureunit); glActiveTexture(activetextureunit);
else else
@@ -86,7 +86,7 @@ void initializeContext()
// multitexturing not supported, so we only have 1 texture unit // multitexturing not supported, so we only have 1 texture unit
textureUnits.resize(1, 0); textureUnits.resize(1, 0);
curTextureUnitIndex = 0; curTextureUnitIndex = 0;
glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) &textureUnits[0]); glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) &textureUnits[0]);
} }
} }
@@ -99,12 +99,12 @@ void uninitializeContext()
void setActiveTextureUnit(GLenum textureunit) void setActiveTextureUnit(GLenum textureunit)
{ {
initializeContext(); initializeContext();
int textureunitindex = textureunit - GL_TEXTURE0; int textureunitindex = textureunit - GL_TEXTURE0;
if (textureunitindex < 0 || (size_t) textureunitindex >= textureUnits.size()) if (textureunitindex < 0 || (size_t) textureunitindex >= textureUnits.size())
throw love::Exception("Invalid texture unit index."); throw love::Exception("Invalid texture unit index.");
if (textureunitindex != curTextureUnitIndex) if (textureunitindex != curTextureUnitIndex)
{ {
if (GLEE_VERSION_1_3) if (GLEE_VERSION_1_3)
@@ -114,14 +114,14 @@ void setActiveTextureUnit(GLenum textureunit)
else else
throw love::Exception("Multitexturing not supported."); throw love::Exception("Multitexturing not supported.");
} }
curTextureUnitIndex = textureunitindex; curTextureUnitIndex = textureunitindex;
} }
void bindTexture(GLuint texture) void bindTexture(GLuint texture)
{ {
initializeContext(); initializeContext();
if (texture != textureUnits[curTextureUnitIndex]) if (texture != textureUnits[curTextureUnitIndex])
{ {
textureUnits[curTextureUnitIndex] = texture; textureUnits[curTextureUnitIndex] = texture;
@@ -132,20 +132,20 @@ void bindTexture(GLuint texture)
void bindTextureToUnit(GLuint texture, GLenum textureunit, bool restoreprev) void bindTextureToUnit(GLuint texture, GLenum textureunit, bool restoreprev)
{ {
initializeContext(); initializeContext();
int textureunitindex = textureunit - GL_TEXTURE0; int textureunitindex = textureunit - GL_TEXTURE0;
if (textureunitindex < 0 || (size_t) textureunitindex >= textureUnits.size()) if (textureunitindex < 0 || (size_t) textureunitindex >= textureUnits.size())
throw love::Exception("Invalid texture unit index."); throw love::Exception("Invalid texture unit index.");
if (texture != textureUnits[textureunitindex]) if (texture != textureUnits[textureunitindex])
{ {
int oldtexunitindex = curTextureUnitIndex; int oldtexunitindex = curTextureUnitIndex;
setActiveTextureUnit(textureunit); setActiveTextureUnit(textureunit);
textureUnits[textureunitindex] = texture; textureUnits[textureunitindex] = texture;
glBindTexture(GL_TEXTURE_2D, texture); glBindTexture(GL_TEXTURE_2D, texture);
if (restoreprev) if (restoreprev)
setActiveTextureUnit(GL_TEXTURE0 + oldtexunitindex); setActiveTextureUnit(GL_TEXTURE0 + oldtexunitindex);
} }
@@ -154,7 +154,7 @@ void bindTextureToUnit(GLuint texture, GLenum textureunit, bool restoreprev)
void deleteTexture(GLuint texture) void deleteTexture(GLuint texture)
{ {
initializeContext(); initializeContext();
std::vector<GLuint>::iterator it; std::vector<GLuint>::iterator it;
for (it = textureUnits.begin(); it != textureUnits.end(); ++it) for (it = textureUnits.begin(); it != textureUnits.end(); ++it)
{ {
+53 -53
View File
@@ -40,7 +40,7 @@ namespace
{ {
cureffect->attach(true); cureffect->attach(true);
} }
~TemporaryAttacher() ~TemporaryAttacher()
{ {
if (preveffect != NULL) if (preveffect != NULL)
@@ -48,7 +48,7 @@ namespace
else else
ShaderEffect::detach(); ShaderEffect::detach();
} }
ShaderEffect *cureffect; ShaderEffect *cureffect;
ShaderEffect *preveffect; ShaderEffect *preveffect;
}; };
@@ -66,15 +66,15 @@ ShaderEffect::ShaderEffect(const std::vector<ShaderSource> &shadersources)
{ {
if (shadersources.size() == 0) if (shadersources.size() == 0)
throw love::Exception("Cannot create shader effect: no source code!"); throw love::Exception("Cannot create shader effect: no source code!");
GLint maxtextureunits; GLint maxtextureunits;
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxtextureunits); glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxtextureunits);
_max_texture_units = std::max(maxtextureunits - 1, 0); _max_texture_units = std::max(maxtextureunits - 1, 0);
// initialize global texture id counters if needed // initialize global texture id counters if needed
if (_texture_id_counters.size() < (size_t) _max_texture_units) if (_texture_id_counters.size() < (size_t) _max_texture_units)
_texture_id_counters.resize(_max_texture_units, 0); _texture_id_counters.resize(_max_texture_units, 0);
// load shader source and create program object // load shader source and create program object
loadVolatile(); loadVolatile();
} }
@@ -83,7 +83,7 @@ ShaderEffect::~ShaderEffect()
{ {
if (current == this) if (current == this)
detach(); detach();
unloadVolatile(); unloadVolatile();
} }
@@ -91,7 +91,7 @@ GLuint ShaderEffect::createShader(const ShaderSource &source)
{ {
GLenum shadertype; GLenum shadertype;
const char *shadertypename = NULL; const char *shadertypename = NULL;
switch (source.type) switch (source.type)
{ {
case TYPE_VERTEX: case TYPE_VERTEX:
@@ -118,47 +118,47 @@ GLuint ShaderEffect::createShader(const ShaderSource &source)
throw love::Exception("Cannot create shader object: unknown shader type."); throw love::Exception("Cannot create shader object: unknown shader type.");
break; break;
} }
// clear existing errors // clear existing errors
while (glGetError() != GL_NO_ERROR); while (glGetError() != GL_NO_ERROR);
GLuint shaderid = glCreateShader(shadertype); GLuint shaderid = glCreateShader(shadertype);
if (shaderid == 0) // oh no! if (shaderid == 0) // oh no!
{ {
GLenum err = glGetError(); GLenum err = glGetError();
if (err == GL_INVALID_ENUM) // invalid or unsupported shader type if (err == GL_INVALID_ENUM) // invalid or unsupported shader type
throw love::Exception("Cannot create %s shader object: %s shaders not supported.", shadertypename, shadertypename); throw love::Exception("Cannot create %s shader object: %s shaders not supported.", shadertypename, shadertypename);
else // other errors should only happen between glBegin() and glEnd() else // other errors should only happen between glBegin() and glEnd()
throw love::Exception("Cannot create %s shader object.", shadertypename); throw love::Exception("Cannot create %s shader object.", shadertypename);
} }
const char *src = source.code.c_str(); const char *src = source.code.c_str();
size_t srclen = source.code.length(); size_t srclen = source.code.length();
glShaderSource(shaderid, 1, (const GLchar **)&src, (GLint *)&srclen); glShaderSource(shaderid, 1, (const GLchar **)&src, (GLint *)&srclen);
glCompileShader(shaderid); glCompileShader(shaderid);
GLint compile_status; GLint compile_status;
glGetShaderiv(shaderid, GL_COMPILE_STATUS, &compile_status); glGetShaderiv(shaderid, GL_COMPILE_STATUS, &compile_status);
if (compile_status == GL_FALSE) if (compile_status == GL_FALSE)
{ {
GLint infologlen; GLint infologlen;
glGetShaderiv(shaderid, GL_INFO_LOG_LENGTH, &infologlen); glGetShaderiv(shaderid, GL_INFO_LOG_LENGTH, &infologlen);
GLchar *errorlog = new GLchar[infologlen + 1]; GLchar *errorlog = new GLchar[infologlen + 1];
glGetShaderInfoLog(shaderid, infologlen, NULL, errorlog); glGetShaderInfoLog(shaderid, infologlen, NULL, errorlog);
std::string tmp(errorlog); std::string tmp(errorlog);
delete[] errorlog; delete[] errorlog;
glDeleteShader(shaderid); glDeleteShader(shaderid);
throw love::Exception("Cannot compile %s shader:\n%s", shadertypename, tmp.c_str()); throw love::Exception("Cannot compile %s shader:\n%s", shadertypename, tmp.c_str());
} }
return shaderid; return shaderid;
} }
@@ -167,24 +167,24 @@ void ShaderEffect::createProgram(const std::vector<GLuint> &shaderids)
_program = glCreateProgram(); _program = glCreateProgram();
if (_program == 0) // should only fail when called between glBegin() and glEnd() if (_program == 0) // should only fail when called between glBegin() and glEnd()
throw love::Exception("Cannot create shader program object."); throw love::Exception("Cannot create shader program object.");
std::vector<GLuint>::const_iterator it; std::vector<GLuint>::const_iterator it;
for (it = shaderids.begin(); it != shaderids.end(); ++it) for (it = shaderids.begin(); it != shaderids.end(); ++it)
glAttachShader(_program, *it); glAttachShader(_program, *it);
glLinkProgram(_program); glLinkProgram(_program);
for (it = shaderids.begin(); it != shaderids.end(); ++it) for (it = shaderids.begin(); it != shaderids.end(); ++it)
glDeleteShader(*it); // flag shaders for auto-deletion when program object is deleted glDeleteShader(*it); // flag shaders for auto-deletion when program object is deleted
GLint link_ok; GLint link_ok;
glGetProgramiv(_program, GL_LINK_STATUS, &link_ok); glGetProgramiv(_program, GL_LINK_STATUS, &link_ok);
if (link_ok == GL_FALSE) if (link_ok == GL_FALSE)
{ {
const std::string warnings = getWarnings(); const std::string warnings = getWarnings();
glDeleteProgram(_program); glDeleteProgram(_program);
throw love::Exception("Cannot link shader program object:\n%s", warnings.c_str()); throw love::Exception("Cannot link shader program object:\n%s", warnings.c_str());
} }
} }
@@ -194,18 +194,18 @@ bool ShaderEffect::loadVolatile()
// zero out texture id list // zero out texture id list
_texture_id_list.clear(); _texture_id_list.clear();
_texture_id_list.insert(_texture_id_list.begin(), _max_texture_units, 0); _texture_id_list.insert(_texture_id_list.begin(), _max_texture_units, 0);
std::vector<GLuint> shaderids; std::vector<GLuint> shaderids;
std::vector<ShaderSource>::const_iterator source; std::vector<ShaderSource>::const_iterator source;
for (source = _shadersources.begin(); source != _shadersources.end(); ++source) for (source = _shadersources.begin(); source != _shadersources.end(); ++source)
shaderids.push_back(createShader(*source)); shaderids.push_back(createShader(*source));
if (shaderids.size() == 0) if (shaderids.size() == 0)
throw love::Exception("Cannot create shader effect: no valid source code!"); throw love::Exception("Cannot create shader effect: no valid source code!");
createProgram(shaderids); createProgram(shaderids);
if (current == this) if (current == this)
{ {
current = NULL; // make sure glUseProgram gets called current = NULL; // make sure glUseProgram gets called
@@ -219,25 +219,25 @@ void ShaderEffect::unloadVolatile()
{ {
if (current == this) if (current == this)
glUseProgram(0); glUseProgram(0);
if (_program != 0) if (_program != 0)
glDeleteProgram(_program); glDeleteProgram(_program);
_program = 0; _program = 0;
// decrement global texture id counters for texture units which had textures bound from this shader // decrement global texture id counters for texture units which had textures bound from this shader
for (size_t i = 0; i < _texture_id_list.size(); ++i) for (size_t i = 0; i < _texture_id_list.size(); ++i)
{ {
if (_texture_id_list[i] == 0) if (_texture_id_list[i] == 0)
continue; continue;
_texture_id_counters[i] = std::max(_texture_id_counters[i] - 1, 0); _texture_id_counters[i] = std::max(_texture_id_counters[i] - 1, 0);
} }
// texture list is probably invalid, clear it // texture list is probably invalid, clear it
_texture_id_list.clear(); _texture_id_list.clear();
_texture_id_list.insert(_texture_id_list.begin(), _max_texture_units, 0); _texture_id_list.insert(_texture_id_list.begin(), _max_texture_units, 0);
// same with uniform location list // same with uniform location list
_uniforms.clear(); _uniforms.clear();
} }
@@ -283,9 +283,9 @@ void ShaderEffect::attach(bool temporary)
{ {
if (current != this) if (current != this)
glUseProgram(_program); glUseProgram(_program);
current = this; current = this;
if (!temporary) if (!temporary)
{ {
// make sure all sent textures are properly bound to their respective texture units // make sure all sent textures are properly bound to their respective texture units
@@ -294,7 +294,7 @@ void ShaderEffect::attach(bool temporary)
{ {
if (_texture_id_list[i] == 0) if (_texture_id_list[i] == 0)
continue; continue;
bindTextureToUnit(_texture_id_list[i], GL_TEXTURE0 + i + 1, false); bindTextureToUnit(_texture_id_list[i], GL_TEXTURE0 + i + 1, false);
} }
setActiveTextureUnit(GL_TEXTURE0); setActiveTextureUnit(GL_TEXTURE0);
@@ -305,7 +305,7 @@ void ShaderEffect::detach()
{ {
if (current != NULL) if (current != NULL)
glUseProgram(0); glUseProgram(0);
current = NULL; current = NULL;
} }
@@ -372,21 +372,21 @@ void ShaderEffect::sendTexture(const std::string &name, GLuint texture)
TemporaryAttacher attacher(this); TemporaryAttacher attacher(this);
GLint location = getUniformLocation(name); GLint location = getUniformLocation(name);
GLint texture_unit = getTextureUnit(name); GLint texture_unit = getTextureUnit(name);
// bind texture to assigned texture unit and send uniform to bound shader program // bind texture to assigned texture unit and send uniform to bound shader program
bindTextureToUnit(texture, GL_TEXTURE0 + texture_unit, false); bindTextureToUnit(texture, GL_TEXTURE0 + texture_unit, false);
glUniform1i(location, texture_unit); glUniform1i(location, texture_unit);
// reset texture unit // reset texture unit
setActiveTextureUnit(GL_TEXTURE0); setActiveTextureUnit(GL_TEXTURE0);
// increment global shader texture id counter for this texture unit, if we haven't already // increment global shader texture id counter for this texture unit, if we haven't already
if (_texture_id_list[texture_unit-1] == 0) if (_texture_id_list[texture_unit-1] == 0)
++_texture_id_counters[texture_unit-1]; ++_texture_id_counters[texture_unit-1];
// store texture id so it can be re-bound to the proper texture unit when necessary // store texture id so it can be re-bound to the proper texture unit when necessary
_texture_id_list[texture_unit-1] = texture; _texture_id_list[texture_unit-1] = texture;
// throw error if needed // throw error if needed
checkSetUniformError(); checkSetUniformError();
} }
@@ -422,28 +422,28 @@ GLint ShaderEffect::getUniformLocation(const std::string &name)
GLint ShaderEffect::getTextureUnit(const std::string &name) GLint ShaderEffect::getTextureUnit(const std::string &name)
{ {
std::map<std::string, GLint>::const_iterator it = _texture_unit_pool.find(name); std::map<std::string, GLint>::const_iterator it = _texture_unit_pool.find(name);
if (it != _texture_unit_pool.end()) if (it != _texture_unit_pool.end())
return it->second; return it->second;
int nextunitindex = 1; int nextunitindex = 1;
// prefer texture units which are unused by all other shaders // prefer texture units which are unused by all other shaders
std::vector<int>::iterator nextfreeunit = std::find(_texture_id_counters.begin(), _texture_id_counters.end(), 0); std::vector<int>::iterator nextfreeunit = std::find(_texture_id_counters.begin(), _texture_id_counters.end(), 0);
if (nextfreeunit != _texture_id_counters.end()) if (nextfreeunit != _texture_id_counters.end())
nextunitindex = std::distance(_texture_id_counters.begin(), nextfreeunit) + 1; // we don't want to use unit 0 nextunitindex = std::distance(_texture_id_counters.begin(), nextfreeunit) + 1; // we don't want to use unit 0
else else
{ {
// no completely unused texture units exist, try to use next free slot in our own list // no completely unused texture units exist, try to use next free slot in our own list
std::vector<GLuint>::iterator nexttexunit = std::find(_texture_id_list.begin(), _texture_id_list.end(), 0); std::vector<GLuint>::iterator nexttexunit = std::find(_texture_id_list.begin(), _texture_id_list.end(), 0);
if (nexttexunit == _texture_id_list.end()) if (nexttexunit == _texture_id_list.end())
throw love::Exception("No more texture units available for shader."); throw love::Exception("No more texture units available for shader.");
nextunitindex = std::distance(_texture_id_list.begin(), nexttexunit) + 1; // we don't want to use unit 0 nextunitindex = std::distance(_texture_id_list.begin(), nexttexunit) + 1; // we don't want to use unit 0
} }
_texture_unit_pool[name] = nextunitindex; _texture_unit_pool[name] = nextunitindex;
return nextunitindex; return nextunitindex;
} }
+18 -19
View File
@@ -51,14 +51,14 @@ public:
TYPE_FRAGMENT, TYPE_FRAGMENT,
TYPE_MAX_ENUM TYPE_MAX_ENUM
}; };
// thin wrapper for GLSL source code. // thin wrapper for GLSL source code.
struct ShaderSource struct ShaderSource
{ {
std::string code; std::string code;
ShaderType type; ShaderType type;
}; };
/** /**
* Creates a new ShaderEffect using a list of source codes. * Creates a new ShaderEffect using a list of source codes.
* Must contain at least one vertex or fragment shader source. * Must contain at least one vertex or fragment shader source.
@@ -66,7 +66,7 @@ public:
* @param shadersources Vector of shader source codes. * @param shadersources Vector of shader source codes.
**/ **/
ShaderEffect(const std::vector<ShaderSource> &shadersources); ShaderEffect(const std::vector<ShaderSource> &shadersources);
virtual ~ShaderEffect(); virtual ~ShaderEffect();
// Implements Volatile // Implements Volatile
@@ -79,23 +79,23 @@ public:
* @param temporary True if we just want to send values to the shader with no intention of rendering. * @param temporary True if we just want to send values to the shader with no intention of rendering.
**/ **/
void attach(bool temporary = false); void attach(bool temporary = false);
/** /**
* Detach the currently bound ShaderEffect. * Detach the currently bound ShaderEffect.
* Causes OpenGL to use fixed functionality in place of shader programs. * Causes OpenGL to use fixed functionality in place of shader programs.
**/ **/
static void detach(); static void detach();
/** /**
* Returns any warnings this ShaderEffect may have generated. * Returns any warnings this ShaderEffect may have generated.
**/ **/
std::string getWarnings() const; std::string getWarnings() const;
/** /**
* Returns the maximum GLSL version supported on this system. * Returns the maximum GLSL version supported on this system.
**/ **/
static std::string getGLSLVersion(); static std::string getGLSLVersion();
/** /**
* Returns whether ShaderEffects are supported on this system. * Returns whether ShaderEffects are supported on this system.
**/ **/
@@ -111,7 +111,7 @@ public:
* @param count Number of float or vector values. * @param count Number of float or vector values.
**/ **/
void sendFloat(const std::string &name, int size, const GLfloat *vec, int count); void sendFloat(const std::string &name, int size, const GLfloat *vec, int count);
/** /**
* Send at least one matrix to this ShaderEffect as a uniform. * Send at least one matrix to this ShaderEffect as a uniform.
* *
@@ -121,7 +121,7 @@ public:
* @param count Number of matrices to send. * @param count Number of matrices to send.
**/ **/
void sendMatrix(const std::string &name, int size, const GLfloat *m, int count); void sendMatrix(const std::string &name, int size, const GLfloat *m, int count);
/** /**
* Send an image to this ShaderEffect as a uniform. * Send an image to this ShaderEffect as a uniform.
* *
@@ -129,7 +129,7 @@ public:
* @param image The image to send. * @param image The image to send.
**/ **/
void sendImage(const std::string &name, const Image &image); void sendImage(const std::string &name, const Image &image);
/** /**
* Send a canvas to this ShaderEffect as a uniform. * Send a canvas to this ShaderEffect as a uniform.
* *
@@ -137,38 +137,37 @@ public:
* @param canvas The canvas to send. * @param canvas The canvas to send.
**/ **/
void sendCanvas(const std::string &name, const Canvas &canvas); void sendCanvas(const std::string &name, const Canvas &canvas);
// pointer to currently active ShaderEffect. // pointer to currently active ShaderEffect.
static ShaderEffect *current; static ShaderEffect *current;
private: private:
GLint getUniformLocation(const std::string &name); GLint getUniformLocation(const std::string &name);
void checkSetUniformError(); void checkSetUniformError();
GLuint createShader(const ShaderSource &source); GLuint createShader(const ShaderSource &source);
void createProgram(const std::vector<GLuint> &shaderids); void createProgram(const std::vector<GLuint> &shaderids);
// list of all shader code attached to this ShaderEffect // list of all shader code attached to this ShaderEffect
std::vector<ShaderSource> _shadersources; std::vector<ShaderSource> _shadersources;
GLuint _program; // volatile GLuint _program; // volatile
// uniform location buffer map // uniform location buffer map
std::map<std::string, GLint> _uniforms; std::map<std::string, GLint> _uniforms;
// total max GPU texture units for shaders // total max GPU texture units for shaders
static GLint _max_texture_units; static GLint _max_texture_units;
// counts total number of textures bound to each texture unit in all shaders // counts total number of textures bound to each texture unit in all shaders
static std::vector<int> _texture_id_counters; static std::vector<int> _texture_id_counters;
// texture unit pool for setting images // texture unit pool for setting images
std::map<std::string, GLint> _texture_unit_pool; std::map<std::string, GLint> _texture_unit_pool;
std::vector<GLuint> _texture_id_list; std::vector<GLuint> _texture_id_list;
GLint getTextureUnit(const std::string &name); GLint getTextureUnit(const std::string &name);
void sendTexture(const std::string &name, GLuint texture); void sendTexture(const std::string &name, GLuint texture);
}; };
} // opengl } // opengl
@@ -444,16 +444,16 @@ int w_newShaderEffect(lua_State *L)
lua_settop(L, 2); lua_settop(L, 2);
luax_getfunction(L, "graphics", "_effectCodeToGLSL"); luax_getfunction(L, "graphics", "_effectCodeToGLSL");
// push vertcode and fragcode strings to the top of the stack so they become arguments for the function // push vertcode and fragcode strings to the top of the stack so they become arguments for the function
lua_pushvalue(L, 1); lua_pushvalue(L, 1);
lua_pushvalue(L, 2); lua_pushvalue(L, 2);
// call effectCodeToGLSL, returned values will be at the top of the stack // call effectCodeToGLSL, returned values will be at the top of the stack
lua_pcall(L, 2, 2, 0); lua_pcall(L, 2, 2, 0);
std::vector<ShaderEffect::ShaderSource> shaderlist; std::vector<ShaderEffect::ShaderSource> shaderlist;
// vertex shader code // vertex shader code
if (lua_isstring(L, -2)) if (lua_isstring(L, -2))
{ {
@@ -462,7 +462,7 @@ int w_newShaderEffect(lua_State *L)
vertshader.code = luaL_checkstring(L, -2); vertshader.code = luaL_checkstring(L, -2);
shaderlist.push_back(vertshader); shaderlist.push_back(vertshader);
} }
// fragment shader code // fragment shader code
if (lua_isstring(L, -1)) if (lua_isstring(L, -1))
{ {
@@ -471,7 +471,7 @@ int w_newShaderEffect(lua_State *L)
fragshader.code = luaL_checkstring(L, -1); fragshader.code = luaL_checkstring(L, -1);
shaderlist.push_back(fragshader); shaderlist.push_back(fragshader);
} }
ShaderEffect *effect = instance->newShaderEffect(shaderlist); ShaderEffect *effect = instance->newShaderEffect(shaderlist);
luax_newtype(L, "ShaderEffect", GRAPHICS_SHADEREFFECT_T, (void *)effect); luax_newtype(L, "ShaderEffect", GRAPHICS_SHADEREFFECT_T, (void *)effect);
} }
+16 -15
View File
@@ -1282,9 +1282,10 @@ do
love.graphics.printf = _printf love.graphics.printf = _printf
love.graphics.printf(...) love.graphics.printf(...)
end end
local GLSL_VERSION = "#version 120" local GLSL_VERSION = "#version 120"
local GLSL_VERT = { local GLSL_VERT = {
HEADER = [[ HEADER = [[
#define VERTEX #define VERTEX
@@ -1294,17 +1295,17 @@ do
#define extern uniform #define extern uniform
#define Texel texture2D #define Texel texture2D
#define VertexPosition gl_Vertex
#define VertexTexCoord gl_MultiTexCoord0
#define VertexColor gl_Color
#define ModelViewMatrix gl_ModelViewMatrix #define ModelViewMatrix gl_ModelViewMatrix
#define ProjectionMatrix gl_ProjectionMatrix #define ProjectionMatrix gl_ProjectionMatrix
#define ModelViewProjectionMatrix gl_ModelViewProjectionMatrix #define ModelViewProjectionMatrix gl_ModelViewProjectionMatrix
#define NormalMatrix gl_NormalMatrix #define NormalMatrix gl_NormalMatrix
#define VertexColor gl_Color
#define VertexTexCoord gl_MultiTexCoord0
#define VertexPosition gl_Vertex
#define VaryingColor gl_FrontColor
#define VaryingTexCoord gl_TexCoord[0] #define VaryingTexCoord gl_TexCoord[0]
#define VaryingColor gl_FrontColor
uniform sampler2D _tex0_; uniform sampler2D _tex0_;
@@ -1316,7 +1317,7 @@ void main() {
gl_Position = position(ModelViewProjectionMatrix, VertexPosition); gl_Position = position(ModelViewProjectionMatrix, VertexPosition);
}]], }]],
} }
local GLSL_FRAG = { local GLSL_FRAG = {
HEADER = [[ HEADER = [[
#define PIXEL #define PIXEL
@@ -1331,8 +1332,8 @@ void main() {
#define ModelViewProjectionMatrix gl_ModelViewProjectionMatrix #define ModelViewProjectionMatrix gl_ModelViewProjectionMatrix
#define NormalMatrix gl_NormalMatrix #define NormalMatrix gl_NormalMatrix
#define VaryingColor gl_Color
#define VaryingTexCoord gl_TexCoord[0] #define VaryingTexCoord gl_TexCoord[0]
#define VaryingColor gl_Color
uniform sampler2D _tex0_; uniform sampler2D _tex0_;
@@ -1373,7 +1374,7 @@ void main() {
if fragcode then if fragcode then
fragcode = table.concat({GLSL_VERSION, GLSL_FRAG.HEADER, fragcode, GLSL_FRAG.FOOTER}, "\n") fragcode = table.concat({GLSL_VERSION, GLSL_FRAG.HEADER, fragcode, GLSL_FRAG.FOOTER}, "\n")
end end
return vertcode, fragcode return vertcode, fragcode
end end
@@ -1408,7 +1409,7 @@ void main() {
-- {a, b, c, d, e, f, ...} -- {a, b, c, d, e, f, ...}
local function flattenMatrices(mat, ...) local function flattenMatrices(mat, ...)
if not mat then return end if not mat then return end
local tonumber = tonumber local tonumber = tonumber
local ret,l = {}, 1 local ret,l = {}, 1
@@ -1465,14 +1466,14 @@ void main() {
meta.send = shadereffect_dispatch_send meta.send = shadereffect_dispatch_send
return effect return effect
end end
-- compatibility functions -- compatibility functions
function love.graphics.newPixelEffect(fragcode) function love.graphics.newPixelEffect(fragcode)
return love.graphics.newShaderEffect(nil, fragcode) return love.graphics.newShaderEffect(nil, fragcode)
end end
love.graphics.setPixelEffect = love.graphics.setShaderEffect love.graphics.setPixelEffect = love.graphics.setShaderEffect
love.graphics.getPixelEffect = love.graphics.getShaderEffect love.graphics.getPixelEffect = love.graphics.getShaderEffect
end end
+11 -20
View File
@@ -6259,10 +6259,8 @@ const unsigned char graphics_lua[] =
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72,
0x69, 0x6e, 0x74, 0x66, 0x28, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x69, 0x6e, 0x74, 0x66, 0x28, 0x2e, 0x2e, 0x2e, 0x29, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x0a,
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x47, 0x4c, 0x53, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x47, 0x4c, 0x53, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f,
0x4e, 0x20, 0x3d, 0x20, 0x22, 0x23, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x32, 0x30, 0x22, 0x0a, 0x4e, 0x20, 0x3d, 0x20, 0x22, 0x23, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x32, 0x30, 0x22, 0x0a,
0x09, 0x0a,
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x47, 0x4c, 0x53, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x54, 0x20, 0x3d, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x47, 0x4c, 0x53, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x54, 0x20, 0x3d,
0x20, 0x7b, 0x0a, 0x20, 0x7b, 0x0a,
0x09, 0x09, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x20, 0x3d, 0x20, 0x5b, 0x5b, 0x0a, 0x09, 0x09, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x20, 0x3d, 0x20, 0x5b, 0x5b, 0x0a,
@@ -6275,6 +6273,13 @@ const unsigned char graphics_lua[] =
0x66, 0x6f, 0x72, 0x6d, 0x0a, 0x66, 0x6f, 0x72, 0x6d, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x20, 0x74, 0x65, 0x78, 0x74,
0x75, 0x72, 0x65, 0x32, 0x44, 0x0a, 0x75, 0x72, 0x65, 0x32, 0x44, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x50, 0x6f, 0x73, 0x69,
0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6c, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x43,
0x6f, 0x6f, 0x72, 0x64, 0x20, 0x67, 0x6c, 0x5f, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x54, 0x65, 0x78, 0x43, 0x6f,
0x6f, 0x72, 0x64, 0x30, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f,
0x72, 0x20, 0x67, 0x6c, 0x5f, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x4d, 0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x4d,
0x61, 0x74, 0x72, 0x69, 0x78, 0x20, 0x67, 0x6c, 0x5f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x61, 0x74, 0x72, 0x69, 0x78, 0x20, 0x67, 0x6c, 0x5f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77,
0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x0a, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x0a,
@@ -6287,18 +6292,11 @@ const unsigned char graphics_lua[] =
0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x0a, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x72, 0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x72,
0x69, 0x78, 0x20, 0x67, 0x6c, 0x5f, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x0a, 0x69, 0x78, 0x20, 0x67, 0x6c, 0x5f, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f,
0x72, 0x20, 0x67, 0x6c, 0x5f, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x43,
0x6f, 0x6f, 0x72, 0x64, 0x20, 0x67, 0x6c, 0x5f, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x54, 0x65, 0x78, 0x43, 0x6f,
0x6f, 0x72, 0x64, 0x30, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x50, 0x6f, 0x73, 0x69,
0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6c, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x54, 0x65, 0x78, 0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x54, 0x65, 0x78,
0x43, 0x6f, 0x6f, 0x72, 0x64, 0x20, 0x67, 0x6c, 0x5f, 0x54, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x5b, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x20, 0x67, 0x6c, 0x5f, 0x54, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x5b,
0x30, 0x5d, 0x0a, 0x30, 0x5d, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x0a,
0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20,
0x5f, 0x74, 0x65, 0x78, 0x30, 0x5f, 0x3b, 0x0a, 0x5f, 0x74, 0x65, 0x78, 0x30, 0x5f, 0x3b, 0x0a,
0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x30, 0x5d, 0x5d, 0x2c, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x30, 0x5d, 0x5d, 0x2c, 0x0a,
@@ -6314,7 +6312,6 @@ const unsigned char graphics_lua[] =
0x74, 0x65, 0x78, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x3b, 0x0a, 0x74, 0x65, 0x78, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x3b, 0x0a,
0x7d, 0x5d, 0x5d, 0x2c, 0x0a, 0x7d, 0x5d, 0x5d, 0x2c, 0x0a,
0x09, 0x7d, 0x0a, 0x09, 0x7d, 0x0a,
0x09, 0x0a,
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x47, 0x4c, 0x53, 0x4c, 0x5f, 0x46, 0x52, 0x41, 0x47, 0x20, 0x3d, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x47, 0x4c, 0x53, 0x4c, 0x5f, 0x46, 0x52, 0x41, 0x47, 0x20, 0x3d,
0x20, 0x7b, 0x0a, 0x20, 0x7b, 0x0a,
0x09, 0x09, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x20, 0x3d, 0x20, 0x5b, 0x5b, 0x0a, 0x09, 0x09, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x20, 0x3d, 0x20, 0x5b, 0x5b, 0x0a,
@@ -6339,11 +6336,11 @@ const unsigned char graphics_lua[] =
0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x0a, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x72, 0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x72,
0x69, 0x78, 0x20, 0x67, 0x6c, 0x5f, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x0a, 0x69, 0x78, 0x20, 0x67, 0x6c, 0x5f, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 0x20, 0x67, 0x6c, 0x5f, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x54, 0x65, 0x78, 0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x54, 0x65, 0x78,
0x43, 0x6f, 0x6f, 0x72, 0x64, 0x20, 0x67, 0x6c, 0x5f, 0x54, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x5b, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x20, 0x67, 0x6c, 0x5f, 0x54, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x5b,
0x30, 0x5d, 0x0a, 0x30, 0x5d, 0x0a,
0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x56, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 0x20, 0x67, 0x6c, 0x5f, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x0a,
0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20,
0x5f, 0x74, 0x65, 0x78, 0x30, 0x5f, 0x3b, 0x0a, 0x5f, 0x74, 0x65, 0x78, 0x30, 0x5f, 0x3b, 0x0a,
0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x30, 0x5d, 0x5d, 0x2c, 0x0a, 0x23, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x30, 0x5d, 0x5d, 0x2c, 0x0a,
@@ -6430,7 +6427,6 @@ const unsigned char graphics_lua[] =
0x53, 0x4c, 0x5f, 0x46, 0x52, 0x41, 0x47, 0x2e, 0x46, 0x4f, 0x4f, 0x54, 0x45, 0x52, 0x7d, 0x2c, 0x20, 0x22, 0x53, 0x4c, 0x5f, 0x46, 0x52, 0x41, 0x47, 0x2e, 0x46, 0x4f, 0x4f, 0x54, 0x45, 0x52, 0x7d, 0x2c, 0x20, 0x22,
0x5c, 0x6e, 0x22, 0x29, 0x0a, 0x5c, 0x6e, 0x22, 0x29, 0x0a,
0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x09, 0x0a,
0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x2c,
0x20, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x0a, 0x20, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a,
@@ -6520,7 +6516,6 @@ const unsigned char graphics_lua[] =
0x20, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x2e, 0x2e, 0x2e, 0x29, 0x0a,
0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6d, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6d, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20,
0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x09, 0x0a,
0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x74, 0x6f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x3d, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x74, 0x6f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x3d,
0x20, 0x74, 0x6f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x0a, 0x20, 0x74, 0x6f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x0a,
0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x74, 0x2c, 0x6c, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x74, 0x2c, 0x6c, 0x20, 0x3d, 0x20, 0x7b, 0x7d,
@@ -6643,11 +6638,8 @@ const unsigned char graphics_lua[] =
0x73, 0x65, 0x6e, 0x64, 0x0a, 0x73, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x0a, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x0a,
0x09, 0x0a,
0x09, 0x2d, 0x2d, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x09, 0x2d, 0x2d, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20,
0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a,
0x09, 0x0a,
0x09, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x09, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61,
0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77, 0x50, 0x69, 0x78, 0x65, 0x6c, 0x45, 0x66, 0x66, 0x65, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77, 0x50, 0x69, 0x78, 0x65, 0x6c, 0x45, 0x66, 0x66, 0x65,
0x63, 0x74, 0x28, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a, 0x63, 0x74, 0x28, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a,
@@ -6655,7 +6647,6 @@ const unsigned char graphics_lua[] =
0x68, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x45, 0x66, 0x66, 0x65, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x45, 0x66, 0x66, 0x65,
0x63, 0x74, 0x28, 0x6e, 0x69, 0x6c, 0x2c, 0x20, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a, 0x63, 0x74, 0x28, 0x6e, 0x69, 0x6c, 0x2c, 0x20, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x0a,
0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74,
0x50, 0x69, 0x78, 0x65, 0x6c, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x50, 0x69, 0x78, 0x65, 0x6c, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65,
0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x53, 0x68, 0x61, 0x64, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x53, 0x68, 0x61, 0x64, 0x65,