blob: 1fab2ecd43133093a32374e14ae9a75c3d985f45 (
plain) (
blame)
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
|
use anyhow::anyhow;
use rgb::RGBA;
use std::io::prelude::*;
use std::io::BufReader;
use std::{fs::File, usize};
mod lowlevel;
fn main1() -> anyhow::Result<lowlevel::map::Map> {
let file = File::open("./testing_data/018-4.tmx")?;
let mut reader = BufReader::new(file);
let mut string = "".to_owned();
reader.read_to_string(&mut string)?;
println!("{}", string);
let doc = roxmltree::Document::parse(&string)?;
for t in doc.root().children().enumerate() {
println!("{:?}", t);
}
let map = lowlevel::map::Map::from_xml(doc)?;
Ok(map)
}
fn main() {
println!("{:?}", main1());
}
// https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#tileset
|