mirror of
https://github.com/zoriya/Gamacon.git
synced 2026-05-26 16:47:36 +00:00
Merge branch 'master' of github.com:AnonymusRaccoon/Gamacon
This commit is contained in:
@@ -19,6 +19,9 @@ Gamacon also has a UI handler to ease development of graphical interfaces. For e
|
||||
|
||||
To look at a read usage of prefabs or scene, take a look at [ForecastingVillage](https://github.com/AnonymusRaccoon/ForecastingVillage) which is the more complete project you can find created with this library.
|
||||
|
||||
## Build
|
||||
To build the library, simple run ``make``.
|
||||
|
||||
## Dependencies
|
||||
|
||||
Gamacon needs four others libraries:
|
||||
|
||||
@@ -70,9 +70,10 @@ sel->corners[i]->y, sel->corners[i]->z);
|
||||
struct tile*get_selected_tile(struct sfml_renderer_system *this, \
|
||||
struct vertex_component *info, gc_vector2 pos)
|
||||
{
|
||||
sfVector2i v = sfMouse_getPosition((const sfWindow *) this->window);
|
||||
sfVector2f w = sfRenderWindow_mapPixelToCoords(this->window, v, this->view);
|
||||
sfVector2i v = sfMouse_getPosition((const sfWindow *) this->window);
|
||||
sfVector2f w = sfRenderWindow_mapPixelToCoords(this->window, \
|
||||
v, this->view);
|
||||
|
||||
w.y *= -1;
|
||||
return (get_tile_from_pos(info, gc_vector2_add(pos, *(gc_vector2 *)&w)));
|
||||
w.y *= -1;
|
||||
return (get_tile_from_pos(info, gc_vector2_add(pos, *(gc_vector2 *)&w)));
|
||||
}
|
||||
@@ -94,15 +94,15 @@ struct vertex_component *info, float dt)
|
||||
if (!info || !info->map)
|
||||
return;
|
||||
tl = get_selected_tile(this, info, tra->position);
|
||||
for (width = 0; info->vertices[0][width].z != INT32_MIN; width++);
|
||||
for (length = 0; info->map[length].corners[0]; length++);
|
||||
width--;
|
||||
end_diagonal = length + width - 1;
|
||||
for (int i = length - 1; i >= 0; i -= (i > length - width) ? 1 : width) {
|
||||
end_diagonal -= (end_diagonal <= width) ? 1 : width;
|
||||
for (int j = i; j >= end_diagonal; j -= width - 1) {
|
||||
sfmlrenderer_manage_hovered_tile(this, &info->map[j] == tl);
|
||||
sfmlrenderer_draw_tile(engine, tra->position, &info->map[j], dt);
|
||||
}
|
||||
}
|
||||
for (width = 0; info->vertices[0][width].z != INT32_MIN; width++);
|
||||
for (length = 0; info->map[length].corners[0]; length++);
|
||||
width--;
|
||||
end_diagonal = length + width - 1;
|
||||
for (int i = length - 1; i >= 0; i -= (i > length - width) ? 1 : width) {
|
||||
end_diagonal -= (end_diagonal <= width) ? 1 : width;
|
||||
for (int j = i; j >= end_diagonal; j -= width - 1) {
|
||||
sfmlrenderer_manage_hovered_tile(this, &info->map[j] == tl);
|
||||
sfmlrenderer_draw_tile(engine, tra->position, &info->map[j], dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user