mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-07-14 14:00:29 +02:00
Use a more general db client factory approach.
This commit is contained in:
@ -56,7 +56,7 @@ func createTiles(
|
||||
}
|
||||
|
||||
func createBaseLevel(
|
||||
dbcc common.DBClientCreator,
|
||||
dbcf common.DBClientFactory,
|
||||
xMin, yMin, zMin, xMax, yMax, zMax int,
|
||||
transparent bool, transparentDim float32,
|
||||
colorsFile string, bg color.RGBA, outDir string,
|
||||
@ -81,7 +81,7 @@ func createBaseLevel(
|
||||
for i := 0; i < numWorkers; i++ {
|
||||
var client common.DBClient
|
||||
|
||||
if client, err = dbcc(); err != nil {
|
||||
if client, err = dbcf.Create(); err != nil {
|
||||
return
|
||||
}
|
||||
done.Add(1)
|
||||
|
@ -68,12 +68,16 @@ func main() {
|
||||
|
||||
bg := common.ParseColorDefault(bgColor, common.BackgroundColor)
|
||||
|
||||
dbcc := common.CreateDBClientCreator(host, port)
|
||||
dbcf, err := common.CreateDBClientFactory(host, port)
|
||||
if err != nil {
|
||||
log.Fatalf("error: %s\n", err)
|
||||
}
|
||||
defer dbcf.Close()
|
||||
|
||||
if !skipBaseLevel {
|
||||
td := common.Clamp32f(float32(transparentDim/100.0), 0.0, 1.0)
|
||||
if err := createBaseLevel(
|
||||
dbcc,
|
||||
dbcf,
|
||||
xMin, yMin, zMin, xMax, yMax, zMax,
|
||||
transparent, td,
|
||||
colorsFile, bg,
|
||||
|
Reference in New Issue
Block a user