mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
* Splitted version yamls and implemented wip geo and dlist extraction * Fixed linux compilation * Added PoC WSL 2 detection * Add undefined behaviour * Added gfxdis as submodule * update * Removed gfxdis as a submodule * Code works * Replace ByteSwap with BSWAP * Cleanup vertice factory * readability * readability 2 * Cleanup gfxfactory * last one * Rename name to symbol * More implementation * Implemented first PoC of C file generation * Added output formatting on factories * changes * Moved generated dlists onto their respective folder * Migrated more factories onto the new extractor system * Fully ported all factories and added header generation * Some updates * Added Lights factory * fix * Fixed vtx extraction * Lights work now * delete old startup_logo yaml * Generate all sections in single file * Added support to generate header and code for textures * Added O3 for release builds * Added WIP dlist extraction and moved to use f3dold microcode * Added segment support, autogeneration and fixed C generation * Added symbol names on display list extraction * Removed warnings * Moved back to transform and replace * Removed unnecesary macros * Added extraction order and reversed vtx order * Implemented true backwards sort * [WIP] Implemented runtime gbi, more headers and a few config features * Fix CLI11 on WSL and variety of fixes * Fixes * Update DisplayListFactory.h * Update TextureFactory.cpp * wip lights * fix * Correct callback * Added waypoints * Update ceremony_data.yml * Changes * Update TextureFactory.cpp * Update commandline args * Update comment * Remove printf * Update couple commands * Renamed cubeos to torch * Removed unused stuff and added an example config file --------- Co-authored-by: KiritoDv <kiritodev01@gmail.com> Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <memory>
|
|
#include <vector>
|
|
#include "endianness.h"
|
|
#include "Stream.h"
|
|
|
|
class BinaryReader;
|
|
|
|
namespace LUS {
|
|
|
|
class BinaryReader {
|
|
public:
|
|
BinaryReader(char* nBuffer, size_t nBufferSize);
|
|
BinaryReader(uint8_t* nBuffer, size_t nBufferSize);
|
|
BinaryReader(Stream* nStream);
|
|
BinaryReader(std::shared_ptr<Stream> nStream);
|
|
|
|
void Close();
|
|
|
|
void SetEndianness(Endianness endianness);
|
|
Endianness GetEndianness() const;
|
|
|
|
void Seek(int32_t offset, SeekOffsetType seekType);
|
|
uint32_t GetBaseAddress();
|
|
size_t GetLength();
|
|
|
|
void Read(int32_t length);
|
|
void Read(char* buffer, int32_t length);
|
|
char ReadChar();
|
|
int8_t ReadInt8();
|
|
int16_t ReadInt16();
|
|
int32_t ReadInt32();
|
|
uint8_t ReadUByte();
|
|
uint16_t ReadUInt16();
|
|
uint32_t ReadUInt32();
|
|
uint64_t ReadUInt64();
|
|
unsigned short ReadUShort();
|
|
short ReadShort();
|
|
float ReadFloat();
|
|
double ReadDouble();
|
|
std::string ReadString();
|
|
std::string ReadCString();
|
|
|
|
std::vector<char> ToVector();
|
|
|
|
protected:
|
|
std::shared_ptr<Stream> mStream;
|
|
Endianness mEndianness = Endianness::Native;
|
|
};
|
|
} // namespace LUS
|