move to terrain render system

This commit is contained in:
2019-11-16 03:40:26 +03:00
parent 7b4a3c3200
commit 7e9f7686a9
17 changed files with 158 additions and 62 deletions

View File

@ -1,12 +1,14 @@
package gamemap
import (
"context"
"errors"
"fmt"
"lab.zaar.be/thefish/alchemyst-go/engine/items"
"lab.zaar.be/thefish/alchemyst-go/engine/mob"
"lab.zaar.be/thefish/alchemyst-go/engine/types"
"lab.zaar.be/thefish/alchemyst-go/util"
"lab.zaar.be/thefish/alchemyst-go/util/appctx"
"strings"
)
@ -31,7 +33,7 @@ func (r *Room) Put (x, y int, tileFunc interface{}) {
}
}
func (room *Room) BlitToLevel(l *Level) error {
func (room *Room) BlitToLevel(ctx context.Context, l *Level) error {
//copy tiles like this:
//https://stackoverflow.com/questions/21011023/copy-pointer-values-a-b-in-golang
@ -49,7 +51,7 @@ func (room *Room) BlitToLevel(l *Level) error {
//check underlying tile
if underlyingTile == nil ||
underlyingTile.Name != "Wall" {
fmt.Println("Invalid blit!")
appctx.Logger(ctx).Warn().Msg("Invalid blit!")
return invalidBlit
}
l.Put(mapCoords.X, mapCoords.Y, tileFunc)