forked from MTSR/mapserver
transparency flag
This commit is contained in:
parent
ce44b5b8c4
commit
873843ee54
@ -13,6 +13,7 @@ type Config struct {
|
||||
Port int `json:"port"`
|
||||
EnablePrometheus bool `json:"enableprometheus"`
|
||||
EnableRendering bool `json:"enablerendering"`
|
||||
EnableTransparency bool `json:"enabletransparency"`
|
||||
Webdev bool `json:"webdev"`
|
||||
WebApi *WebApiConfig `json:"webapi"`
|
||||
Layers []*layer.Layer `json:"layers"`
|
||||
@ -133,6 +134,7 @@ func ParseConfig(filename string) (*Config, error) {
|
||||
Port: 8080,
|
||||
EnableRendering: true,
|
||||
EnablePrometheus: true,
|
||||
EnableTransparency: true,
|
||||
Webdev: false,
|
||||
WebApi: &webapi,
|
||||
Layers: layers,
|
||||
|
@ -15,16 +15,18 @@ import (
|
||||
)
|
||||
|
||||
type MapBlockRenderer struct {
|
||||
accessor *mapblockaccessor.MapBlockAccessor
|
||||
colors *colormapping.ColorMapping
|
||||
enableShadow bool
|
||||
accessor *mapblockaccessor.MapBlockAccessor
|
||||
colors *colormapping.ColorMapping
|
||||
enableShadow bool
|
||||
enableTransparency bool
|
||||
}
|
||||
|
||||
func NewMapBlockRenderer(accessor *mapblockaccessor.MapBlockAccessor, colors *colormapping.ColorMapping) *MapBlockRenderer {
|
||||
return &MapBlockRenderer{
|
||||
accessor: accessor,
|
||||
colors: colors,
|
||||
enableShadow: true,
|
||||
accessor: accessor,
|
||||
colors: colors,
|
||||
enableShadow: true,
|
||||
enableTransparency: false,
|
||||
}
|
||||
}
|
||||
|
||||
@ -211,7 +213,7 @@ func (r *MapBlockRenderer) Render(pos1, pos2 *coords.MapBlockCoords) (*image.NRG
|
||||
imgX+IMG_SCALE, imgY+IMG_SCALE,
|
||||
)
|
||||
|
||||
if c.A != 0xFF {
|
||||
if c.A != 0xFF || !r.enableTransparency {
|
||||
//not transparent, mark as rendered
|
||||
foundBlocks++
|
||||
xzOccupationMap[x][z] = true
|
||||
|
Loading…
Reference in New Issue
Block a user