...
 
Commits (6)
    https://gitcode.net/GGELUA/GGELUA2/-/commit/c1dd15c54d356fcf29146ab8c8312e0d1ac02c04 fix FPS 2022-05-02T04:38:50+08:00 baidwwy baidwwy@vip.qq.com https://gitcode.net/GGELUA/GGELUA2/-/commit/7553870e3517f1c4dcf38fd2cc44aa1502e9b731 4月赞助 2022-05-02T20:24:58+08:00 baidwwy baidwwy@vip.qq.com https://gitcode.net/GGELUA/GGELUA2/-/commit/a290cb7bf5831b510b9434b02ca97cbf35aa041c fix 2022-05-03T06:43:18+08:00 baidwwy baidwwy@vip.qq.com https://gitcode.net/GGELUA/GGELUA2/-/commit/8570e9754770e6987540d507045005b761ab8c35 优化 2022-05-10T07:23:00+08:00 baidwwy baidwwy@vip.qq.com https://gitcode.net/GGELUA/GGELUA2/-/commit/fa6697f1512fb108875da2abb1624a38c875ae64 up 2022-05-11T15:59:33+08:00 baidwwy baidwwy@vip.qq.com https://gitcode.net/GGELUA/GGELUA2/-/commit/416f10142bdfd3d6e4569cacb007eb522b5ca11f 2022.5.13 2022-05-14T10:37:27+08:00 baidwwy baidwwy@vip.qq.com
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -45,6 +56,17 @@ ...@@ -45,6 +56,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -75,6 +97,17 @@ ...@@ -75,6 +97,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
......
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
-- @Author : GGELUA -- @Author : GGELUA
-- @Date : 2022-01-25 22:14:50 -- @Date : 2022-01-25 22:14:50
-- @Last Modified by : baidwwy -- @Last Modified by : Please set LastEditors
-- @Last Modified time : 2022-02-15 09:23:28 -- @Last Modified time : 2022-05-12 21:14:40
require('build/base') require('build/base')
pcall(require, 'ggerun') pcall(require, 'ggerun')
if arg[1] == 'windows' then if arg[1] == 'windows' then
执行('%s/GGELUAc.exe %s', 引擎目录, 项目目录) 执行('%s/GGELUAc.exe %s %s', 引擎目录, 项目目录, table.concat(arg, ' ', 3))
else else
编译目录('ggelua') 编译目录('ggelua')
编译目录('./lua') 编译目录('./lua')
......
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -45,6 +56,17 @@ ...@@ -45,6 +56,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -75,6 +97,17 @@ ...@@ -75,6 +97,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
......
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -45,6 +56,17 @@ ...@@ -45,6 +56,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -75,6 +97,17 @@ ...@@ -75,6 +97,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
......
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -45,6 +56,17 @@ ...@@ -45,6 +56,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -75,6 +97,17 @@ ...@@ -75,6 +97,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
......
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -45,6 +56,17 @@ ...@@ -45,6 +56,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -75,6 +97,17 @@ ...@@ -75,6 +97,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
......
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -45,6 +56,17 @@ ...@@ -45,6 +56,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -75,6 +97,17 @@ ...@@ -75,6 +97,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
......
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -45,6 +56,17 @@ ...@@ -45,6 +56,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -75,6 +97,17 @@ ...@@ -75,6 +97,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
......
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -45,6 +56,17 @@ ...@@ -45,6 +56,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -75,6 +97,17 @@ ...@@ -75,6 +97,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
......
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -45,6 +56,17 @@ ...@@ -45,6 +56,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -75,6 +97,17 @@ ...@@ -75,6 +97,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
......
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -45,6 +56,17 @@ ...@@ -45,6 +56,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
...@@ -75,6 +97,17 @@ ...@@ -75,6 +97,17 @@
"args": [ "args": [
"${workspaceFolder}" "${workspaceFolder}"
], ],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
......
无法预览此类型文件
-- @Author : GGELUA -- @Author : GGELUA
-- @Date : 2022-03-07 18:52:00
-- @Last Modified by : baidwwy -- @Last Modified by : baidwwy
-- @Last Modified time : 2022-04-14 07:25:26 -- @Date : 2022-03-07 18:52:00
-- @Last Modified time : 2022-05-14 10:13:20
local cprint = require('cprint') local cprint = require('cprint')
local _isdebug = require('ggelua').isdebug local _isdebug = require('ggelua').isdebug
local lcolor = { local lcolor = {
...@@ -57,4 +56,13 @@ function GGE日志:DEBUG(msg, ...) ...@@ -57,4 +56,13 @@ function GGE日志:DEBUG(msg, ...)
self:LOG('DEBUG', msg, ...) self:LOG('DEBUG', msg, ...)
end end
end end
function GGE日志:print(...)
local arg = {}
for i = 1, select('#', ...) do
arg[i] = tostring(select(i, ...))
end
self:LOG('INFO', table.concat(arg, '\t'))
end
return GGE日志 return GGE日志
-- @Author : GGELUA -- @Author : GGELUA
-- @Date : 2022-04-14 06:55:04
-- @Last Modified by : baidwwy -- @Last Modified by : baidwwy
-- @Last Modified time : 2022-04-14 08:04:48 -- @Date : 2022-04-14 06:58:54
-- @Last Modified time : 2022-05-14 10:13:56
local _list = setmetatable({}, {__mode = 'v'}) local _list = setmetatable({}, {__mode = 'v'})
local 日志 = require('GGE.日志') local 日志 = require('GGE.日志')
......
-- @Author : GGELUA -- @Author : GGELUA
-- @Date : 2021-09-17 08:26:43 -- @Last Modified by : baidwwy
-- @Last Modified by: baidwwy -- @Date : 2022-03-07 18:52:00
-- @Last Modified time: 2021-12-08 11:57:22 -- @Last Modified time : 2022-05-14 10:13:39
local adler32 = require('zlib').adler32 local adler32 = require('zlib').adler32
local m_pack = require('cmsgpack').pack local m_pack = require('cmsgpack').pack
...@@ -24,9 +24,9 @@ function RPCAgent:RPCAgent() ...@@ -24,9 +24,9 @@ function RPCAgent:RPCAgent()
local reg = {} local reg = {}
_REG[self] = reg --private _REG[self] = reg --private
_CBK[self] = {} --private _CBK[self] = {} --private
self.REG = {}
return setmetatable( return setmetatable(
{}, self.REG,
{ {
__newindex = function(t, k, v) __newindex = function(t, k, v)
if type(v) == 'function' then if type(v) == 'function' then
......
-- @Author : GGELUA -- @Author : GGELUA
-- @Date : 2021-09-17 08:26:43
-- @Last Modified by : baidwwy -- @Last Modified by : baidwwy
-- @Last Modified time : 2022-02-16 14:55:37 -- @Date : 2022-03-07 18:52:00
-- @Last Modified time : 2022-05-14 10:13:46
local adler32 = require('zlib').adler32 local adler32 = require('zlib').adler32
local m_pack = require('cmsgpack').pack local m_pack = require('cmsgpack').pack
...@@ -42,8 +42,9 @@ function RPCClient:RPCClient(mcall) ...@@ -42,8 +42,9 @@ function RPCClient:RPCClient(mcall)
local reg = {} local reg = {}
_REG[self] = reg --private 注册表 _REG[self] = reg --private 注册表
_CBK[self] = {} --private 回调表 _CBK[self] = {} --private 回调表
self.REG = {}
return setmetatable( return setmetatable(
{}, self.REG,
{ {
__newindex = function(t, k, v) __newindex = function(t, k, v)
if type(v) == 'function' then if type(v) == 'function' then
......
-- @Author : GGELUA -- @Author : GGELUA
-- @Date : 2021-09-17 08:26:43 -- @Last Modified by : baidwwy
-- @Last Modified by: baidwwy -- @Date : 2022-03-07 18:52:00
-- @Last Modified time: 2021-12-08 12:04:37 -- @Last Modified time : 2022-05-14 10:13:51
local adler32 = require('zlib').adler32 local adler32 = require('zlib').adler32
local m_pack = require('cmsgpack').pack local m_pack = require('cmsgpack').pack
...@@ -27,8 +27,9 @@ function RPCServer:RPCServer() ...@@ -27,8 +27,9 @@ function RPCServer:RPCServer()
_REG[self] = reg --private _REG[self] = reg --private
_CBK[self] = {} --private _CBK[self] = {} --private
_PAS[self] = {} _PAS[self] = {}
self.REG = {}
return setmetatable( return setmetatable(
{}, self.REG,
{ {
__newindex = function(t, k, v) __newindex = function(t, k, v)
if type(v) == 'function' then if type(v) == 'function' then
......
-- @Author : GGELUA -- @Author : GGELUA
-- @Date : 2022-04-03 14:00:28 -- @Date : 2022-04-03 14:00:28
-- @Last Modified by : baidwwy -- @Last Modified by : baidwwy
-- @Last Modified time : 2022-04-14 23:14:43 -- @Last Modified time : 2022-05-03 06:39:18
local SDL = require 'SDL' local SDL = require 'SDL'
local GUI控件 = require('GUI.控件') local GUI控件 = require('GUI.控件')
...@@ -367,3 +367,5 @@ function GUI控件:创建单选按钮(name, x, y, w, h) ...@@ -367,3 +367,5 @@ function GUI控件:创建单选按钮(name, x, y, w, h)
table.insert(self.子控件, self[name]) table.insert(self.子控件, self[name])
return self[name] return self[name]
end end
return GUI按钮
-- @Author : GGELUA -- @Author : GGELUA
-- @Date : 2022-03-07 18:52:00 -- @Date : 2022-03-07 18:52:00
-- @Last Modified by : baidwwy -- @Last Modified by : baidwwy
-- @Last Modified time : 2022-04-10 06:05:19 -- @Last Modified time : 2022-05-03 06:39:36
local SDL = require 'SDL' local SDL = require 'SDL'
local GUI控件 = require('GUI.控件') local GUI控件 = require('GUI.控件')
...@@ -101,3 +101,5 @@ function GUI控件:创建进度(name, x, y, w, h) ...@@ -101,3 +101,5 @@ function GUI控件:创建进度(name, x, y, w, h)
table.insert(self.子控件, self[name]) table.insert(self.子控件, self[name])
return self[name] return self[name]
end end
return GUI进度
-- @Author: baidwwy -- @Author : GGELUA
-- @Date: 2021-08-14 11:47:41 -- @Last Modified by : baidwwy
-- @Last Modified by: baidwwy -- @Date : 2022-03-07 18:52:00
-- @Last Modified time: 2021-12-08 12:09:28 -- @Last Modified time : 2022-05-14 10:14:13
--https://github.com/neoxic/lua-mongo/tree/master/doc --https://github.com/neoxic/lua-mongo/tree/master/doc
local MG集合 = class('MG集合') local MG集合 = class('MG集合')
...@@ -31,7 +31,7 @@ function MG集合:遍历(query, options, prefs) ...@@ -31,7 +31,7 @@ function MG集合:遍历(query, options, prefs)
return self._col:find(query, options, prefs):iterator() return self._col:find(query, options, prefs):iterator()
end end
function MG集合:查询一(query, options, prefs) function MG集合:查询一(query, options, prefs)
local r = self._col:findOne(query, options, prefs) local r = self._col:findOne(query, options, prefs)
return r and r:value() return r and r:value()
end end
...@@ -56,7 +56,7 @@ function MG集合:删除全部(query, options) ...@@ -56,7 +56,7 @@ function MG集合:删除全部(query, options)
return self._col:removeMany(query, options) return self._col:removeMany(query, options)
end end
function MG集合:删除一(query, options) function MG集合:删除一(query, options)
return self._col:removeOne(query, options) return self._col:removeOne(query, options)
end end
...@@ -76,7 +76,7 @@ function MG集合:更新全部(query, document, options) ...@@ -76,7 +76,7 @@ function MG集合:更新全部(query, document, options)
return self._col:updateMany(query, document, options) return self._col:updateMany(query, document, options)
end end
function MG集合:更新一(query, document, options) function MG集合:更新一(query, document, options)
return self._col:updateOne(query, document, options) return self._col:updateOne(query, document, options)
end end
......
-- @Author : GGELUA -- @Author : GGELUA
-- @Date : 2022-03-07 18:52:00 -- @Date : 2022-03-07 18:52:00
-- @Last Modified by : baidwwy -- @Last Modified by : baidwwy
-- @Last Modified time : 2022-03-28 02:18:41 -- @Last Modified time : 2022-05-06 09:10:13
local SDL = require('SDL') local SDL = require('SDL')
local IMG = SDL.IMG_Init() local IMG = SDL.IMG_Init()
local ggetype = ggetype local ggetype = ggetype
local GGE动画 = require('GGE.动画') local GGE动画 = require('GGE.动画')
local SDL动画 = class('SDL动画', GGE动画) local SDL动画 = class('SDL动画', GGE动画)
function SDL动画:SDL动画(file) function SDL动画:SDL动画(obj)
GGE动画.GGE动画(self) GGE动画.GGE动画(self)
local tp = ggetype(file) local tp = ggetype(obj)
local info local info
if tp == 'string' then if tp == 'string' then
info = IMG.LoadAnimation(file) info = assert(IMG.LoadAnimation(obj), SDL.GetError()))
elseif tp == 'SDL读写' and a:取对象() then elseif tp == 'SDL读写' and obj:取对象() then
info = IMG.LoadAnimation_RW(a:取对象()) info = assert(IMG.LoadAnimation_RW(obj:取对象()), SDL.GetError())
elseif tp == 'SDL_RWops' then elseif tp == 'SDL_RWops' then
info = IMG.LoadAnimation_RW(a) info = assert(IMG.LoadAnimation_RW(obj), SDL.GetError())
end end
if info then if info then
...@@ -28,8 +29,6 @@ function SDL动画:SDL动画(file) ...@@ -28,8 +29,6 @@ function SDL动画:SDL动画(file)
for i, v in ipairs(info.frames) do for i, v in ipairs(info.frames) do
self:添加帧(require('SDL.精灵')(v)) self:添加帧(require('SDL.精灵')(v))
end end
else
error(' 载入失败')
end end
end end
......
-- @Author : GGELUA -- @Author : GGELUA
-- @Date : 2022-03-07 18:52:00
-- @Last Modified by : baidwwy -- @Last Modified by : baidwwy
-- @Last Modified time : 2022-03-28 02:21:36 -- @Date : 2022-03-07 18:52:00
-- @Last Modified time : 2022-05-14 10:14:34
local SDL = require('SDL') local SDL = require('SDL')
local ggetype = ggetype local ggetype = ggetype
...@@ -18,11 +18,21 @@ function SDL矩形:SDL矩形(x, y, w, h) ...@@ -18,11 +18,21 @@ function SDL矩形:SDL矩形(x, y, w, h)
end end
function SDL矩形:__index(k) function SDL矩形:__index(k)
if k == '宽度' then
k = 'w'
elseif k == '高度' then
k = 'h'
end
local t = rawget(self, '_rect') local t = rawget(self, '_rect')
return t and t[k] return t and t[k]
end end
function SDL矩形:__newindex(k, v) function SDL矩形:__newindex(k, v)
if k == '宽度' then
k = 'w'
elseif k == '高度' then
k = 'h'
end
if k == 'x' or k == 'y' or k == 'w' or k == 'h' then if k == 'x' or k == 'y' or k == 'w' or k == 'h' then
self._rect[k] = v self._rect[k] = v
else else
......
-- @Author : GGELUA -- @Author : GGELUA
-- @Date : 2022-03-21 14:01:02 -- @Date : 2022-03-21 14:01:02
-- @Last Modified by : baidwwy -- @Last Modified by : baidwwy
-- @Last Modified time : 2022-04-29 19:45:00 -- @Last Modified time : 2022-05-03 06:37:07
local SDL = require('SDL') local SDL = require('SDL')
local gge = require('ggelua') local gge = require('ggelua')
...@@ -98,10 +98,10 @@ function SDL窗口:SDL窗口(t) ...@@ -98,10 +98,10 @@ function SDL窗口:SDL窗口(t)
end end
SDL.ShowCursor(t.鼠标 ~= false) SDL.ShowCursor(t.鼠标 ~= false)
self.FPS = self.帧率 self.FPS = math.abs(self.帧率)
self._ft = 1 / self.FPS self._ft = self.FPS > 0 and (1 / self.FPS) or 0
self._dt = 0 self._dt = 0
if self.FPS > 0 and (SDL._ft == 0 or self._ft < SDL._ft) then if self._ft < SDL._ft then
SDL._ft = self._ft SDL._ft = self._ft
end end
if not SDL._win then --主窗口 if not SDL._win then --主窗口
...@@ -217,23 +217,22 @@ function SDL窗口:_Event(t, ...) ...@@ -217,23 +217,22 @@ function SDL窗口:_Event(t, ...)
_Destroy(self) _Destroy(self)
return SDL._win == self return SDL._win == self
else else
if self._fps then local dt, x, y = ...
self._fps = self._fps + 1 self._dt = self._dt + dt -- 多个不同帧率的窗口
if SDL.GetTicks() - self._ftk > 1000 then if self._dt + 0.001 > self._ft then
self._ftk = SDL.GetTicks() self.dt = self._dt
self.FPS = self._fps
self._fps = 0
end
end
local dt = ...
if dt + 0.001 > self._ft then
self.dt = dt
self._dt = 0 self._dt = 0
_Sendreg(self, '更新事件', ...) --注册事件 _Sendreg(self, '更新事件', self.dt, x, y) --注册事件
_Sendmsg(self, '更新事件', ...) _Sendmsg(self, '更新事件', self.dt, x, y)
_Sendmsg(self, '渲染事件', ...) _Sendmsg(self, '渲染事件', self.dt, x, y)
else if self._fps then
self._dt = self._dt + dt self._fps = self._fps + 1
if SDL.GetTicks() - self._ftk > 1000 then
self._ftk = SDL.GetTicks()
self.FPS = self._fps
self._fps = 0
end
end
end end
end end
elseif t == ggeinit then elseif t == ggeinit then
......
-- @Author : GGELUA -- @Author : GGELUA
-- @Date : 2022-03-07 18:52:00 -- @Date : 2022-03-07 18:52:00
-- @Last Modified by : baidwwy -- @Last Modified by : baidwwy
-- @Last Modified time : 2022-03-28 02:28:24 -- @Last Modified time : 2022-05-06 09:02:53
local SDL = require('SDL') local SDL = require('SDL')
local ggetype = ggetype
local SDL读写 = class 'SDL读写' local SDL读写 = class 'SDL读写'
...@@ -24,6 +25,7 @@ function SDL读写:SDL读写(file, mode) ...@@ -24,6 +25,7 @@ function SDL读写:SDL读写(file, mode)
if not self._rw then if not self._rw then
warn('打开失败->' .. file) warn('打开失败->' .. file)
warn(SDL.GetError()) warn(SDL.GetError())
return false
end end
end end
......
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件
无法预览此类型文件