updated names of many params

This commit is contained in:
hyzboy 2022-02-16 16:54:19 +08:00
parent 16425b5598
commit 3e78da3b45
5 changed files with 14 additions and 16 deletions

View File

@ -16,7 +16,7 @@ using namespace hgl::graph;
constexpr uint32_t SCREEN_WIDTH =1280; constexpr uint32_t SCREEN_WIDTH =1280;
constexpr uint32_t SCREEN_HEIGHT=SCREEN_WIDTH/16*9; constexpr uint32_t SCREEN_HEIGHT=SCREEN_WIDTH/16*9;
constexpr uint CHAR_BITMAP_SIZE=12; //字符尺寸 constexpr uint CHAR_BITMAP_SIZE=16; //字符尺寸
class TestApp:public VulkanApplicationFramework class TestApp:public VulkanApplicationFramework
{ {
@ -156,7 +156,7 @@ private:
tla.line_gap=0.1f; tla.line_gap=0.1f;
tl_engine.SetFont(tile_font->GetFontSource()); tl_engine.SetFont(tile_font->GetFontSource());
tl_engine.SetTLA(&tla); tl_engine.Set(&tla);
tl_engine.SetTextDirection(0); tl_engine.SetTextDirection(0);
tl_engine.SetAlign(TextAlign::Left); tl_engine.SetAlign(TextAlign::Left);
tl_engine.SetMaxWidth(0); tl_engine.SetMaxWidth(0);

View File

@ -34,8 +34,8 @@ public:
GPUPhysicalDevice(VkInstance,VkPhysicalDevice); GPUPhysicalDevice(VkInstance,VkPhysicalDevice);
~GPUPhysicalDevice()=default; ~GPUPhysicalDevice()=default;
operator VkPhysicalDevice(){return physical_device;} operator VkPhysicalDevice() {return physical_device;}
operator const VkPhysicalDevice()const{return physical_device;} operator const VkPhysicalDevice()const {return physical_device;}
const int GetMemoryType(uint32_t,VkMemoryPropertyFlags)const; const int GetMemoryType(uint32_t,VkMemoryPropertyFlags)const;
@ -117,7 +117,6 @@ public:
const VkBool32 SupportGeometryShader ()const{return features.geometryShader;} const VkBool32 SupportGeometryShader ()const{return features.geometryShader;}
const VkBool32 SupportCubeMapArray ()const{return features.imageCubeArray;} const VkBool32 SupportCubeMapArray ()const{return features.imageCubeArray;}
// support != open, so please don't direct use GetFeatures(). // support != open, so please don't direct use GetFeatures().
// open any features in CreateDevice()&SetDeviceFeatures() functions. // open any features in CreateDevice()&SetDeviceFeatures() functions.
const bool SupportMDI ()const const bool SupportMDI ()const

View File

@ -20,10 +20,9 @@ namespace hgl
{ {
bool bold =false; ///<加粗 bool bold =false; ///<加粗
bool italic =false; ///<右斜 bool italic =false; ///<右斜
bool underline =false; ///<下划线
Color4f CharColor; ///<字符颜色 Color4f CharColor; ///<字符颜色
Color4f BackgroundColor; ///<背颜色 Color4f BackgroundColor; ///<背颜色
};//struct CharLayoutAttr };//struct CharLayoutAttr
/** /**
@ -99,8 +98,8 @@ namespace hgl
int draw_chars_count; ///<要绘制字符列表 int draw_chars_count; ///<要绘制字符列表
SortedSets<u32char> alone_chars; ///<不重复字符统计缓冲区 SortedSets<u32char> chars_sets; ///<不重复字符统计缓冲区
TileUVFloatMap alone_chars_uv; ///<所有要绘制字符的uv TileUVFloatMap chars_uv; ///<所有要绘制字符的uv
struct CharDrawAttr struct CharDrawAttr
{ {
@ -156,7 +155,7 @@ namespace hgl
virtual ~TextLayout()=default; virtual ~TextLayout()=default;
void SetTLA (const TextLayoutAttributes *_tla) {if(_tla)memcpy(&tla,_tla,sizeof(TextLayoutAttributes));} void Set (const TextLayoutAttributes *_tla) {if(_tla)hgl_cpy(&tla,_tla);}
void SetFont (FontSource *fs) {if(fs)font_source=fs;} void SetFont (FontSource *fs) {if(fs)font_source=fs;}
void SetTextDirection (const uint8 &td) {tla.text_direction=td;} void SetTextDirection (const uint8 &td) {tla.text_direction=td;}
void SetAlign (const TextAlign &ta) {tla.align=ta;} void SetAlign (const TextAlign &ta) {tla.align=ta;}

View File

@ -20,7 +20,7 @@ VulkanInstance *CreateInstance(const AnsiString &app_name,VKDebugOut *out,Create
app_info.applicationVersion = 1; app_info.applicationVersion = 1;
app_info.pEngineName = "CMGameEngine/ULRE"; app_info.pEngineName = "CMGameEngine/ULRE";
app_info.engineVersion = 1; app_info.engineVersion = 1;
app_info.apiVersion = VK_API_VERSION_1_0; app_info.apiVersion = VK_API_VERSION_1_3;
ext_list.Add(VK_KHR_SURFACE_EXTENSION_NAME); ext_list.Add(VK_KHR_SURFACE_EXTENSION_NAME);
ext_list.Add(HGL_VK_SURFACE_EXTENSION_NAME); //此宏在VKSurfaceExtensionName.h中定义 ext_list.Add(HGL_VK_SURFACE_EXTENSION_NAME); //此宏在VKSurfaceExtensionName.h中定义

View File

@ -58,7 +58,7 @@ namespace hgl
//遍历所有字符,取得每一个字符的基本绘制信息 //遍历所有字符,取得每一个字符的基本绘制信息
{ {
draw_chars_count=0; draw_chars_count=0;
alone_chars.ClearData(); chars_sets.ClearData();
draw_chars_list.ClearData(); draw_chars_list.ClearData();
const T *cp=str; const T *cp=str;
@ -72,7 +72,7 @@ namespace hgl
if(cda->cla->visible) if(cda->cla->visible)
{ {
alone_chars.Add(*cp); //统计所有不重复字符 chars_sets.Add(*cp); //统计所有不重复字符
++draw_chars_count; ++draw_chars_count;
} }
@ -83,10 +83,10 @@ namespace hgl
} }
//注册不重复字符给tile font系统获取所有字符的UV //注册不重复字符给tile font系统获取所有字符的UV
if(!tile_font->Registry(alone_chars_uv,alone_chars.GetData(),alone_chars.GetCount())) if(!tile_font->Registry(chars_uv,chars_sets.GetData(),chars_sets.GetCount()))
{ {
draw_chars_list.ClearData(); draw_chars_list.ClearData();
alone_chars.ClearData(); chars_sets.ClearData();
return(false); return(false);
} }
@ -97,7 +97,7 @@ namespace hgl
for(int i=0;i<str_length;i++) for(int i=0;i<str_length;i++)
{ {
alone_chars_uv.Get((*cda)->cla->attr->ch,(*cda)->uv); chars_uv.Get((*cda)->cla->attr->ch,(*cda)->uv);
++cda; ++cda;
} }