升级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 cmds={
move="translate",
zoom="scale",
rgba="setColor",
lwid="setLineWidth",
trans="translate",
scale="scale",
setCL="setColor",
setLW="setLineWidth",
draw="draw",
line="line",
rect="rectangle",
circ="circle",
poly="polygon",
dLine="line",
fRect=function(...)gc.rectangle("fill",...)end,
dRect=function(...)gc.rectangle("line",...)end,
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)
gc.push()
@@ -18,7 +21,14 @@ return function(L)
gc.setColor(1,1,1)
gc.setLineWidth(1)
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
gc.setCanvas()
gc.pop()

View File

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

View File

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

View File

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