use GLSL shaders

This commit is contained in:
Eduardo Bart
2011-12-06 22:31:55 -02:00
parent cf0aab6d4d
commit 7eead50806
64 changed files with 1219 additions and 630 deletions

View File

@@ -15,16 +15,16 @@ if not io.open(cppclassheader, 'r') then
return false
end
function string.matchcount(str, pattern)
function string:matchcount(pattern)
local count = 0
for w in str:gmatch(pattern) do count = count + 1 end
for w in self:gmatch(pattern) do count = count + 1 end
return count
end
function string.splitlines(str)
function string:splitlines()
local t = {}
local function helper(line) table.insert(t, line) return "" end
helper((str:gsub("(.-)\r?\n", helper)))
helper((self:gsub("(.-)\r?\n", helper)))
return t
end
@@ -34,7 +34,7 @@ for line in io.lines(cppclassheader) do
foundclassname = line:match('^class ([%w_]+)')
if foundclassname then
if not cppclassname then
guessedclassname = cppclassheader:match('([%w_]+).h'):lower()
guessedclassname = cppclassheader:match('([%w_]+)\.h$'):lower()
if foundclassname:lower() == guessedclassname then
cppclassname = foundclassname
end
@@ -69,8 +69,9 @@ for line in io.lines(cppclassheader) do
elseif line:match('private:') or line:match('protected:') then
publicmethods = false
elseif publicmethods then
for funcname,args in line:gmatch(' *[%w :_]* ([%w_]+)%(([^%(]*%)) *[;{].*$') do
if funcname ~= cppclassname then
funcname, args = line:match('^ *[%w <>&\*:_]* ([%w_]+)%(([^%)]*%))[%w ]*[;{].*$')
if funcname then
if funcname ~= cppclassname and funcname ~= 'create' then
numargs = args:matchcount('[^,)]+[,)]')
if cppclassinstance then