mirror of
https://github.com/ACEmulator/ACE
synced 2026-08-17 12:26:06 -04:00
Both formats expanded their packed channels with arithmetic that cannot reach the top of the 8-bit range. A4R4G4B4 used `nibble / 0xF * 255` in integer arithmetic. nibble / 15 is 0 for every nibble 0..14 and 1 only for 15, so all four channels - alpha included - snapped to 0 or 255. In practice every affected texture decoded to a single flat colour with binary alpha. Measured on a CustomDM dat set, distinct colours and distinct alpha levels per texture before -> after: 06007068 1 -> 14 colours, 1 -> 1 alpha 0600926C 1 -> 40 colours, 2 -> 15 alpha 0600926E 1 -> 54 colours, 2 -> 16 alpha 06009340 1 -> 70 colours, 2 -> 9 alpha 06006430 1 -> 1 colours, 2 -> 11 alpha 255 / 15 == 17 exactly, so multiplying the nibble by 17 maps 0..15 onto 0..255 with no rounding error. The alpha nibble is now masked for symmetry with the other three. R5G6B5 expanded with a bare left shift, mapping a 5-bit value onto 0,8,16..248 and a 6-bit value onto 0,4,8..252. Neither reaches 255, so a fully saturated white decoded to (248,252,248) - slightly dark and slightly green tinted, since green keeps one more bit. Replicating the high bits into the low ones spans the full range. Measured before -> after on four textures whose brightest pixel is white: 06006402, 06006404, 0600641D, 060096C0 (248,252,248) -> (255,255,255) and partial-range textures scale correspondingly, e.g. 06009694 (216,36,248) -> (222,36,255). Affects every consumer of ACE.DatLoader that renders or exports textures. |
||
|---|---|---|
| .. | ||
| ActionMap.cs | ||
| Animation.cs | ||
| BadData.cs | ||
| CellLandblock.cs | ||
| CharGen.cs | ||
| ChatPoseTable.cs | ||
| ClothingTable.cs | ||
| CombatManeuverTable.cs | ||
| ContractTable.cs | ||
| DbProperty.cs | ||
| DidMapper.cs | ||
| DualDidMapper.cs | ||
| EnumMapper.cs | ||
| EnvCell.cs | ||
| Environment.cs | ||
| FileType.cs | ||
| Font.cs | ||
| GeneratorTable.cs | ||
| GfxObj.cs | ||
| GfxObjDegradeInfo.cs | ||
| Iteration.cs | ||
| LandblockInfo.cs | ||
| LanguageInfo.cs | ||
| LanguageString.cs | ||
| LayoutDesc.cs | ||
| MasterProperty.cs | ||
| MotionTable.cs | ||
| NameFilterTable.cs | ||
| Palette.cs | ||
| PaletteSet.cs | ||
| ParticleEmitterInfo.cs | ||
| PhysicsScript.cs | ||
| PhysicsScriptTable.cs | ||
| QualityFilter.cs | ||
| RegionDesc.cs | ||
| RenderTexture.cs | ||
| Scene.cs | ||
| SecondaryAttributeTable.cs | ||
| SetupModel.cs | ||
| SkillTable.cs | ||
| SoundTable.cs | ||
| SpellComponentsTable.cs | ||
| SpellTable.cs | ||
| StringTable.cs | ||
| Surface.cs | ||
| SurfaceTexture.cs | ||
| TabooTable.cs | ||
| Texture.cs | ||
| UserBindingValue.cs | ||
| Wave.cs | ||
| XpTable.cs | ||