Don't add the index offset for Asian fonts if no pot files are given.

This commit is contained in:
hiker 2014-06-11 08:18:35 +10:00
parent e55d976aa2
commit a5c7b295be

View File

@ -9,6 +9,10 @@ const int fontsizes[] = {4,6,8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,56,68,72
char bUsed[0x10000]={0};
/** True if pot files where given, which indicates that Asian fonts
* are to be created, and an offset needs to be used for the index. */
bool has_pot_files = false;
inline u32 getTextureSizeFromSurfaceSize(u32 size)
{
u32 ts = 0x01;
@ -19,6 +23,7 @@ inline u32 getTextureSizeFromSurfaceSize(u32 size)
}
bool LoadPoFiles(const char* sListFileName){
has_pot_files = true;
char s[1024];
std::ifstream fin(sListFileName);
if(!fin){
@ -762,7 +767,8 @@ bool CFontTool::saveBitmapFont(const c8 *filename, const c8* format)
writer->writeLineBreak();
// write images and link to them
u32 offset_for_asian_fonts=100;
// Only use the offset if Asian fonts are created.
u32 offset_for_asian_fonts=has_pot_files ? 100 : 0;
for (u32 i=0; i<currentImages.size(); ++i)
{
imagename = filename;