Skip to content

Commit ee26cec

Browse files
committed
UI improvements
1 parent b20523b commit ee26cec

21 files changed

+4115
-2135
lines changed

deps/flecs.c

Lines changed: 3253 additions & 1668 deletions
Large diffs are not rendered by default.

deps/flecs.h

Lines changed: 772 additions & 407 deletions
Large diffs are not rendered by default.

deps/flecs_components_input.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ void ecs_on_set(EcsClassList)(ecs_iter_t *it) {
141141
ecs_add_id(world, tgt, id);
142142
} else {
143143
/* Component, copy value */
144-
void *dst = ecs_ensure_id(world, tgt, id);
145-
void *src = ecs_ensure_id(world, by, id);
144+
void *dst = ecs_ensure_id(world, tgt, id, (size_t)ti->size);
145+
void *src = ecs_ensure_id(world, by, id, (size_t)ti->size);
146146
if (ti->hooks.copy) {
147147
ti->hooks.copy(dst, src, 1, ti);
148148
} else {
@@ -173,6 +173,8 @@ void FlecsComponentsInputImport(
173173
ECS_COMPONENT_DEFINE(world, EcsEventListener);
174174
ECS_COMPONENT_DEFINE(world, EcsClassList);
175175

176+
ecs_add_id(world, ecs_id(EcsInput), EcsSingleton);
177+
176178
ecs_add_pair(world, ecs_id(EcsEventListener), EcsWith,
177179
ecs_id(EcsInputState));
178180

deps/flecs_game.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ void FlecsGameImport(ecs_world_t *world) {
295295
ECS_META_COMPONENT(world, EcsParticleEmitter);
296296
ECS_META_COMPONENT(world, EcsParticle);
297297

298+
ecs_add_id(world, ecs_id(EcsTimeOfDay), EcsSingleton);
299+
298300
FlecsGameCameraControllerImport(world);
299301
FlecsGameLightControllerImport(world);
300302

@@ -543,7 +545,7 @@ void FlecsGameCameraControllerImport(ecs_world_t *world) {
543545
[none] CameraController);
544546

545547
ECS_SYSTEM(world, CameraControllerAccelerate, EcsOnUpdate,
546-
[in] flecs.components.input.Input($),
548+
[in] flecs.components.input.Input,
547549
[in] flecs.components.transform.Rotation3,
548550
[inout] flecs.components.physics.Velocity3,
549551
[inout] flecs.components.physics.AngularVelocity,
@@ -710,17 +712,17 @@ void FlecsGameLightControllerImport(ecs_world_t *world) {
710712
[in] flecs.components.graphics.Rgb);
711713

712714
ECS_SYSTEM(world, TimeOfDayUpdate, EcsOnUpdate,
713-
[inout] TimeOfDay($));
715+
[inout] TimeOfDay);
714716

715717
ECS_SYSTEM(world, LightControllerTimeOfDay, EcsOnUpdate,
716-
[in] TimeOfDay($),
718+
[in] TimeOfDay,
717719
[out] flecs.components.transform.Rotation3,
718720
[out] flecs.components.graphics.Rgb,
719721
[out] flecs.components.graphics.LightIntensity,
720722
[none] flecs.components.graphics.Sun);
721723

722724
ECS_SYSTEM(world, AmbientLightControllerTimeOfDay, EcsOnUpdate,
723-
[in] TimeOfDay($),
725+
[in] TimeOfDay,
724726
[out] flecs.components.gui.Canvas);
725727

726728
ecs_add_pair(world, EcsSun, EcsWith, ecs_id(EcsRotation3));

deps/flecs_systems_physics.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ void EcsAddBoxCollider(ecs_iter_t *it) {
101101
for (i = 0; i < it->count; i ++) {
102102
ecs_entity_t pair = ecs_pair(C, B);
103103
EcsBox *collider = ecs_ensure_id(
104-
it->world, it->entities[i], pair);
104+
it->world, it->entities[i], pair, sizeof(EcsBox));
105105
ecs_os_memcpy_t(collider, &box[i], EcsBox);
106106
}
107107
} else {
108108
for (i = 0; i < it->count; i ++) {
109109
ecs_entity_t pair = ecs_pair(C, B);
110110
EcsBox *collider = ecs_ensure_id(
111-
it->world, it->entities[i], pair);
111+
it->world, it->entities[i], pair, sizeof(EcsBox));
112112
ecs_os_memcpy_t(collider, box, EcsBox);
113113
}
114114
}

deps/flecs_systems_sokol.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33254,13 +33254,15 @@ void FlecsSystemsSokolRendererImport(
3325433254

3325533255
ECS_COMPONENT_DEFINE(world, SokolRenderer);
3325633256

33257+
ecs_add_id(world, ecs_id(SokolRenderer), EcsSingleton);
33258+
3325733259
/* Register systems in module scope */
3325833260
ecs_set_scope(world, module);
3325933261

3326033262
/* System that initializes renderer */
3326133263
ECS_SYSTEM(world, SokolInitRenderer, EcsOnLoad,
3326233264
flecs.components.gui.Canvas,
33263-
[out] !flecs.systems.sokol.Renderer($));
33265+
[out] !flecs.systems.sokol.Renderer);
3326433266

3326533267
/* Configure immediate for SokolInitRenderer as it needs direct access to
3326633268
* the world for creating queries */

etc/css/colors.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
--bg-auto-complete: rgb(25, 28, 31, 1.0);
5454
--bg-error: var(--red);
5555
--bg-ok: var(--green);
56-
--border: rgb(57, 57, 62);
56+
--border: hsl(240, 4%, 23%);
5757
--text-color: rgb(175, 175, 175);
5858
--highlight-bg: var(--blue);
5959
--highlight-text: white;

etc/css/style.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,17 @@ hr {
106106
height: 1px;
107107
margin-top: 6px;
108108
margin-bottom: 6px;
109-
background-color: white;
110-
opacity: 0.2;
109+
background-color: var(--border);
111110
border: none;
112111
}
113112

114113
div.pane, input.pane {
115114
background-color: var(--bg-pane);
116115
color: var(--primary-text);
116+
border-color: var(--border);
117+
border-width: 1px;
118+
border-style: solid;
119+
border-radius: var(--border-radius-medium);
117120
}
118121

119122
.noselect {

etc/flecs_explorer.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

etc/flecs_explorer.wasm

13.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)