mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Renamed all instances of 'ShaderEffect' (previously 'PixelEffect') to 'Shader'.
This commit is contained in:
+2
-2
@@ -52,7 +52,7 @@ enum Type
|
||||
GRAPHICS_PARTICLE_SYSTEM_ID,
|
||||
GRAPHICS_SPRITE_BATCH_ID,
|
||||
GRAPHICS_CANVAS_ID,
|
||||
GRAPHICS_SHADEREFFECT_ID,
|
||||
GRAPHICS_SHADER_ID,
|
||||
|
||||
// Image
|
||||
IMAGE_IMAGE_DATA_ID,
|
||||
@@ -123,7 +123,7 @@ const bits GRAPHICS_FONT_T = (bits(1) << GRAPHICS_FONT_ID) | OBJECT_T;
|
||||
const bits GRAPHICS_PARTICLE_SYSTEM_T = (bits(1) << GRAPHICS_PARTICLE_SYSTEM_ID) | GRAPHICS_DRAWABLE_T;
|
||||
const bits GRAPHICS_SPRITE_BATCH_T = (bits(1) << GRAPHICS_SPRITE_BATCH_ID) | GRAPHICS_DRAWABLE_T;
|
||||
const bits GRAPHICS_CANVAS_T = (bits(1) << GRAPHICS_CANVAS_ID) | GRAPHICS_DRAWQABLE_T;
|
||||
const bits GRAPHICS_SHADEREFFECT_T = (bits(1) << GRAPHICS_SHADEREFFECT_ID) | OBJECT_T;
|
||||
const bits GRAPHICS_SHADER_T = (bits(1) << GRAPHICS_SHADER_ID) | OBJECT_T;
|
||||
|
||||
// Image.
|
||||
const bits IMAGE_IMAGE_DATA_T = (bits(1) << IMAGE_IMAGE_DATA_ID) | DATA_T;
|
||||
|
||||
@@ -157,8 +157,8 @@ StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM>::Entry Graphics::suppor
|
||||
{
|
||||
{ "canvas", Graphics::SUPPORT_CANVAS },
|
||||
{ "hdrcanvas", Graphics::SUPPORT_HDR_CANVAS },
|
||||
{ "shadereffect", Graphics::SUPPORT_SHADEREFFECT },
|
||||
{ "pixeleffect", Graphics::SUPPORT_SHADEREFFECT }, // for compatibility
|
||||
{ "shader", Graphics::SUPPORT_SHADER },
|
||||
{ "pixeleffect", Graphics::SUPPORT_SHADER }, // for compatibility
|
||||
{ "npot", Graphics::SUPPORT_NPOT },
|
||||
{ "subtractive", Graphics::SUPPORT_SUBTRACTIVE },
|
||||
{ "mipmap", Graphics::SUPPORT_MIPMAP },
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
{
|
||||
SUPPORT_CANVAS = 1,
|
||||
SUPPORT_HDR_CANVAS,
|
||||
SUPPORT_SHADEREFFECT,
|
||||
SUPPORT_SHADER,
|
||||
SUPPORT_NPOT,
|
||||
SUPPORT_SUBTRACTIVE,
|
||||
SUPPORT_MIPMAP,
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
static void bindDefaultCanvas();
|
||||
|
||||
private:
|
||||
friend class ShaderEffect;
|
||||
friend class Shader;
|
||||
GLuint getTextureName() const
|
||||
{
|
||||
return img;
|
||||
|
||||
@@ -193,7 +193,7 @@ void Graphics::reset()
|
||||
DisplayState s;
|
||||
discardStencil();
|
||||
Canvas::bindDefaultCanvas();
|
||||
ShaderEffect::detach();
|
||||
Shader::detach();
|
||||
restoreState(s);
|
||||
}
|
||||
|
||||
@@ -453,21 +453,21 @@ Canvas *Graphics::newCanvas(int width, int height, Canvas::TextureType texture_t
|
||||
return NULL; // never reached
|
||||
}
|
||||
|
||||
ShaderEffect *Graphics::newShaderEffect(const ShaderEffect::ShaderSources &shadersources)
|
||||
Shader *Graphics::newShader(const Shader::ShaderSources &shadersources)
|
||||
{
|
||||
ShaderEffect *effect = NULL;
|
||||
Shader *shader = NULL;
|
||||
try
|
||||
{
|
||||
effect = new ShaderEffect(shadersources);
|
||||
shader = new Shader(shadersources);
|
||||
}
|
||||
catch(love::Exception &)
|
||||
{
|
||||
if (effect)
|
||||
delete effect;
|
||||
if (shader)
|
||||
delete shader;
|
||||
|
||||
throw;
|
||||
}
|
||||
return effect;
|
||||
return shader;
|
||||
}
|
||||
|
||||
void Graphics::setColor(const Color &c)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include "SpriteBatch.h"
|
||||
#include "ParticleSystem.h"
|
||||
#include "Canvas.h"
|
||||
#include "ShaderEffect.h"
|
||||
#include "Shader.h"
|
||||
|
||||
namespace love
|
||||
{
|
||||
@@ -270,7 +270,7 @@ public:
|
||||
|
||||
Canvas *newCanvas(int width, int height, Canvas::TextureType texture_type = Canvas::TYPE_NORMAL);
|
||||
|
||||
ShaderEffect *newShaderEffect(const ShaderEffect::ShaderSources &shadersources);
|
||||
Shader *newShader(const Shader::ShaderSources &shadersources);
|
||||
|
||||
/**
|
||||
* Sets the foreground color.
|
||||
|
||||
@@ -125,7 +125,7 @@ private:
|
||||
|
||||
void drawv(const Matrix &t, const vertex *v) const;
|
||||
|
||||
friend class ShaderEffect;
|
||||
friend class Shader;
|
||||
GLuint getTextureName() const
|
||||
{
|
||||
return texture;
|
||||
|
||||
+36
-36
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "ShaderEffect.h"
|
||||
#include "Shader.h"
|
||||
#include "Graphics.h"
|
||||
|
||||
namespace love
|
||||
@@ -36,38 +36,38 @@ namespace
|
||||
// reattaches the originally active program when destroyed
|
||||
struct TemporaryAttacher
|
||||
{
|
||||
TemporaryAttacher(ShaderEffect *effect)
|
||||
: cureffect(effect)
|
||||
, preveffect(ShaderEffect::current)
|
||||
TemporaryAttacher(Shader *shader)
|
||||
: curshader(shader)
|
||||
, prevshader(Shader::current)
|
||||
{
|
||||
cureffect->attach(true);
|
||||
curshader->attach(true);
|
||||
}
|
||||
|
||||
~TemporaryAttacher()
|
||||
{
|
||||
if (preveffect != NULL)
|
||||
preveffect->attach();
|
||||
if (prevshader != NULL)
|
||||
prevshader->attach();
|
||||
else
|
||||
ShaderEffect::detach();
|
||||
Shader::detach();
|
||||
}
|
||||
|
||||
ShaderEffect *cureffect;
|
||||
ShaderEffect *preveffect;
|
||||
Shader *curshader;
|
||||
Shader *prevshader;
|
||||
};
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
ShaderEffect *ShaderEffect::current = NULL;
|
||||
Shader *Shader::current = NULL;
|
||||
|
||||
GLint ShaderEffect::_maxtextureunits = 0;
|
||||
std::vector<int> ShaderEffect::_texturecounters;
|
||||
GLint Shader::_maxtextureunits = 0;
|
||||
std::vector<int> Shader::_texturecounters;
|
||||
|
||||
ShaderEffect::ShaderEffect(const ShaderSources &shadersources)
|
||||
Shader::Shader(const ShaderSources &shadersources)
|
||||
: _shadersources(shadersources)
|
||||
, _program(0)
|
||||
{
|
||||
if (shadersources.empty())
|
||||
throw love::Exception("Cannot create shader effect: no source code!");
|
||||
throw love::Exception("Cannot create shader: no source code!");
|
||||
|
||||
GLint maxtextureunits;
|
||||
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxtextureunits);
|
||||
@@ -81,7 +81,7 @@ ShaderEffect::ShaderEffect(const ShaderSources &shadersources)
|
||||
loadVolatile();
|
||||
}
|
||||
|
||||
ShaderEffect::~ShaderEffect()
|
||||
Shader::~Shader()
|
||||
{
|
||||
if (current == this)
|
||||
detach();
|
||||
@@ -89,7 +89,7 @@ ShaderEffect::~ShaderEffect()
|
||||
unloadVolatile();
|
||||
}
|
||||
|
||||
GLuint ShaderEffect::createShader(ShaderType type, const std::string &code)
|
||||
GLuint Shader::compileShaderCode(ShaderType type, const std::string &code)
|
||||
{
|
||||
GLenum glshadertype;
|
||||
const char *shadertypename = NULL;
|
||||
@@ -158,13 +158,13 @@ GLuint ShaderEffect::createShader(ShaderType type, const std::string &code)
|
||||
delete[] errorlog;
|
||||
glDeleteShader(shaderid);
|
||||
|
||||
throw love::Exception("Cannot compile %s shader:\n%s", shadertypename, tmp.c_str());
|
||||
throw love::Exception("Cannot compile %s shader code:\n%s", shadertypename, tmp.c_str());
|
||||
}
|
||||
|
||||
return shaderid;
|
||||
}
|
||||
|
||||
void ShaderEffect::createProgram(const std::vector<GLuint> &shaderids)
|
||||
void Shader::createProgram(const std::vector<GLuint> &shaderids)
|
||||
{
|
||||
_program = glCreateProgram();
|
||||
if (_program == 0) // should only fail when called between glBegin() and glEnd()
|
||||
@@ -191,7 +191,7 @@ void ShaderEffect::createProgram(const std::vector<GLuint> &shaderids)
|
||||
}
|
||||
}
|
||||
|
||||
bool ShaderEffect::loadVolatile()
|
||||
bool Shader::loadVolatile()
|
||||
{
|
||||
// zero out active texture list
|
||||
_activetextureunits.clear();
|
||||
@@ -202,12 +202,12 @@ bool ShaderEffect::loadVolatile()
|
||||
ShaderSources::const_iterator source;
|
||||
for (source = _shadersources.begin(); source != _shadersources.end(); ++source)
|
||||
{
|
||||
GLuint shaderid = createShader(source->first, source->second);
|
||||
GLuint shaderid = compileShaderCode(source->first, source->second);
|
||||
shaderids.push_back(shaderid);
|
||||
}
|
||||
|
||||
if (shaderids.empty())
|
||||
throw love::Exception("Cannot create shader effect: no valid source code!");
|
||||
throw love::Exception("Cannot create shader: no valid source code!");
|
||||
|
||||
createProgram(shaderids);
|
||||
|
||||
@@ -220,7 +220,7 @@ bool ShaderEffect::loadVolatile()
|
||||
return true;
|
||||
}
|
||||
|
||||
void ShaderEffect::unloadVolatile()
|
||||
void Shader::unloadVolatile()
|
||||
{
|
||||
if (current == this)
|
||||
glUseProgram(0);
|
||||
@@ -245,7 +245,7 @@ void ShaderEffect::unloadVolatile()
|
||||
_uniforms.clear();
|
||||
}
|
||||
|
||||
std::string ShaderEffect::getWarnings() const
|
||||
std::string Shader::getWarnings() const
|
||||
{
|
||||
GLint strlen, nullpos;
|
||||
glGetProgramiv(_program, GL_INFO_LOG_LENGTH, &strlen);
|
||||
@@ -260,7 +260,7 @@ std::string ShaderEffect::getWarnings() const
|
||||
return warnings;
|
||||
}
|
||||
|
||||
void ShaderEffect::attach(bool temporary)
|
||||
void Shader::attach(bool temporary)
|
||||
{
|
||||
if (current != this)
|
||||
glUseProgram(_program);
|
||||
@@ -280,7 +280,7 @@ void ShaderEffect::attach(bool temporary)
|
||||
}
|
||||
}
|
||||
|
||||
void ShaderEffect::detach()
|
||||
void Shader::detach()
|
||||
{
|
||||
if (current != NULL)
|
||||
glUseProgram(0);
|
||||
@@ -288,7 +288,7 @@ void ShaderEffect::detach()
|
||||
current = NULL;
|
||||
}
|
||||
|
||||
void ShaderEffect::sendFloat(const std::string &name, int size, const GLfloat *vec, int count)
|
||||
void Shader::sendFloat(const std::string &name, int size, const GLfloat *vec, int count)
|
||||
{
|
||||
TemporaryAttacher attacher(this);
|
||||
GLint location = getUniformLocation(name);
|
||||
@@ -317,7 +317,7 @@ void ShaderEffect::sendFloat(const std::string &name, int size, const GLfloat *v
|
||||
checkSetUniformError();
|
||||
}
|
||||
|
||||
void ShaderEffect::sendMatrix(const std::string &name, int size, const GLfloat *m, int count)
|
||||
void Shader::sendMatrix(const std::string &name, int size, const GLfloat *m, int count)
|
||||
{
|
||||
TemporaryAttacher attacher(this);
|
||||
GLint location = getUniformLocation(name);
|
||||
@@ -346,7 +346,7 @@ void ShaderEffect::sendMatrix(const std::string &name, int size, const GLfloat *
|
||||
checkSetUniformError();
|
||||
}
|
||||
|
||||
void ShaderEffect::sendTexture(const std::string &name, GLuint texture)
|
||||
void Shader::sendTexture(const std::string &name, GLuint texture)
|
||||
{
|
||||
TemporaryAttacher attacher(this);
|
||||
GLint location = getUniformLocation(name);
|
||||
@@ -370,17 +370,17 @@ void ShaderEffect::sendTexture(const std::string &name, GLuint texture)
|
||||
_activetextureunits[textureunit-1] = texture;
|
||||
}
|
||||
|
||||
void ShaderEffect::sendImage(const std::string &name, const Image &image)
|
||||
void Shader::sendImage(const std::string &name, const Image &image)
|
||||
{
|
||||
sendTexture(name, image.getTextureName());
|
||||
}
|
||||
|
||||
void ShaderEffect::sendCanvas(const std::string &name, const Canvas &canvas)
|
||||
void Shader::sendCanvas(const std::string &name, const Canvas &canvas)
|
||||
{
|
||||
sendTexture(name, canvas.getTextureName());
|
||||
}
|
||||
|
||||
GLint ShaderEffect::getUniformLocation(const std::string &name)
|
||||
GLint Shader::getUniformLocation(const std::string &name)
|
||||
{
|
||||
std::map<std::string, GLint>::const_iterator it = _uniforms.find(name);
|
||||
if (it != _uniforms.end())
|
||||
@@ -398,7 +398,7 @@ GLint ShaderEffect::getUniformLocation(const std::string &name)
|
||||
return location;
|
||||
}
|
||||
|
||||
int ShaderEffect::getTextureUnit(const std::string &name)
|
||||
int Shader::getTextureUnit(const std::string &name)
|
||||
{
|
||||
std::map<std::string, GLint>::const_iterator it = _textureunitpool.find(name);
|
||||
|
||||
@@ -427,7 +427,7 @@ int ShaderEffect::getTextureUnit(const std::string &name)
|
||||
return textureunit;
|
||||
}
|
||||
|
||||
void ShaderEffect::checkSetUniformError()
|
||||
void Shader::checkSetUniformError()
|
||||
{
|
||||
GLenum error_code = glGetError();
|
||||
if (GL_INVALID_OPERATION == error_code)
|
||||
@@ -440,7 +440,7 @@ void ShaderEffect::checkSetUniformError()
|
||||
}
|
||||
}
|
||||
|
||||
std::string ShaderEffect::getGLSLVersion()
|
||||
std::string Shader::getGLSLVersion()
|
||||
{
|
||||
// GL_SHADING_LANGUAGE_VERSION may not be available in OpenGL < 2.0.
|
||||
const char *tmp = (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION);
|
||||
@@ -457,7 +457,7 @@ std::string ShaderEffect::getGLSLVersion()
|
||||
return versionString.substr(0, minorEndPos);
|
||||
}
|
||||
|
||||
bool ShaderEffect::isSupported()
|
||||
bool Shader::isSupported()
|
||||
{
|
||||
return GLEE_VERSION_2_0 && getGLSLVersion() >= "1.2";
|
||||
}
|
||||
@@ -18,8 +18,8 @@
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
**/
|
||||
|
||||
#ifndef LOVE_GRAPHICS_EFFECT_H
|
||||
#define LOVE_GRAPHICS_EFFECT_H
|
||||
#ifndef LOVE_GRAPHICS_SHADER_H
|
||||
#define LOVE_GRAPHICS_SHADER_H
|
||||
|
||||
#include "common/Object.h"
|
||||
#include <string>
|
||||
@@ -36,14 +36,14 @@ namespace graphics
|
||||
namespace opengl
|
||||
{
|
||||
// A GLSL shader
|
||||
class ShaderEffect : public Object, public Volatile
|
||||
class Shader : public Object, public Volatile
|
||||
{
|
||||
public:
|
||||
|
||||
// pointer to currently active ShaderEffect.
|
||||
static ShaderEffect *current;
|
||||
// pointer to currently active Shader.
|
||||
static Shader *current;
|
||||
|
||||
// Only vertex and fragment shaders have guaranteed support in all ShaderEffects.
|
||||
// Only vertex and fragment shaders have guaranteed support in all Shaders.
|
||||
enum ShaderType
|
||||
{
|
||||
TYPE_VERTEX,
|
||||
@@ -58,37 +58,37 @@ public:
|
||||
typedef std::map<ShaderType, std::string> ShaderSources;
|
||||
|
||||
/**
|
||||
* Creates a new ShaderEffect using a list of source codes.
|
||||
* Creates a new Shader using a list of source codes.
|
||||
* Sources must contain at least one vertex or fragment shader.
|
||||
**/
|
||||
ShaderEffect(const ShaderSources &shadersources);
|
||||
Shader(const ShaderSources &shadersources);
|
||||
|
||||
virtual ~ShaderEffect();
|
||||
virtual ~Shader();
|
||||
|
||||
// Implements Volatile
|
||||
virtual bool loadVolatile();
|
||||
virtual void unloadVolatile();
|
||||
|
||||
/**
|
||||
* Binds this ShaderEffect's program to be used when rendering.
|
||||
* Binds this Shader's program to be used when rendering.
|
||||
*
|
||||
* @param temporary True if we just want to send values to the shader with no intention of rendering.
|
||||
**/
|
||||
void attach(bool temporary = false);
|
||||
|
||||
/**
|
||||
* Detach the currently bound ShaderEffect.
|
||||
* Detach the currently bound Shader.
|
||||
* Causes OpenGL to use fixed functionality in place of shader programs.
|
||||
**/
|
||||
static void detach();
|
||||
|
||||
/**
|
||||
* Returns any warnings this ShaderEffect may have generated.
|
||||
* Returns any warnings this Shader may have generated.
|
||||
**/
|
||||
std::string getWarnings() const;
|
||||
|
||||
/**
|
||||
* Send at least one float or vector value to this ShaderEffect as a uniform.
|
||||
* Send at least one float or vector value to this Shader as a uniform.
|
||||
*
|
||||
* @param name The name of the uniform variable in the source code.
|
||||
* @param size Number of elements in each vector to send.
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
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 Shader as a uniform.
|
||||
*
|
||||
* @param name The name of the uniform variable in the source code.
|
||||
* @param size Number of rows/columns in the matrix.
|
||||
@@ -109,14 +109,14 @@ public:
|
||||
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 Shader as a uniform.
|
||||
*
|
||||
* @param name The name of the uniform variable in the source code.
|
||||
**/
|
||||
void sendImage(const std::string &name, const Image &image);
|
||||
|
||||
/**
|
||||
* Send a canvas to this ShaderEffect as a uniform.
|
||||
* Send a canvas to this Shader as a uniform.
|
||||
*
|
||||
* @param name The name of the uniform variable in the source code.
|
||||
**/
|
||||
@@ -130,14 +130,14 @@ private:
|
||||
GLint getUniformLocation(const std::string &name);
|
||||
void checkSetUniformError();
|
||||
|
||||
GLuint createShader(ShaderType type, const std::string &code);
|
||||
GLuint compileShaderCode(ShaderType type, const std::string &code);
|
||||
void createProgram(const std::vector<GLuint> &shaderids);
|
||||
|
||||
int getTextureUnit(const std::string &name);
|
||||
|
||||
void sendTexture(const std::string &name, GLuint texture);
|
||||
|
||||
// list of all shader code attached to this ShaderEffect
|
||||
// list of all shader code attached to this Shader
|
||||
ShaderSources _shadersources;
|
||||
|
||||
GLuint _program; // volatile
|
||||
@@ -160,4 +160,4 @@ private:
|
||||
} // graphics
|
||||
} // love
|
||||
|
||||
#endif // LOVE_GRAPHICS_EFFECT_H
|
||||
#endif // LOVE_GRAPHICS_SHADER_H
|
||||
@@ -433,10 +433,10 @@ int w_newCanvas(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_newShaderEffect(lua_State *L)
|
||||
int w_newShader(lua_State *L)
|
||||
{
|
||||
if (!ShaderEffect::isSupported())
|
||||
return luaL_error(L, "Sorry, your graphics card does not support shader effects.");
|
||||
if (!Shader::isSupported())
|
||||
return luaL_error(L, "Sorry, your graphics card does not support shaders.");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -452,28 +452,28 @@ int w_newShaderEffect(lua_State *L)
|
||||
// call effectCodeToGLSL, returned values will be at the top of the stack
|
||||
lua_pcall(L, 2, 2, 0);
|
||||
|
||||
ShaderEffect::ShaderSources sources;
|
||||
Shader::ShaderSources sources;
|
||||
|
||||
// vertex shader code
|
||||
if (lua_isstring(L, -2))
|
||||
{
|
||||
std::string vertcode(luaL_checkstring(L, -2));
|
||||
sources[ShaderEffect::TYPE_VERTEX] = vertcode;
|
||||
sources[Shader::TYPE_VERTEX] = vertcode;
|
||||
}
|
||||
|
||||
// fragment shader code
|
||||
if (lua_isstring(L, -1))
|
||||
{
|
||||
std::string fragcode(luaL_checkstring(L, -1));
|
||||
sources[ShaderEffect::TYPE_FRAGMENT] = fragcode;
|
||||
sources[Shader::TYPE_FRAGMENT] = fragcode;
|
||||
}
|
||||
|
||||
ShaderEffect *effect = instance->newShaderEffect(sources);
|
||||
luax_newtype(L, "ShaderEffect", GRAPHICS_SHADEREFFECT_T, (void *)effect);
|
||||
Shader *shader = instance->newShader(sources);
|
||||
luax_newtype(L, "Shader", GRAPHICS_SHADER_T, (void *)shader);
|
||||
}
|
||||
catch(const love::Exception &e)
|
||||
{
|
||||
// memory is freed in Graphics::newShaderEffect
|
||||
// memory is freed in Graphics::newShader
|
||||
luax_getfunction(L, "graphics", "_transformGLSLErrorMessages");
|
||||
lua_pushstring(L, e.what());
|
||||
lua_pcall(L, 1, 1, 0);
|
||||
@@ -818,26 +818,26 @@ int w_getCanvas(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_setShaderEffect(lua_State *L)
|
||||
int w_setShader(lua_State *L)
|
||||
{
|
||||
if (lua_isnoneornil(L,1))
|
||||
{
|
||||
ShaderEffect::detach();
|
||||
Shader::detach();
|
||||
return 0;
|
||||
}
|
||||
|
||||
ShaderEffect *effect = luax_checkshadereffect(L, 1);
|
||||
effect->attach();
|
||||
Shader *shader = luax_checkshader(L, 1);
|
||||
shader->attach();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_getShaderEffect(lua_State *L)
|
||||
int w_getShader(lua_State *L)
|
||||
{
|
||||
ShaderEffect *effect = ShaderEffect::current;
|
||||
if (effect)
|
||||
Shader *shader = Shader::current;
|
||||
if (shader)
|
||||
{
|
||||
effect->retain();
|
||||
luax_newtype(L, "ShaderEffect", GRAPHICS_SHADEREFFECT_T, (void *) effect);
|
||||
shader->retain();
|
||||
luax_newtype(L, "Shader", GRAPHICS_SHADER_T, (void *) shader);
|
||||
}
|
||||
else
|
||||
lua_pushnil(L);
|
||||
@@ -865,8 +865,8 @@ int w_isSupported(lua_State *L)
|
||||
if (!Canvas::isHdrSupported())
|
||||
supported = false;
|
||||
break;
|
||||
case Graphics::SUPPORT_SHADEREFFECT:
|
||||
if (!ShaderEffect::isSupported())
|
||||
case Graphics::SUPPORT_SHADER:
|
||||
if (!Shader::isSupported())
|
||||
supported = false;
|
||||
break;
|
||||
case Graphics::SUPPORT_NPOT:
|
||||
@@ -1285,7 +1285,7 @@ static const luaL_Reg functions[] =
|
||||
{ "newSpriteBatch", w_newSpriteBatch },
|
||||
{ "newParticleSystem", w_newParticleSystem },
|
||||
{ "newCanvas", w_newCanvas },
|
||||
{ "newShaderEffect", w_newShaderEffect },
|
||||
{ "newShader", w_newShader },
|
||||
|
||||
{ "setColor", w_setColor },
|
||||
{ "getColor", w_getColor },
|
||||
@@ -1316,8 +1316,8 @@ static const luaL_Reg functions[] =
|
||||
{ "setCanvas", w_setCanvas },
|
||||
{ "getCanvas", w_getCanvas },
|
||||
|
||||
{ "setShaderEffect", w_setShaderEffect },
|
||||
{ "getShaderEffect", w_getShaderEffect },
|
||||
{ "setShader", w_setShader },
|
||||
{ "getShader", w_getShader },
|
||||
|
||||
{ "isSupported", w_isSupported },
|
||||
|
||||
@@ -1378,7 +1378,7 @@ static const lua_CFunction types[] =
|
||||
luaopen_spritebatch,
|
||||
luaopen_particlesystem,
|
||||
luaopen_canvas,
|
||||
luaopen_shadereffect,
|
||||
luaopen_shader,
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "wrap_SpriteBatch.h"
|
||||
#include "wrap_ParticleSystem.h"
|
||||
#include "wrap_Canvas.h"
|
||||
#include "wrap_ShaderEffect.h"
|
||||
#include "wrap_Shader.h"
|
||||
#include "Graphics.h"
|
||||
|
||||
namespace love
|
||||
@@ -63,7 +63,7 @@ int w_newImageFont(lua_State *L);
|
||||
int w_newSpriteBatch(lua_State *L);
|
||||
int w_newParticleSystem(lua_State *L);
|
||||
int w_newCanvas(lua_State *L); // comments in function
|
||||
int w_newShaderEffect(lua_State *L);
|
||||
int w_newShader(lua_State *L);
|
||||
int w_setColor(lua_State *L);
|
||||
int w_getColor(lua_State *L);
|
||||
int w_setBackgroundColor(lua_State *L);
|
||||
@@ -90,8 +90,8 @@ int w_getMaxPointSize(lua_State *L);
|
||||
int w_newScreenshot(lua_State *L);
|
||||
int w_setCanvas(lua_State *L);
|
||||
int w_getCanvas(lua_State *L);
|
||||
int w_setShaderEffect(lua_State *L);
|
||||
int w_getShaderEffect(lua_State *L);
|
||||
int w_setShader(lua_State *L);
|
||||
int w_getShader(lua_State *L);
|
||||
int w_isSupported(lua_State *L);
|
||||
int w_draw(lua_State *L);
|
||||
int w_drawq(lua_State *L);
|
||||
|
||||
+30
-30
@@ -18,7 +18,7 @@
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
**/
|
||||
|
||||
#include "wrap_ShaderEffect.h"
|
||||
#include "wrap_Shader.h"
|
||||
#include "wrap_Image.h"
|
||||
#include "wrap_Canvas.h"
|
||||
#include <string>
|
||||
@@ -31,19 +31,19 @@ namespace graphics
|
||||
namespace opengl
|
||||
{
|
||||
|
||||
ShaderEffect *luax_checkshadereffect(lua_State *L, int idx)
|
||||
Shader *luax_checkshader(lua_State *L, int idx)
|
||||
{
|
||||
return luax_checktype<ShaderEffect>(L, idx, "ShaderEffect", GRAPHICS_SHADEREFFECT_T);
|
||||
return luax_checktype<Shader>(L, idx, "Shader", GRAPHICS_SHADER_T);
|
||||
}
|
||||
|
||||
int w_ShaderEffect_getWarnings(lua_State *L)
|
||||
int w_Shader_getWarnings(lua_State *L)
|
||||
{
|
||||
ShaderEffect *effect = luax_checkshadereffect(L, 1);
|
||||
lua_pushstring(L, effect->getWarnings().c_str());
|
||||
Shader *shader = luax_checkshader(L, 1);
|
||||
lua_pushstring(L, shader->getWarnings().c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _sendScalars(lua_State *L, ShaderEffect *effect, const char *name, int count)
|
||||
static int _sendScalars(lua_State *L, Shader *shader, const char *name, int count)
|
||||
{
|
||||
float *values = new float[count];
|
||||
for (int i = 0; i < count; ++i)
|
||||
@@ -62,7 +62,7 @@ static int _sendScalars(lua_State *L, ShaderEffect *effect, const char *name, in
|
||||
|
||||
try
|
||||
{
|
||||
effect->sendFloat(name, 1, values, count);
|
||||
shader->sendFloat(name, 1, values, count);
|
||||
}
|
||||
catch(love::Exception &e)
|
||||
{
|
||||
@@ -74,7 +74,7 @@ static int _sendScalars(lua_State *L, ShaderEffect *effect, const char *name, in
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _sendVectors(lua_State *L, ShaderEffect *effect, const char *name, int count)
|
||||
static int _sendVectors(lua_State *L, Shader *shader, const char *name, int count)
|
||||
{
|
||||
size_t dimension = lua_objlen(L, 3);
|
||||
float *values = new float[count * dimension];
|
||||
@@ -106,7 +106,7 @@ static int _sendVectors(lua_State *L, ShaderEffect *effect, const char *name, in
|
||||
|
||||
try
|
||||
{
|
||||
effect->sendFloat(name, dimension, values, count);
|
||||
shader->sendFloat(name, dimension, values, count);
|
||||
}
|
||||
catch(love::Exception &e)
|
||||
{
|
||||
@@ -118,9 +118,9 @@ static int _sendVectors(lua_State *L, ShaderEffect *effect, const char *name, in
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_ShaderEffect_sendFloat(lua_State *L)
|
||||
int w_Shader_sendFloat(lua_State *L)
|
||||
{
|
||||
ShaderEffect *effect = luax_checkshadereffect(L, 1);
|
||||
Shader *shader = luax_checkshader(L, 1);
|
||||
const char *name = luaL_checkstring(L, 2);
|
||||
int count = lua_gettop(L) - 2;
|
||||
|
||||
@@ -128,17 +128,17 @@ int w_ShaderEffect_sendFloat(lua_State *L)
|
||||
return luaL_error(L, "No variable to send.");
|
||||
|
||||
if (lua_isnumber(L, 3) || lua_isboolean(L, 3))
|
||||
return _sendScalars(L, effect, name, count);
|
||||
return _sendScalars(L, shader, name, count);
|
||||
else if (lua_istable(L, 3))
|
||||
return _sendVectors(L, effect, name, count);
|
||||
return _sendVectors(L, shader, name, count);
|
||||
|
||||
return luaL_typerror(L, 3, "number, boolean, or table");
|
||||
}
|
||||
|
||||
int w_ShaderEffect_sendMatrix(lua_State *L)
|
||||
int w_Shader_sendMatrix(lua_State *L)
|
||||
{
|
||||
int count = lua_gettop(L) - 2;
|
||||
ShaderEffect *effect = luax_checkshadereffect(L, 1);
|
||||
Shader *shader = luax_checkshader(L, 1);
|
||||
const char *name = luaL_checkstring(L, 2);
|
||||
|
||||
if (!lua_istable(L, 3))
|
||||
@@ -180,7 +180,7 @@ int w_ShaderEffect_sendMatrix(lua_State *L)
|
||||
|
||||
try
|
||||
{
|
||||
effect->sendMatrix(name, dimension, values, count);
|
||||
shader->sendMatrix(name, dimension, values, count);
|
||||
}
|
||||
catch(love::Exception &e)
|
||||
{
|
||||
@@ -192,15 +192,15 @@ int w_ShaderEffect_sendMatrix(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_ShaderEffect_sendImage(lua_State *L)
|
||||
int w_Shader_sendImage(lua_State *L)
|
||||
{
|
||||
ShaderEffect *effect = luax_checkshadereffect(L, 1);
|
||||
Shader *shader = luax_checkshader(L, 1);
|
||||
const char *name = luaL_checkstring(L, 2);
|
||||
Image *img = luax_checkimage(L, 3);
|
||||
|
||||
try
|
||||
{
|
||||
effect->sendImage(name, *img);
|
||||
shader->sendImage(name, *img);
|
||||
}
|
||||
catch(love::Exception &e)
|
||||
{
|
||||
@@ -210,15 +210,15 @@ int w_ShaderEffect_sendImage(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_ShaderEffect_sendCanvas(lua_State *L)
|
||||
int w_Shader_sendCanvas(lua_State *L)
|
||||
{
|
||||
ShaderEffect *effect = luax_checkshadereffect(L, 1);
|
||||
Shader *shader = luax_checkshader(L, 1);
|
||||
const char *name = luaL_checkstring(L, 2);
|
||||
Canvas *canvas = luax_checkcanvas(L, 3);
|
||||
|
||||
try
|
||||
{
|
||||
effect->sendCanvas(name, *canvas);
|
||||
shader->sendCanvas(name, *canvas);
|
||||
}
|
||||
catch(love::Exception &e)
|
||||
{
|
||||
@@ -231,17 +231,17 @@ int w_ShaderEffect_sendCanvas(lua_State *L)
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
{
|
||||
{ "getWarnings", w_ShaderEffect_getWarnings },
|
||||
{ "sendFloat", w_ShaderEffect_sendFloat },
|
||||
{ "sendMatrix", w_ShaderEffect_sendMatrix },
|
||||
{ "sendImage", w_ShaderEffect_sendImage },
|
||||
{ "sendCanvas", w_ShaderEffect_sendCanvas },
|
||||
{ "getWarnings", w_Shader_getWarnings },
|
||||
{ "sendFloat", w_Shader_sendFloat },
|
||||
{ "sendMatrix", w_Shader_sendMatrix },
|
||||
{ "sendImage", w_Shader_sendImage },
|
||||
{ "sendCanvas", w_Shader_sendCanvas },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
extern "C" int luaopen_shadereffect(lua_State *L)
|
||||
extern "C" int luaopen_shader(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, "ShaderEffect", functions);
|
||||
return luax_register_type(L, "Shader", functions);
|
||||
}
|
||||
|
||||
} // opengl
|
||||
+7
-7
@@ -22,7 +22,7 @@
|
||||
#define LOVE_GRAPHICS_OPENGL_WRAP_PROGRAM_H
|
||||
|
||||
#include "common/runtime.h"
|
||||
#include "ShaderEffect.h"
|
||||
#include "Shader.h"
|
||||
|
||||
namespace love
|
||||
{
|
||||
@@ -31,12 +31,12 @@ namespace graphics
|
||||
namespace opengl
|
||||
{
|
||||
|
||||
ShaderEffect *luax_checkshadereffect(lua_State *L, int idx);
|
||||
int w_ShaderEffect_getWarnings(lua_State *L);
|
||||
int w_ShaderEffect_sendFloat(lua_State *L);
|
||||
int w_ShaderEffect_sendMatrix(lua_State *L);
|
||||
int w_ShaderEffect_sendImage(lua_State *L);
|
||||
extern "C" int luaopen_shadereffect(lua_State *L);
|
||||
Shader *luax_checkshader(lua_State *L, int idx);
|
||||
int w_Shader_getWarnings(lua_State *L);
|
||||
int w_Shader_sendFloat(lua_State *L);
|
||||
int w_Shader_sendMatrix(lua_State *L);
|
||||
int w_Shader_sendImage(lua_State *L);
|
||||
extern "C" int luaopen_shader(lua_State *L);
|
||||
|
||||
} // opengl
|
||||
} // graphics
|
||||
@@ -760,7 +760,7 @@ function love.releaseerrhand(msg)
|
||||
end
|
||||
|
||||
love.graphics.setCanvas()
|
||||
love.graphics.setShaderEffect()
|
||||
love.graphics.setShader()
|
||||
|
||||
-- Load.
|
||||
if love.audio then love.audio.stop() end
|
||||
|
||||
@@ -1783,7 +1783,7 @@ const unsigned char boot_lua[] =
|
||||
0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74,
|
||||
0x43, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x28, 0x29, 0x0a,
|
||||
0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74,
|
||||
0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x28, 0x29, 0x0a,
|
||||
0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x28, 0x29, 0x0a,
|
||||
0x09, 0x2d, 0x2d, 0x20, 0x4c, 0x6f, 0x61, 0x64, 0x2e, 0x0a,
|
||||
0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x20, 0x74, 0x68, 0x65,
|
||||
0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x28,
|
||||
|
||||
+18
-16
@@ -1287,7 +1287,7 @@ do
|
||||
end
|
||||
|
||||
|
||||
-- SHADER EFFECTS
|
||||
-- SHADERS
|
||||
|
||||
local GLSL_VERSION = "#version 120"
|
||||
|
||||
@@ -1360,7 +1360,7 @@ void main() {
|
||||
return table_concat(fragcodes, "\n")
|
||||
end
|
||||
|
||||
function love.graphics._effectCodeToGLSL(vertcode, fragcode)
|
||||
function love.graphics._shaderCodeToGLSL(vertcode, fragcode)
|
||||
if vertcode then
|
||||
local s = vertcode:gsub("\r\n\t", " ")
|
||||
s = s:gsub("%w+(%s+)%(", "")
|
||||
@@ -1393,9 +1393,9 @@ void main() {
|
||||
end
|
||||
|
||||
function love.graphics._transformGLSLErrorMessages(message)
|
||||
local shadertype = message:match("Cannot compile (%a+) shader")
|
||||
local shadertype = message:match("Cannot compile (%a+) shader code")
|
||||
if not shadertype then return message end
|
||||
local lines = {"Cannot compile "..shadertype.." shader:"}
|
||||
local lines = {"Cannot compile "..shadertype.." shader code:"}
|
||||
for l in message:gmatch("[^\n]+") do
|
||||
-- nvidia compiler message:
|
||||
-- 0(<linenumber>) : error/warning [NUMBER]: <error message>
|
||||
@@ -1439,7 +1439,7 @@ void main() {
|
||||
end
|
||||
|
||||
-- automagic uniform setter
|
||||
local function shadereffect_dispatch_send(self, name, value, ...)
|
||||
local function shader_dispatch_send(self, name, value, ...)
|
||||
local valuetype = type(value)
|
||||
if valuetype == "number" or valuetype == "boolean" then -- scalar
|
||||
self:sendFloat(name, value, ...)
|
||||
@@ -1462,9 +1462,9 @@ void main() {
|
||||
end
|
||||
end
|
||||
|
||||
local newShaderEffect = love.graphics.newShaderEffect
|
||||
function love.graphics.newShaderEffect(vertcode, fragcode)
|
||||
love.graphics.newShaderEffect = function(vertcode, fragcode)
|
||||
local newShader = love.graphics.newShader
|
||||
function love.graphics.newShader(vertcode, fragcode)
|
||||
love.graphics.newShader = function(vertcode, fragcode)
|
||||
if love.filesystem then
|
||||
if vertcode and love.filesystem.exists(vertcode) then
|
||||
vertcode = love.filesystem.read(vertcode)
|
||||
@@ -1473,23 +1473,25 @@ void main() {
|
||||
fragcode = love.filesystem.read(fragcode)
|
||||
end
|
||||
end
|
||||
return newShaderEffect(vertcode, fragcode)
|
||||
return newShader(vertcode, fragcode)
|
||||
end
|
||||
|
||||
local effect = love.graphics.newShaderEffect(vertcode, fragcode)
|
||||
local meta = getmetatable(effect)
|
||||
meta.send = shadereffect_dispatch_send
|
||||
local shader = love.graphics.newShader(vertcode, fragcode)
|
||||
local meta = getmetatable(shader)
|
||||
meta.send = shader_dispatch_send
|
||||
meta.sendBoolean = meta.sendFloat
|
||||
return effect
|
||||
return shader
|
||||
end
|
||||
|
||||
|
||||
-- PixelEffect compatibility functions
|
||||
|
||||
function love.graphics.newPixelEffect(fragcode)
|
||||
return love.graphics.newShaderEffect(nil, fragcode)
|
||||
return love.graphics.newShader(nil, fragcode)
|
||||
end
|
||||
|
||||
love.graphics.setPixelEffect = love.graphics.setShaderEffect
|
||||
love.graphics.getPixelEffect = love.graphics.getShaderEffect
|
||||
love.graphics.setPixelEffect = love.graphics.setShader
|
||||
love.graphics.getPixelEffect = love.graphics.getShader
|
||||
|
||||
love.graphics._effectCodeToGLSL = love.graphics._shaderCodeToGLSL
|
||||
end
|
||||
|
||||
+32
-29
@@ -6263,7 +6263,7 @@ const unsigned char graphics_lua[] =
|
||||
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,
|
||||
0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x2d, 0x2d, 0x20, 0x53, 0x48, 0x41, 0x44, 0x45, 0x52, 0x20, 0x45, 0x46, 0x46, 0x45, 0x43, 0x54, 0x53, 0x0a,
|
||||
0x09, 0x2d, 0x2d, 0x20, 0x53, 0x48, 0x41, 0x44, 0x45, 0x52, 0x53, 0x0a,
|
||||
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,
|
||||
0x09, 0x0a,
|
||||
@@ -6385,7 +6385,7 @@ const unsigned char graphics_lua[] =
|
||||
0x22, 0x29, 0x0a,
|
||||
0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61,
|
||||
0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x54,
|
||||
0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x54,
|
||||
0x6f, 0x47, 0x4c, 0x53, 0x4c, 0x28, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x66, 0x72,
|
||||
0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x69, 0x66, 0x20, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
|
||||
@@ -6454,14 +6454,14 @@ const unsigned char graphics_lua[] =
|
||||
0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x74, 0x79, 0x70, 0x65,
|
||||
0x20, 0x3d, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x22,
|
||||
0x43, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x20, 0x28, 0x25, 0x61,
|
||||
0x2b, 0x29, 0x20, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x22, 0x29, 0x0a,
|
||||
0x2b, 0x29, 0x20, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x74, 0x79, 0x70,
|
||||
0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x22,
|
||||
0x43, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x20, 0x22, 0x2e, 0x2e,
|
||||
0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x2e, 0x22, 0x20, 0x73, 0x68, 0x61, 0x64,
|
||||
0x65, 0x72, 0x3a, 0x22, 0x7d, 0x0a,
|
||||
0x65, 0x72, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3a, 0x22, 0x7d, 0x0a,
|
||||
0x09, 0x09, 0x66, 0x6f, 0x72, 0x20, 0x6c, 0x20, 0x69, 0x6e, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||
0x3a, 0x67, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x22, 0x5b, 0x5e, 0x5c, 0x6e, 0x5d, 0x2b, 0x22, 0x29, 0x20,
|
||||
0x64, 0x6f, 0x0a,
|
||||
@@ -6554,9 +6554,9 @@ const unsigned char graphics_lua[] =
|
||||
0x09, 0x2d, 0x2d, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x20, 0x75, 0x6e, 0x69, 0x66,
|
||||
0x6f, 0x72, 0x6d, 0x20, 0x73, 0x65, 0x74, 0x74, 0x65, 0x72, 0x0a,
|
||||
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x68,
|
||||
0x61, 0x64, 0x65, 0x72, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63,
|
||||
0x68, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2c,
|
||||
0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x29, 0x0a,
|
||||
0x61, 0x64, 0x65, 0x72, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x73, 0x65, 0x6e, 0x64,
|
||||
0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
||||
0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x74, 0x79, 0x70, 0x65, 0x20,
|
||||
0x3d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x28, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x69, 0x66, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x3d, 0x20,
|
||||
@@ -6612,17 +6612,16 @@ const unsigned char graphics_lua[] =
|
||||
0x65, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x2e, 0x22, 0x29, 0x2e, 0x22, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6e, 0x65, 0x77, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x45, 0x66,
|
||||
0x66, 0x65, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69,
|
||||
0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x0a,
|
||||
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6e, 0x65, 0x77, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x3d,
|
||||
0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77,
|
||||
0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x0a,
|
||||
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, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x45, 0x66, 0x66,
|
||||
0x65, 0x63, 0x74, 0x28, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x66, 0x72, 0x61, 0x67,
|
||||
0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a,
|
||||
0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x28, 0x76, 0x65,
|
||||
0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65,
|
||||
0x77, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75,
|
||||
0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x66,
|
||||
0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a,
|
||||
0x77, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x28, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64,
|
||||
0x65, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73,
|
||||
0x74, 0x65, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
|
||||
0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x61, 0x6e,
|
||||
@@ -6643,21 +6642,20 @@ const unsigned char graphics_lua[] =
|
||||
0x09, 0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x53, 0x68, 0x61, 0x64, 0x65,
|
||||
0x72, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x28, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x20,
|
||||
0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a,
|
||||
0x72, 0x28, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f,
|
||||
0x64, 0x65, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x6c,
|
||||
0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x6c,
|
||||
0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77, 0x53, 0x68,
|
||||
0x61, 0x64, 0x65, 0x72, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x28, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64,
|
||||
0x65, 0x2c, 0x20, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a,
|
||||
0x61, 0x64, 0x65, 0x72, 0x28, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x66, 0x72, 0x61,
|
||||
0x67, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x3d, 0x20, 0x67, 0x65, 0x74,
|
||||
0x6d, 0x65, 0x74, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x29, 0x0a,
|
||||
0x6d, 0x65, 0x74, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x73, 0x68, 0x61, 0x64,
|
||||
0x65, 0x72, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f,
|
||||
0x73, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x65, 0x72, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x09, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e,
|
||||
0x20, 0x3d, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 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, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x0a,
|
||||
0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x2d, 0x2d, 0x20, 0x50, 0x69, 0x78, 0x65, 0x6c, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x63, 0x6f,
|
||||
0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
|
||||
@@ -6666,17 +6664,22 @@ const unsigned char graphics_lua[] =
|
||||
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,
|
||||
0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70,
|
||||
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,
|
||||
0x68, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x28, 0x6e, 0x69, 0x6c,
|
||||
0x2c, 0x20, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a,
|
||||
0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
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,
|
||||
0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x53, 0x68, 0x61, 0x64, 0x65,
|
||||
0x72, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x0a,
|
||||
0x72, 0x0a,
|
||||
0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x67, 0x65, 0x74,
|
||||
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, 0x67, 0x65, 0x74, 0x53, 0x68, 0x61, 0x64, 0x65,
|
||||
0x72, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x0a,
|
||||
0x72, 0x0a,
|
||||
0x09, 0x0a,
|
||||
0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x5f, 0x65, 0x66,
|
||||
0x66, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x54, 0x6f, 0x47, 0x4c, 0x53, 0x4c, 0x20, 0x3d, 0x20, 0x6c,
|
||||
0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x5f, 0x73, 0x68, 0x61, 0x64,
|
||||
0x65, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x54, 0x6f, 0x47, 0x4c, 0x53, 0x4c, 0x0a,
|
||||
0x65, 0x6e, 0x64, 0x0a,
|
||||
}; // [graphics.lua]
|
||||
} // love
|
||||
Reference in New Issue
Block a user