update symbol placement to be more like js

This commit is contained in:
Konstantin Käfer
2014-08-04 18:24:22 +02:00
parent 9dd50a29e1
commit 36181b0922
18 changed files with 576 additions and 573 deletions

View File

@@ -172,31 +172,31 @@ void Painter::renderSymbol(SymbolBucket &bucket, std::shared_ptr<StyleLayer> lay
}
if (bucket.hasIconData()) {
SpriteAtlas &spriteAtlas = *map.getSpriteAtlas();
useProgram(iconShader->program);
iconShader->setMatrix(matrix);
// TODO: update
iconShader->setColor({{1, 1, 1, 1}});
iconShader->setImage(0);
iconShader->setRatio(map.getState().getPixelRatio());
iconShader->setDimension({{
spriteAtlas.getTextureWidth(), spriteAtlas.getTextureHeight(),
}});
spriteAtlas.bind(map.getState().isChanging());
// TODO: remove hardcoded icon size.
const float iconSize = 12 * map.getState().getPixelRatio();
iconShader->setSize(iconSize);
#ifndef GL_ES_VERSION_2_0
glPointSize(iconSize);
glEnable(GL_POINT_SPRITE);
#endif
glDepthRange(strata, 1.0f);
bucket.drawIcons(*iconShader);
// SpriteAtlas &spriteAtlas = *map.getSpriteAtlas();
//
// useProgram(iconShader->program);
// iconShader->setMatrix(matrix);
//
// // TODO: update
// iconShader->setColor({{1, 1, 1, 1}});
// iconShader->setImage(0);
// iconShader->setRatio(map.getState().getPixelRatio());
// iconShader->setDimension({{
// spriteAtlas.getTextureWidth(), spriteAtlas.getTextureHeight(),
// }});
//
// spriteAtlas.bind(map.getState().isChanging());
//
// // TODO: remove hardcoded icon size.
// const float iconSize = 12 * map.getState().getPixelRatio();
// iconShader->setSize(iconSize);
//#ifndef GL_ES_VERSION_2_0
// glPointSize(iconSize);
// glEnable(GL_POINT_SPRITE);
//#endif
//
// glDepthRange(strata, 1.0f);
// bucket.drawIcons(*iconShader);
}
}
}