mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-07 06:18:14 +03:00
Add compatibility hack for English Daibanchou
Gpx2Plus.CopyStretchReduceAMap behaves differently in the English version. Fixes an issue with text being squashed horizontally on the regional phase menus.
This commit is contained in:
@@ -63,6 +63,7 @@ void get_time(int *hour, int *min, int *sec, int *ms);
|
||||
#define XSYS4_DATA_DIR "/usr/local/share/xsystem4"
|
||||
#endif
|
||||
|
||||
extern bool game_daibanchou_en;
|
||||
extern bool game_rance02_mg;
|
||||
|
||||
#endif /* XSYSTEM4_H */
|
||||
|
||||
+21
-3
@@ -23,12 +23,14 @@
|
||||
#include "system4/buffer.h"
|
||||
#include "system4/instructions.h"
|
||||
#include "system4/string.h"
|
||||
#include "system4/utfsjis.h"
|
||||
|
||||
#include "gfx/gfx.h"
|
||||
#include "xsystem4.h"
|
||||
|
||||
#include "hll/hll.h"
|
||||
|
||||
bool game_daibanchou_en = false;
|
||||
bool game_rance02_mg = false;
|
||||
|
||||
static void write_instruction0(struct buffer *out, enum opcode op)
|
||||
@@ -105,9 +107,25 @@ static void apply_rance02_hacks(struct ain *ain)
|
||||
game_rance02_mg = true;
|
||||
}
|
||||
|
||||
void apply_game_specific_hacks(struct ain *ain)
|
||||
// Daibanchou (English fan translation)
|
||||
// ------------------------------------
|
||||
// Gpx2Plus.CopyStretchReduceAMap behaves differently in order to work around
|
||||
// text rendering issues caused by how the game calculates text width in
|
||||
// StructRegionalSelect::DrawMenuItem.
|
||||
static void apply_daibanchou_hacks(struct ain *ain)
|
||||
{
|
||||
if (!strcmp(config.game_name, "Rance 02")) {
|
||||
apply_rance02_hacks(ain);
|
||||
if (ain->nr_strings > 2 && !strcmp(ain->strings[2]->text, "Seijou Academy")) {
|
||||
game_daibanchou_en = true;
|
||||
}
|
||||
}
|
||||
|
||||
void apply_game_specific_hacks(struct ain *ain)
|
||||
{
|
||||
char *game_name = sjis2utf(config.game_name, 0);
|
||||
if (!strcmp(game_name, "大番長")) {
|
||||
apply_daibanchou_hacks(ain);
|
||||
} else if (!strcmp(game_name, "Rance 02")) {
|
||||
apply_rance02_hacks(ain);
|
||||
}
|
||||
free(game_name);
|
||||
}
|
||||
|
||||
@@ -353,6 +353,8 @@ static void Gpx2Plus_CopyStretchReduce(int destSurface, int dx, int dy, int dWid
|
||||
|
||||
static void Gpx2Plus_CopyStretchReduceAMap(int destSurface, int dx, int dy, int dWidth, int dHeight, int srcSurface, int sx, int sy, int sWidth, int sHeight)
|
||||
{
|
||||
if (game_daibanchou_en)
|
||||
sWidth /= 2;
|
||||
struct texture *dst = get_texture(destSurface);
|
||||
struct texture *src = get_texture(srcSurface);
|
||||
if (!dst || !src)
|
||||
|
||||
Reference in New Issue
Block a user