alstream.cpp changes for SDL3

This commit is contained in:
ZakatTeamI2P 2026-03-30 17:07:56 +04:00
parent 15499eea19
commit e807343c26
1 changed files with 8 additions and 8 deletions

View File

@ -29,9 +29,9 @@
#include "sdl-util.h" #include "sdl-util.h"
#include "debugwriter.h" #include "debugwriter.h"
#include <SDL_mutex.h> #include <SDL3/SDL_mutex.h>
#include <SDL_thread.h> #include <SDL3/SDL_thread.h>
#include <SDL_timer.h> #include <SDL3/SDL_timer.h>
ALStream::ALStream(LoopMode loopMode, ALStream::ALStream(LoopMode loopMode,
const std::string &threadId) const std::string &threadId)
@ -203,16 +203,16 @@ void ALStream::closeSource()
struct ALStreamOpenHandler : FileSystem::OpenHandler struct ALStreamOpenHandler : FileSystem::OpenHandler
{ {
SDL_RWops *srcOps; SDL_IOStream *srcOps;
bool looped; bool looped;
ALDataSource *source; ALDataSource *source;
std::string errorMsg; std::string errorMsg;
ALStreamOpenHandler(SDL_RWops &srcOps, bool looped) ALStreamOpenHandler(SDL_IOStream &srcOps, bool looped)
: srcOps(&srcOps), looped(looped), source(0) : srcOps(&srcOps), looped(looped), source(0)
{} {}
bool tryRead(SDL_RWops &ops, const char *ext) bool tryRead(SDL_IOStream &ops, const char *ext)
{ {
/* Copy this because we need to keep it around, /* Copy this because we need to keep it around,
* as we will continue reading data from it later */ * as we will continue reading data from it later */
@ -220,8 +220,8 @@ struct ALStreamOpenHandler : FileSystem::OpenHandler
/* Try to read ogg file signature */ /* Try to read ogg file signature */
char sig[5] = { 0 }; char sig[5] = { 0 };
SDL_RWread(srcOps, sig, 1, 4); SDL_ReadIO(srcOps, sig, 1, 4);
SDL_RWseek(srcOps, 0, RW_SEEK_SET); SDL_SeekIO(srcOps, 0, RW_SEEK_SET);
try try
{ {