mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-03 04:20:30 +00:00
Revert "revert #1148 as prematurely incorporated"
This reverts commit f946088214.
This commit is contained in:
parent
bd2121b674
commit
7216ba8530
22 changed files with 20385 additions and 1813 deletions
|
|
@ -699,7 +699,8 @@ bool GFont::read(Stream& io_rStream)
|
|||
for(i = 0; i < numSheets; i++)
|
||||
{
|
||||
GBitmap *bmp = new GBitmap;
|
||||
if(!bmp->readBitmap("png", io_rStream))
|
||||
String path = String::ToString("%s/%s %d %d (%s).png", Con::getVariable("$GUI::fontCacheDirectory"), mFaceName.c_str(), mSize, i, getCharSetName(mCharSet));
|
||||
if(!bmp->readBitmap("png", path))
|
||||
{
|
||||
delete bmp;
|
||||
return false;
|
||||
|
|
@ -775,8 +776,11 @@ bool GFont::write(Stream& stream)
|
|||
}
|
||||
|
||||
stream.write(mTextureSheets.size());
|
||||
for(i = 0; i < mTextureSheets.size(); i++)
|
||||
mTextureSheets[i].getBitmap()->writeBitmap("png", stream);
|
||||
for (i = 0; i < mTextureSheets.size(); i++)
|
||||
{
|
||||
String path = String::ToString("%s/%s %d %d (%s).png", Con::getVariable("$GUI::fontCacheDirectory"), mFaceName.c_str(), mSize, i, getCharSetName(mCharSet));
|
||||
mTextureSheets[i].getBitmap()->writeBitmap("png", path);
|
||||
}
|
||||
|
||||
stream.write(mCurX);
|
||||
stream.write(mCurY);
|
||||
|
|
@ -865,20 +869,9 @@ void GFont::exportStrip(const char *fileName, U32 padding, U32 kerning)
|
|||
// Advance.
|
||||
curWidth += mCharInfoList[i].width + kerning + 2*padding;
|
||||
}
|
||||
|
||||
// Write the image!
|
||||
FileStream fs;
|
||||
|
||||
fs.open( fileName, Torque::FS::File::Write );
|
||||
|
||||
if(fs.getStatus() != Stream::Ok)
|
||||
{
|
||||
Con::errorf("GFont::exportStrip - failed to open '%s' for writing.", fileName);
|
||||
return;
|
||||
}
|
||||
|
||||
// Done!
|
||||
gb.writeBitmap("png", fs);
|
||||
gb.writeBitmap("png", fileName);
|
||||
}
|
||||
|
||||
void GFont::setPlatformFont(PlatformFont *inPlatformFont)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue