- extension/src/{port,platform,codepage} -> src/; native_render -> src/host
(+ dxt, shaders/); libgr2 -> src/gr2; extension/third_party -> third_party
- extension/tests -> tests/port, libgr2/tests -> tests/gr2
- android-native -> android (build.sh, push-client.sh moved in)
- script -> scripts; tools/40250 -> tools/server; oracle -> tools/granny-oracle;
perf tools -> tools/perf
- all build trees under build/ (native, release, android, port-gate)
- xrender:: CMake aliases -> mt::; port-map ledger impl paths rewritten
No code changes. ctest 15/15, port_gate macos+android PASS, port_map check 0 errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
103 lines
1.8 KiB
C++
103 lines
1.8 KiB
C++
// 40250 EterLib/GrpText.cpp, verbatim.
|
|
#include "EterLib/StdAfx.h"
|
|
#include "EterBase/Utils.h"
|
|
#include "EterLib/GrpText.h"
|
|
|
|
CGraphicText::CGraphicText(const char* c_szFileName) : CResource(c_szFileName)
|
|
{
|
|
}
|
|
|
|
CGraphicText::~CGraphicText()
|
|
{
|
|
}
|
|
|
|
bool CGraphicText::CreateDeviceObjects()
|
|
{
|
|
return m_fontTexture.CreateDeviceObjects();
|
|
}
|
|
|
|
void CGraphicText::DestroyDeviceObjects()
|
|
{
|
|
m_fontTexture.DestroyDeviceObjects();
|
|
}
|
|
|
|
CGraphicFontTexture* CGraphicText::GetFontTexturePointer()
|
|
{
|
|
return &m_fontTexture;
|
|
}
|
|
|
|
CGraphicText::TType CGraphicText::Type()
|
|
{
|
|
static TType s_type = StringToType("CGraphicText");
|
|
return s_type;
|
|
}
|
|
|
|
bool CGraphicText::OnLoad(int /*iSize*/, const void* /*c_pvBuf*/)
|
|
{
|
|
static char strName[32];
|
|
int size;
|
|
bool bItalic = false;
|
|
|
|
// format
|
|
// 굴림.fnt "굴림" 폰트 기본 사이즈 12 로 로딩
|
|
// 굴림:18.fnt "굴림" 폰트 사이즈 18 로 로딩
|
|
// 굴림:14i.fnt "굴림" 폰트 사이즈 14 & 이탤릭으로 로딩
|
|
const char * p = strrchr(GetFileName(), ':');
|
|
|
|
if (p)
|
|
{
|
|
strncpy(strName, GetFileName(), MIN(31, p - GetFileName()));
|
|
++p;
|
|
|
|
static char num[8];
|
|
|
|
int i = 0;
|
|
while (*p && isdigit(*p))
|
|
{
|
|
num[i++] = *(p++);
|
|
}
|
|
|
|
num[i] = '\0';
|
|
if(*p == 'i')
|
|
bItalic = true;
|
|
size = atoi(num);
|
|
}
|
|
else
|
|
{
|
|
p = strrchr(GetFileName(), '.');
|
|
|
|
if (!p)
|
|
{
|
|
assert(!"CGraphicText::OnLoadFromFile there is no extension (ie: .fnt)");
|
|
strName[0] = '\0';
|
|
}
|
|
else
|
|
strncpy(strName, GetFileName(), MIN(31, p - GetFileName()));
|
|
|
|
size = 12;
|
|
}
|
|
|
|
if (!m_fontTexture.Create(strName, size, bItalic))
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
void CGraphicText::OnClear()
|
|
{
|
|
m_fontTexture.Destroy();
|
|
}
|
|
|
|
bool CGraphicText::OnIsEmpty() const
|
|
{
|
|
return m_fontTexture.IsEmpty();
|
|
}
|
|
|
|
bool CGraphicText::OnIsType(TType type)
|
|
{
|
|
if (CGraphicText::Type() == type)
|
|
return true;
|
|
|
|
return CResource::OnIsType(type);
|
|
}
|