{"id":27243371,"url":"https://github.com/qodotplugin/ogre","last_synced_at":"2025-04-10T20:36:46.963Z","repository":{"id":57648519,"uuid":"364073541","full_name":"QodotPlugin/ogre","owner":"QodotPlugin","description":"A rusty, dual-wielding Quake and Half-Life texture WAD parser.","archived":false,"fork":false,"pushed_at":"2024-04-02T21:34:44.000Z","size":38,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T22:40:02.692Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QodotPlugin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-03T22:08:57.000Z","updated_at":"2024-01-14T19:18:29.000Z","dependencies_parsed_at":"2022-09-13T21:51:14.292Z","dependency_job_id":null,"html_url":"https://github.com/QodotPlugin/ogre","commit_stats":null,"previous_names":["shfty/ogre"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QodotPlugin%2Fogre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QodotPlugin%2Fogre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QodotPlugin%2Fogre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QodotPlugin%2Fogre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QodotPlugin","download_url":"https://codeload.github.com/QodotPlugin/ogre/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248290460,"owners_count":21078992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-10T20:36:44.868Z","updated_at":"2025-04-10T20:36:46.958Z","avatar_url":"https://github.com/QodotPlugin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ogre \u0026emsp; [![License]][mit] [![Latest Version]][crates.io] [![Documentation]][docs.rs]\n\n[License]: https://img.shields.io/badge/license-MIT-blue.svg\n[mit]: LICENSE\n\n[Latest Version]: https://img.shields.io/crates/v/ogre.svg\n[crates.io]: https://crates.io/crates/ogre\n\n[Documentation]: https://docs.rs/ogre/badge.svg\n[docs.rs]: https://docs.rs/ogre\n\n## A rusty, dual-wielding Quake and Half-Life texture WAD parser\n\n`ogre` is a rust representation and `nom` parser for Quake and Half-Life [`WAD`](https://www.gamers.org/dEngine/quake/spec/quake-spec34/qkspec_7.htm#CWAD0) files.\n\nIt's written in pure Rust, and enforces the use of safe code crate-wide via `#![forbid(unsafe_code)]`.\n\n## Rust Representation\n\nThe Rust represention lives in the `repr` module,\nand is a set of structs representing the contents of a parsed [`WAD`](https://www.gamers.org/dEngine/quake/spec/quake-spec34/qkspec_7.htm#CWAD0) file.\n\n[`WAD`](https://www.gamers.org/dEngine/quake/spec/quake-spec34/qkspec_7.htm#CWAD0) files contain certain intermediary structures - such as a header, and metadata directory - that are specific to parse-time, and thus don't show up in the final representation.\nFor cases where you want to inspect these elements of a [`WAD`](https://www.gamers.org/dEngine/quake/spec/quake-spec34/qkspec_7.htm#CWAD0), the `parser` module contains its own `parser::repr` submodule, as well as `nom` functions for parsing into the structures therein.\n\n## Parsing\n\nThe simplest way to parse a [`WAD`](https://www.gamers.org/dEngine/quake/spec/quake-spec34/qkspec_7.htm#CWAD0) file into AST is via the `parser::parse_wad` function:\n\n```rust\nlet wad = include_bytes!(\"../../ogre/test_data/wad2/medieval.wad\");\nlet (_, wad) = ogre::parser::parse_wad(wad).expect(\"Failed to parse WAD\");\nassert!(wad.len() \u003e 0);\nprintln!(\"{:#?}\", wad);\n```\n\nThis will parse a complete `Wad`, and block the calling thread until completion.\nInternally, it calls the rest of functions `parser` module to assemble its final output.\nThese can also be used directly in cases where more granular parsing is desired.\n\nFor better performance, a parallelized implementation is recommended. See the [`Async`](#Async) header below for more.\n\n## Format Support\n\n`ogre` supports the Quake [`WAD2`](https://www.gamers.org/dEngine/quake/spec/quake-spec34/qkspec_7.htm#CWAD0) and Half-Life [`WAD3`](https://yuraj.ucoz.com/half-life-formats.pdf) formats.\n\nCurrently, the original Doom [`WAD`](https://doomwiki.org/wiki/WAD) format is not supported on account of its different data structure and significantly larger scope.\n\n## Serde Support\n\nFor cases where serializing and deserializing the rust representation is required,\n`ogre` includes `serde::Serialize` and `serde::Deserialize` derives for all types inside the `repr` and `parser::repr` modules.\n\nThis functionality is gated behind the `serde_support` feature flag, which is enabled by default.\n\n## Async\n\n`ogre` includes a parallelized implementation that uses `async_std::task` to multiplex the routines inside `parser` over some source of [`WAD`](https://www.gamers.org/dEngine/quake/spec/quake-spec34/qkspec_7.htm#CWAD0) bytes.\nThis approach scales better than single-threading, and is generally more performant - especially for large [`WAD`](https://www.gamers.org/dEngine/quake/spec/quake-spec34/qkspec_7.htm#CWAD0) files.\nAn explanation and usage guide can be found inside the `parser_async` module.\n\nThis functionality is gated behind the `async` feature flag, which is enabled by default.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqodotplugin%2Fogre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqodotplugin%2Fogre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqodotplugin%2Fogre/lists"}