mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-14 10:09:29 +03:00
Migrate to SDL3 (except for Android and Switch)
Switch desktop/emscripten builds from SDL2 to SDL3, applying only the API changes that cannot compile through the SDL_oldnames.h aliases. Pure renames will be swept in a follow-up commit.
This commit is contained in:
+5
-5
@@ -7,7 +7,7 @@
|
||||
#include "dri.h"
|
||||
#include <memory>
|
||||
#include <string.h>
|
||||
#include <SDL.h>
|
||||
#include <SDL3/SDL.h>
|
||||
#include "game_id.h"
|
||||
#include "fileio.h"
|
||||
|
||||
@@ -191,7 +191,7 @@ std::vector<uint8> Dri::load_mda(const GameId& game_id, int page)
|
||||
uint8 buf[4];
|
||||
|
||||
// ページの位置を取得
|
||||
SDL_RWread(rw, buf, 4, 1);
|
||||
SDL_ReadIO(rw, buf, 4);
|
||||
int link_sector = buf[0] | (buf[1] << 8);
|
||||
int data_sector = buf[2] | (buf[3] << 8);
|
||||
|
||||
@@ -202,7 +202,7 @@ std::vector<uint8> Dri::load_mda(const GameId& game_id, int page)
|
||||
}
|
||||
|
||||
SDL_RWseek(rw, (link_sector - 1) * 256 + (page - 1) * 2, RW_SEEK_SET);
|
||||
SDL_RWread(rw, buf, 2, 1);
|
||||
SDL_ReadIO(rw, buf, 2);
|
||||
|
||||
int disk_index = buf[0];
|
||||
int link_index = buf[1];
|
||||
@@ -287,7 +287,7 @@ std::vector<uint8> Dri::load_mda(const GameId& game_id, int page)
|
||||
|
||||
// データ取得
|
||||
SDL_RWseek(rw, link_index * 2, RW_SEEK_SET);
|
||||
SDL_RWread(rw, buf, 4, 1);
|
||||
SDL_ReadIO(rw, buf, 4);
|
||||
int start_sector = buf[0] | (buf[1] << 8);
|
||||
int end_sector = buf[2] | (buf[3] << 8);
|
||||
|
||||
@@ -299,7 +299,7 @@ std::vector<uint8> Dri::load_mda(const GameId& game_id, int page)
|
||||
}
|
||||
std::vector<uint8_t> buffer(size);
|
||||
SDL_RWseek(rw, (start_sector - 1) * 256, RW_SEEK_SET);
|
||||
SDL_RWread(rw, buffer.data(), size, 1);
|
||||
SDL_ReadIO(rw, buffer.data(), size);
|
||||
|
||||
SDL_RWclose(rw);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user