Skip to content

Commit

Permalink
Fix grain and remove dpi setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
BigJk committed May 23, 2023
1 parent 0898e89 commit 4da97aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions cmd/game_win/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func main() {
vi.SetDefault("font_normal", "IosevkaTermNerdFontMono-Regular.ttf")
vi.SetDefault("font_italic", "IosevkaTermNerdFontMono-Italic.ttf")
vi.SetDefault("font_bold", "IosevkaTermNerdFontMono-Bold.ttf")
vi.SetDefault("dpi", 1)
vi.SetDefault("width", 1100)
vi.SetDefault("height", 900)
vi.SetDefault("crt", false)
Expand All @@ -83,8 +82,7 @@ func main() {
fmt.Println(lipgloss.NewStyle().Bold(true).Foreground(style.BaseRed).Render("End Of Eden"))
initSystems(settings.GetBool("audio"))

dpi := settings.GetFloat("dpi")
fonts, err := crt.LoadFaces("./assets/fonts/"+settings.GetString("font_normal"), "./assets/fonts/"+settings.GetString("font_bold"), "./assets/fonts/"+settings.GetString("font_italic"), 72*dpi, settings.GetFloat("font_size")/dpi)
fonts, err := crt.LoadFaces("./assets/fonts/"+settings.GetString("font_normal"), "./assets/fonts/"+settings.GetString("font_bold"), "./assets/fonts/"+settings.GetString("font_italic"), crt.GetFontDPI(), settings.GetFloat("font_size"))
if err != nil {
panic(err)
}
Expand All @@ -93,7 +91,6 @@ func main() {
{Key: "audio", Name: "Audio", Description: "Enable or disable audio", Type: uiset.Bool, Val: settings.GetBool("audio"), Min: nil, Max: nil},
{Key: "volume", Name: "Volume", Description: "Change the volume", Type: uiset.Float, Val: settings.GetFloat("volume"), Min: 0.0, Max: 2.0},
{Key: "font_size", Name: "Font Size", Description: "Change the font size", Type: uiset.Float, Val: settings.GetFloat("font_size"), Min: 6.0, Max: 64.0},
{Key: "dpi", Name: "DPI", Description: "Change the DPI", Type: uiset.Float, Val: settings.GetFloat("dpi"), Min: 1.0, Max: 5.0},
{Key: "width", Name: "Width", Description: "Change the window width", Type: uiset.Float, Val: settings.GetFloat("width"), Min: 450.0, Max: 5000.0},
{Key: "height", Name: "Height", Description: "Change the window height", Type: uiset.Float, Val: settings.GetFloat("height"), Min: 450.0, Max: 5000.0},
{Key: "crt", Name: "CRT", Description: "Enable or disable CRT shader. Increases GPU usage.", Type: uiset.Bool, Val: settings.GetBool("crt"), Min: nil, Max: nil},
Expand Down Expand Up @@ -160,7 +157,7 @@ func main() {
panic(err)
}

w, h := win.Layout(0, 0)
w, h := win.Layout(ebiten.WindowSize())
s := &shader.BaseShader{
Shader: grain,
Uniforms: map[string]any{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replace github.com/charmbracelet/bubbletea v0.24.0 => github.com/charmbracelet/b

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161
github.com/BigJk/crt v0.0.8
github.com/BigJk/crt v0.0.9
github.com/BigJk/imeji v0.0.2
github.com/atotto/clipboard v0.1.4
github.com/charmbracelet/bubbles v0.15.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BigJk/crt v0.0.8 h1:Sfoqx/hLBUWqsHAqLwmCGn4x8RQPpYL7nYpXW4LKG40=
github.com/BigJk/crt v0.0.8/go.mod h1:RqZ9qPoYZgrprf78nYON4RpbZLMbmm+A4g8EF908qGo=
github.com/BigJk/crt v0.0.9 h1:0miNK2DwLFrIGlZ/IbtJw80wUvcmbFC2HXJHnRNb6Q0=
github.com/BigJk/crt v0.0.9/go.mod h1:RqZ9qPoYZgrprf78nYON4RpbZLMbmm+A4g8EF908qGo=
github.com/BigJk/imeji v0.0.2 h1:h4cKLWkVzs+IVs/27DFTYGsGuA1OqQxrYDNtvlojypU=
github.com/BigJk/imeji v0.0.2/go.mod h1:TPCNIXiEsYvZmMFIoRE0RLz9ko4+0nkRvcc5HXtsLaU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
Expand Down

0 comments on commit 4da97aa

Please sign in to comment.