1
0
Fork 0

save files for refresh

png-branch
an 2019-02-09 00:02:52 -05:00
commit 69063cc41a
3 arquivos alterados com 247 adições e 239 exclusões

1
.gitattributes externo Normal file
Ver arquivo

@ -0,0 +1 @@
* text=auto eol=lf

Ver arquivo

@ -362,10 +362,8 @@ Example:
## Wad ##
Wad files are used as a container for many different data formats. The
following sub-sections all use the Wad format.
### Marathon 2 Scenarios (`.sceA`) ###
Wad files are used for scenario data, images, and physics files. Here is a
listing of all chunks used within them:
| Name | Description |
| ---- | ----------- |
@ -390,6 +388,13 @@ following sub-sections all use the Wad format.
| `ShPa` | Not analyzed (shapes) |
| `MMLS` | Not analyzed (MML scripts) |
| `LUAS` | Not analyzed (Lua scripts) |
| `FXpx` | Effect definitions |
| `MNpx` | Monster definitions |
| `PRpx` | Player definitions |
| `PXpx` | Physics definitions |
| `WPpx` | Weapon definitions |
| `PICT` | Picture Resource |
| `clut` | Unused(?) |
Map files can be identified by the Minf chunk.
@ -398,56 +403,13 @@ map (and editor) use. PNTS are plain and have no more information than the
actual position, while EPNT has flags and some extra stuff to help the engine
load quicker (not that it needs it.)
### Marathon 1 Scenarios (`.scen`) ###
Not analyzed
### Images (`.imgA`, `.imgs`) ###
| Name | Description |
| ---- | ----------- |
| `PICT` | Picture Resource |
| `clut` | Unused(?) |
Images can be identified by the PICT chunk.
### Marathon 2 Physics (`.phyA`) ###
| Name | Description |
| ---- | ----------- |
| `FXpx` | Effect definitions |
| `MNpx` | Monster definitions |
| `PRpx` | Player definitions |
| `PXpx` | Physics definitions |
| `WPpx` | Weapon definitions |
## Marathon 1 Physics (`.phys`) ##
Not analyzed
## Marathon 2 Shapes (`.shpA`) ##
Not analyzed
## Marathon 1 Shapes (`.shps`) ##
Not analyzed
## Marathon 2 Sounds (`.sndA`) ##
Not analyzed
## Marathon 1 Sounds (`.sndz`) ##
Not analyzed
## Save Game (`.sgaA`) ##
Not analyzed
## Film (`.filA`) ##
Not analyzed
The Shapes file is used for storing animation and sprite data. It uses a fixed
format for everything, with sprites sorted into collections along with frames
and sequences.
# STRUCTURES ##################################################################
@ -898,7 +860,6 @@ Header Op is 24 bytes.
| u16 | X start | Left |
| u16 | Y end | Bottom |
| u16 | X end | Right |
| 4 bytes | Unused | |
### QuickTime Image ###
@ -918,6 +879,31 @@ if matte:
* image data follows
* some other bullshit
## Shapes ##
### Collection Header ###
32 bytes
| Type | Description | Name |
| ---- | ----------- | ---- |
| u16 | Status (TODO: unknown purpose) | Status |
| u16 | Flags (TODO: unknown purpose) | Flags |
| u32 | Offset for lo-res collection | OffsetLo |
| u32 | Length for lo-res collection | LengthLo |
| u32 | Offset for hi-res collection | OffsetHi |
| u32 | Length for hi-res collection | LengthHi |
### Collection Definition ###
544 bytes (no, I'm not kidding)
| Type | Description | Name |
| ---- | ----------- | ---- |
| u16 | Version, not checked by engine (current is 3) | Version |
| u16 | Collection Type | Type |
| 2 bytes | Unused | |
# ENUMERATIONS ################################################################
Here is a list of names and descriptions for enumerations used throughout this
@ -998,46 +984,46 @@ exit upon reading them.
| Value | Description | Name |
| ----- | ----------- | ---- |
| 1 | Color mapped bit | Pal1 |
| 2 | Color mapped dibit | Pal2 |
| 4 | Color mapped nibble | Pal4 |
| 8 | Color mapped byte | Pal8 |
| 16 | X1RGB5 | X1RGB5 |
| 32 | RGB8 (if NoPad) or XRGB8 | RGB8 |
| `1` | Color mapped bit | Pal1 |
| `2` | Color mapped dibit | Pal2 |
| `4` | Color mapped nibble | Pal4 |
| `8` | Color mapped byte | Pal8 |
| `16` | X1RGB5 | X1RGB5 |
| `32` | RGB8 (if NoPad) or XRGB8 | RGB8 |
### Pack Type ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| 0 | Always pack | Default |
| 1 | Never pack | None |
| 2 | Never pack, no padding channel in 32bpp mode | NoPad |
| 3 | Only pack in 16bpp mode | RLE16 |
| 4 | Only pack in 32bpp mode, no padding channel | RLE32 |
| `0` | Always pack | Default |
| `1` | Never pack | None |
| `2` | Never pack, no padding channel in 32bpp mode | NoPad |
| `3` | Only pack in 16bpp mode | RLE16 |
| `4` | Only pack in 32bpp mode, no padding channel | RLE32 |
### Polygon Type ###
| Value | Description | Permutation | Name |
| ----- | ----------- | ----------- | ---- |
| 0 | Normal, no effects | None | Normal |
| 1 | Items may not pass | None | ImpassItem |
| 2 | Monsters may not pass | None | ImpassMons |
| 3 | Hill (for King of the Hill) | None | Hill |
| 4 | Base (for Capture The Flag et al) | Team | Base |
| 5 | Platform | Plat index | Platform |
| 6 | Triggers light on | Light index | TrigLightOn |
| 7 | Triggers platform on | Plat index | TrigPlatOn |
| 8 | Triggers light off | Poly index | TrigLightOff |
| 9 | Triggers platform off | Poly index | TrigPlatOff |
| 10 | Teleports to polygon centroid | Poly index | Teleporter |
| 11 | Zone border | None | ZoneBorder |
| 12 | Goal point | None | Goal |
| 13 | Triggers near-by visible monsters | None | TrigMonsVis |
| 14 | Triggers near-by invisible monsters | None | TrigMonsInv |
| 15 | Same as TrigMonsInv | None | TrigMonsDual |
| 16 | Triggers near-by invisible items | None | TrigItems |
| 17 | Must be entered for Exploration | None | MustExplore |
| 18 | Teleports to next level if success | None | AutoExit |
| `0` | Normal, no effects | None | Normal |
| `1` | Items may not pass | None | ImpassItem |
| `2` | Monsters may not pass | None | ImpassMons |
| `3` | Hill (for King of the Hill) | None | Hill |
| `4` | Base (for Capture The Flag et al) | Team | Base |
| `5` | Platform | Plat index | Platform |
| `6` | Triggers light on | Light index | TrigLightOn |
| `7` | Triggers platform on | Plat index | TrigPlatOn |
| `8` | Triggers light off | Poly index | TrigLightOff |
| `9` | Triggers platform off | Poly index | TrigPlatOff |
| `10` | Teleports to polygon centroid | Poly index | Teleporter |
| `11` | Zone border | None | ZoneBorder |
| `12` | Goal point | None | Goal |
| `13` | Triggers near-by visible monsters | None | TrigMonsVis |
| `14` | Triggers near-by invisible monsters | None | TrigMonsInv |
| `15` | Same as TrigMonsInv | None | TrigMonsDual |
| `16` | Triggers near-by invisible items | None | TrigItems |
| `17` | Must be entered for Exploration | None | MustExplore |
| `18` | Teleports to next level if success | None | AutoExit |
### Control Panel Type ###
@ -1046,25 +1032,25 @@ permutation each one uses.
| Value | Description | Permutation | Name |
| ----- | ----------- | ----------- | ---- |
| 0 | Oxygen refuel | None | Oxygen |
| 1 | Health charger | None | Shield |
| 2 | Health charger (2x) | None | Shield2x |
| 3 | Health charger (3x) | None | Shield3x |
| 4 | Light switch | Light index | Light |
| 5 | Platform switch | Plat index | Platform |
| 6 | Tag switch | Tag or -1 | Tag |
| 7 | Save station | None | PatternBuf |
| 8 | Computer terminal | None | Terminal |
| `0` | Oxygen refuel | None | Oxygen |
| `1` | Health charger | None | Shield |
| `2` | Health charger (2x) | None | Shield2x |
| `3` | Health charger (3x) | None | Shield3x |
| `4` | Light switch | Light index | Light |
| `5` | Platform switch | Plat index | Platform |
| `6` | Tag switch | Tag or -1 | Tag |
| `7` | Save station | None | PatternBuf |
| `8` | Computer terminal | None | Terminal |
### Side Type ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| 0 | First texture is mapped over the whole side | Full |
| 1 | First texture is mapped on the ceiling panel | High |
| 2 | First texture is mapped on the floor panel | Low |
| 3 | Composite texture (Not implemented) | Composite |
| 4 | First texture for ceiling panel, second for floor | Split |
| `0` | First texture is mapped over the whole side | Full |
| `1` | First texture is mapped on the ceiling panel | High |
| `2` | First texture is mapped on the floor panel | Low |
| `3` | Composite texture (Not implemented) | Composite |
| `4` | First texture for ceiling panel, second for floor | Split |
"Panel" here refers to a pertrusion inbetween two polygons. These would be
mapped to upper/lower textures in Doom for instance. Even the source code for
@ -1074,47 +1060,47 @@ Marathon 2 itself acknowledges how redundant this enumeration is.
| Value | Description | Name |
| ----- | ----------- | ---- |
| 0 | Monster | |
| 1 | Object | |
| 2 | Item | |
| 3 | Player | |
| 4 | Goal | |
| 5 | Sound source (facing is sound volume) | |
| `0` | Monster | |
| `1` | Object | |
| `2` | Item | |
| `3` | Player | |
| `4` | Goal | |
| `5` | Sound source (facing is sound volume) | |
### Transfer Mode ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| 0 | Normal | |
| 1 | Fade to black | |
| 2 | Invisibility | |
| 3 | Invisibility (subtle) | |
| 4 | Pulsate (polygons only) | |
| 5 | Wobble (polygons only) | |
| 6 | Wobble (fast, polygons only) | |
| 7 | Static | |
| 8 | 50% static | |
| 9 | Sky | |
| 10 | Smear | |
| 11 | Static (fade out) | |
| 12 | Static (pulsating) | |
| 13 | Fold-in | |
| 14 | Fold-out | |
| 15 | Horizontal slide | |
| 16 | Horizontal slide (fast) | |
| 17 | Vertical slide | |
| 18 | Vertical slide (fast) | |
| 19 | Wander | |
| 20 | Wander (fast) | |
| 21 | Big sky | |
| `0` | Normal | |
| `1` | Fade to black | |
| `2` | Invisibility | |
| `3` | Invisibility (subtle) | |
| `4` | Pulsate (polygons only) | |
| `5` | Wobble (polygons only) | |
| `6` | Wobble (fast, polygons only) | |
| `7` | Static | |
| `8` | 50% static | |
| `9` | Sky | |
| `10` | Smear | |
| `11` | Static (fade out) | |
| `12` | Static (pulsating) | |
| `13` | Fold-in | |
| `14` | Fold-out | |
| `15` | Horizontal slide | |
| `16` | Horizontal slide (fast) | |
| `17` | Vertical slide | |
| `18` | Vertical slide (fast) | |
| `19` | Wander | |
| `20` | Wander (fast) | |
| `21` | Big sky | |
### Light Type ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| 0 | Normal light | |
| 1 | Strobe light | |
| 2 | Media light | |
| `0` | Normal light | |
| `1` | Strobe light | |
| `2` | Media light | |
### Wad Version ###
@ -1122,10 +1108,10 @@ Used to determine how the engine loads the Wad file.
| Value | Description | Name |
| ----- | ----------- | ---- |
| 0 | Marathon 1 data (no directory entry) | VerBase |
| 1 | Marathon 1 data (has directory entry) | VerDir |
| 2 | Marathon 2 data (supports overlays) | VerOver |
| 4 | Marathon Infinity data | VerMI |
| `0` | Marathon 1 data (no directory entry) | VerBase |
| `1` | Marathon 1 data (has directory entry) | VerDir |
| `2` | Marathon 2 data (supports overlays) | VerOver |
| `4` | Marathon Infinity data | VerMI |
### Data Version ###
@ -1133,30 +1119,30 @@ Used to determine how the engine loads map data.
| Value | Description | Name |
| ----- | ----------- | ---- |
| 0 | Marathon 1 data | DataM1 |
| 1 | Marathon 2 data | DataM2 |
| `0` | Marathon 1 data | DataM1 |
| `1` | Marathon 2 data | DataM2 |
### Terminal Group Type ###
| Value | Description | Permutation | Name |
| ----- | ----------- | ----------- | ---- |
| 0 | Logon | None | Logon |
| 1 | Unfinished (conditions incomplete) | None | Unfinished |
| 2 | Success (success condition) | None | Success |
| 3 | Failure (failure condition) | None | Failure |
| 4 | Information (no image attached) | None | Info |
| 5 | End terminal | None | End |
| 6 | Changes level | Level id | TeleInter |
| 7 | Teleports to polygon | Polygon id | TeleIntra |
| 8 | Shows goal point | Goal id | Checkpoint |
| 9 | Plays a sound | Sound id | Sound |
| 10 | Movie (not implemented) | Movie id | Movie |
| 11 | Music (not implemented) | Track id | Track |
| 12 | Show image | Pict id | Pict |
| 13 | Logoff | None | Logoff |
| 14 | Camera (not implemented) | Object id | Camera |
| 15 | Static (TV static effect) | 1/30 secs | Static |
| 16 | Activate tag | Tag number | Tag |
| `0` | Logon | None | Logon |
| `1` | Unfinished (conditions incomplete) | None | Unfinished |
| `2` | Success (success condition) | None | Success |
| `3` | Failure (failure condition) | None | Failure |
| `4` | Information (no image attached) | None | Info |
| `5` | End terminal | None | End |
| `6` | Changes level | Level id | TeleInter |
| `7` | Teleports to polygon | Polygon id | TeleIntra |
| `8` | Shows goal point | Goal id | Checkpoint |
| `9` | Plays a sound | Sound id | Sound |
| `10` | Movie (not implemented) | Movie id | Movie |
| `11` | Music (not implemented) | Track id | Track |
| `12` | Show image | Pict id | Pict |
| `13` | Logoff | None | Logoff |
| `14` | Camera (not implemented) | Object id | Camera |
| `15` | Static (TV static effect) | 1/30 secs | Static |
| `16` | Activate tag | Tag number | Tag |
### Terminal Color ###
@ -1164,135 +1150,135 @@ These are the default colors. These can be overridden with mods.
| Value | Description | Name |
| ----- | ----------- | ---- |
| 0 | Light Green | Color0 |
| 1 | White | Color1 |
| 2 | Red | Color2 |
| 3 | Dark Green | Color3 |
| 4 | Light Blue | Color4 |
| 5 | Yellow | Color5 |
| 6 | Dark Red | Color6 |
| 7 | Dark Blue | Color7 |
| 8 | No color | Color8 |
| 9 | No color | Color9 |
| `0` | Light Green | Color0 |
| `1` | White | Color1 |
| `2` | Red | Color2 |
| `3` | Dark Green | Color3 |
| `4` | Light Blue | Color4 |
| `5` | Yellow | Color5 |
| `6` | Dark Red | Color6 |
| `7` | Dark Blue | Color7 |
| `8` | No color | Color8 |
| `9` | No color | Color9 |
# FLAGS #######################################################################
### Endpoint Flags ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| `$0001` | Point belongs to any solid line | Solid |
| `$0002` | All polys with this point have the same height | SameHeight |
| `$0004` | Point does not belong to an un-transparent line | Transparent |
| Bit | Description | Name |
| --- | ----------- | ---- |
| `0` | Point belongs to any solid line | Solid |
| `1` | All polys with this point have the same height | SameHeight |
| `2` | Point does not belong to an opaque line | Transparent |
Note that the SameHeight flag is set relative to the endpoint's lines.
### Line Flags ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| `$0200` | Line has a transparent side | TransSide |
| `$0400` | Polygons on either side do not have same heights | ElevVar |
| `$0800` | Differing height between this line's polygons | Elevation |
| `$1000` | Line shows only sky | Landscape |
| `$2000` | Both sides are see-through | Transparent |
| `$4000` | Can't be walked through | Solid |
| Bit | Description | Name |
| --- | ----------- | ---- |
| `9` | Line has a transparent side | TransSide |
| `10` | Polygons on either side do not have same heights | ElevVar |
| `11` | Differing height between this line's polygons | Elevation |
| `12` | Line shows only sky | Landscape |
| `13` | Both sides are see-through | Transparent |
| `14` | Can't be walked through | Solid |
### Side Flags ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| `$0001` | Button is switched | Status |
| `$0002` | Control panel | Panel |
| `$0004` | Must be switched for Repair | Repair |
| `$0008` | Switch uses an item (for scripts) | ItemUse |
| `$0010` | Switch must be 3/4ths or more lit up to use | Lighted |
| `$0020` | Projectiles toggle and disable this switch | CanDestroy |
| `$0040` | Switch can only be hit by projectiles | HitOnly |
| `$0080` | Switch item is optional (for scripts) | ItemOpt |
| Bit | Description | Name |
| --- | ----------- | ---- |
| `0` | Button is switched | Status |
| `1` | Control panel | Panel |
| `2` | Must be switched for Repair | Repair |
| `3` | Switch uses an item (for scripts) | ItemUse |
| `4` | Switch must be 3/4ths or more lit up to use | Lighted |
| `5` | Projectiles toggle and disable this switch | CanDestroy |
| `6` | Switch can only be hit by projectiles | HitOnly |
| `7` | Switch item is optional (for scripts) | ItemOpt |
### Polygon Flags ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| `$4000` | TODO | Detached |
| Bit | Description | Name |
| --- | ----------- | ---- |
| `14` | TODO | Detached |
### Map Object Flags ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| `$0001` | Initially invisible (warp-in) | Invisible |
| `$0002` | Reversed Z coordinate (from ceiling) | Ceiling |
| `$0004` | Can not be activated by sight | Blind |
| `$0008` | Can not be activated by sounds | Deaf |
| `$0010` | TODO | Floating |
| `$0020` | Net-game only, only works on items | NetOnly |
| Bit | Description | Name |
| --- | ----------- | ---- |
| `0` | Initially invisible (warp-in) | Invisible |
| `1` | Reversed Z coordinate (from ceiling) | Ceiling |
| `2` | Can not be activated by sight | Blind |
| `3` | Can not be activated by sounds | Deaf |
| `4` | TODO | Floating |
| `5` | Net-game only, only works on items | NetOnly |
### Mission Flags ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| `$0001` | Kill a certain percentage of monsters | Extermination |
| `$0002` | Must explore marked polygons | Exploration |
| `$0004` | Must grab marked items | Retrieval |
| `$0008` | Must flip marked switches | Repair |
| `$0010` | Must keep certain percent of BoBs alive | Rescue |
| Bit | Description | Name |
| --- | ----------- | ---- |
| `0` | Kill a certain percentage of monsters | Extermination |
| `1` | Must explore marked polygons | Exploration |
| `2` | Must grab marked items | Retrieval |
| `3` | Must flip marked switches | Repair |
| `4` | Must keep certain percent of BoBs alive | Rescue |
### Environment Flags ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| `$0001` | Makes most weapons not work and oxygen depletes | Vacuum |
| `$0002` | Motion sensor is fucked | Magnetic |
| `$0004` | Friendly S'pht, strips items and health | Rebellion |
| `$0008` | Low gravity | LowGrav |
| `$0010` | Handles glue like Marathon 1 | M1Glue |
| `$0020` | The floor damages you | LavaFloor |
| `$0040` | Friendly S'pht | Rebellion2 |
| `$0080` | Level has music | Music |
| `$0100` | Terminals stop time (Solo only) | TermPause |
| `$0200` | M1 monster activation limits | M1Monster |
| `$0400` | Weapon pickups on TC, lo-G grenades | M1Weps |
| `$2000` | Net-play map | NetPlay |
| `$4000` | Solo map | Solo |
| Bit | Description | Name |
| --- | ----------- | ---- |
| `0` | Makes most weapons not work and oxygen depletes | Vacuum |
| `1` | Motion sensor is fucked | Magnetic |
| `2` | Friendly S'pht, strips items and health | Rebellion |
| `3` | Low gravity | LowGrav |
| `4` | Handles glue like Marathon 1 | M1Glue |
| `5` | The floor damages you | LavaFloor |
| `6` | Friendly S'pht | Rebellion2 |
| `7` | Level has music | Music |
| `8` | Terminals stop time (Solo only) | TermPause |
| `9` | M1 monster activation limits | M1Monster |
| `10` | Weapon pickups on TC, lo-G grenades | M1Weps |
| `13` | Net-play map | NetPlay |
| `14` | Solo map | Solo |
### Light Flags ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| `$0001` | TODO | |
| `$0002` | TODO | Stateless |
| Bit | Description | Name |
| --- | ----------- | ---- |
| `0` | TODO | |
| `1` | TODO | Stateless |
### Entry Point Flags ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| `$0001` | Solo | Solo |
| `$0002` | Co-op | CoOp |
| `$0004` | Carnage | Carnage |
| `$0008` | Kill The Man With The Ball | KTMWTB |
| `$0010` | King of the Hill | KOTH |
| `$0020` | Defense | Defense |
| `$0040` | Rugby | Rugby |
| `$0080` | Capture The Flag | CTF |
| Bit | Description | Name |
| --- | ----------- | ---- |
| `0` | Solo | Solo |
| `1` | Co-op | CoOp |
| `2` | Carnage | Carnage |
| `3` | Kill The Man With The Ball | KTMWTB |
| `4` | King of the Hill | KOTH |
| `5` | Defense | Defense |
| `6` | Rugby | Rugby |
| `7` | Capture The Flag | CTF |
### Terminal Flags ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| `$0001` | Text is encoded | Encoded |
| Bit | Description | Name |
| --- | ----------- | ---- |
| `0` | Text is encoded | Encoded |
### CopyBits Flags ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| `$4000` | Unused | |
| `$8000` | Is PICT2 | PICT2 |
| Bit | Description | Name |
| --- | ----------- | ---- |
| `14` | Unused | |
| `15` | Is PICT2 | PICT2 |
### Color Table Flags ###
| Value | Description | Name |
| ----- | ----------- | ---- |
| `$8000` | Use automatic device mapping for indices | DeviceMap |
| Bit | Description | Name |
| --- | ----------- | ---- |
| `15` | Use automatic device mapping for indices | DeviceMap |
<!-- EOF -->

21
rustfmt.toml Normal file
Ver arquivo

@ -0,0 +1,21 @@
binop_separator = "Back"
brace_style = "AlwaysNextLine"
condense_wildcard_suffixes = true
enum_discrim_align_threshold = 40
format_doc_comments = true
format_macro_matchers = true
format_strings = true
imports_indent = "Visual"
indent_style = "Visual"
max_width = 80
merge_imports = true
newline_style = "Unix"
normalize_comments = true
normalize_doc_attributes = true
overflow_delimited_expr = true
reorder_impl_items = true
struct_field_align_threshold = 40
tab_spaces = 3
use_field_init_shorthand = true
use_try_shorthand = true
wrap_comments = true