rewrite the emulator to use UTF-8 internally

This commit is contained in:
David Hrdlička
2021-03-14 20:35:01 +01:00
parent 56d62de4fe
commit dfbbe08a07
146 changed files with 1507 additions and 1457 deletions

View File

@@ -317,7 +317,7 @@ static png_infop info_ptr;
static void
video_take_screenshot(const wchar_t *fn, int startx, int starty, int y1, int y2, int w, int h)
video_take_screenshot(const char *fn, int startx, int starty, int y1, int y2, int w, int h)
{
int i, x, y;
png_bytep *b_rgb = NULL;
@@ -325,9 +325,9 @@ video_take_screenshot(const wchar_t *fn, int startx, int starty, int y1, int y2,
uint32_t temp = 0x00000000;
/* create file */
fp = plat_fopen((wchar_t *) fn, (wchar_t *) L"wb");
fp = plat_fopen((char *) fn, (char *) "wb");
if (!fp) {
video_log("[video_take_screenshot] File %ls could not be opened for writing", fn);
video_log("[video_take_screenshot] File %s could not be opened for writing", fn);
return;
}
@@ -390,7 +390,7 @@ video_take_screenshot(const wchar_t *fn, int startx, int starty, int y1, int y2,
static void
video_screenshot(int x, int y, int y1, int y2, int w, int h)
{
wchar_t path[1024], fn[128];
char path[1024], fn[128];
memset(fn, 0, sizeof(fn));
memset(path, 0, sizeof(path));
@@ -400,14 +400,14 @@ video_screenshot(int x, int y, int y1, int y2, int w, int h)
if (! plat_dir_check(path))
plat_dir_create(path);
wcscat(path, L"\\");
plat_path_slash(path);
plat_tempfile(fn, NULL, L".png");
wcscat(path, fn);
plat_tempfile(fn, NULL, ".png");
strcat(path, fn);
video_log("taking screenshot to: %S\n", path);
video_log("taking screenshot to: %s\n", path);
video_take_screenshot((const wchar_t *) path, x, y, y1, y2, w, h);
video_take_screenshot((const char *) path, x, y, y1, y2, w, h);
png_destroy_write_struct(&png_ptr, &info_ptr);
}
@@ -1051,11 +1051,11 @@ loadfont_common(FILE *f, int format)
}
void
loadfont_ex(wchar_t *s, int format, int offset)
loadfont_ex(char *s, int format, int offset)
{
FILE *f;
f = rom_fopen(s, L"rb");
f = rom_fopen(s, "rb");
if (f == NULL)
return;
@@ -1065,7 +1065,7 @@ loadfont_ex(wchar_t *s, int format, int offset)
}
void
loadfont(wchar_t *s, int format)
loadfont(char *s, int format)
{
loadfont_ex(s, format, 0);
}