mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-29 15:32:24 +00:00
4a87003408
* Vulkan backend updated. * zlib replaced with miniz. * FileReader is now 64 bit capable. * jpeg replaced with stb-image. * CMake project warnings fixed.
24 lines
952 B
C
24 lines
952 B
C
#pragma once
|
|
|
|
#include <zmusic.h>
|
|
#include "files.h"
|
|
|
|
|
|
inline ZMusicCustomReader *GetMusicReader(FileReader& fr)
|
|
{
|
|
using FileSys::FileReaderInterface;
|
|
auto zcr = new ZMusicCustomReader;
|
|
|
|
zcr->handle = fr.GetInterface();
|
|
zcr->gets = [](ZMusicCustomReader* zr, char* buff, int n) { return reinterpret_cast<FileReaderInterface*>(zr->handle)->Gets(buff, n); };
|
|
zcr->read = [](ZMusicCustomReader* zr, void* buff, int32_t size) -> long { return (long)reinterpret_cast<FileReaderInterface*>(zr->handle)->Read(buff, size); };
|
|
zcr->seek = [](ZMusicCustomReader* zr, long offset, int whence) -> long { return (long)reinterpret_cast<FileReaderInterface*>(zr->handle)->Seek(offset, whence); };
|
|
zcr->tell = [](ZMusicCustomReader* zr) -> long { return (long)reinterpret_cast<FileReaderInterface*>(zr->handle)->Tell(); };
|
|
zcr->close = [](ZMusicCustomReader* zr)
|
|
{
|
|
delete reinterpret_cast<FileReaderInterface*>(zr->handle);
|
|
delete zr;
|
|
};
|
|
return zcr;
|
|
}
|
|
|