mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-04 08:17:40 +00:00
Added signed read/write methods to the Stream classes
svn-id: r13680
This commit is contained in:
parent
90075cd190
commit
33ef0d0a4b
@ -59,6 +59,24 @@ uint32 ReadStream::readUint32BE() {
|
||||
}
|
||||
|
||||
|
||||
int16 ReadStream::readSint16LE() {
|
||||
return (int16)readUint16LE();
|
||||
}
|
||||
|
||||
int32 ReadStream::readSint32LE() {
|
||||
return (int32)readUint32LE();
|
||||
}
|
||||
|
||||
int16 ReadStream::readSint16BE() {
|
||||
return (int16)readUint16BE();
|
||||
}
|
||||
|
||||
int32 ReadStream::readSint32BE() {
|
||||
return (int32)readUint32BE();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void WriteStream::writeByte(byte value) {
|
||||
write(&value, 1);
|
||||
}
|
||||
@ -83,4 +101,21 @@ void WriteStream::writeUint32BE(uint32 value) {
|
||||
writeUint16BE((uint16)(value & 0xffff));
|
||||
}
|
||||
|
||||
|
||||
void WriteStream::writeSint16LE(int16 value) {
|
||||
writeUint16LE((uint16)value);
|
||||
}
|
||||
|
||||
void WriteStream::writeSint32LE(int32 value) {
|
||||
writeUint32LE((uint32)value);
|
||||
}
|
||||
|
||||
void WriteStream::writeSint16BE(int16 value) {
|
||||
writeUint16BE((uint16)value);
|
||||
}
|
||||
|
||||
void WriteStream::writeSint32BE(int32 value) {
|
||||
writeUint32BE((uint32)value);
|
||||
}
|
||||
|
||||
} // End of namespace Common
|
||||
|
@ -43,13 +43,11 @@ public:
|
||||
void writeUint16BE(uint16 value);
|
||||
void writeUint32BE(uint32 value);
|
||||
|
||||
/*
|
||||
void writeSint16LE(int16 value);
|
||||
void writeSint32LE(int32 value);
|
||||
|
||||
void writeSint16BE(int16 value);
|
||||
void writeSint32BE(int32 value);
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
@ -67,13 +65,11 @@ public:
|
||||
uint16 readUint16BE();
|
||||
uint32 readUint32BE();
|
||||
|
||||
/*
|
||||
int16 readSint16LE();
|
||||
int32 readSint32LE();
|
||||
|
||||
int16 readSint16BE();
|
||||
int32 readSint32BE();
|
||||
*/
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user