升级doGC模块命令

This commit is contained in:
MrZ626
2021-04-19 00:20:35 +08:00
parent 63d3f02abe
commit 026fbc910f
4 changed files with 65 additions and 55 deletions

View File

@@ -1,14 +1,17 @@
local gc=love.graphics local gc=love.graphics
local cmds={ local cmds={
move="translate", trans="translate",
zoom="scale", scale="scale",
rgba="setColor", setCL="setColor",
lwid="setLineWidth", setLW="setLineWidth",
draw="draw", draw="draw",
line="line", dLine="line",
rect="rectangle", fRect=function(...)gc.rectangle("fill",...)end,
circ="circle", dRect=function(...)gc.rectangle("line",...)end,
poly="polygon", fCirc=function(...)gc.circle("fill",...)end,
dCirc=function(...)gc.circle("line",...)end,
fPoly=function(...)gc.polygon("line",...)end,
dPoly=function(...)gc.polygon("line",...)end,
} }
return function(L) return function(L)
gc.push() gc.push()
@@ -18,7 +21,14 @@ return function(L)
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.setLineWidth(1) gc.setLineWidth(1)
for i=3,#L do for i=3,#L do
gc[cmds[L[i][1]]](unpack(L[i],2)) print(L[i][1])
local cmd=cmds[L[i][1]]
print(L[i][1])
if type(cmd)=="string"then
gc[cmd](unpack(L[i],2))
else
cmd(unpack(L[i],2))
end
end end
gc.setCanvas() gc.setCanvas()
gc.pop() gc.pop()

View File

@@ -75,50 +75,50 @@ local loadingThread=coroutine.wrap(function()
upFloor() upFloor()
local modeIcons={} local modeIcons={}
modeIcons.marathon=DOGC{32,32, modeIcons.marathon=DOGC{32,32,
{"move",3,1}, {"trans",3,1},
{"rect","fill",10,4,-2,23}, {"fRect",10,4,-2,23},
{"poly","fill",10,4,24,10,10,16.5}, {"fPoly",10,4,24,10,10,16.5},
{"rect","fill",4,24,10,3}, {"fRect",4,24,10,3},
}YIELD() }YIELD()
modeIcons.tsd=DOGC{64,64, modeIcons.tsd=DOGC{64,64,
{"rect","fill",7,7,16,16}, {"fRect",7,7,16,16},
{"rect","fill",7,41,16,16}, {"fRect",7,41,16,16},
{"rect","fill",41,41,16,16}, {"fRect",41,41,16,16},
{"move",.5,.5}, {"trans",.5,.5},
{"poly","line",7,24,56,24,56,39,39,39,39,56,24,56,24,39,7,39}, {"dPoly",7,24,56,24,56,39,39,39,39,56,24,56,24,39,7,39},
}YIELD() }YIELD()
modeIcons.infinite=DOGC{64,64, modeIcons.infinite=DOGC{64,64,
{"lwid",4}, {"setLW",4},
{"circ","line",32,32,28}, {"dCirc",32,32,28},
{"line",32,32,32,14}, {"dLine",32,32,32,14},
{"line",32,32,41,41}, {"dLine",32,32,41,41},
{"move",.5,.5}, {"trans",.5,.5},
{"rect","fill",30,7,4,4}, {"fRect",30,7,4,4},
{"rect","fill",7,30,4,4}, {"fRect",7,30,4,4},
{"rect","fill",52,30,4,4}, {"fRect",52,30,4,4},
{"rect","fill",30,52,4,4}, {"fRect",30,52,4,4},
}YIELD() }YIELD()
modeIcons.t49=DOGC{64,64, modeIcons.t49=DOGC{64,64,
{"lwid",2}, {"setLW",2},
{"rect","line",05,05,10,20},{"rect","line",49,05,10,20}, {"dRect",05,05,10,20},{"dRect",49,05,10,20},
{"rect","line",05,39,10,20},{"rect","line",49,39,10,20}, {"dRect",05,39,10,20},{"dRect",49,39,10,20},
{"rect","line",20,10,23,43}, {"dRect",20,10,23,43},
{"rgba",1,1,1,.7}, {"setCL",1,1,1,.7},
{"rect","fill",20,10,23,43}, {"fRect",20,10,23,43},
}YIELD() }YIELD()
modeIcons.t99=DOGC{64,64, modeIcons.t99=DOGC{64,64,
{"lwid",2}, {"setLW",2},
{"rect","line",02,02,6,12},{"rect","line",11,02,6,12}, {"dRect",02,02,6,12},{"dRect",11,02,6,12},
{"rect","line",02,18,6,12},{"rect","line",11,18,6,12}, {"dRect",02,18,6,12},{"dRect",11,18,6,12},
{"rect","line",02,34,6,12},{"rect","line",11,34,6,12}, {"dRect",02,34,6,12},{"dRect",11,34,6,12},
{"rect","line",02,50,6,12},{"rect","line",11,50,6,12}, {"dRect",02,50,6,12},{"dRect",11,50,6,12},
{"rect","line",47,02,6,12},{"rect","line",56,02,6,12}, {"dRect",47,02,6,12},{"dRect",56,02,6,12},
{"rect","line",47,18,6,12},{"rect","line",56,18,6,12}, {"dRect",47,18,6,12},{"dRect",56,18,6,12},
{"rect","line",47,34,6,12},{"rect","line",56,34,6,12}, {"dRect",47,34,6,12},{"dRect",56,34,6,12},
{"rect","line",47,50,6,12},{"rect","line",56,50,6,12}, {"dRect",47,50,6,12},{"dRect",56,50,6,12},
{"rect","line",20,10,23,43}, {"dRect",20,10,23,43},
{"rgba",1,1,1,.7}, {"setCL",1,1,1,.7},
{"rect","fill",20,10,23,43}, {"fRect",20,10,23,43},
}YIELD() }YIELD()
upFloor() upFloor()

View File

@@ -47,11 +47,11 @@ for i=18,24 do
gc.rectangle("line",7,7,16,16) gc.rectangle("line",7,7,16,16)
end end
TEXTURE.puzzleMark[-1]=DOGC{30,30, TEXTURE.puzzleMark[-1]=DOGC{30,30,
{"rgba",1,1,1,.8}, {"setCL",1,1,1,.8},
{"draw",DOGC{30,30, {"draw",DOGC{30,30,
{"lwid",3}, {"setLW",3},
{"line",5,5,25,25}, {"dLine",5,5,25,25},
{"line",5,25,25,5}, {"dLine",5,25,25,5},
}} }}
} }

View File

@@ -2,12 +2,12 @@ local loadImage=love.graphics.newImage
local fs=love.filesystem local fs=love.filesystem
local texture_noImage=DOGC{32,32, local texture_noImage=DOGC{32,32,
{"rgba",0,0,0}, {"setCL",0,0,0},
{"rect","fill",0,0,32,32}, {"fRect",0,0,32,32},
{"rgba",1,1,1}, {"setCL",1,1,1},
{"lwid",3}, {"setLW",3},
{"line",0,0,31,31}, {"dLine",0,0,31,31},
{"line",0,31,31,0}, {"dLine",0,31,31,0},
} }
local function _getEmptyUser() local function _getEmptyUser()