Added a bugfix for font creation
Fixes Japanese builds using the wrong charset on non-Japanese Windows installations, and fixed the font using antialiasing, causing it to clash with the game's colour-keying.
This commit is contained in:
parent
ea489f9063
commit
0faf06224f
1 changed files with 18 additions and 2 deletions
20
src/Draw.cpp
20
src/Draw.cpp
|
@ -829,10 +829,26 @@ void InitTextObject(const char *name)
|
||||||
|
|
||||||
// The game uses DEFAULT_CHARSET when it should have used SHIFTJIS_CHARSET.
|
// The game uses DEFAULT_CHARSET when it should have used SHIFTJIS_CHARSET.
|
||||||
// This breaks the Japanese text on English Windows installations.
|
// This breaks the Japanese text on English Windows installations.
|
||||||
font = CreateFontA(height, width, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH | FF_DONTCARE, name);
|
|
||||||
|
// Also, the game uses DEFAULT_QUALITY instead of NONANTIALIASED_QUALITY,
|
||||||
|
// causing font antialiasing to blend with the colour-key, giving text ab
|
||||||
|
// ugly black outline.
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
#define QUALITY NONANTIALIASED_QUALITY
|
||||||
|
#ifdef JAPANESE
|
||||||
|
#define CHARSET SHIFTJIS_CHARSET
|
||||||
|
#else
|
||||||
|
#define CHARSET DEFAULT_CHARSET
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define QUALITY DEFAULT_QUALITY
|
||||||
|
#define CHARSET DEFAULT_CHARSET
|
||||||
|
#endif
|
||||||
|
|
||||||
|
font = CreateFontA(height, width, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, QUALITY, FIXED_PITCH | FF_DONTCARE, name);
|
||||||
|
|
||||||
if (font == NULL)
|
if (font == NULL)
|
||||||
font = CreateFontA(height, width, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH | FF_DONTCARE, NULL);
|
font = CreateFontA(height, width, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, QUALITY, FIXED_PITCH | FF_DONTCARE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PutText(int x, int y, const char *text, unsigned long color)
|
void PutText(int x, int y, const char *text, unsigned long color)
|
||||||
|
|
Loading…
Add table
Reference in a new issue