mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
STBImage
STB used for loading and writing images.
This commit is contained in:
parent
d671f2611e
commit
108ba34c08
21 changed files with 20355 additions and 1737 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);
|
||||
|
|
@ -878,7 +882,7 @@ void GFont::exportStrip(const char *fileName, U32 padding, U32 kerning)
|
|||
}
|
||||
|
||||
// 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