This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct badType; | |
template <typename TType = badType> | |
struct type_decl { | |
static constexpr const char * format_string() { | |
return (std::is_integral_v<TType> | |
? "%d" | |
: (std::is_floating_point_v<TType> | |
? "%f" | |
: (std::is_pointer_v<TType> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
namespace XBox.IO | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static byte[] UnSwizzle4(byte[] buffer, int width, int height, int where) | |
{ | |
// HUGE THANKS TO: | |
// L33TMasterJacob for finding the information on unswizzling 4-bit textures | |
// Dageron for his 4-bit unswizzling code; he's truly a genius! | |
// | |
// Source: https://gta.nick7.com/ps2/swizzling/unswizzle_delphi.txt | |
byte[] InterlaceMatrix = { | |
0x00, 0x10, 0x02, 0x12, |