|
|
@ -508,6 +508,43 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod
|
|
|
|
update_region_info_ui(context);
|
|
|
|
update_region_info_ui(context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case GLFW_KEY_Y:
|
|
|
|
|
|
|
|
if(action == GLFW_PRESS) {
|
|
|
|
|
|
|
|
HexRegion* region = context->hex->regions[context->hex->data.clicked_region];
|
|
|
|
|
|
|
|
if(region != NULL) {
|
|
|
|
|
|
|
|
region->data.hexes[context->hex->data.clicked_hex].height[context->hex->data.clicked_vertex-1] += 0.1;
|
|
|
|
|
|
|
|
add_transfer(
|
|
|
|
|
|
|
|
®ion->data.hexes[context->hex->data.clicked_hex].height[context->hex->data.clicked_vertex-1],
|
|
|
|
|
|
|
|
region->region,
|
|
|
|
|
|
|
|
offsetof(GPUHexRegion, hexes)
|
|
|
|
|
|
|
|
+ sizeof(GPUHex)*context->hex->data.clicked_hex
|
|
|
|
|
|
|
|
+ offsetof(GPUHex, height)
|
|
|
|
|
|
|
|
+ sizeof(float)*(context->hex->data.clicked_vertex-1),
|
|
|
|
|
|
|
|
sizeof(float),
|
|
|
|
|
|
|
|
context->render->current_frame,
|
|
|
|
|
|
|
|
context->render);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GLFW_KEY_H:
|
|
|
|
|
|
|
|
if(action == GLFW_PRESS) {
|
|
|
|
|
|
|
|
HexRegion* region = context->hex->regions[context->hex->data.clicked_region];
|
|
|
|
|
|
|
|
if(region != NULL) {
|
|
|
|
|
|
|
|
region->data.hexes[context->hex->data.clicked_hex].height[context->hex->data.clicked_vertex-1] -= 0.1;
|
|
|
|
|
|
|
|
add_transfer(
|
|
|
|
|
|
|
|
®ion->data.hexes[context->hex->data.clicked_hex].height[context->hex->data.clicked_vertex-1],
|
|
|
|
|
|
|
|
region->region,
|
|
|
|
|
|
|
|
offsetof(GPUHexRegion, hexes)
|
|
|
|
|
|
|
|
+ sizeof(GPUHex)*context->hex->data.clicked_hex
|
|
|
|
|
|
|
|
+ offsetof(GPUHex, height)
|
|
|
|
|
|
|
|
+ sizeof(float)*(context->hex->data.clicked_vertex-1),
|
|
|
|
|
|
|
|
sizeof(float),
|
|
|
|
|
|
|
|
context->render->current_frame,
|
|
|
|
|
|
|
|
context->render);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|