diff options
author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-10-19 16:17:57 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-10-19 16:17:57 +0700 |
commit | 83f5429e21b3fc9e1a533aea808685824ef7b5af (patch) | |
tree | ce8facde8e614ef8c29a0c548b6b9b4d4eff8693 /src | |
parent | c86700fef89f48a1219473c27f15bc9bbd062cfa (diff) | |
download | blackshades-2.4.1.tar.gz |
Move joints and muscles data out of src 2.4.1
Diffstat (limited to 'src')
-rw-r--r-- | src/joints.tsv | 21 | ||||
-rw-r--r-- | src/misc.zig | 17 | ||||
-rw-r--r-- | src/muscles.tsv | 30 |
3 files changed, 11 insertions, 57 deletions
diff --git a/src/joints.tsv b/src/joints.tsv deleted file mode 100644 index 52f81ef..0000000 --- a/src/joints.tsv +++ /dev/null @@ -1,21 +0,0 @@ -label x y z length model visible lower parent -5 -0.1378 0.2002 1.0711 0.3174 5 true false 15 -18 -3.8366 0.2002 1.1826 0.6836 8 true true -1 -17 -2.5112 0.2002 0.5712 1.4597 7 true true 1 -10 0.0644 0.2002 0.1555 1.4178 2 false true 7 -14 -0.5556 0.2002 2.9636 1.5648 6 true true -1 -15 -1.0848 0.2002 4.4175 1.5473 7 true true 4 -16 -1.2397 0.2002 4.5773 0.2226 8 true true 5 -2 1.2820 0.2002 -0.5709 0.0000 0 false false -1 -6 -0.4220 0.2002 -1.1863 1.8730 0 false false 7 -1 0.4964 0.2002 -0.8546 0.9459 1 false false 8 -0 0.2390 0.2002 -2.2577 1.4112 0 true false 9 -7 -1.5911 0.2002 -1.3499 1.1803 3 true false 8 -8 -2.5230 0.2002 -1.3332 0.9321 4 true false 11 -9 -2.8692 0.2002 -1.2356 0.3597 5 true false 12 -3 1.0220 0.2002 0.6092 1.2048 3 true false 7 -4 0.1480 0.2002 0.9330 0.9321 4 true false 14 -19 -4.0869 0.2002 1.1576 0.2515 8 true true 1 -12 -0.8438 0.2002 0.9086 1.1798 6 false true 3 -13 -0.2474 0.2002 1.1657 0.5090 6 false true 17 -11 0.3856 0.2002 1.4386 1.3227 6 false true 3 diff --git a/src/misc.zig b/src/misc.zig index fc428b2..2e54416 100644 --- a/src/misc.zig +++ b/src/misc.zig @@ -137,7 +137,10 @@ const Joint = extern struct { /// Load joints in character's skeleton. export fn loadJoints(joints: [*]Joint) void { - var tsv = tokenize(@embedFile("joints.tsv"), "\n"); + const file = readFile(cwd(), data_dir ++ "joints.tsv", .{}) + catch unreachable; + defer allocator.free(file); + var tsv = tokenize(file, "\n"); _ = tsv.next().?; // ignore field names var i = @as(u8, 0); while (tsv.next()) |row| : (i += 1) @@ -189,10 +192,9 @@ export fn loadModel(path: [*:0]const u8) extern struct { len: usize, }, } { - var dir = cwd().openDir(data_dir ++ "models", .{}) catch unreachable; - defer dir.close(); - const file = dir.readFileAlloc(allocator, span(path), max_size) - catch unreachable; + const file = readFile(cwd(), data_dir ++ "models{c}{s}", .{ + sep, path, + }) catch unreachable; defer allocator.free(file); var lines = OffIterator.init(file); var counts = lines.next().?; @@ -256,7 +258,10 @@ const Muscle = extern struct { /// Load muscles in character's skeleton. export fn loadMuscles(muscles: [*]Muscle) void { - var tsv = tokenize(@embedFile("muscles.tsv"), "\n"); + const file = readFile(cwd(), data_dir ++ "muscles.tsv", .{}) + catch unreachable; + defer allocator.free(file); + var tsv = tokenize(file, "\n"); _ = tsv.next().?; // ignore field names var i = @as(u8, 0); while (tsv.next()) |row| : (i += 1) diff --git a/src/muscles.tsv b/src/muscles.tsv deleted file mode 100644 index 795e036..0000000 --- a/src/muscles.tsv +++ /dev/null @@ -1,30 +0,0 @@ -length initlen minlen maxlen type visible parent1 parent2 -1.7697 1.7697 0.0000 16.6320 false true 17 2 -0.8354 0.8354 0.0000 10.0000 false false 7 9 -1.4274 1.4274 0.0000 13.6748 false false 3 8 -0.6199 0.6199 0.0000 13.5724 false false 18 19 -1.3388 1.3388 0.0000 15.8856 false false 17 19 -1.7920 1.7920 0.0000 12.8109 false true 19 4 -1.0572 1.9491 0.0000 13.2607 true true 3 18 -1.0987 1.0143 0.0000 12.5167 true true 9 3 -2.1370 2.3075 0.0000 2.3075 true false 8 17 -2.2003 2.5659 0.0000 2.5659 true false 7 19 -2.5899 2.5822 2.0812 10.0000 true false 17 7 -2.7465 2.7494 2.2821 10.0000 true false 19 8 -2.2376 1.0983 1.1285 10.0000 true false 3 11 -1.0596 1.0856 1.0596 10.0000 true false 3 14 -2.1947 2.2254 2.1947 10.0000 true false 8 15 -3.8805 2.5318 2.5462 10.0000 true false 7 12 -2.4195 2.0167 2.3011 10.0000 true false 3 10 -3.0239 1.8946 1.9257 10.0000 true false 19 2 -2.0751 2.0963 2.0751 10.0000 true false 17 4 -4.2300 1.7806 3.5772 4.2300 true false 19 1 -3.5171 2.9497 2.9440 4.0761 true false 17 5 -4.1521 2.8085 3.9940 10.0000 true false 8 4 -5.6429 3.9810 5.6429 10.0000 true false 8 5 -3.9613 3.5795 3.5930 10.0000 true false 7 2 -5.4106 5.0035 5.0111 10.0000 true false 7 1 -1.7528 1.7509 1.7513 10.0000 true false 4 6 -1.6813 1.6416 1.6507 10.0000 true false 2 16 -1.2484 1.2301 1.2221 10.0000 true false 14 0 -1.2833 1.1653 1.1626 10.0000 true false 11 13 |