新增游戏内方块和场地的亮度参数调整

This commit is contained in:
MrZ626
2021-07-08 03:57:18 +08:00
parent 7b227181f2
commit 03dad89787
13 changed files with 103 additions and 3 deletions

View File

@@ -306,8 +306,13 @@ do
love.event.quit('restart')
end
end
--Apply system setting
LANG.set(SETTING.lang)
VK.setShape(SETTING.VKSkin)
applyBlockSatur(SETTING.blockSatur)
applyFieldSatur(SETTING.fieldSatur)
--Load replays
for _,fileName in next,fs.getDirectoryItems('replay')do
if fileName:sub(12,12):match("[a-zA-Z]")then

View File

@@ -17,6 +17,25 @@ function switchFullscreen()
love.window.setFullscreen(SETTING.fullscreen)
love.resize(gc.getWidth(),gc.getHeight())
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

View File

@@ -328,6 +328,8 @@ SETTING={--Settings
atkFX=2,
frameMul=100,
cleanCanvas=false,
blockSatur='normal',
fieldSatur='normal',
text=true,
score=true,

View File

@@ -348,6 +348,9 @@ return{
clean="Fast Draw",
fullscreen="Full Screen",
bg="Background",
blockSatur="Block Saturation",
fieldSatur="Field Saturation",
},
setting_sound={
title="Sound Settings",

View File

@@ -323,6 +323,9 @@ return{
clean="Fast Draw",
fullscreen="Pant. Completa",
bg="Fondo",
-- blockSatur="Block Saturation",
-- fieldSatur="Field Saturation",
},
setting_sound={
title="Ajustes de Sonido",

View File

@@ -321,6 +321,9 @@ return{
-- clean="Fast Draw",
fullscreen="Plein écran",
bg="Arrière-plan",
-- blockSatur="Block Saturation",
-- fieldSatur="Field Saturation",
},
setting_sound={
title="Paramètres du son",

View File

@@ -347,6 +347,9 @@ return{
-- clean="Fast Draw",
fullscreen="Tela cheia",
bg="Fundo",
-- blockSatur="Block Saturation",
-- fieldSatur="Field Saturation",
},
setting_sound={
title="Config. de sons",

View File

@@ -176,6 +176,9 @@ return{
clean="[]→→O",
fullscreen="|←→|",
bg="__?__",
blockSatur="==#0x",
fieldSatur="[]#0x",
},
setting_sound={
title="(~~)",

View File

@@ -348,6 +348,9 @@ return{
clean="绘制优化",
fullscreen="全屏",
bg="背景",
blockSatur="方块饱和度",
fieldSatur="场地饱和度",
},
setting_sound={
title="声音设置",

View File

@@ -13,6 +13,7 @@ local setFont,mDraw,mStr=setFont,mDraw,mStr
local SKIN,TEXTURE,IMG=SKIN,TEXTURE,IMG
local TEXT,COLOR,GAME,TIME=TEXT,COLOR,GAME,TIME
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 RCPB={5,33,195,33,100,5,100,60}
@@ -122,7 +123,7 @@ local function drawField(P)
--<drawRow>
for j=start,min(start+21,#F)do drawRow(j,V[j],F[j])end
--</drawRow>
gc_setShader()
gc_setShader(shader_fieldSatur)
gc_translate(0,4)
end
@@ -146,7 +147,7 @@ local function drawField(P)
drawRow(j,V[j],F[j])
end
--</drawRow>
gc_setShader()
gc_setShader(shader_fieldSatur)
gc_pop()
h=1
end
@@ -165,6 +166,7 @@ local function drawField(P)
--</drawRow>
gc_pop()
end
gc_setShader()
end
local function drawFXs(P)
--LockFX
@@ -285,6 +287,7 @@ local function drawBlockOutline(P,texture,trans)
end
local function drawBlock(P,clr)
gc_setColor(1,1,1)
gc_setShader(shader_blockSatur)
local texture=SKIN.curText[clr]
local CB=P.cur.bk
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))
end
end end
gc_setShader()
end
local function drawNextPreview(P,B)
gc_setColor(1,1,1,.8)
@@ -405,6 +409,7 @@ local function drawHold(P)
end
gc_push('transform')
gc_translate(62,40)
gc_setShader(shader_blockSatur)
for n=1,#holdQueue do
if n==N then gc_setColor(.6,.4,.4)end
local bk,clr=holdQueue[n].bk,holdQueue[n].color
@@ -419,6 +424,7 @@ local function drawHold(P)
gc_scale(1/k)
gc_translate(0,72)
end
gc_setShader()
gc_pop()
gc_pop()
end
@@ -534,6 +540,7 @@ function draw.drawNext_norm(P)
N=1
gc_push('transform')
gc_translate(62,40)
gc_setShader(shader_blockSatur)
while N<=ENV.nextCount and P.nextQueue[N]do
local bk,sprite=P.nextQueue[N].bk,texture[P.nextQueue[N].color]
local k=#bk>2 and 2.2/#bk or 1
@@ -547,6 +554,7 @@ function draw.drawNext_norm(P)
N=N+1
gc_translate(0,72)
end
gc_setShader()
gc_pop()
if ENV.bagLine then
@@ -567,6 +575,7 @@ function draw.drawNext_hidden(P)
N=min(ENV.nextStartPos,P.pieceCount+1)
gc_push('transform')
gc_translate(62,40)
gc_setShader(shader_blockSatur)
local queue=P.nextQueue
while N<=ENV.nextCount and queue[N]do
local bk,sprite=queue[N].bk,texture[queue[N].color]
@@ -581,6 +590,7 @@ function draw.drawNext_hidden(P)
N=N+1
gc_translate(0,72)
end
gc_setShader()
gc_pop()
if ENV.bagLine then

View File

@@ -17,9 +17,23 @@ function scene.draw()
gc.setColor(1,1,1)
PLY.draw.drawGhost[SETTING.ghostType](fakePlayer,math.floor(TIME()*3)%16+1,SETTING.ghost)
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
scene.widgetScrollHeight=700
scene.widgetScrollHeight=900
scene.widgetList={
WIDGET.newText{name="title", x=640,y=15,font=80},
@@ -63,6 +77,18 @@ scene.widgetList={
SETTING.bg=not SETTING.bg
BG.set()
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},
}

View 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
);
}

View 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
);
}