Compare commits

...

3 Commits

Author SHA1 Message Date
4c2049f05c Fixed processing of graphs 2024-12-11 00:06:37 +03:00
af490a5eb4 Roworking enterance handling 2024-12-10 21:59:26 +03:00
d2cd99d325 remove inkcpp 2024-12-10 19:31:10 +03:00
9 changed files with 493 additions and 292 deletions

4
.gitmodules vendored
View File

@@ -17,7 +17,3 @@
path = tests/flecs-systems-sokol
url = https://github.com/flecs-hub/flecs-systems-sokol
branch = master
[submodule "src/inkcpp"]
path = src/inkcpp
url = https://github.com/JBenda/inkcpp
branch = master

View File

@@ -1,7 +1,7 @@
[layouts]
entries=[ {
"children": [ 4, 5 ],
"children": [ 5, 6 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"floor_index": 0,
"index": 0,
@@ -9,7 +9,7 @@ entries=[ {
"order": 0,
"type": "layout"
}, {
"children": [ 6, 7, 8 ],
"children": [ 7, 8, 9 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"floor_index": 0,
"index": 1,
@@ -17,7 +17,7 @@ entries=[ {
"order": 0,
"type": "layout"
}, {
"children": [ 9, 10, 11, 12, 13 ],
"children": [ 10, 11, 12, 13, 14 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"floor_index": 0,
"index": 2,
@@ -25,7 +25,7 @@ entries=[ {
"order": 0,
"type": "layout"
}, {
"children": [ 14, 15, 16, 17 ],
"children": [ 15, 16, 17, 18 ],
"commands": [ ],
"floor_index": 0,
"index": 3,
@@ -33,116 +33,140 @@ entries=[ {
"order": 4,
"type": "layout"
}, {
"children": [ 18, 19, 20 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"children": [ 19, 20 ],
"commands": [ ],
"floor_index": 0,
"index": 4,
"name": "v5",
"order": 5,
"type": "layout"
}, {
"children": [ 21, 22, 23, 24 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 5,
"name": "zone_0",
"order": 0,
"type": "zone",
"zone_type": 1
}, {
"children": [ 21, 22, 23 ],
"children": [ 25, 26, 27 ],
"commands": [ [ 4, [ ] ] ],
"index": 5,
"name": "zone_1",
"order": 1,
"type": "zone",
"zone_type": 0
}, {
"children": [ 24, 25, 26, 27 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 6,
"name": "zone_1",
"order": 1,
"type": "zone",
"zone_type": 0
}, {
"children": [ 28, 29, 30, 31 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 7,
"name": "zone_1",
"order": 0,
"type": "zone",
"zone_type": 1
}, {
"children": [ 28, 29, 30 ],
"children": [ 32, 33, 34 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 7,
"index": 8,
"name": "zone_0",
"order": 1,
"type": "zone",
"zone_type": 0
}, {
"children": [ 31, 32 ],
"children": [ 35, 36 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 8,
"index": 9,
"name": "unit_0",
"order": 3,
"type": "unit"
}, {
"children": [ 33, 34 ],
"children": [ 37, 38 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 9,
"index": 10,
"name": "zone_0",
"order": 0,
"type": "zone",
"zone_type": 1
}, {
"children": [ 35, 36 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 10,
"name": "unit_0",
"order": 0,
"type": "unit"
}, {
"children": [ 37, 38 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 11,
"name": "unit_1",
"order": 0,
"type": "unit"
}, {
"children": [ 39, 40 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 12,
"name": "unit_2",
"index": 11,
"name": "unit_0",
"order": 0,
"type": "unit"
}, {
"children": [ 41, 42 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 13,
"name": "unit_3",
"index": 12,
"name": "unit_1",
"order": 0,
"type": "unit"
}, {
"children": [ 43, 44 ],
"commands": [ ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 13,
"name": "unit_2",
"order": 0,
"type": "unit"
}, {
"children": [ 45, 46 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 14,
"name": "unit_3",
"order": 0,
"type": "unit"
}, {
"children": [ 47, 48 ],
"commands": [ ],
"index": 15,
"name": "zone_0",
"order": 1,
"type": "zone",
"zone_type": 0
}, {
"children": [ 45, 46 ],
"children": [ 49, 50 ],
"commands": [ ],
"index": 15,
"index": 16,
"name": "zone_1",
"order": 2,
"type": "zone",
"zone_type": 0
}, {
"children": [ 47, 48, 49 ],
"children": [ 51, 52, 53 ],
"commands": [ ],
"index": 16,
"index": 17,
"name": "zone_2",
"order": 3,
"type": "zone",
"zone_type": 0
}, {
"children": [ 50, 51, 52, 53, 54 ],
"children": [ 54, 55, 56, 57, 58 ],
"commands": [ ],
"index": 17,
"index": 18,
"name": "zone_3",
"order": 4,
"type": "zone",
"zone_type": 1
}, {
"children": [ 59, 60 ],
"commands": [ ],
"index": 19,
"name": "zone_0",
"order": 1,
"type": "zone",
"zone_type": 0
}, {
"children": [ 61, 62 ],
"commands": [ ],
"index": 20,
"name": "zone_1",
"order": 2,
"type": "zone",
"zone_type": 1
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 18,
"index": 21,
"name": "living_room_0",
"order": 1,
"room_area": 144.0,
@@ -152,7 +176,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 19,
"index": 22,
"name": "kitchen_0",
"order": 2,
"room_area": 16.0,
@@ -162,7 +186,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ ],
"index": 20,
"index": 23,
"name": "office_0",
"order": 3,
"room_area": 16.0,
@@ -171,8 +195,18 @@ entries=[ {
"window": true
}, {
"children": [ ],
"commands": [ ],
"index": 24,
"name": "enterance_0",
"order": 4,
"room_area": 0.0,
"room_type": 304,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 21,
"index": 25,
"name": "wc_0",
"order": 0,
"room_area": 16.0,
@@ -182,7 +216,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ [ 5, [ ] ], [ 3, [ ] ] ],
"index": 22,
"index": 26,
"name": "bathroom_0",
"order": 1,
"room_area": 16.0,
@@ -192,7 +226,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 23,
"index": 27,
"name": "bedroom_0",
"order": 2,
"room_area": 64.0,
@@ -202,7 +236,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 24,
"index": 28,
"name": "living_room_0",
"order": 0,
"room_area": 144.0,
@@ -212,7 +246,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 25,
"index": 29,
"name": "kitchen_0",
"order": 1,
"room_area": 64.0,
@@ -222,7 +256,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 26,
"index": 30,
"name": "storage_room_0",
"order": 2,
"room_area": 16.0,
@@ -232,7 +266,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ [ 5, [ ] ], [ 4, [ ] ] ],
"index": 27,
"index": 31,
"name": "enterance_0",
"order": 3,
"room_area": 16.0,
@@ -242,7 +276,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 28,
"index": 32,
"name": "wc_0",
"order": 0,
"room_area": 16.0,
@@ -252,7 +286,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 29,
"index": 33,
"name": "bathroom_0",
"order": 1,
"room_area": 16.0,
@@ -262,7 +296,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 30,
"index": 34,
"name": "bedroom_0",
"order": 2,
"room_area": 64.0,
@@ -270,43 +304,7 @@ entries=[ {
"type": "room",
"window": true
}, {
"children": [ 55, 56, 57 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 31,
"name": "zone_0",
"order": 0,
"type": "zone",
"zone_type": 0
}, {
"children": [ 58, 59 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 32,
"name": "zone_1",
"order": 0,
"type": "zone",
"zone_type": 1
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 33,
"name": "enterance_0",
"order": 0,
"room_area": 64.0,
"room_type": 304,
"type": "room",
"window": true
}, {
"children": [ 60 ],
"commands": [ [ 5, [ ] ] ],
"index": 34,
"name": "stair_0",
"order": 0,
"room_area": 16.0,
"room_type": 305,
"type": "room",
"window": true
}, {
"children": [ 61, 62, 63 ],
"children": [ 63, 64, 65 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 35,
"name": "zone_0",
@@ -314,7 +312,7 @@ entries=[ {
"type": "zone",
"zone_type": 0
}, {
"children": [ 64, 65 ],
"children": [ 66, 67 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 36,
"name": "zone_1",
@@ -322,23 +320,27 @@ entries=[ {
"type": "zone",
"zone_type": 1
}, {
"children": [ 66 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 37,
"name": "zone_0",
"name": "enterance_0",
"order": 0,
"type": "zone",
"zone_type": 0
"room_area": 64.0,
"room_type": 304,
"type": "room",
"window": true
}, {
"children": [ 67, 68 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"children": [ 68 ],
"commands": [ [ 5, [ ] ] ],
"index": 38,
"name": "zone_1",
"name": "stair_0",
"order": 0,
"type": "zone",
"zone_type": 1
"room_area": 16.0,
"room_type": 305,
"type": "room",
"window": true
}, {
"children": [ 69 ],
"children": [ 69, 70, 71 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 39,
"name": "zone_0",
@@ -346,15 +348,15 @@ entries=[ {
"type": "zone",
"zone_type": 0
}, {
"children": [ 70 ],
"children": [ 72, 73 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 40,
"name": "zone_1",
"order": 1,
"order": 0,
"type": "zone",
"zone_type": 1
}, {
"children": [ 71 ],
"children": [ 74 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 41,
"name": "zone_0",
@@ -362,53 +364,45 @@ entries=[ {
"type": "zone",
"zone_type": 0
}, {
"children": [ 72 ],
"children": [ 75, 76 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 42,
"name": "zone_1",
"order": 0,
"type": "zone",
"zone_type": 1
}, {
"children": [ 77 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 43,
"name": "zone_0",
"order": 0,
"type": "zone",
"zone_type": 0
}, {
"children": [ 78 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 44,
"name": "zone_1",
"order": 1,
"type": "zone",
"zone_type": 1
}, {
"children": [ ],
"commands": [ ],
"index": 43,
"name": "wc_0",
"order": 1,
"room_area": 16.0,
"room_type": 200,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ ],
"index": 44,
"name": "bedroom_0",
"order": 2,
"room_area": 64.0,
"room_type": 202,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ ],
"children": [ 79 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 45,
"name": "wc_0",
"order": 1,
"room_area": 16.0,
"room_type": 200,
"type": "room",
"window": false
"name": "zone_0",
"order": 0,
"type": "zone",
"zone_type": 0
}, {
"children": [ ],
"commands": [ ],
"children": [ 80 ],
"commands": [ [ 3, [ ] ], [ 4, [ ] ] ],
"index": 46,
"name": "bedroom_0",
"order": 2,
"room_area": 64.0,
"room_type": 202,
"type": "room",
"window": true
"name": "zone_1",
"order": 1,
"type": "zone",
"zone_type": 1
}, {
"children": [ ],
"commands": [ ],
@@ -423,6 +417,46 @@ entries=[ {
"children": [ ],
"commands": [ ],
"index": 48,
"name": "bedroom_0",
"order": 2,
"room_area": 64.0,
"room_type": 202,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ ],
"index": 49,
"name": "wc_0",
"order": 1,
"room_area": 16.0,
"room_type": 200,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ ],
"index": 50,
"name": "bedroom_0",
"order": 2,
"room_area": 64.0,
"room_type": 202,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ ],
"index": 51,
"name": "wc_0",
"order": 1,
"room_area": 16.0,
"room_type": 200,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ ],
"index": 52,
"name": "bathroom_0",
"order": 2,
"room_area": 16.0,
@@ -432,7 +466,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ ],
"index": 49,
"index": 53,
"name": "bathroom_1",
"order": 3,
"room_area": 144.0,
@@ -442,7 +476,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ ],
"index": 50,
"index": 54,
"name": "living_room_0",
"order": 1,
"room_area": 144.0,
@@ -452,7 +486,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ ],
"index": 51,
"index": 55,
"name": "kitchen_0",
"order": 2,
"room_area": 64.0,
@@ -462,7 +496,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ ],
"index": 52,
"index": 56,
"name": "dining_room_0",
"order": 3,
"room_area": 144.0,
@@ -472,7 +506,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ ],
"index": 53,
"index": 57,
"name": "enterance_0",
"order": 4,
"room_area": 16.0,
@@ -482,7 +516,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ ],
"index": 54,
"index": 58,
"name": "enterance_1",
"order": 5,
"room_area": 16.0,
@@ -491,116 +525,48 @@ entries=[ {
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 55,
"name": "bathroom_0",
"order": 0,
"room_area": 16.0,
"room_type": 201,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 56,
"name": "wc_0",
"order": 1,
"room_area": 16.0,
"room_type": 200,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 57,
"name": "bedroom_0",
"order": 2,
"room_area": 36.0,
"room_type": 202,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 58,
"name": "living_room_0",
"order": 0,
"room_area": 36.0,
"room_type": 300,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 59,
"name": "kitchen_0",
"order": 1,
"room_area": 16.0,
"room_type": 302,
"type": "room",
"window": true
}, {
"children": [ 73, 74 ],
"commands": [ ],
"floor_index": 1,
"index": 60,
"name": "floor_0",
"order": 0,
"type": "floor"
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 61,
"index": 59,
"name": "wc_0",
"order": 0,
"room_area": 16.0,
"order": 1,
"room_area": 0.0,
"room_type": 200,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 62,
"commands": [ ],
"index": 60,
"name": "bathroom_0",
"order": 1,
"room_area": 16.0,
"order": 2,
"room_area": 64.0,
"room_type": 201,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ ],
"index": 61,
"name": "studio_0",
"order": 1,
"room_area": 144.0,
"room_type": 312,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ ],
"index": 62,
"name": "enterance_0",
"order": 2,
"room_area": 0.0,
"room_type": 304,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 63,
"name": "bedroom_0",
"order": 2,
"room_area": 64.0,
"room_type": 202,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 64,
"name": "kitchen_0",
"order": 0,
"room_area": 16.0,
"room_type": 302,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 65,
"name": "living_room_0",
"order": 1,
"room_area": 144.0,
"room_type": 300,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 66,
"name": "bathroom_0",
"order": 0,
"room_area": 16.0,
@@ -610,26 +576,54 @@ entries=[ {
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 67,
"name": "kitchen_0",
"order": 0,
"room_area": 64.0,
"room_type": 302,
"index": 64,
"name": "wc_0",
"order": 1,
"room_area": 16.0,
"room_type": 200,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 65,
"name": "bedroom_0",
"order": 2,
"room_area": 36.0,
"room_type": 202,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 68,
"index": 66,
"name": "living_room_0",
"order": 1,
"room_area": 64.0,
"order": 0,
"room_area": 36.0,
"room_type": 300,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 67,
"name": "kitchen_0",
"order": 1,
"room_area": 16.0,
"room_type": 302,
"type": "room",
"window": true
}, {
"children": [ 81, 82 ],
"commands": [ ],
"floor_index": 1,
"index": 68,
"name": "floor_0",
"order": 0,
"type": "floor"
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 69,
"name": "wc_0",
"order": 0,
@@ -641,16 +635,46 @@ entries=[ {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 70,
"name": "living_room_0",
"order": 0,
"name": "bathroom_0",
"order": 1,
"room_area": 16.0,
"room_type": 201,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 71,
"name": "bedroom_0",
"order": 2,
"room_area": 64.0,
"room_type": 202,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 72,
"name": "kitchen_0",
"order": 0,
"room_area": 16.0,
"room_type": 302,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 73,
"name": "living_room_0",
"order": 1,
"room_area": 144.0,
"room_type": 300,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 71,
"index": 74,
"name": "bathroom_0",
"order": 0,
"room_area": 16.0,
@@ -660,7 +684,37 @@ entries=[ {
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 72,
"index": 75,
"name": "kitchen_0",
"order": 0,
"room_area": 64.0,
"room_type": 302,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 76,
"name": "living_room_0",
"order": 1,
"room_area": 64.0,
"room_type": 300,
"type": "room",
"window": true
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 77,
"name": "wc_0",
"order": 0,
"room_area": 16.0,
"room_type": 200,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 78,
"name": "living_room_0",
"order": 0,
"room_area": 64.0,
@@ -668,24 +722,44 @@ entries=[ {
"type": "room",
"window": true
}, {
"children": [ 75 ],
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 79,
"name": "bathroom_0",
"order": 0,
"room_area": 16.0,
"room_type": 201,
"type": "room",
"window": false
}, {
"children": [ ],
"commands": [ [ 5, [ ] ] ],
"index": 80,
"name": "living_room_0",
"order": 0,
"room_area": 64.0,
"room_type": 300,
"type": "room",
"window": true
}, {
"children": [ 83 ],
"commands": [ ],
"index": 73,
"index": 81,
"name": "zone_0",
"order": 0,
"type": "zone",
"zone_type": 1
}, {
"children": [ 76, 77 ],
"children": [ 84, 85 ],
"commands": [ ],
"index": 74,
"index": 82,
"name": "unit_0",
"order": 0,
"type": "unit"
}, {
"children": [ ],
"commands": [ ],
"index": 75,
"index": 83,
"name": "storage_room_0",
"order": 0,
"room_area": 64.0,
@@ -693,17 +767,17 @@ entries=[ {
"type": "room",
"window": true
}, {
"children": [ 78 ],
"children": [ 86 ],
"commands": [ ],
"index": 76,
"index": 84,
"name": "zone_0",
"order": 0,
"type": "zone",
"zone_type": 0
}, {
"children": [ 79 ],
"children": [ 87 ],
"commands": [ ],
"index": 77,
"index": 85,
"name": "zone_1",
"order": 0,
"type": "zone",
@@ -711,7 +785,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ ],
"index": 78,
"index": 86,
"name": "wc_0",
"order": 0,
"room_area": 16.0,
@@ -721,7 +795,7 @@ entries=[ {
}, {
"children": [ ],
"commands": [ ],
"index": 79,
"index": 87,
"name": "living_room_0",
"order": 0,
"room_area": 16.0,

Submodule src/inkcpp deleted from 8210a4163c

View File

@@ -1,5 +1,6 @@
#include <core/os/memory.h>
#include <core/io/config_file.h>
#include "base_data.h"
class BuildingLayoutGraph {
static BuildingLayoutGraph *singleton;

View File

@@ -984,6 +984,13 @@ void BuildingLayoutGraphUI::draw_2d_grid_view(Control *draw)
flecs::entity
re) {
assert(mcount == 0);
int room_type =
re.get<WorldEditor::components::
buildings_layout_room>()
->room_type;
if (room_type == 304)
colors[String(re.path())] =
Color(1, 0, 0, 1);
if (!colors.has(String(re.path()))) {
colors[String(re.path())] =
Color(Math::randf(),

View File

@@ -748,7 +748,6 @@ void graph_module::zones_graph_module(flecs::world &ecs,
buildings_layout_area &area) {
if (area.area < MIN_ROOM_SIZE) {
badness++;
assert(false);
}
});
if (badness == 0) {

View File

@@ -119,7 +119,10 @@ void grow_job_queue::job_initial(struct grow_job *job)
clip_rect.grow(-1), grid_size * grid_size, false, false,
false, true },
Vector<struct region_tree *>(),
nullptr });
nullptr,
false,
false,
-1 });
struct region_tree *rtree = grid_floor_e.get_mut<region_tree>();
flecs::log::dbg("region rect: %s",
(rtree->region.rect.operator String()).ascii().ptr());

View File

@@ -4,6 +4,7 @@
#include <core/list.h>
#include <core/hashfuncs.h>
#include <core/hash_map.h>
#include "building_layout_graph.h"
#include "region_tree.h"
void region_tree::split(flecs::entity grid_floor_e,
@@ -16,6 +17,11 @@ void region_tree::split(flecs::entity grid_floor_e,
const List<struct region>::Element *e = regions.front();
int count = 0;
assert(base_rtree->check(grid_floor_e));
assert(!is_a_room(grid_floor_e));
assert(!flag_room);
flecs::entity room_c = grid_floor_e.world().lookup(
"::graph_module::buildings_layout_room");
assert(room_c.is_valid());
while (e) {
flecs::log::warn(
"%lx: %s -> %s", region.region_et,
@@ -25,6 +31,23 @@ void region_tree::split(flecs::entity grid_floor_e,
struct region_tree *child = memnew(struct region_tree);
child->parent = this;
child->region = e->get();
flecs::entity region_e =
grid_floor_e.world().entity(child->region.region_et);
assert(region_e.is_valid());
if (region_e.has(room_c)) {
child->flag_room = true;
flecs::entity room_e = region_e;
int room = room_e.get<WorldEditor::components::
buildings_layout_room>()
->room_type;
bool special = BuildingLayoutGraph::get_singleton()
->get_room_type_property(
room, "special");
child->flag_special = special;
child->room_type = room;
} else
child->flag_room = false;
children.push_back(child);
base_rtree->dump(grid_floor_e);
flecs::log::dbg(
@@ -107,10 +130,12 @@ void region_tree::dump(flecs::entity grid_floor_e) const
void region_tree::grow(flecs::entity grid_floor_e, bool limited)
{
List<struct region_tree *> grow_list;
List<struct region_tree *> special_grow_list;
List<struct region_tree *> queue;
List<struct region_tree *>::Element *e, *e1;
const struct region_tree *base_rtree = grid_floor_e.get<region_tree>();
assert(base_rtree);
make_random r(11365);
#ifdef TESTS
flecs::log::warn("grow");
#endif
@@ -118,15 +143,26 @@ void region_tree::grow(flecs::entity grid_floor_e, bool limited)
queue.push_back(this);
else
flecs::log::warn("incomplete");
flecs::entity room_c = grid_floor_e.world().lookup(
"::graph_module::buildings_layout_room");
assert(room_c.is_valid());
while (!queue.empty()) {
int i;
struct region_tree *item = queue.front()->get();
queue.pop_front();
if (item->region.can_grow || item->region.can_grow_square)
continue;
/* special treatment for enterance */
for (i = 0; i < (int)item->children.size(); i++) {
if (item->children[i]->region.can_grow)
grow_list.push_back(item->children[i]);
if (item->children[i]->region.can_grow) {
if (item->children[i]->is_a_room() &&
item->children[i]->is_special() &&
item->children[i]->room_type == 304)
special_grow_list.push_back(
item->children[i]);
else
grow_list.push_back(item->children[i]);
}
queue.push_back(item->children[i]);
}
}
@@ -140,6 +176,73 @@ void region_tree::grow(flecs::entity grid_floor_e, bool limited)
return hash_one_uint64((uint64_t)ptr);
}
};
while (1) {
e = special_grow_list.front();
int count = 0;
int bad_count = 0;
int variant = 0;
while (e) {
struct region_tree *item = e->get();
if (!item->region.can_move) {
e = e->next();
continue;
}
struct region backup = item->region;
RegionRect2i parent_rect = item->parent->region.rect;
switch (variant) {
case 0:
item->region.rect.position.x =
parent_rect.position.x +
parent_rect.size.x - 1;
break;
case 1:
item->region.rect.position.x =
parent_rect.position.x;
break;
case 2:
item->region.rect.position.y =
parent_rect.position.y +
parent_rect.size.y - 1;
break;
case 3:
item->region.rect.position.y =
parent_rect.position.y;
break;
}
if (variant > 3) {
do {
item->region.rect.position.x =
parent_rect.position.x +
r.get() % (parent_rect.size.x -
1);
item->region.rect.position.y =
parent_rect.position.y +
r.get() % (parent_rect.size.y -
1);
} while (!base_rtree->check(grid_floor_e));
bad_count++;
assert(bad_count < 100);
variant = 0;
continue;
}
if (!base_rtree->check(grid_floor_e)) {
item->region = backup;
variant++;
continue;
} else {
item->region.can_move = false;
item->region.can_grow_square = false;
item->region.can_grow = false;
grow_list.push_back(item);
e = e->next();
count++;
bad_count = 0;
continue;
}
}
if (count == 0)
break;
}
HashMap<struct region_tree *, int, pointer_hasher> state;
while (1) {
e = grow_list.front();
@@ -271,10 +374,10 @@ bool region_tree::check(flecs::entity grid_floor_e) const
int i, j;
if (children.size() == 0)
return true;
int grid_size = grid_floor_e
.get<WorldEditor::components::
buildings_layout_grid_floor>()
->grid_size;
// int grid_size = grid_floor_e
// .get<WorldEditor::components::
// buildings_layout_grid_floor>()
// ->grid_size;
for (i = 0; i < children.size(); i++)
root_regions.push_back(children[i]->region.rect);
flecs::log::dbg("root regions count: %d", root_regions.size());
@@ -475,7 +578,7 @@ void region_tree::move(flecs::entity grid_floor_e)
while (!queue.empty()) {
int i;
struct region_tree *item = queue.front()->get();
if (item->is_a_room(grid_floor_e) && !item->region.can_grow &&
if (item->is_a_room() && !item->region.can_grow &&
item->region.can_move) {
movables.push_back(item);
count++;
@@ -582,9 +685,22 @@ void region_tree::get_leaf_nodes(List<struct region_tree *> *node_list)
bool region_tree::is_a_room(flecs::entity grid_floor_e) const
{
return grid_floor_e.world()
.entity(region.region_et)
.has<WorldEditor::components::buildings_layout_room>();
bool ret =
grid_floor_e.world()
.entity(region.region_et)
.has<WorldEditor::components::buildings_layout_room>();
assert(flag_room == ret);
return ret;
}
bool region_tree::is_a_room() const
{
return flag_room;
}
bool region_tree::is_special() const
{
return flag_special;
}
bool region_tree::check_candidate(int i, const RegionRect2i &candidate) const
@@ -637,7 +753,7 @@ flecs::entity region_tree::update_cell(flecs::entity grid_floor_e,
flecs::entity_t region_et, int id) const
{
flecs::entity region_e = grid_floor_e.world().entity(region_et);
flecs::entity parent_e = grid_floor_e.world().entity(parent_et);
// flecs::entity parent_e = grid_floor_e.world().entity(parent_et);
flecs::log::dbg("create_cell: %s %d", region_e.path().c_str(), id);
String pname("cell_" + itos(id));
flecs::entity cell_e = grid_floor_e.lookup(pname.ascii().ptr());
@@ -684,7 +800,7 @@ flecs::entity region_tree::create_corridoor_cell(flecs::entity grid_floor_e,
int id) const
{
// flecs::entity region_e = grid_floor_e.world().entity(region_et);
flecs::entity parent_e = grid_floor_e.world().entity(parent_et);
// flecs::entity parent_e = grid_floor_e.world().entity(parent_et);
String pname("cell_" + itos(id));
flecs::entity cell_e = grid_floor_e.lookup(pname.ascii().ptr());
if (!cell_e.is_valid()) {
@@ -712,7 +828,7 @@ bool region_tree::check_cell(flecs::entity grid_floor_e,
flecs::entity_t region_et, int id) const
{
flecs::entity region_e = grid_floor_e.world().entity(region_et);
flecs::entity parent_e = grid_floor_e.world().entity(parent_et);
// flecs::entity parent_e = grid_floor_e.world().entity(parent_et);
flecs::log::dbg("check_cell: %s %d", region_e.path().c_str(), id);
String pname("cell_" + itos(id));
flecs::entity cell_e = grid_floor_e.lookup(pname.ascii().ptr());

View File

@@ -6,6 +6,10 @@ struct region_tree {
struct region region;
Vector<struct region_tree *> children;
struct region_tree *parent;
bool flag_room;
bool flag_special;
int room_type;
void split(flecs::entity grid_floor_e,
const List<struct region> &regions);
const struct region_tree *find(flecs::entity_t which) const;
@@ -23,6 +27,8 @@ struct region_tree {
void get_leaf_nodes(List<const struct region_tree *> *node_list) const;
void get_leaf_nodes(List<struct region_tree *> *node_list);
bool is_a_room(flecs::entity grid_floor_e) const;
bool is_a_room() const;
bool is_special() const;
private:
bool check_candidate(int i, const RegionRect2i &candidate) const;