mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-20 13:59:57 +00:00
asfs
This commit is contained in:
parent
5ae9caaf39
commit
7b740a8a1a
7 changed files with 39 additions and 39 deletions
|
|
@ -31,7 +31,7 @@
|
|||
static void
|
||||
fileIntFreeInstance(void *inst)
|
||||
{
|
||||
SDL_RWops *ops = static_cast<SDL_RWops*>(inst);
|
||||
SDL_IOStream *ops = static_cast<SDL_IOStream*>(inst);
|
||||
|
||||
SDL_RWclose(ops);
|
||||
SDL_FreeRW(ops);
|
||||
|
|
@ -42,7 +42,7 @@ DEF_TYPE_CUSTOMFREE(FileInt, fileIntFreeInstance);
|
|||
static VALUE
|
||||
fileIntForPath(const char *path, bool rubyExc)
|
||||
{
|
||||
SDL_RWops *ops = SDL_AllocRW();
|
||||
SDL_IOStream *ops = SDL_AllocRW();
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -73,7 +73,7 @@ RB_METHOD(fileIntRead)
|
|||
int length = -1;
|
||||
rb_get_args(argc, argv, "i", &length RB_ARG_END);
|
||||
|
||||
SDL_RWops *ops = getPrivateData<SDL_RWops>(self);
|
||||
SDL_IOStream *ops = getPrivateData<SDL_IOStream>(self);
|
||||
|
||||
if (length == -1)
|
||||
{
|
||||
|
|
@ -97,7 +97,7 @@ RB_METHOD(fileIntClose)
|
|||
{
|
||||
RB_UNUSED_PARAM;
|
||||
|
||||
SDL_RWops *ops = getPrivateData<SDL_RWops>(self);
|
||||
SDL_IOStream *ops = getPrivateData<SDL_IOStream>(self);
|
||||
SDL_RWclose(ops);
|
||||
|
||||
return Qnil;
|
||||
|
|
@ -107,7 +107,7 @@ RB_METHOD(fileIntGetByte)
|
|||
{
|
||||
RB_UNUSED_PARAM;
|
||||
|
||||
SDL_RWops *ops = getPrivateData<SDL_RWops>(self);
|
||||
SDL_IOStream *ops = getPrivateData<SDL_IOStream>(self);
|
||||
|
||||
unsigned char byte;
|
||||
size_t result = SDL_RWread(ops, &byte, 1, 1);
|
||||
|
|
|
|||
|
|
@ -57,12 +57,12 @@ struct ALDataSource
|
|||
virtual bool setPitch(float value) = 0;
|
||||
};
|
||||
|
||||
ALDataSource *createSDLSource(SDL_RWops &ops,
|
||||
ALDataSource *createSDLSource(SDL_IOStream &ops,
|
||||
const char *extension,
|
||||
uint32_t maxBufSize,
|
||||
bool looped);
|
||||
|
||||
ALDataSource *createVorbisSource(SDL_RWops &ops,
|
||||
ALDataSource *createVorbisSource(SDL_IOStream &ops,
|
||||
bool looped);
|
||||
|
||||
#endif // ALDATASOURCE_H
|
||||
|
|
|
|||
|
|
@ -456,18 +456,18 @@ void EventThread::process(RGSSThreadData &rtData)
|
|||
break;
|
||||
|
||||
case SDL_EVENT_FINGER_DOWN :
|
||||
i = event.tfinger.fingerId;
|
||||
i = event.tfinger.fingerID;
|
||||
touchState.fingers[i].down = true;
|
||||
/* falls through */
|
||||
|
||||
case SDL_EVENT_FINGER_MOTION :
|
||||
i = event.tfinger.fingerId;
|
||||
i = event.tfinger.fingerID;
|
||||
touchState.fingers[i].x = event.tfinger.x * winW;
|
||||
touchState.fingers[i].y = event.tfinger.y * winH;
|
||||
break;
|
||||
|
||||
case SDL_EVENT_FINGER_UP :
|
||||
i = event.tfinger.fingerId;
|
||||
i = event.tfinger.fingerID;
|
||||
memset(&touchState.fingers[i], 0, sizeof(touchState.fingers[0]));
|
||||
break;
|
||||
|
||||
|
|
@ -801,7 +801,7 @@ SyncPoint::Util::Util()
|
|||
|
||||
SyncPoint::Util::~Util()
|
||||
{
|
||||
SDL_DestroyCond(cond);
|
||||
SDL_DestroyCondition(cond);
|
||||
SDL_DestroyMutex(mut);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ static inline PHYSFS_File *sdlPHYS(SDL_IOStream *ops)
|
|||
return static_cast<PHYSFS_File*>(ops->hidden.unknown.data1);
|
||||
}
|
||||
|
||||
static Sint64 SDL_RWopsSize(SDL_IOStream *ops)
|
||||
static Sint64 SDL_IOStreamSize(SDL_IOStream *ops)
|
||||
{
|
||||
PHYSFS_File *f = sdlPHYS(ops);
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ static Sint64 SDL_RWopsSize(SDL_IOStream *ops)
|
|||
return PHYSFS_fileLength(f);
|
||||
}
|
||||
|
||||
static Sint64 SDL_RWopsSeek(SDL_IOStream *ops, int64_t offset, int whence)
|
||||
static Sint64 SDL_IOStreamSeek(SDL_IOStream *ops, int64_t offset, int whence)
|
||||
{
|
||||
PHYSFS_File *f = sdlPHYS(ops);
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ static Sint64 SDL_RWopsSeek(SDL_IOStream *ops, int64_t offset, int whence)
|
|||
return (result != 0) ? PHYSFS_tell(f) : -1;
|
||||
}
|
||||
|
||||
static size_t SDL_RWopsRead(SDL_IO_SEEK_END *ops, void *buffer, size_t size, size_t maxnum)
|
||||
static size_t SDL_IOStreamRead(SDL_IO_SEEK_END *ops, void *buffer, size_t size, size_t maxnum)
|
||||
{
|
||||
PHYSFS_File *f = sdlPHYS(ops);
|
||||
|
||||
|
|
@ -198,7 +198,7 @@ static size_t SDL_RWopsRead(SDL_IO_SEEK_END *ops, void *buffer, size_t size, siz
|
|||
return (result != -1) ? (result / size) : 0;
|
||||
}
|
||||
|
||||
static size_t SDL_RWopsWrite(SDL_IOStream *ops, const void *buffer, size_t size, size_t num)
|
||||
static size_t SDL_IOStreamWrite(SDL_IOStream *ops, const void *buffer, size_t size, size_t num)
|
||||
{
|
||||
PHYSFS_File *f = sdlPHYS(ops);
|
||||
|
||||
|
|
@ -210,7 +210,7 @@ static size_t SDL_RWopsWrite(SDL_IOStream *ops, const void *buffer, size_t size,
|
|||
return (result != -1) ? (result / size) : 0;
|
||||
}
|
||||
|
||||
static int SDL_RWopsClose(SDL_IOStream *ops)
|
||||
static int SDL_IOStreamClose(SDL_IOStream *ops)
|
||||
{
|
||||
PHYSFS_File *f = sdlPHYS(ops);
|
||||
|
||||
|
|
@ -223,9 +223,9 @@ static int SDL_RWopsClose(SDL_IOStream *ops)
|
|||
return (result != 0) ? 0 : -1;
|
||||
}
|
||||
|
||||
static int SDL_RWopsCloseFree(SDL_IOStream *ops)
|
||||
static int SDL_IOStreamCloseFree(SDL_IOStream *ops)
|
||||
{
|
||||
int result = SDL_RWopsClose(ops);
|
||||
int result = SDL_IOStreamClose(ops);
|
||||
|
||||
SDL_CloseIO(ops);
|
||||
|
||||
|
|
@ -276,15 +276,15 @@ initReadOps(PHYSFS_File *handle,
|
|||
SDL_IOStream &ops,
|
||||
bool freeOnClose)
|
||||
{
|
||||
ops.size = SDL_RWopsSize;
|
||||
ops.seek = SDL_RWopsSeek;
|
||||
ops.read = SDL_RWopsRead;
|
||||
ops.write = SDL_RWopsWrite;
|
||||
ops.size = SDL_IOStreamSize;
|
||||
ops.seek = SDL_IOStreamSeek;
|
||||
ops.read = SDL_IOStreamRead;
|
||||
ops.write = SDL_IOStreamWrite;
|
||||
|
||||
if (freeOnClose)
|
||||
ops.close = SDL_RWopsCloseFree;
|
||||
ops.close = SDL_IOStreamCloseFree;
|
||||
else
|
||||
ops.close = SDL_RWopsClose;
|
||||
ops.close = SDL_IOStreamClose;
|
||||
|
||||
ops.type = SDL_RWOPS_PHYSFS;
|
||||
ops.hidden.unknown.data1 = handle;
|
||||
|
|
@ -339,7 +339,7 @@ void FileSystem::addPath(const char *path)
|
|||
if (!PHYSFS_mount(path, 0, 1))
|
||||
{
|
||||
/* If it didn't work, try mounting via a wrapped
|
||||
* SDL_RWops */
|
||||
* SDL_IOStream */
|
||||
PHYSFS_Io *io = createSDLRWIo(path);
|
||||
|
||||
if (io)
|
||||
|
|
@ -648,7 +648,7 @@ void FileSystem::openRead(OpenHandler &handler, const char *filename)
|
|||
throw Exception(Exception::NoFileError, "%s", filename);
|
||||
}
|
||||
|
||||
void FileSystem::openReadRaw(SDL_RWops &ops,
|
||||
void FileSystem::openReadRaw(SDL_IOStream &ops,
|
||||
const char *filename,
|
||||
bool freeOnClose)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
#include "font.h"
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_image.h>
|
||||
#include <SDL3/SDL_ttf.h>
|
||||
#include <SDL3_image/SDL_image.h>
|
||||
#include <SDL3_ttf/SDL_ttf.h>
|
||||
|
||||
// OS-Specific code
|
||||
#if defined _WIN32
|
||||
|
|
@ -68,7 +68,7 @@ struct OneshotPrivate
|
|||
|
||||
// Alpha texture data for portions of window obscured by screen edges
|
||||
int winX, winY;
|
||||
SDL_mutex *winMutex;
|
||||
SDL_Mutex *winMutex;
|
||||
bool winPosChanged;
|
||||
std::vector<uint8_t> obscuredMap;
|
||||
bool obscuredCleared;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ SDL_Thread *createSDLThread(C *obj, const std::string &name = std::string())
|
|||
* on the physical filesystem. This wrapper attempts to open a
|
||||
* real file first before falling back to the assets folder */
|
||||
//static inline
|
||||
//SDL_RWops *RWFromFile(const char *filename,
|
||||
//SDL_IOStream *RWFromFile(const char *filename,
|
||||
// const char *mode)
|
||||
//{
|
||||
// FILE *f = fopen(filename, mode);
|
||||
|
|
|
|||
|
|
@ -29,17 +29,17 @@
|
|||
|
||||
static size_t vfRead(void *ptr, size_t size, size_t nmemb, void *ops)
|
||||
{
|
||||
return SDL_RWread(static_cast<SDL_RWops*>(ops), ptr, size, nmemb);
|
||||
return SDL_RWread(static_cast<SDL_IOStream*>(ops), ptr, size, nmemb);
|
||||
}
|
||||
|
||||
static int vfSeek(void *ops, ogg_int64_t offset, int whence)
|
||||
{
|
||||
return SDL_RWseek(static_cast<SDL_RWops*>(ops), offset, whence);
|
||||
return SDL_RWseek(static_cast<SDL_IOStream*>(ops), offset, whence);
|
||||
}
|
||||
|
||||
static long vfTell(void *ops)
|
||||
{
|
||||
return SDL_RWtell(static_cast<SDL_RWops*>(ops));
|
||||
return SDL_RWtell(static_cast<SDL_IOStream*>(ops));
|
||||
}
|
||||
|
||||
static ov_callbacks OvCallbacks =
|
||||
|
|
@ -53,7 +53,7 @@ static ov_callbacks OvCallbacks =
|
|||
|
||||
struct VorbisSource : ALDataSource
|
||||
{
|
||||
SDL_RWops &src;
|
||||
SDL_IOStream &src;
|
||||
|
||||
OggVorbis_File vf;
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ struct VorbisSource : ALDataSource
|
|||
|
||||
std::vector<int16_t> sampleBuf;
|
||||
|
||||
VorbisSource(SDL_RWops &ops,
|
||||
VorbisSource(SDL_IOStream &ops,
|
||||
bool looped)
|
||||
: src(ops),
|
||||
currentFrame(0)
|
||||
|
|
@ -87,7 +87,7 @@ struct VorbisSource : ALDataSource
|
|||
|
||||
if (error)
|
||||
{
|
||||
SDL_RWclose(&src);
|
||||
SDL_CloseIO(&src);
|
||||
throw Exception(Exception::MKXPError,
|
||||
"Vorbisfile: Cannot read ogg file");
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ struct VorbisSource : ALDataSource
|
|||
if (info.channels > 2)
|
||||
{
|
||||
ov_clear(&vf);
|
||||
SDL_RWclose(&src);
|
||||
SDL_CloseIO(&src);
|
||||
throw Exception(Exception::MKXPError,
|
||||
"Cannot handle audio with more than 2 channels");
|
||||
}
|
||||
|
|
@ -148,7 +148,7 @@ struct VorbisSource : ALDataSource
|
|||
~VorbisSource()
|
||||
{
|
||||
ov_clear(&vf);
|
||||
SDL_RWclose(&src);
|
||||
SDL_CloseIO(&src);
|
||||
}
|
||||
|
||||
int sampleRate()
|
||||
|
|
@ -282,7 +282,7 @@ struct VorbisSource : ALDataSource
|
|||
}
|
||||
};
|
||||
|
||||
ALDataSource *createVorbisSource(SDL_RWops &ops,
|
||||
ALDataSource *createVorbisSource(SDL_IOStream &ops,
|
||||
bool looped)
|
||||
{
|
||||
return new VorbisSource(ops, looped);
|
||||
|
|
|
|||
Loading…
Reference in a new issue