From a771a6f083d450c9cbba7367a08602c0a4bd6abc Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Sat, 14 Apr 2018 23:54:44 +0900 Subject: win32: fixed several UI issues and updated manifest --- common/fmplayer_fontrom.h | 6 ++++-- common/fmplayer_fontrom_unix.c | 5 +++-- common/fmplayer_fontrom_win.c | 5 +++-- win32/amd64/Makefile | 5 ++++- win32/configdialog.c | 2 +- win32/fmplayer.mak | 1 + win32/lnf.manifest | 10 ---------- win32/lnf.manifest.in | 11 +++++++++++ win32/main.c | 2 +- win32/x86/Makefile | 5 ++++- 10 files changed, 32 insertions(+), 20 deletions(-) delete mode 100644 win32/lnf.manifest create mode 100644 win32/lnf.manifest.in diff --git a/common/fmplayer_fontrom.h b/common/fmplayer_fontrom.h index 7a67133..601cecc 100644 --- a/common/fmplayer_fontrom.h +++ b/common/fmplayer_fontrom.h @@ -1,9 +1,11 @@ #ifndef MYON_FMPLAYER_FONTROM_H_INCLUDED #define MYON_FMPLAYER_FONTROM_H_INCLUDED +#include + struct fmdsp_font; -// always succeeds -void fmplayer_font_rom_load(struct fmdsp_font *font); +// true if font rom available, false if using alternatives +bool fmplayer_font_rom_load(struct fmdsp_font *font); #endif // MYON_FMPLAYER_FONTROM_H_INCLUDED diff --git a/common/fmplayer_fontrom_unix.c b/common/fmplayer_fontrom_unix.c index bb8f12e..238be9c 100644 --- a/common/fmplayer_fontrom_unix.c +++ b/common/fmplayer_fontrom_unix.c @@ -13,7 +13,7 @@ static struct { uint8_t fontrombuf[FONT_ROM_FILESIZE]; } g; -void fmplayer_font_rom_load(struct fmdsp_font *font) { +bool fmplayer_font_rom_load(struct fmdsp_font *font) { const char *path = "font.rom"; const char *home = getenv("HOME"); char *dpath = 0; @@ -40,9 +40,10 @@ void fmplayer_font_rom_load(struct fmdsp_font *font) { goto err; } fclose(f); - return; + return true; err: if (f) fclose(f); fmdsp_font_from_font_rom(font, fmdsp_shinonome_font_rom); + return false; } diff --git a/common/fmplayer_fontrom_win.c b/common/fmplayer_fontrom_win.c index 8ba8300..4f9ed12 100644 --- a/common/fmplayer_fontrom_win.c +++ b/common/fmplayer_fontrom_win.c @@ -13,7 +13,7 @@ static struct { bool font_rom_loaded; } g; -void fmplayer_font_rom_load(struct fmdsp_font *font) { +bool fmplayer_font_rom_load(struct fmdsp_font *font) { const wchar_t *path = L"font.rom"; wchar_t exepath[MAX_PATH]; if (GetModuleFileNameW(0, exepath, MAX_PATH)) { @@ -33,8 +33,9 @@ void fmplayer_font_rom_load(struct fmdsp_font *font) { CloseHandle(file); fmdsp_font_from_font_rom(font, g.fontrombuf); g.font_rom_loaded = true; - return; + return true; err: if (file != INVALID_HANDLE_VALUE) CloseHandle(file); fmdsp_font_win(font); + return false; } diff --git a/win32/amd64/Makefile b/win32/amd64/Makefile index c1d7426..90e56d3 100644 --- a/win32/amd64/Makefile +++ b/win32/amd64/Makefile @@ -36,10 +36,13 @@ $(TARGET): $(OBJS) @echo " CC $@" @$(CC) $(CFLAGS) $(SSECFLAGS) -c $< -o $@ -%.o: %.rc $(ICON) +%.o: %.rc $(ICON) $(MANIFEST) @echo " WINDRES $@" @$(WINDRES) -o $@ -i $< +$(MANIFEST): $(MANIFEST).in ../../version.h + sed -e "s/@VER@/$(shell ../../versionprint.c)/g" $< > $@ + $(ICON): $(ICONFILES) icotool -o $@ -c $^ diff --git a/win32/configdialog.c b/win32/configdialog.c index 3d15220..21c9c62 100644 --- a/win32/configdialog.c +++ b/win32/configdialog.c @@ -45,7 +45,7 @@ enum { GROUP_FM_H = 75, BOX_X = 15, CHECK_FM_HIRES_SIN_Y = GROUP_FM_Y + 20, - BOX_W = 380, + BOX_W = 450, CHECK_H = 25, CHECK_FM_HIRES_ENV_Y = CHECK_FM_HIRES_SIN_Y + CHECK_H, GROUP_SSG_Y = GROUP_FM_Y+GROUP_FM_H+5, diff --git a/win32/fmplayer.mak b/win32/fmplayer.mak index 8bbf8ae..5c27df8 100644 --- a/win32/fmplayer.mak +++ b/win32/fmplayer.mak @@ -2,6 +2,7 @@ TARGET=98fmplayer.exe ICON=../fmplayer.ico ICONFILES=../fmplayer.png ../fmplayer32.png +MANIFEST=../lnf.manifest DEFINES=UNICODE _UNICODE \ WINVER=0x0500 _WIN32_WINNT=0x0500 \ diff --git a/win32/lnf.manifest b/win32/lnf.manifest deleted file mode 100644 index ef951b7..0000000 --- a/win32/lnf.manifest +++ /dev/null @@ -1,10 +0,0 @@ - - - - Your application description here. - - - - - - diff --git a/win32/lnf.manifest.in b/win32/lnf.manifest.in new file mode 100644 index 0000000..680b7d5 --- /dev/null +++ b/win32/lnf.manifest.in @@ -0,0 +1,11 @@ + + + + PC-98 sound emulator + + + + + + + diff --git a/win32/main.c b/win32/main.c index 946c7db..f113d06 100644 --- a/win32/main.c +++ b/win32/main.c @@ -774,7 +774,7 @@ int CALLBACK wWinMain(HINSTANCE hinst, HINSTANCE hpinst, if (__builtin_cpu_supports("sse2")) opna_ssg_sinc_calc_func = opna_ssg_sinc_calc_sse2; fft_init_table(); - fmplayer_font_rom_load(&g.font); + about_set_fontrom_loaded(fmplayer_font_rom_load(&g.font)); const wchar_t *argfile = 0; { diff --git a/win32/x86/Makefile b/win32/x86/Makefile index 184d3a4..44d11f6 100644 --- a/win32/x86/Makefile +++ b/win32/x86/Makefile @@ -37,10 +37,13 @@ $(TARGET): $(OBJS) @echo " CC $@" @$(CC) $(CFLAGS) $(SSECFLAGS) -c $< -o $@ -%.o: %.rc $(ICON) +%.o: %.rc $(ICON) $(MANIFEST) @echo " WINDRES $@" @$(WINDRES) -o $@ -i $< +$(MANIFEST): $(MANIFEST).in ../../version.h + sed -e "s/@VER@/$(shell ../../versionprint.c)/g" $< > $@ + $(ICON): $(ICONFILES) icotool -o $@ -c $^ -- cgit v1.2.3