more code cleanup

This commit is contained in:
2026-01-09 23:05:05 -06:00
parent cf036a0bdb
commit 90e36425ff
6 changed files with 243 additions and 197 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"fmt"
sg "github.com/d2fn/sumi/internal/graphics"
rl "github.com/gen2brain/raylib-go/raylib"
"github.com/ojrac/opensimplex-go"
"math"
@@ -105,11 +106,13 @@ func (fl *FieldLayer) Update(env *Env) {
}
func (fl *FieldLayer) Draw(env *Env) {
rl.ClearBackground(rl.Blank)
rl.BeginBlendMode(rl.BlendAlphaPremultiply)
for x := range int32(env.GetGraphicsHeight()) {
for y := range int32(env.GetGraphicsHeight()) {
func (fl *FieldLayer) Draw(env *Env, g *sg.Graphics) {
g.Clear()
g.BeginAdditiveBlend()
//rl.ClearBackground(rl.Blank)
//rl.BeginBlendMode(rl.BlendAlphaPremultiply)
for x := range g.WidthInt32() {
for y := range g.HeightInt32() {
v := fl.field.Get(float32(x), float32(y))
clr := LerpCurve(v, 1.3, fl.loColor, fl.hiColor)
rl.DrawPixel(x, y, clr)