mirror of
https://github.com/make-42/xyosc
synced 2025-01-18 18:57:10 +01:00
yes
This commit is contained in:
parent
98dcc095be
commit
5c6ea36a7a
4
main.go
4
main.go
@ -109,8 +109,8 @@ func (g *Game) Draw(screen *ebiten.Image) {
|
|||||||
lastPeriodOffset := uint32(indices[min(len(indices)-1, config.Config.PeriodCropCount)])
|
lastPeriodOffset := uint32(indices[min(len(indices)-1, config.Config.PeriodCropCount)])
|
||||||
samplesPerCrop := lastPeriodOffset - offset
|
samplesPerCrop := lastPeriodOffset - offset
|
||||||
for i := uint32(0); i < min(numSamples, samplesPerCrop*config.Config.PeriodCropLoopOverCount)-1; i++ {
|
for i := uint32(0); i < min(numSamples, samplesPerCrop*config.Config.PeriodCropLoopOverCount)-1; i++ {
|
||||||
fAX := float32(FFTBuffer[(i+offset)%samplesPerCrop]) * config.Config.Gain * float32(scale)
|
fAX := float32(FFTBuffer[(i+offset)%numSamples]) * config.Config.Gain * float32(scale)
|
||||||
fBX := float32(FFTBuffer[(i+1+offset)%samplesPerCrop]) * config.Config.Gain * float32(scale)
|
fBX := float32(FFTBuffer[(i+1+offset)%numSamples]) * config.Config.Gain * float32(scale)
|
||||||
vector.StrokeLine(screen, float32(config.Config.WindowWidth)*float32(i%samplesPerCrop)/float32(samplesPerCrop), float32(config.Config.WindowHeight/2)+fAX, float32(config.Config.WindowWidth)*float32(i%samplesPerCrop+1)/float32(samplesPerCrop), float32(config.Config.WindowHeight/2)+fBX, config.Config.LineThickness, config.ThirdColorAdj, true)
|
vector.StrokeLine(screen, float32(config.Config.WindowWidth)*float32(i%samplesPerCrop)/float32(samplesPerCrop), float32(config.Config.WindowHeight/2)+fAX, float32(config.Config.WindowWidth)*float32(i%samplesPerCrop+1)/float32(samplesPerCrop), float32(config.Config.WindowHeight/2)+fBX, config.Config.LineThickness, config.ThirdColorAdj, true)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user