Compare commits

..
4 Commits
Author SHA1 Message Date
kichikuou 065e16a082 Version 2.11.4 2024-05-22 13:38:33 +09:00
kichikuou 3699aa5c2d Windows: Hide menu bar in fullscreen mode
The menu bar is displayed when the mouse is moved to the top of the
screen, like System39.exe's full-screen mode.

This fixes https://github.com/kichikuou/xsystem35-sdl2/issues/53.
2024-05-22 13:37:12 +09:00
kichikuou 20914970c9 Fix text rendering issue in Rance 3 OP
This fixes https://github.com/kichikuou/xsystem35-sdl2/issues/54.
2024-05-22 09:13:09 +09:00
kichikuou 3f2f555aa6 Add a link to SDL issue 2024-05-16 20:55:35 +09:00
13 changed files with 60 additions and 32 deletions
+2 -2
View File
@@ -16,8 +16,8 @@ android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 34
versionCode 21
versionName "2.11.3" + gitRevision()
versionCode 22
versionName "2.11.4" + gitRevision()
externalNativeBuild {
cmake {
arguments "-DANDROID_APP_PLATFORM=android-19", "-DANDROID_STL=c++_static"
+1 -1
View File
@@ -1,5 +1,5 @@
#cmakedefine PACKAGE "@PACKAGE@"
#define VERSION "2.11.3"
#define VERSION "2.11.4"
#cmakedefine CACHE_TOTALSIZE @CACHE_TOTALSIZE@
+1 -1
View File
@@ -72,7 +72,7 @@ void commandCX() {
case 0:
// In Daiakuji, the image after the blending is used as a source image
// for sprite copy (CX 1). SDL's SIMD blending implementation has some
// error (blending #ff00ff and #ff00ff results in #fd00fd), so the
// error (https://github.com/libsdl-org/SDL/issues/3364), so the
// resulting color may not match the colorkey of CX 1. To workaround
// this, specify a small alpha mod so that SDL will use a "slow path"
// that does accurate calculation.
+2 -2
View File
@@ -33,7 +33,7 @@
#include "ags.h"
#include "message.h"
#include "hankaku.h"
#include "hacks.h"
/* MI 用パラメータ */
INPUTSTRING_PARAM mi_param;
@@ -60,7 +60,7 @@ void commandMP() {
char *str;
/* Patched English executable appends num2 spaces instead of truncating */
if (nact->game == GAME_RANCE3_ENG || nact->game == GAME_RANCE4_ENG) {
if (game_id == GAME_RANCE3_ENG || game_id == GAME_RANCE4_ENG) {
str = calloc(strlen(src) + num2 * strlen(fullwidth_blank[nact->encoding]) + 1, 1);
if (NULL == str) {
NOMEMERR();
+2 -1
View File
@@ -26,6 +26,7 @@
#include "xsystem35.h"
#include "scenario.h"
#include "music.h"
#include "hacks.h"
/* ぱにょ〜ん 異常シナリオ対策 */
static boolean dummy_pcm_in_play = FALSE;
@@ -272,7 +273,7 @@ void commandSU() {
}
}
/* 闘神都市II 異常シナリオ対策 */
if (nact->game == GAME_TT2) {
if (game_id == GAME_TT2) {
*var1 = *var2 = 0;
}
+2 -1
View File
@@ -33,6 +33,7 @@
#include "cmd_check.h"
#include "sdl_core.h"
#include "music_cdrom.h"
#include "hacks.h"
unsigned Y3waitFlags = KEYWAIT_CANCELABLE;
@@ -126,7 +127,7 @@ void commandY() {
default:
if (p1 == 1003) {
sys_key_releasewait(SYS35KEY_RET, FALSE);
} else if (nact->game == GAME_RANCE4_V2 && p2 == 1) {
} else if (game_id == GAME_RANCE4_V2 && p2 == 1) {
// Return immediately if any key is pressed.
sysVar[0] = sys_getInputInfo();
if (sysVar[0])
+11 -2
View File
@@ -36,6 +36,7 @@
#include "system.h"
#include "font.h"
#include "sdl_private.h"
#include "hacks.h"
typedef struct {
int size;
@@ -175,7 +176,15 @@ SDL_Rect font_draw_glyph(int x, int y, const char *str_utf8, uint8_t cl) {
if (!fontset)
return r_dst;
if (this.antialiase_on) {
bool antialias = this.antialiase_on;
// The post-effect in Rance 3 opening does not work properly if colors other
// than the specified text color (32) are used.
// https://github.com/kichikuou/xsystem35-sdl2/issues/54
// In Rance 3, text color 32 is only used in the opening.
if ((game_id == GAME_RANCE3 || game_id == GAME_RANCE3_ENG) && cl == 32)
antialias = false;
if (antialias) {
fs = TTF_RenderUTF8_Blended(fontset->id, str_utf8, sdl_col[cl]);
} else {
fs = TTF_RenderUTF8_Solid(fontset->id, str_utf8, sdl_col[cl]);
@@ -190,7 +199,7 @@ SDL_Rect font_draw_glyph(int x, int y, const char *str_utf8, uint8_t cl) {
y -= (TTF_FontHeight(fontset->id) - fontset->size) / 2;
r_dst = (SDL_Rect){x, y, w, h};
if (sdl_dib->format->BitsPerPixel == 8 && this.antialiase_on) {
if (sdl_dib->format->BitsPerPixel == 8 && antialias) {
sdl_drawAntiAlias_8bpp(x, y, fs, cl);
} else {
r_src = (SDL_Rect){0, 0, w, h};
+15 -9
View File
@@ -27,23 +27,27 @@
#define GT_TOSHIN2 "闘神都市Ⅱ for Win95 "
#define GT_RANCE4 "Rance4 -教団の遺産- For Win95 "
#define GT_RANCE4_V2 "RanceⅣ -教団の遺産- for Windows "
#define GT_RANCE3 "Rance3"
#define GT_RANCE3_ENG "Rance3"
#define GT_RANCE4_ENG "Rance4 -Legacy of the Sect- For Win95 "
/* defined by cmdy.c */
extern boolean Y3waitFlags;
enum gameId game_id;
bool daiakuji_cx_hack;
void enable_hack_by_gameid(const char *gameid) {
if (!strcmp(gameid, "toushin2"))
nact->game = GAME_TT2;
game_id = GAME_TT2;
else if (!strcmp(gameid, "rance3"))
game_id = GAME_RANCE3;
else if (!strcmp(gameid, "rance3_eng"))
nact->game = GAME_RANCE3_ENG;
game_id = GAME_RANCE3_ENG;
else if (!strcmp(gameid, "rance4_eng"))
nact->game = GAME_RANCE4_ENG;
game_id = GAME_RANCE4_ENG;
else if (!strcmp(gameid, "rance4_v2"))
nact->game = GAME_RANCE4_V2;
game_id = GAME_RANCE4_V2;
else
sys_error("Unknown game id \"%s\"", gameid);
}
@@ -52,15 +56,17 @@ void enable_hack_by_title(const char *title_utf8) {
if (!strcmp(title_utf8, GT_RANCE4))
Y3waitFlags = KEYWAIT_NONCANCELABLE;
if (nact->game != GAME_UNKNOWN)
if (game_id != GAME_UNKNOWN)
return;
if (!strcmp(title_utf8, GT_TOSHIN2))
nact->game = GAME_TT2;
game_id = GAME_TT2;
else if (!strcmp(title_utf8, GT_RANCE4_V2))
nact->game = GAME_RANCE4_V2;
game_id = GAME_RANCE4_V2;
else if (!strcmp(title_utf8, GT_RANCE3))
game_id = GAME_RANCE3;
else if (!strcmp(title_utf8, GT_RANCE3_ENG))
nact->game = GAME_RANCE3_ENG;
game_id = GAME_RANCE3_ENG;
else if (!strcmp(title_utf8, GT_RANCE4_ENG))
nact->game = GAME_RANCE4_ENG;
game_id = GAME_RANCE4_ENG;
}
+3
View File
@@ -25,11 +25,14 @@
enum gameId {
GAME_UNKNOWN = 0,
GAME_TT2,
GAME_RANCE3,
GAME_RANCE3_ENG,
GAME_RANCE4_ENG,
GAME_RANCE4_V2,
};
extern enum gameId game_id;
void enable_hack_by_gameid(const char *gameid);
void enable_hack_by_title(const char *game_title_utf8);
+3 -2
View File
@@ -59,8 +59,9 @@ extern void menu_setSkipState(boolean enabled, boolean activated);
#ifdef _WIN32
struct SDL_SysWMmsg;
extern void win_menu_init(void);
extern void win_menu_onsyswmevent(struct SDL_SysWMmsg* msg);
void win_menu_init(void);
void win_menu_onSysWMEvent(struct SDL_SysWMmsg* msg);
void win_menu_onMouseMotion(int x, int y);
#endif
#endif /* !__MENULL */
-3
View File
@@ -110,9 +110,6 @@ typedef struct {
int patch_emen; /* see patch_emen command */
int patch_g0; /* see patch g0 command */
// For game-specific hacks.
enum gameId game;
/* ain 関連 */
S39AIN ain;
+6 -2
View File
@@ -40,6 +40,7 @@
#include "menu.h"
#include "input.h"
#include "msgskip.h"
#include "hacks.h"
static void sdl_getEvent(void);
static void keyEventProsess(SDL_KeyboardEvent *e, boolean pressed);
@@ -259,7 +260,7 @@ void sdl_handle_event(SDL_Event *e) {
break;
#ifdef _WIN32
case SDL_SYSWMEVENT:
win_menu_onsyswmevent(e->syswm.msg);
win_menu_onSysWMEvent(e->syswm.msg);
break;
#endif
case SDL_APP_DIDENTERFOREGROUND:
@@ -281,6 +282,9 @@ void sdl_handle_event(SDL_Event *e) {
break;
case SDL_MOUSEMOTION:
sdl_setCursorInternalLocation(e->motion.x, e->motion.y);
#ifdef _WIN32
win_menu_onMouseMotion(e->motion.x, e->motion.y);
#endif
break;
case SDL_MOUSEWHEEL:
@@ -445,7 +449,7 @@ static void sdl_getEvent(void) {
cmd_count_of_prev_input = nact->cmd_count;
} else if (nact->cmd_count != cmd_count_of_prev_input) {
nact->wait_vsync = TRUE;
if (nact->game == GAME_RANCE4_V2)
if (game_id == GAME_RANCE4_V2)
rance4v2_hack();
}
}
+12 -6
View File
@@ -29,6 +29,8 @@
#include "resources.h"
#include "msgskip.h"
static HMENU hmenu;
static HWND get_hwnd(SDL_Window *window) {
SDL_SysWMinfo info;
SDL_VERSION(&info.version);
@@ -60,9 +62,6 @@ static void saveScreenshot(void) {
}
static bool toggle_menu_item(UINT id, bool *checked_out) {
HWND hwnd = get_hwnd(sdl_window);
HMENU hmenu = GetMenu(hwnd);
MENUITEMINFO menuitem = {
.cbSize = sizeof(MENUITEMINFO),
.fMask = MIIM_STATE,
@@ -82,7 +81,7 @@ static bool toggle_menu_item(UINT id, bool *checked_out) {
void win_menu_init(void) {
HINSTANCE hinst = (HINSTANCE)GetModuleHandle(NULL);
HMENU hmenu = LoadMenu(hinst, MAKEINTRESOURCE(IDR_MENU1));
hmenu = LoadMenu(hinst, MAKEINTRESOURCE(IDR_MENU1));
SetMenu(get_hwnd(sdl_window), hmenu);
SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
// Let SDL recalc the window size, taking menu height into account.
@@ -90,7 +89,7 @@ void win_menu_init(void) {
CheckMenuItem(hmenu, ID_OPTION_MOUSE_MOVE, MF_BYCOMMAND | MFS_CHECKED);
}
void win_menu_onsyswmevent(SDL_SysWMmsg* msg) {
void win_menu_onSysWMEvent(SDL_SysWMmsg* msg) {
bool checked;
switch (msg->msg.win.msg) {
case WM_COMMAND:
@@ -106,9 +105,11 @@ void win_menu_onsyswmevent(SDL_SysWMmsg* msg) {
break;
case ID_SCREEN_WINDOW:
sdl_setFullscreen(FALSE);
SetMenu(get_hwnd(sdl_window), hmenu);
break;
case ID_SCREEN_FULL:
sdl_setFullscreen(TRUE);
SetMenu(get_hwnd(sdl_window), NULL);
break;
case ID_SCREEN_INTEGER_SCALING:
if (toggle_menu_item(ID_SCREEN_INTEGER_SCALING, &checked))
@@ -126,9 +127,14 @@ void win_menu_onsyswmevent(SDL_SysWMmsg* msg) {
}
}
void win_menu_onMouseMotion(int x, int y) {
if (!sdl_isFullscreen())
return;
SetMenu(get_hwnd(sdl_window), y > 0 ? NULL : hmenu);
}
void menu_setSkipState(boolean enabled, boolean activated) {
HWND hwnd = get_hwnd(sdl_window);
HMENU hmenu = GetMenu(hwnd);
EnableMenuItem(hmenu, ID_MSGSKIP, enabled ? MF_ENABLED : MF_GRAYED);