mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 10:44:07 +02:00
entity utf8 fixes?
This commit is contained in:
parent
14c93cb157
commit
d11d90c8e6
4 changed files with 16 additions and 2 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -3,3 +3,5 @@ target
|
||||||
*.obj
|
*.obj
|
||||||
result
|
result
|
||||||
.direnv
|
.direnv
|
||||||
|
*.log
|
||||||
|
*.vmf
|
||||||
|
|
@ -16,6 +16,13 @@ fn main() -> Result<(), vbsp::BspError> {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
See [vbsp-to-gltf](https://github.com/icewind1991/vbsp-to-gltf) or [vbspviewer](https://github.com/icewind1991/vbspview) for some more examples of how to use the bsp data.
|
||||||
|
|
||||||
|
## TODO
|
||||||
|
|
||||||
|
- [ ] smooth normals for displacements
|
||||||
|
- [ ] smooth normals for faces
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
This project is adapted from the [quake bsp parser] and
|
This project is adapted from the [quake bsp parser] and
|
||||||
|
|
|
||||||
|
|
@ -500,6 +500,10 @@ impl Packfile {
|
||||||
};
|
};
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn into_zip(self) -> Mutex<ZipArchive<Cursor<Vec<u8>>>> {
|
||||||
|
self.zip
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn try_read_enum<Enum, Reader, Error, ErrorFn>(
|
fn try_read_enum<Enum, Reader, Error, ErrorFn>(
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,9 @@ impl<'a> LumpReader<Cursor<Cow<'a, [u8]>>> {
|
||||||
|
|
||||||
impl<R: BinReaderExt + Read> LumpReader<R> {
|
impl<R: BinReaderExt + Read> LumpReader<R> {
|
||||||
pub fn read_entities(&mut self) -> BspResult<Entities> {
|
pub fn read_entities(&mut self) -> BspResult<Entities> {
|
||||||
let mut entities = String::with_capacity(self.length);
|
let mut data: Vec<u8> = Vec::with_capacity(self.length);
|
||||||
self.inner.read_to_string(&mut entities)?;
|
self.inner.read_exact(&mut data)?;
|
||||||
|
let entities = String::from_utf8(data).map_err(|e| StringError::from(e.utf8_error()))?;
|
||||||
Ok(Entities { entities })
|
Ok(Entities { entities })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue