mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-14 01:59:19 +03:00
Fix file name encoding issues in movie.c and Toushin3Loader.c
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "little_endian.h"
|
||||
#include "system4/buffer.h"
|
||||
#include "system4/file.h"
|
||||
#include "system4/string.h"
|
||||
#include "system4/utfsjis.h"
|
||||
|
||||
@@ -55,7 +56,7 @@ static struct buffer *ts3m_read_buf;
|
||||
static FILE *open_and_read_header(struct ts3m_header *header)
|
||||
{
|
||||
char *path = gamedir_path("Data/Toushin3Map.dat");
|
||||
FILE *fp = fopen(path, "rb");
|
||||
FILE *fp = file_open_utf8(path, "rb");
|
||||
free(path);
|
||||
|
||||
uint8_t buf[28];
|
||||
|
||||
+8
-3
@@ -15,10 +15,14 @@
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <SDL.h>
|
||||
|
||||
#include "system4.h"
|
||||
#include "system4/file.h"
|
||||
|
||||
#include "gfx/gfx.h"
|
||||
#include "movie.h"
|
||||
@@ -108,13 +112,14 @@ struct movie_context *movie_load(const char *filename)
|
||||
{
|
||||
struct movie_context *mc = xcalloc(1, sizeof(struct movie_context));
|
||||
char *path = gamedir_path(filename);
|
||||
mc->plm = plm_create_with_filename(path);
|
||||
if (!mc->plm) {
|
||||
WARNING("Couldn't open %s", path);
|
||||
FILE *fp = file_open_utf8(path, "rb");
|
||||
if (!fp) {
|
||||
WARNING("%s: %s", path, strerror(errno));
|
||||
free(path);
|
||||
movie_free(mc);
|
||||
return NULL;
|
||||
}
|
||||
mc->plm = plm_create_with_file(fp, TRUE);
|
||||
if (!plm_has_headers(mc->plm)) {
|
||||
WARNING("%s: not a MPEG-PS file", path);
|
||||
free(path);
|
||||
|
||||
Reference in New Issue
Block a user