1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
diff --git a/assets/gfx/kirby.json b/assets/gfx/kirby.json
index 3f2de7b..fa2754e 100644
--- a/assets/gfx/kirby.json
+++ b/assets/gfx/kirby.json
@@ -1,6 +1,6 @@
{
"meta": {
- "image": "assets/gfx/kirby.png",
+ "image": "/opt/miro/assets/gfx/kirby.png",
"size": {
"w": 234,
"h": 26
diff --git a/assets/gfx/mario.json b/assets/gfx/mario.json
index 0b25eae..b7cf419 100644
--- a/assets/gfx/mario.json
+++ b/assets/gfx/mario.json
@@ -1,6 +1,6 @@
{
"meta": {
- "image": "assets/gfx/mario.png",
+ "image": "/opt/miro/assets/gfx/mario.png",
"size": {
"w": 96,
"h": 32
diff --git a/assets/gfx/pika.json b/assets/gfx/pika.json
index 6d59e8b..3c821bc 100644
--- a/assets/gfx/pika.json
+++ b/assets/gfx/pika.json
@@ -1,6 +1,6 @@
{
"meta": {
- "image": "assets/gfx/pika.png",
+ "image": "/opt/miro/assets/gfx/pika.png",
"size": {
"w": 208,
"h": 28
diff --git a/src/gui/spritesheet.rs b/src/gui/spritesheet.rs
index aab382c..97971a2 100644
--- a/src/gui/spritesheet.rs
+++ b/src/gui/spritesheet.rs
@@ -32,16 +32,7 @@ impl SpriteSheet {
let sprite_width = sprites[0].size.0;
let sprite_height = sprites[0].size.1;
- SpriteSheet {
- image_path: String::from(format!(
- "{}/{}",
- env!("CARGO_MANIFEST_DIR"),
- config.image_path
- )),
- sprites,
- sprite_height,
- sprite_width,
- }
+ SpriteSheet { image_path: config.image_path.clone(), sprites, sprite_height, sprite_width }
}
}
diff --git a/src/main.rs b/src/main.rs
index f015e3a..915fe36 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -50,24 +50,15 @@ fn main() -> anyhow::Result<()> {
let theme = match matches.value_of("theme") {
Some("mario") => Theme {
- spritesheet_path: String::from(concat!(
- env!("CARGO_MANIFEST_DIR"),
- "/assets/gfx/mario.json"
- )),
+ spritesheet_path: String::from("/opt/miro/assets/gfx/mario.json"),
color: RgbColor { red: 99, green: 137, blue: 250 },
},
Some("pika") => Theme {
- spritesheet_path: String::from(concat!(
- env!("CARGO_MANIFEST_DIR"),
- "/assets/gfx/pika.json"
- )),
+ spritesheet_path: String::from("/opt/miro/assets/gfx/pika.json"),
color: RgbColor { red: 176, green: 139, blue: 24 },
},
Some("kirby") => Theme {
- spritesheet_path: String::from(concat!(
- env!("CARGO_MANIFEST_DIR"),
- "/assets/gfx/kirby.json"
- )),
+ spritesheet_path: String::from("/opt/miro/assets/gfx/kirby.json"),
color: RgbColor { red: 242, green: 120, blue: 141 },
},
_ => unreachable!("not possible"),
|