py script

This commit is contained in:
nora 2023-04-17 20:07:54 +02:00
parent 2be0e28305
commit 851d491846
4 changed files with 31 additions and 6 deletions

19
apply.py Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/python3
with open("src/tiles.rs") as f:
content: str = f.read()
result = ''
while True:
next_add = content.find("//ADD")
if next_add == -1:
break
result += content[:next_add]
content = content[(next_add + 5):]
result += content
with open("src/tiles.rs", "w") as f:
f.write(result)

View file

@ -3,7 +3,8 @@
cp tiles.rs src/tiles.rs cp tiles.rs src/tiles.rs
cargo clean -p mantle-diver cargo clean -p mantle-diver
cargo build cargo build
git apply crash.patch
./apply.py
OUT=$(cargo build 2>&1) OUT=$(cargo build 2>&1)

View file

@ -52,7 +52,7 @@ impl Bg {
h: 0, h: 0,
}, },
layer: (), layer: (),
blend_graphic: String::new(), //ADD blend_graphic: String::new(),
} }
} }
} }
@ -77,7 +77,7 @@ impl Mid {
h: 32, h: 32,
}), }),
}, },
blend_graphic: String::new(), //ADD blend_graphic: String::new(),
} }
} }
} }
@ -94,7 +94,7 @@ impl Fg {
h: 0, h: 0,
}, },
layer: (), layer: (),
blend_graphic: String::new(), //ADD blend_graphic: String::new(),
} }
} }
} }
@ -148,7 +148,7 @@ where
pub graphic_name: String, pub graphic_name: String,
pub tex_rect: IntRect, pub tex_rect: IntRect,
pub layer: Layer::SpecificDef, pub layer: Layer::SpecificDef,
pub blend_graphic: String, //ADD pub blend_graphic: String,
} }
#[derive(Debug, Inspect, Default, Serialize, Deserialize)] #[derive(Debug, Inspect, Default, Serialize, Deserialize)]
@ -183,7 +183,7 @@ where
graphic_name: Default::default(), graphic_name: Default::default(),
tex_rect: Default::default(), tex_rect: Default::default(),
layer: Layer::SpecificDef::default(), layer: Layer::SpecificDef::default(),
blend_graphic: String::new(), //ADD blend_graphic: String::new(),
} }
} }
} }

View file

@ -52,6 +52,7 @@ impl Bg {
h: 0, h: 0,
}, },
layer: (), layer: (),
//ADD blend_graphic: String::new(),
} }
} }
} }
@ -76,6 +77,7 @@ impl Mid {
h: 32, h: 32,
}), }),
}, },
//ADD blend_graphic: String::new(),
} }
} }
} }
@ -92,6 +94,7 @@ impl Fg {
h: 0, h: 0,
}, },
layer: (), layer: (),
//ADD blend_graphic: String::new(),
} }
} }
} }
@ -145,6 +148,7 @@ where
pub graphic_name: String, pub graphic_name: String,
pub tex_rect: IntRect, pub tex_rect: IntRect,
pub layer: Layer::SpecificDef, pub layer: Layer::SpecificDef,
//ADD pub blend_graphic: String,
} }
#[derive(Debug, Inspect, Default, Serialize, Deserialize)] #[derive(Debug, Inspect, Default, Serialize, Deserialize)]
@ -179,6 +183,7 @@ where
graphic_name: Default::default(), graphic_name: Default::default(),
tex_rect: Default::default(), tex_rect: Default::default(),
layer: Layer::SpecificDef::default(), layer: Layer::SpecificDef::default(),
//ADD blend_graphic: String::new(),
} }
} }
} }