新增游戏内方块和场地的亮度参数调整
This commit is contained in:
5
main.lua
5
main.lua
@@ -306,8 +306,13 @@ do
|
|||||||
love.event.quit('restart')
|
love.event.quit('restart')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Apply system setting
|
||||||
LANG.set(SETTING.lang)
|
LANG.set(SETTING.lang)
|
||||||
VK.setShape(SETTING.VKSkin)
|
VK.setShape(SETTING.VKSkin)
|
||||||
|
applyBlockSatur(SETTING.blockSatur)
|
||||||
|
applyFieldSatur(SETTING.fieldSatur)
|
||||||
|
|
||||||
--Load replays
|
--Load replays
|
||||||
for _,fileName in next,fs.getDirectoryItems('replay')do
|
for _,fileName in next,fs.getDirectoryItems('replay')do
|
||||||
if fileName:sub(12,12):match("[a-zA-Z]")then
|
if fileName:sub(12,12):match("[a-zA-Z]")then
|
||||||
|
|||||||
@@ -17,6 +17,25 @@ function switchFullscreen()
|
|||||||
love.window.setFullscreen(SETTING.fullscreen)
|
love.window.setFullscreen(SETTING.fullscreen)
|
||||||
love.resize(gc.getWidth(),gc.getHeight())
|
love.resize(gc.getWidth(),gc.getHeight())
|
||||||
end
|
end
|
||||||
|
do--function applyXxxSatur(mode)
|
||||||
|
local saturateValues={
|
||||||
|
normal={0,1},
|
||||||
|
soft={.2,.7},
|
||||||
|
grey={.4,.4},
|
||||||
|
light={.2,.8},
|
||||||
|
color={-.2,1.2},
|
||||||
|
}
|
||||||
|
function applyBlockSatur(mode)
|
||||||
|
local m=saturateValues[mode]or saturateValues.normal
|
||||||
|
SHADER.blockSatur:send('b',m[1])
|
||||||
|
SHADER.blockSatur:send('k',m[2])
|
||||||
|
end
|
||||||
|
function applyFieldSatur(mode)
|
||||||
|
local m=saturateValues[mode]or saturateValues.normal
|
||||||
|
SHADER.fieldSatur:send('b',m[1])
|
||||||
|
SHADER.fieldSatur:send('k',m[2])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -328,6 +328,8 @@ SETTING={--Settings
|
|||||||
atkFX=2,
|
atkFX=2,
|
||||||
frameMul=100,
|
frameMul=100,
|
||||||
cleanCanvas=false,
|
cleanCanvas=false,
|
||||||
|
blockSatur='normal',
|
||||||
|
fieldSatur='normal',
|
||||||
|
|
||||||
text=true,
|
text=true,
|
||||||
score=true,
|
score=true,
|
||||||
|
|||||||
@@ -348,6 +348,9 @@ return{
|
|||||||
clean="Fast Draw",
|
clean="Fast Draw",
|
||||||
fullscreen="Full Screen",
|
fullscreen="Full Screen",
|
||||||
bg="Background",
|
bg="Background",
|
||||||
|
|
||||||
|
blockSatur="Block Saturation",
|
||||||
|
fieldSatur="Field Saturation",
|
||||||
},
|
},
|
||||||
setting_sound={
|
setting_sound={
|
||||||
title="Sound Settings",
|
title="Sound Settings",
|
||||||
|
|||||||
@@ -323,6 +323,9 @@ return{
|
|||||||
clean="Fast Draw",
|
clean="Fast Draw",
|
||||||
fullscreen="Pant. Completa",
|
fullscreen="Pant. Completa",
|
||||||
bg="Fondo",
|
bg="Fondo",
|
||||||
|
|
||||||
|
-- blockSatur="Block Saturation",
|
||||||
|
-- fieldSatur="Field Saturation",
|
||||||
},
|
},
|
||||||
setting_sound={
|
setting_sound={
|
||||||
title="Ajustes de Sonido",
|
title="Ajustes de Sonido",
|
||||||
|
|||||||
@@ -321,6 +321,9 @@ return{
|
|||||||
-- clean="Fast Draw",
|
-- clean="Fast Draw",
|
||||||
fullscreen="Plein écran",
|
fullscreen="Plein écran",
|
||||||
bg="Arrière-plan",
|
bg="Arrière-plan",
|
||||||
|
|
||||||
|
-- blockSatur="Block Saturation",
|
||||||
|
-- fieldSatur="Field Saturation",
|
||||||
},
|
},
|
||||||
setting_sound={
|
setting_sound={
|
||||||
title="Paramètres du son",
|
title="Paramètres du son",
|
||||||
|
|||||||
@@ -347,6 +347,9 @@ return{
|
|||||||
-- clean="Fast Draw",
|
-- clean="Fast Draw",
|
||||||
fullscreen="Tela cheia",
|
fullscreen="Tela cheia",
|
||||||
bg="Fundo",
|
bg="Fundo",
|
||||||
|
|
||||||
|
-- blockSatur="Block Saturation",
|
||||||
|
-- fieldSatur="Field Saturation",
|
||||||
},
|
},
|
||||||
setting_sound={
|
setting_sound={
|
||||||
title="Config. de sons",
|
title="Config. de sons",
|
||||||
|
|||||||
@@ -176,6 +176,9 @@ return{
|
|||||||
clean="[]→→O",
|
clean="[]→→O",
|
||||||
fullscreen="|←→|",
|
fullscreen="|←→|",
|
||||||
bg="__?__",
|
bg="__?__",
|
||||||
|
|
||||||
|
blockSatur="==#0x",
|
||||||
|
fieldSatur="[]#0x",
|
||||||
},
|
},
|
||||||
setting_sound={
|
setting_sound={
|
||||||
title="(~~)",
|
title="(~~)",
|
||||||
|
|||||||
@@ -348,6 +348,9 @@ return{
|
|||||||
clean="绘制优化",
|
clean="绘制优化",
|
||||||
fullscreen="全屏",
|
fullscreen="全屏",
|
||||||
bg="背景",
|
bg="背景",
|
||||||
|
|
||||||
|
blockSatur="方块饱和度",
|
||||||
|
fieldSatur="场地饱和度",
|
||||||
},
|
},
|
||||||
setting_sound={
|
setting_sound={
|
||||||
title="声音设置",
|
title="声音设置",
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ local setFont,mDraw,mStr=setFont,mDraw,mStr
|
|||||||
local SKIN,TEXTURE,IMG=SKIN,TEXTURE,IMG
|
local SKIN,TEXTURE,IMG=SKIN,TEXTURE,IMG
|
||||||
local TEXT,COLOR,GAME,TIME=TEXT,COLOR,GAME,TIME
|
local TEXT,COLOR,GAME,TIME=TEXT,COLOR,GAME,TIME
|
||||||
local shader_alpha,shader_lighter=SHADER.alpha,SHADER.lighter
|
local shader_alpha,shader_lighter=SHADER.alpha,SHADER.lighter
|
||||||
|
local shader_fieldSatur,shader_blockSatur=SHADER.fieldSatur,SHADER.blockSatur
|
||||||
local drawableText,missionEnum,minoColor=drawableText,missionEnum,minoColor
|
local drawableText,missionEnum,minoColor=drawableText,missionEnum,minoColor
|
||||||
|
|
||||||
local RCPB={5,33,195,33,100,5,100,60}
|
local RCPB={5,33,195,33,100,5,100,60}
|
||||||
@@ -122,7 +123,7 @@ local function drawField(P)
|
|||||||
--<drawRow>
|
--<drawRow>
|
||||||
for j=start,min(start+21,#F)do drawRow(j,V[j],F[j])end
|
for j=start,min(start+21,#F)do drawRow(j,V[j],F[j])end
|
||||||
--</drawRow>
|
--</drawRow>
|
||||||
gc_setShader()
|
gc_setShader(shader_fieldSatur)
|
||||||
gc_translate(0,4)
|
gc_translate(0,4)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -146,7 +147,7 @@ local function drawField(P)
|
|||||||
drawRow(j,V[j],F[j])
|
drawRow(j,V[j],F[j])
|
||||||
end
|
end
|
||||||
--</drawRow>
|
--</drawRow>
|
||||||
gc_setShader()
|
gc_setShader(shader_fieldSatur)
|
||||||
gc_pop()
|
gc_pop()
|
||||||
h=1
|
h=1
|
||||||
end
|
end
|
||||||
@@ -165,6 +166,7 @@ local function drawField(P)
|
|||||||
--</drawRow>
|
--</drawRow>
|
||||||
gc_pop()
|
gc_pop()
|
||||||
end
|
end
|
||||||
|
gc_setShader()
|
||||||
end
|
end
|
||||||
local function drawFXs(P)
|
local function drawFXs(P)
|
||||||
--LockFX
|
--LockFX
|
||||||
@@ -285,6 +287,7 @@ local function drawBlockOutline(P,texture,trans)
|
|||||||
end
|
end
|
||||||
local function drawBlock(P,clr)
|
local function drawBlock(P,clr)
|
||||||
gc_setColor(1,1,1)
|
gc_setColor(1,1,1)
|
||||||
|
gc_setShader(shader_blockSatur)
|
||||||
local texture=SKIN.curText[clr]
|
local texture=SKIN.curText[clr]
|
||||||
local CB=P.cur.bk
|
local CB=P.cur.bk
|
||||||
for i=1,#CB do for j=1,#CB[1]do
|
for i=1,#CB do for j=1,#CB[1]do
|
||||||
@@ -292,6 +295,7 @@ local function drawBlock(P,clr)
|
|||||||
gc_draw(texture,30*(j+P.curX-1)-30,-30*(i+P.curY-1))
|
gc_draw(texture,30*(j+P.curX-1)-30,-30*(i+P.curY-1))
|
||||||
end
|
end
|
||||||
end end
|
end end
|
||||||
|
gc_setShader()
|
||||||
end
|
end
|
||||||
local function drawNextPreview(P,B)
|
local function drawNextPreview(P,B)
|
||||||
gc_setColor(1,1,1,.8)
|
gc_setColor(1,1,1,.8)
|
||||||
@@ -405,6 +409,7 @@ local function drawHold(P)
|
|||||||
end
|
end
|
||||||
gc_push('transform')
|
gc_push('transform')
|
||||||
gc_translate(62,40)
|
gc_translate(62,40)
|
||||||
|
gc_setShader(shader_blockSatur)
|
||||||
for n=1,#holdQueue do
|
for n=1,#holdQueue do
|
||||||
if n==N then gc_setColor(.6,.4,.4)end
|
if n==N then gc_setColor(.6,.4,.4)end
|
||||||
local bk,clr=holdQueue[n].bk,holdQueue[n].color
|
local bk,clr=holdQueue[n].bk,holdQueue[n].color
|
||||||
@@ -419,6 +424,7 @@ local function drawHold(P)
|
|||||||
gc_scale(1/k)
|
gc_scale(1/k)
|
||||||
gc_translate(0,72)
|
gc_translate(0,72)
|
||||||
end
|
end
|
||||||
|
gc_setShader()
|
||||||
gc_pop()
|
gc_pop()
|
||||||
gc_pop()
|
gc_pop()
|
||||||
end
|
end
|
||||||
@@ -534,6 +540,7 @@ function draw.drawNext_norm(P)
|
|||||||
N=1
|
N=1
|
||||||
gc_push('transform')
|
gc_push('transform')
|
||||||
gc_translate(62,40)
|
gc_translate(62,40)
|
||||||
|
gc_setShader(shader_blockSatur)
|
||||||
while N<=ENV.nextCount and P.nextQueue[N]do
|
while N<=ENV.nextCount and P.nextQueue[N]do
|
||||||
local bk,sprite=P.nextQueue[N].bk,texture[P.nextQueue[N].color]
|
local bk,sprite=P.nextQueue[N].bk,texture[P.nextQueue[N].color]
|
||||||
local k=#bk>2 and 2.2/#bk or 1
|
local k=#bk>2 and 2.2/#bk or 1
|
||||||
@@ -547,6 +554,7 @@ function draw.drawNext_norm(P)
|
|||||||
N=N+1
|
N=N+1
|
||||||
gc_translate(0,72)
|
gc_translate(0,72)
|
||||||
end
|
end
|
||||||
|
gc_setShader()
|
||||||
gc_pop()
|
gc_pop()
|
||||||
|
|
||||||
if ENV.bagLine then
|
if ENV.bagLine then
|
||||||
@@ -567,6 +575,7 @@ function draw.drawNext_hidden(P)
|
|||||||
N=min(ENV.nextStartPos,P.pieceCount+1)
|
N=min(ENV.nextStartPos,P.pieceCount+1)
|
||||||
gc_push('transform')
|
gc_push('transform')
|
||||||
gc_translate(62,40)
|
gc_translate(62,40)
|
||||||
|
gc_setShader(shader_blockSatur)
|
||||||
local queue=P.nextQueue
|
local queue=P.nextQueue
|
||||||
while N<=ENV.nextCount and queue[N]do
|
while N<=ENV.nextCount and queue[N]do
|
||||||
local bk,sprite=queue[N].bk,texture[queue[N].color]
|
local bk,sprite=queue[N].bk,texture[queue[N].color]
|
||||||
@@ -581,6 +590,7 @@ function draw.drawNext_hidden(P)
|
|||||||
N=N+1
|
N=N+1
|
||||||
gc_translate(0,72)
|
gc_translate(0,72)
|
||||||
end
|
end
|
||||||
|
gc_setShader()
|
||||||
gc_pop()
|
gc_pop()
|
||||||
|
|
||||||
if ENV.bagLine then
|
if ENV.bagLine then
|
||||||
|
|||||||
@@ -17,9 +17,23 @@ function scene.draw()
|
|||||||
gc.setColor(1,1,1)
|
gc.setColor(1,1,1)
|
||||||
PLY.draw.drawGhost[SETTING.ghostType](fakePlayer,math.floor(TIME()*3)%16+1,SETTING.ghost)
|
PLY.draw.drawGhost[SETTING.ghostType](fakePlayer,math.floor(TIME()*3)%16+1,SETTING.ghost)
|
||||||
gc.pop()
|
gc.pop()
|
||||||
|
gc.push('transform')
|
||||||
|
gc.setColor(1,1,1)
|
||||||
|
local L=SKIN.curText
|
||||||
|
local T=L[1]
|
||||||
|
gc.translate(0,1410-WIDGET.scrollPos)
|
||||||
|
gc.setShader(SHADER.blockSatur)
|
||||||
|
gc.draw(T,420+15,0)gc.draw(T,450+15,0)gc.draw(T,450+15,30)gc.draw(T,480+15,30)
|
||||||
|
gc.setShader(SHADER.fieldSatur)
|
||||||
|
for i=1,8 do
|
||||||
|
gc.draw(L[i],330+30*i,100)
|
||||||
|
gc.draw(L[i+8],330+30*i,130)
|
||||||
|
end
|
||||||
|
gc.setShader()
|
||||||
|
gc.pop()
|
||||||
end
|
end
|
||||||
|
|
||||||
scene.widgetScrollHeight=700
|
scene.widgetScrollHeight=900
|
||||||
scene.widgetList={
|
scene.widgetList={
|
||||||
WIDGET.newText{name="title", x=640,y=15,font=80},
|
WIDGET.newText{name="title", x=640,y=15,font=80},
|
||||||
|
|
||||||
@@ -63,6 +77,18 @@ scene.widgetList={
|
|||||||
SETTING.bg=not SETTING.bg
|
SETTING.bg=not SETTING.bg
|
||||||
BG.set()
|
BG.set()
|
||||||
end},
|
end},
|
||||||
|
|
||||||
|
WIDGET.newSelector{name="blockSatur",x=800,y=1440,w=300,color='lN',
|
||||||
|
list={'normal','soft','grey','light','color'},
|
||||||
|
disp=SETval("blockSatur"),
|
||||||
|
code=function(v)SETTING.blockSatur=v;applyBlockSatur(SETTING.blockSatur)end
|
||||||
|
},
|
||||||
|
WIDGET.newSelector{name="fieldSatur",x=800,y=1540,w=300,color='lN',
|
||||||
|
list={'normal','soft','grey','light','color'},
|
||||||
|
disp=SETval("fieldSatur"),
|
||||||
|
code=function(v)SETTING.fieldSatur=v;applyFieldSatur(SETTING.fieldSatur)end
|
||||||
|
},
|
||||||
|
|
||||||
WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,fText=TEXTURE.back,code=backScene},
|
WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,fText=TEXTURE.back,code=backScene},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
parts/shaders/blockSatur.glsl
Normal file
10
parts/shaders/blockSatur.glsl
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
extern float k,b;
|
||||||
|
vec4 effect(vec4 color,Image tex,vec2 tex_coords,vec2 scr_coords){
|
||||||
|
vec4 texcolor=Texel(tex,tex_coords);
|
||||||
|
return vec4(
|
||||||
|
b+texcolor.r*k,
|
||||||
|
b+texcolor.g*k,
|
||||||
|
b+texcolor.b*k,
|
||||||
|
texcolor.a*color.a
|
||||||
|
);
|
||||||
|
}
|
||||||
10
parts/shaders/fieldSatur.glsl
Normal file
10
parts/shaders/fieldSatur.glsl
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
extern float k,b;
|
||||||
|
vec4 effect(vec4 color,Image tex,vec2 tex_coords,vec2 scr_coords){
|
||||||
|
vec4 texcolor=Texel(tex,tex_coords);
|
||||||
|
return vec4(
|
||||||
|
b+texcolor.r*k,
|
||||||
|
b+texcolor.g*k,
|
||||||
|
b+texcolor.b*k,
|
||||||
|
texcolor.a*color.a
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user