mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
Migrated disassemble audio into audio manager class
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "MemoryStream.h"
|
||||
#include <cmath>
|
||||
#include <stdexcept>
|
||||
#include <locale>
|
||||
|
||||
LUS::BinaryReader::BinaryReader(char* nBuffer, size_t nBufferSize) {
|
||||
mStream = std::make_shared<MemoryStream>(nBuffer, nBufferSize);
|
||||
@@ -113,6 +114,28 @@ uint64_t LUS::BinaryReader::ReadUInt64() {
|
||||
return result;
|
||||
}
|
||||
|
||||
unsigned short LUS::BinaryReader::ReadUShort() {
|
||||
unsigned short result = 0;
|
||||
mStream->Read((char*)&result, sizeof(unsigned short));
|
||||
|
||||
if (mEndianness != Endianness::Native) {
|
||||
result = BSWAP16(result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
short LUS::BinaryReader::ReadShort() {
|
||||
short result = 0;
|
||||
mStream->Read((char*)&result, sizeof(short));
|
||||
|
||||
if (mEndianness != Endianness::Native) {
|
||||
result = BSWAP16(result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
float LUS::BinaryReader::ReadFloat() {
|
||||
float result = NAN;
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ class BinaryReader {
|
||||
uint16_t ReadUInt16();
|
||||
uint32_t ReadUInt32();
|
||||
uint64_t ReadUInt64();
|
||||
unsigned short ReadUShort();
|
||||
short ReadShort();
|
||||
float ReadFloat();
|
||||
double ReadDouble();
|
||||
std::string ReadString();
|
||||
|
||||
Reference in New Issue
Block a user