| 111 | } |
| 112 | |
| 113 | bool StateWrapper::ReadOnlyMemoryStream::SeekRelative(s32 count) |
| 114 | { |
| 115 | if (count < 0) |
| 116 | { |
| 117 | if (static_cast<u32>(-count) > m_buf_position) |
| 118 | return false; |
| 119 | |
| 120 | m_buf_position -= static_cast<u32>(-count); |
| 121 | return true; |
| 122 | } |
| 123 | else |
| 124 | { |
| 125 | if ((m_buf_position + static_cast<u32>(count)) > m_buf_length) |
| 126 | return false; |
| 127 | |
| 128 | m_buf_position += static_cast<u32>(count); |
| 129 | return true; |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | StateWrapper::MemoryStream::MemoryStream(void* buf, u32 buf_length) |
| 134 | : m_buf(static_cast<u8*>(buf)) |