-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move everything related to tile generation into internal/generator
- Loading branch information
Showing
19 changed files
with
227 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package flat | ||
|
||
import ( | ||
"image" | ||
|
||
"github.com/lord-server/panorama/internal/game" | ||
"github.com/lord-server/panorama/internal/generator" | ||
"github.com/lord-server/panorama/internal/generator/rasterizer" | ||
"github.com/lord-server/panorama/internal/world" | ||
"github.com/lord-server/panorama/pkg/geom" | ||
"github.com/lord-server/panorama/pkg/lm" | ||
) | ||
|
||
type FlatRenderer struct { | ||
nr rasterizer.NodeRasterizer | ||
|
||
region geom.Region | ||
game *game.Game | ||
} | ||
|
||
func NewRenderer(region geom.Region, game *game.Game) *FlatRenderer { | ||
return &FlatRenderer{ | ||
nr: rasterizer.New(lm.DimetricProjection()), | ||
region: region, | ||
game: game, | ||
} | ||
} | ||
|
||
func (r *FlatRenderer) RenderTile( | ||
tilePos generator.TilePosition, | ||
world *world.World, | ||
game *game.Game, | ||
) *rasterizer.RenderBuffer { | ||
rect := image.Rect(0, 0, 256, 256) | ||
target := rasterizer.NewRenderBuffer(rect) | ||
|
||
return target | ||
} | ||
|
||
func (r *FlatRenderer) ProjectRegion(region geom.Region) geom.ProjectedRegion { | ||
return geom.ProjectedRegion{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.