|
|
|
|
@ -112,7 +112,7 @@ slParseCamera(slSceneDoc* sd, camera& cam)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
slParseHexGrid(slSceneDoc* sd, hexgrid& hg) |
|
|
|
|
slParseHexGrid(slSceneDoc* sd, hexgrid& hg, util_image& palette_image) |
|
|
|
|
{ |
|
|
|
|
const rapidjson::Value& json_grid = (*sd->doc)["hex_grid"]; |
|
|
|
|
|
|
|
|
|
@ -131,9 +131,12 @@ slParseHexGrid(slSceneDoc* sd, hexgrid& hg)
|
|
|
|
|
hg.position.x = pos.x; |
|
|
|
|
hg.position.y = pos.y; |
|
|
|
|
hg.position.z = pos.z; |
|
|
|
|
hg.fill_color = json_grid["fill_color"].GetInt(); |
|
|
|
|
hg.selected_fill_color = json_grid["selected_fill_color"].GetInt(); |
|
|
|
|
hg.hex_line_color = json_grid["hex_line_color"].GetInt(); |
|
|
|
|
|
|
|
|
|
hg.fill_color_uv = utilGetPaletteCoords(palette_image, json_grid["fill_color"].GetInt()); |
|
|
|
|
hg.selected_fill_color_uv = utilGetPaletteCoords(palette_image, |
|
|
|
|
json_grid["selected_fill_color"].GetInt()); |
|
|
|
|
hg.line_color_uv = utilGetPaletteCoords(palette_image, json_grid["hex_line_color"].GetInt()); |
|
|
|
|
|
|
|
|
|
std::string orientation_str = json_grid["hexlib_orientation"].GetString(); |
|
|
|
|
hg.hexlib_orientation = (orientation_str == "layout_flat") ? layout_flat : layout_pointy; |
|
|
|
|
Layout lo(hg.hexlib_orientation, Point(hg.hex_size, hg.hex_size), Point(hg.position.x, hg.position.y)); |
|
|
|
|
@ -163,10 +166,6 @@ slCreateHexRenderGroups(hexgrid& hg, render_state* rs)
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
hg.fill_color_uv = utilGetPaletteCoords(rs->palette_image, hg.fill_color); |
|
|
|
|
hg.selected_fill_color_uv = utilGetPaletteCoords(rs->palette_image, hg.selected_fill_color); |
|
|
|
|
hg.line_color_uv = utilGetPaletteCoords(rs->palette_image, hg.hex_line_color); |
|
|
|
|
|
|
|
|
|
populateFilledHexGLBuffers(hg, rg_filled); |
|
|
|
|
populateLineGLBuffers(hg, rg_lines); |
|
|
|
|
|
|
|
|
|
|