Browse Source

minor cleanup and fixes

Alexander Szpakowski 12 years ago
parent
commit
f54c270042

+ 4 - 6
src/modules/graphics/opengl/ShaderEffect.cpp

@@ -122,7 +122,7 @@ GLuint ShaderEffect::createShader(const ShaderSource &source)
 		
 		
 		if (err == GL_INVALID_OPERATION) // should only happen between glBegin() and glEnd()
 		if (err == GL_INVALID_OPERATION) // 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);
-		else if (err == GL_INVALID_ENUM)
+		else 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);
 	}
 	}
 	
 	
@@ -189,9 +189,9 @@ bool ShaderEffect::loadVolatile()
 	
 	
 	std::vector<GLuint> shaderids;
 	std::vector<GLuint> shaderids;
 	
 	
-	std::vector<ShaderSource>::const_iterator cursource;
-	for (cursource = _shadersources.begin(); cursource != _shadersources.end(); ++cursource)
-		shaderids.push_back(createShader(*cursource));
+	std::vector<ShaderSource>::const_iterator source;
+	for (source = _shadersources.begin(); source != _shadersources.end(); ++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!");
@@ -323,9 +323,7 @@ void ShaderEffect::sendFloat(const std::string &name, int size, const GLfloat *v
 	GLint location = getUniformLocation(name);
 	GLint location = getUniformLocation(name);
 
 
 	if (size < 1 || size > 4)
 	if (size < 1 || size > 4)
-	{
 		throw love::Exception("Invalid variable size: %d (expected 1-4).", size);
 		throw love::Exception("Invalid variable size: %d (expected 1-4).", size);
-	}
 
 
 	switch (size)
 	switch (size)
 	{
 	{

+ 3 - 2
src/modules/graphics/opengl/ShaderEffect.h

@@ -58,6 +58,7 @@ public:
 	
 	
 	ShaderEffect(const std::vector<ShaderSource> &shadersources);
 	ShaderEffect(const std::vector<ShaderSource> &shadersources);
 	virtual ~ShaderEffect();
 	virtual ~ShaderEffect();
+	
 	std::string getWarnings() const;
 	std::string getWarnings() const;
 
 
 	virtual bool loadVolatile();
 	virtual bool loadVolatile();
@@ -69,7 +70,7 @@ public:
 	static std::string getGLSLVersion();
 	static std::string getGLSLVersion();
 	static bool isSupported();
 	static bool isSupported();
 
 
-	static ShaderEffect *current;
+	static ShaderEffect *current; // pointer to currently active ShaderEffect
 
 
 	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);
 	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);
@@ -82,7 +83,7 @@ private:
 	GLuint createShader(const ShaderSource &source);
 	GLuint createShader(const ShaderSource &source);
 	void createProgram(const std::vector<GLuint> &shaders);
 	void createProgram(const std::vector<GLuint> &shaders);
 	
 	
-	std::vector<ShaderSource> _shadersources; // list of all shader code attached to this ShaderEffect
+	std::vector<ShaderSource> _shadersources; // all shader code attached to this ShaderEffect
 	
 	
 	GLuint _program; // volatile
 	GLuint _program; // volatile
 
 

+ 15 - 9
src/scripts/graphics.lua

@@ -1282,11 +1282,9 @@ do
 		love.graphics.printf = _printf
 		love.graphics.printf = _printf
 		love.graphics.printf(...)
 		love.graphics.printf(...)
 	end
 	end
-
-	-- PIXEL EFFECTS
-	local HEADER_LINE_COUNT = 7
 	
 	
 	local GLSL_VERT = {
 	local GLSL_VERT = {
+		HEADER_LINE_COUNT = 7,
 		HEADER = [[
 		HEADER = [[
 #version 120
 #version 120
 #define number float
 #define number float
@@ -1304,6 +1302,7 @@ void main() {
 	}
 	}
 	
 	
 	local GLSL_FRAG = {
 	local GLSL_FRAG = {
+		HEADER_LINE_COUNT = 7,
 		HEADER = [[
 		HEADER = [[
 #version 120
 #version 120
 #define number float
 #define number float
@@ -1325,20 +1324,20 @@ void main() {
 			local s = vertcode:gsub("\r\n\t", " ")
 			local s = vertcode:gsub("\r\n\t", " ")
 			s = s:gsub("%w+(%s+)%(", "")
 			s = s:gsub("%w+(%s+)%(", "")
 			if s:match("vec4 effect%(") then
 			if s:match("vec4 effect%(") then
-				fragcode = vertcode
+				fragcode = vertcode -- first argument contains frag shader code
 			end
 			end
 			if not s:match("vec4 transform%(") then
 			if not s:match("vec4 transform%(") then
-				vertcode = nil
+				vertcode = nil -- first argument doesn't contain vert shader code
 			end
 			end
 		end
 		end
 		if fragcode then
 		if fragcode then
 			local s = fragcode:gsub("\r\n\t", " ")
 			local s = fragcode:gsub("\r\n\t", " ")
 			s = s:gsub("%w+(%s+)%(", "")
 			s = s:gsub("%w+(%s+)%(", "")
 			if s:match("vec4 transform%(") then
 			if s:match("vec4 transform%(") then
-				vertcode = fragcode
+				vertcode = fragcode -- second argument contains vert shader code
 			end
 			end
 			if not s:match("vec4 effect%(") then
 			if not s:match("vec4 effect%(") then
-				fragcode = nil
+				fragcode = nil -- second argument doesn't contain frag shader code
 			end
 			end
 		end
 		end
 
 
@@ -1364,10 +1363,17 @@ void main() {
 				-- ati compiler message:
 				-- ati compiler message:
 				-- ERROR 0:<linenumber>: error/warning(#[NUMBER]) [ERRORNAME]: <errormessage>
 				-- ERROR 0:<linenumber>: error/warning(#[NUMBER]) [ERRORNAME]: <errormessage>
 				linenumber, what, message = l:match("^%w+: 0:(%d+):%s*(%w+)%([^%)]+%)%s*(.+)$")
 				linenumber, what, message = l:match("^%w+: 0:(%d+):%s*(%w+)%([^%)]+%)%s*(.+)$")
+				if not linenumber then
+					-- OSX compiler message:
+					-- ERROR: 0:<linenumber>: <errormessage>
+					what, linenumber, message = l:match("^(%w+): %d+:(%d+): (.+)$")
+				end
 			end
 			end
 			if linenumber and what and message then
 			if linenumber and what and message then
-				local headerlinecount = GLSL_FRAG.HEADER_LINE_COUNT
-				if shadertype == "vertex" then
+				local headerlinecount = 0
+				if shadertype == "fragment" then
+					headerlinecount = GLSL_FRAG.HEADER_LINE_COUNT
+				elseif shadertype == "vertex" then
 					headerlinecount = GLSL_VERT.HEADER_LINE_COUNT
 					headerlinecount = GLSL_VERT.HEADER_LINE_COUNT
 				end
 				end
 				linenumber = linenumber - headerlinecount
 				linenumber = linenumber - headerlinecount

+ 38 - 11
src/scripts/graphics.lua.h

@@ -6259,12 +6259,11 @@ 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, 0x2d, 0x2d, 0x20, 0x50, 0x49, 0x58, 0x45, 0x4c, 0x20, 0x45, 0x46, 0x46, 0x45, 0x43, 0x54, 0x53, 0x0a,
-	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x5f, 0x4c, 0x49, 0x4e, 0x45, 
-	0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x20, 0x3d, 0x20, 0x37, 0x0a,
 	0x09, 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, 0x5f, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 
+	0x54, 0x20, 0x3d, 0x20, 0x37, 0x2c, 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,
 	0x23, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x32, 0x30, 0x0a,
 	0x23, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x32, 0x30, 0x0a,
 	0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x66, 0x6c, 0x6f, 
 	0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x66, 0x6c, 0x6f, 
@@ -6293,6 +6292,8 @@ const unsigned char graphics_lua[] =
 	0x09, 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, 0x5f, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 
+	0x54, 0x20, 0x3d, 0x20, 0x37, 0x2c, 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,
 	0x23, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x32, 0x30, 0x0a,
 	0x23, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x32, 0x30, 0x0a,
 	0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x66, 0x6c, 0x6f, 
 	0x23, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x66, 0x6c, 0x6f, 
@@ -6336,12 +6337,17 @@ const unsigned char graphics_lua[] =
 	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x73, 0x3a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x22, 0x76, 0x65, 0x63, 
 	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x73, 0x3a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x22, 0x76, 0x65, 0x63, 
 	0x34, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x25, 0x28, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
 	0x34, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x25, 0x28, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
 	0x09, 0x09, 0x09, 0x09, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x72, 
 	0x09, 0x09, 0x09, 0x09, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x72, 
-	0x74, 0x63, 0x6f, 0x64, 0x65, 0x0a,
+	0x74, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x2d, 0x2d, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x61, 0x72, 0x67, 
+	0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x66, 0x72, 0x61, 
+	0x67, 0x20, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x0a,
 	0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x3a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 
 	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x3a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 
 	0x22, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x25, 0x28, 0x22, 
 	0x22, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x25, 0x28, 0x22, 
 	0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
 	0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
-	0x09, 0x09, 0x09, 0x09, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x6e, 0x69, 0x6c, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x6e, 0x69, 0x6c, 
+	0x20, 0x2d, 0x2d, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 
+	0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x76, 
+	0x65, 0x72, 0x74, 0x20, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x0a,
 	0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x69, 0x66, 0x20, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
 	0x09, 0x09, 0x69, 0x66, 0x20, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
@@ -6354,12 +6360,17 @@ const unsigned char graphics_lua[] =
 	0x34, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x25, 0x28, 0x22, 0x29, 0x20, 0x74, 0x68, 
 	0x34, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x25, 0x28, 0x22, 0x29, 0x20, 0x74, 0x68, 
 	0x65, 0x6e, 0x0a,
 	0x65, 0x6e, 0x0a,
 	0x09, 0x09, 0x09, 0x09, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x72, 0x61, 
 	0x09, 0x09, 0x09, 0x09, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x72, 0x61, 
-	0x67, 0x63, 0x6f, 0x64, 0x65, 0x0a,
+	0x67, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x2d, 0x2d, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x61, 0x72, 
+	0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x76, 0x65, 
+	0x72, 0x74, 0x20, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x0a,
 	0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x3a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 
 	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x3a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 
 	0x22, 0x76, 0x65, 0x63, 0x34, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x25, 0x28, 0x22, 0x29, 0x20, 0x74, 
 	0x22, 0x76, 0x65, 0x63, 0x34, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x25, 0x28, 0x22, 0x29, 0x20, 0x74, 
 	0x68, 0x65, 0x6e, 0x0a,
 	0x68, 0x65, 0x6e, 0x0a,
-	0x09, 0x09, 0x09, 0x09, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x6e, 0x69, 0x6c, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x66, 0x72, 0x61, 0x67, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x6e, 0x69, 0x6c, 
+	0x20, 0x2d, 0x2d, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 
+	0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 
+	0x66, 0x72, 0x61, 0x67, 0x20, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x0a,
 	0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x69, 0x66, 0x20, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
 	0x09, 0x09, 0x69, 0x66, 0x20, 0x76, 0x65, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
@@ -6423,16 +6434,32 @@ const unsigned char graphics_lua[] =
 	0x74, 0x63, 0x68, 0x28, 0x22, 0x5e, 0x25, 0x77, 0x2b, 0x3a, 0x20, 0x30, 0x3a, 0x28, 0x25, 0x64, 0x2b, 0x29, 
 	0x74, 0x63, 0x68, 0x28, 0x22, 0x5e, 0x25, 0x77, 0x2b, 0x3a, 0x20, 0x30, 0x3a, 0x28, 0x25, 0x64, 0x2b, 0x29, 
 	0x3a, 0x25, 0x73, 0x2a, 0x28, 0x25, 0x77, 0x2b, 0x29, 0x25, 0x28, 0x5b, 0x5e, 0x25, 0x29, 0x5d, 0x2b, 0x25, 
 	0x3a, 0x25, 0x73, 0x2a, 0x28, 0x25, 0x77, 0x2b, 0x29, 0x25, 0x28, 0x5b, 0x5e, 0x25, 0x29, 0x5d, 0x2b, 0x25, 
 	0x29, 0x25, 0x73, 0x2a, 0x28, 0x2e, 0x2b, 0x29, 0x24, 0x22, 0x29, 0x0a,
 	0x29, 0x25, 0x73, 0x2a, 0x28, 0x2e, 0x2b, 0x29, 0x24, 0x22, 0x29, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 
+	0x62, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x09, 0x2d, 0x2d, 0x20, 0x4f, 0x53, 0x58, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 
+	0x65, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x09, 0x2d, 0x2d, 0x20, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x3a, 0x20, 0x30, 0x3a, 0x3c, 
+	0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3e, 0x3a, 0x20, 0x3c, 0x65, 0x72, 0x72, 0x6f, 
+	0x72, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3e, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x09, 0x77, 0x68, 0x61, 0x74, 0x2c, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 
+	0x62, 0x65, 0x72, 0x2c, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x6c, 0x3a, 0x6d, 
+	0x61, 0x74, 0x63, 0x68, 0x28, 0x22, 0x5e, 0x28, 0x25, 0x77, 0x2b, 0x29, 0x3a, 0x20, 0x25, 0x64, 0x2b, 0x3a, 
+	0x28, 0x25, 0x64, 0x2b, 0x29, 0x3a, 0x20, 0x28, 0x2e, 0x2b, 0x29, 0x24, 0x22, 0x29, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x61, 
 	0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x61, 
 	0x6e, 0x64, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 
 	0x6e, 0x64, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 
 	0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
 	0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
 	0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x6c, 0x69, 
 	0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x6c, 0x69, 
-	0x6e, 0x65, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x47, 0x4c, 0x53, 0x4c, 0x5f, 0x46, 0x52, 0x41, 
-	0x47, 0x2e, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x5f, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 
-	0x54, 0x0a,
+	0x6e, 0x65, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x30, 0x0a,
 	0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x74, 0x79, 0x70, 0x65, 0x20, 
 	0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x74, 0x79, 0x70, 0x65, 0x20, 
-	0x3d, 0x3d, 0x20, 0x22, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
+	0x3d, 0x3d, 0x20, 0x22, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x09, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x65, 0x63, 0x6f, 0x75, 
+	0x6e, 0x74, 0x20, 0x3d, 0x20, 0x47, 0x4c, 0x53, 0x4c, 0x5f, 0x46, 0x52, 0x41, 0x47, 0x2e, 0x48, 0x45, 0x41, 
+	0x44, 0x45, 0x52, 0x5f, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x0a,
+	0x09, 0x09, 0x09, 0x09, 0x65, 0x6c, 0x73, 0x65, 0x69, 0x66, 0x20, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x74, 
+	0x79, 0x70, 0x65, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x22, 0x20, 0x74, 0x68, 
+	0x65, 0x6e, 0x0a,
 	0x09, 0x09, 0x09, 0x09, 0x09, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x65, 0x63, 0x6f, 0x75, 
 	0x09, 0x09, 0x09, 0x09, 0x09, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x65, 0x63, 0x6f, 0x75, 
 	0x6e, 0x74, 0x20, 0x3d, 0x20, 0x47, 0x4c, 0x53, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x54, 0x2e, 0x48, 0x45, 0x41, 
 	0x6e, 0x74, 0x20, 0x3d, 0x20, 0x47, 0x4c, 0x53, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x54, 0x2e, 0x48, 0x45, 0x41, 
 	0x44, 0x45, 0x52, 0x5f, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x0a,
 	0x44, 0x45, 0x52, 0x5f, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x0a,