Use SDL function for rwops size

This commit is contained in:
Dmitry Marakasov 2017-04-21 18:16:08 +03:00
parent aef47fbfeb
commit 5f6191dfc1

View File

@ -191,12 +191,7 @@ Sint64 RWops::Tell() {
} }
Sint64 RWops::Size() { Sint64 RWops::Size() {
Sint64 old_pos = Tell(); return SDL_RWsize(rwops_);
Sint64 size = Seek(0, RW_SEEK_END);
Sint64 back_pos = Seek(old_pos, RW_SEEK_SET);
(void)back_pos; // silence unused variable warning on release build
assert(back_pos == old_pos);
return size;
} }
Uint16 RWops::ReadBE16() { Uint16 RWops::ReadBE16() {