v0.1.0 initial commit
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package render
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"symph/parameter"
|
||||
)
|
||||
|
||||
type noteTile = [parameter.RenderNoteHeight][parameter.RenderNoteWidth]rune
|
||||
|
||||
var noteChar noteTile
|
||||
|
||||
func init() {
|
||||
funnel := max(
|
||||
len(fmt.Sprintf(parameter.DropFunnelFormat, "0.0")),
|
||||
len(fmt.Sprintf(parameter.RiseFunnelFormat, "0.0")),
|
||||
)
|
||||
inner := parameter.RenderNoteWidth - 2
|
||||
|
||||
// inner == PositionLookaheadWindow by construction; assert the
|
||||
// distance row and funnel still fit
|
||||
if parameter.RenderNoteHeight < 2+parameter.RenderRowStrip ||
|
||||
inner < parameter.RenderDistCols ||
|
||||
parameter.RenderNoteWidth < funnel ||
|
||||
parameter.RenderGapY < 1 {
|
||||
panic("Render tile too small: need height>=5, width-2>=RenderDistCols, width>=funnel, gapY>=1")
|
||||
}
|
||||
|
||||
noteChar[0][0] = parameter.BorderSingleTopLeft
|
||||
noteChar[parameter.RenderNoteHeight-1][0] = parameter.BorderSingleBottomLeft
|
||||
noteChar[0][parameter.RenderNoteWidth-1] = parameter.BorderSingleTopRight
|
||||
noteChar[parameter.RenderNoteHeight-1][parameter.RenderNoteWidth-1] = parameter.BorderSingleBottomRight
|
||||
|
||||
for i := 1; i < parameter.RenderNoteWidth-1; i++ {
|
||||
noteChar[0][i] = parameter.BorderSingleHorizontal
|
||||
noteChar[parameter.RenderNoteHeight-1][i] = parameter.BorderSingleHorizontal
|
||||
}
|
||||
|
||||
for i := 1; i < parameter.RenderNoteHeight-1; i++ {
|
||||
noteChar[i][0] = parameter.BorderSingleVertical
|
||||
noteChar[i][parameter.RenderNoteWidth-1] = parameter.BorderSingleVertical
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user