fix color parsing

This commit is contained in:
Konstantin Käfer
2014-03-24 10:55:05 +01:00
parent ea6b24d02d
commit af8c936c10
3 changed files with 5 additions and 6 deletions

View File

@@ -93,11 +93,12 @@ void TextBucket::addGlyphs(const PlacedGlyphs &glyphs, float placementZoom,
// add the two triangles, referencing the four coordinates we just
// inserted.
triangleElementsBuffer->add(triangleIndex + 0, triangleIndex + 1,
triangleIndex + 1);
triangleIndex + 2);
triangleElementsBuffer->add(triangleIndex + 1, triangleIndex + 2,
triangleIndex + 3);
triangleGroup.vertex_length += glyph_vertex_length;
triangleGroup.elements_length += 2;
}
};

View File

@@ -65,8 +65,6 @@ TextShader::TextShader()
}
void TextShader::bind(char *offset) {
fprintf(stderr, "bind textshader\n");
glEnableVertexAttribArray(a_pos);
glVertexAttribPointer(a_pos, 2, GL_SHORT, false, 16, offset + 0);

View File

@@ -279,9 +279,9 @@ Color StyleParser::parseColor(JSVal value) {
throw Style::exception("color values must be numbers");
}
return {{static_cast<float>(r.GetDouble() / 255),
static_cast<float>(g.GetDouble() / 255),
static_cast<float>(b.GetDouble() / 255),
return {{static_cast<float>(r.GetDouble()),
static_cast<float>(g.GetDouble()),
static_cast<float>(b.GetDouble()),
static_cast<float>(a.GetDouble())}};
} else if (!value.IsString()) {