mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-29 04:18:49 -04:00
Triforce v0.8.5
A Randomizer page in the launcher, a new title screen with Mods and Save Select tabs, scaling changes applied in game, the Jabu-Jabu bars fixed, renderer frame-time work and the brightness-flash fix, and fixes from the 0.8.4 reports.
This commit is contained in:
@@ -42,6 +42,11 @@ public static class BlockLinear
|
||||
{
|
||||
if (bytesPerElement is not (1 or 2 or 4 or 8 or 16))
|
||||
throw new NotSupportedException(bytesPerElement + " bytes per element");
|
||||
// ((Triforce, 11-26) the sizes checked before anything is allocated: a header could ask for 2 GB, then be refused)
|
||||
ImageLimits.Check(width, height);
|
||||
if ((long)width * bytesPerElement * height > int.MaxValue || blockHeightLog2 is < 0 or > 5) throw new InvalidDataException("a texture larger than the game has");
|
||||
if (Size(width, height, bytesPerElement, blockHeightLog2) > input.Length)
|
||||
throw new InvalidDataException("the texture's data is shorter than its size calls for");
|
||||
var pitch = width * bytesPerElement;
|
||||
var output = new byte[pitch * height];
|
||||
var gobsInX = (pitch + 63) >> GobSizeXShift;
|
||||
@@ -49,9 +54,6 @@ public static class BlockLinear
|
||||
var blockHeightMask = (1 << blockHeightLog2) - 1;
|
||||
var xShift = GobSizeShift + blockHeightLog2;
|
||||
|
||||
if (Size(width, height, bytesPerElement, blockHeightLog2) > input.Length)
|
||||
throw new InvalidDataException("the texture's data is shorter than its size calls for");
|
||||
|
||||
for (var y = 0; y < height; y++)
|
||||
{
|
||||
var swizzledY = SwizzleY(y);
|
||||
|
||||
Reference in New Issue
Block a user