|
|
@ -288,8 +288,8 @@ VkResult main_thread(ClientContext* context) {
|
|
|
|
context->zoom = 0;
|
|
|
|
context->zoom = 0;
|
|
|
|
context->cur_spin[0] = 0;
|
|
|
|
context->cur_spin[0] = 0;
|
|
|
|
context->cur_spin[1] = 0;
|
|
|
|
context->cur_spin[1] = 0;
|
|
|
|
glfwPollEvents();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
glfwPollEvents();
|
|
|
|
if((context->key_spin[0] != 0 || context->key_spin[1] != 0 ||
|
|
|
|
if((context->key_spin[0] != 0 || context->key_spin[1] != 0 ||
|
|
|
|
context->zoom != 0 ||
|
|
|
|
context->zoom != 0 ||
|
|
|
|
context->cur_spin[0] != 0 || context->cur_spin[1] != 0 ||
|
|
|
|
context->cur_spin[0] != 0 || context->cur_spin[1] != 0 ||
|
|
|
@ -535,6 +535,22 @@ void cursor_pos_callback(GLFWwindow* window, double xpos, double ypos) {
|
|
|
|
cursor_to_world_ray(context, context->cursor, context->hex->data.hover_start, context->hex->data.hover_end);
|
|
|
|
cursor_to_world_ray(context, context->cursor, context->hex->data.hover_start, context->hex->data.hover_end);
|
|
|
|
add_transfer(&context->hex->data.hover_start, context->hex->context, offsetof(GPUHexContext, hover_start), sizeof(vec4)*2, context->render->current_frame, context->render);
|
|
|
|
add_transfer(&context->hex->data.hover_start, context->hex->context, offsetof(GPUHexContext, hover_start), sizeof(vec4)*2, context->render->current_frame, context->render);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Hex intersections
|
|
|
|
|
|
|
|
float distance;
|
|
|
|
|
|
|
|
for(uint32_t r = 0; r < MAX_LOADED_REGIONS; r++) {
|
|
|
|
|
|
|
|
if(context->hex->regions[r] == NULL) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
} else if(context->hex->regions[r]->data.map != context->hex->data.current_map) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for(uint32_t h = 0; h < REGION_HEX_COUNT; h++) {
|
|
|
|
|
|
|
|
if(ray_hex_intersect(&distance, context->hex->data.hover_start, context->hex->data.hover_end, r, h, context->hex)) {
|
|
|
|
|
|
|
|
context->hex->data.hovered_region = r;
|
|
|
|
|
|
|
|
context->hex->data.hovered_hex = h;
|
|
|
|
|
|
|
|
add_transfer(&context->hex->data.hovered_region, context->hex->context, offsetof(GPUHexContext, hovered_region), sizeof(uint32_t)*2, context->render->current_frame, context->render);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
int main() {
|
|
|
|