add TileFont/FontManage

This commit is contained in:
hyzboy 2020-07-01 20:36:49 +08:00
parent da0fba1760
commit 592a9343f4
5 changed files with 46 additions and 6 deletions

2
CMCore

@ -1 +1 @@
Subproject commit bb66ce1f5a4b1f9dcbe61758813ffdd34ae7c1e3
Subproject commit 2e076881513560dd8111d3f101222dc2fd0b333e

View File

@ -0,0 +1,26 @@
#ifndef HGL_GRAPH_FONT_MANAGE_INCLUDE
#define HGL_GRAPH_FONT_MANAGE_INCLUDE
#include<hgl/graph/font/Font.h>
#include<hgl/type/Map.h>
namespace hgl
{
namespace graph
{
struct FontConfig
{
};//
/**
* <br>
* 使
*/
class FontManage
{
MapObject<Font,FontSource> sources;
TileFont *
};//class FontManage
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_FONT_MANAGE_INCLUDE

View File

@ -3,20 +3,34 @@
#include<hgl/graph/TileData.h>
#include<hgl/graph/font/FontSource.h>
#include<hgl/type/UnicodeBlocks.h>
namespace hgl
{
namespace graph
{
/**
* Tile字符管理<br>
* unicode块, unicode块只能对应一个字体数据来源
*/
class TileFont
{
FontSource *source;
using FontSourcePointer=FontSource *;
using FontSourceTable=FontSourcePointer[(size_t)UnicodeBlock::RANGE_SIZE];
FontSourceTable source_map;
TileData *tile_data;
public:
TileFont()
{
hgl_zero(source_map);
}
};//class TileFont
TileFont *CreateTileFont(const Font &,const int=-1);
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_TILE_FONT_INCLUDE

View File

@ -157,7 +157,7 @@ Texture2D *CreateTextureFromFile(Device *device,const OSString &filename)
return tex;
}
}
/*
struct Texture2DData
{
uint32 width;
@ -219,5 +219,5 @@ void *LoadTextureFromFile(const OSString &filename)
delete buf;
return tex;
}
}
}*/
VK_NAMESPACE_END

View File

@ -95,6 +95,6 @@ TileData *Device::CreateTileData(const VkFormat format,const uint width,const ui
else
return(nullptr);
return(new TileData(tex,width,height));
return(new TileData(this,tex,width,height));
}
VK_NAMESPACE_END