more code cleanup
This commit is contained in:
13
field.go
13
field.go
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user