convert file codes to UTF8-BOM

This commit is contained in:
hyzboy 2020-07-29 01:00:25 +08:00
parent 38d810cd6c
commit 8cc35599ad
13 changed files with 129 additions and 132 deletions

3
.gitmodules vendored
View File

@ -1,9 +1,6 @@
[submodule "3rdpty/MathGeoLib"]
path = 3rdpty/MathGeoLib
url = https://github.com/juj/MathGeoLib.git
[submodule "3rdpty/SPIRV-Cross"]
path = 3rdpty/SPIRV-Cross
url = https://github.com/KhronosGroup/SPIRV-Cross
[submodule "3rdpty/jsoncpp"]
path = 3rdpty/jsoncpp
url = https://github.com/open-source-parsers/jsoncpp

@ -1 +1 @@
Subproject commit 7eb1cafe575cc305a9d09fce66494a5445da5305
Subproject commit b2676f3e15b059069611a20a4b998b2387dbe9c2

View File

@ -1,4 +1,4 @@
#ifndef HGL_GRAPH_RENDERABLE_CREATER_INCLUDE
#ifndef HGL_GRAPH_RENDERABLE_CREATER_INCLUDE
#define HGL_GRAPH_RENDERABLE_CREATER_INCLUDE
#include<hgl/graph/SceneDB.h>

View File

@ -1,4 +1,4 @@
#ifndef HGL_GRAPH_TEXTURE_LOADER_INCLUDE
#ifndef HGL_GRAPH_TEXTURE_LOADER_INCLUDE
#define HGL_GRAPH_TEXTURE_LOADER_INCLUDE
#include<hgl/io/InputStream.h>

View File

@ -1,36 +1,36 @@
#ifndef HGL_GRAPH_FONT_INCLUDE
#ifndef HGL_GRAPH_FONT_INCLUDE
#define HGL_GRAPH_FONT_INCLUDE
#include<hgl/type/DataType.h>
namespace hgl
{
namespace graph
{
constexpr size_t MAX_FONT_NAME_LENGTH=128;
namespace graph
{
constexpr size_t MAX_FONT_NAME_LENGTH=128;
/**
*
*/
struct Font
{
os_char name[MAX_FONT_NAME_LENGTH]; ///<字体名称
/**
*
*/
struct Font
{
os_char name[MAX_FONT_NAME_LENGTH]; ///<字体名称
int width; ///<宽度
int height; ///<高度
int width; ///<宽度
int height; ///<高度
bool bold; ///<加粗
bool italic; ///<右斜
bool bold; ///<加粗
bool italic; ///<右斜
bool anti; ///<反矩齿
bool anti; ///<反矩齿
public:
public:
Font();
Font(const os_char *,int,int,bool,bool,bool=true);
Font();
Font(const os_char *,int,int,bool,bool,bool=true);
CompOperatorMemcmp(const Font &); ///<比较操作符重载
};//struct Font
}//namespace graph
CompOperatorMemcmp(const Font &); ///<比较操作符重载
};//struct Font
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_FONT_INCLUDE

View File

@ -1,4 +1,4 @@
#ifndef HGL_GRAPH_FONT_SOURCE_INCLUDE
#ifndef HGL_GRAPH_FONT_SOURCE_INCLUDE
#define HGL_GRAPH_FONT_SOURCE_INCLUDE
#include<hgl/type/StrChar.h>

View File

@ -1,4 +1,4 @@
#ifndef HGL_GRAPH_TEXT_LAYOUT_INCLUDE
#ifndef HGL_GRAPH_TEXT_LAYOUT_INCLUDE
#define HGL_GRAPH_TEXT_LAYOUT_INCLUDE
#include<hgl/type/StringList.h>

View File

@ -1,4 +1,4 @@
#ifndef HGL_GRAPH_TILE_FONT_INCLUDE
#ifndef HGL_GRAPH_TILE_FONT_INCLUDE
#define HGL_GRAPH_TILE_FONT_INCLUDE
#include<hgl/graph/TileData.h>

View File

@ -1,4 +1,4 @@
#pragma once
#pragma once
#include<hgl/type/BaseString.h>
#include<hgl/type/List.h>
#include<hgl/type/StringList.h>

View File

@ -1,9 +1,9 @@
#include<hgl/graph/font/FontSource.h>
#include<hgl/graph/font/FontSource.h>
namespace hgl
{
namespace graph
{
FontSource *CreateFontSource(const Font &f); //各平台独立提供
FontSource *CreateFontSource(const Font &f); //各平台独立提供
static MapObject<Font,FontSource> FontStorage;

View File

@ -1,128 +1,128 @@
#include<hgl/graph/font/FontSource.h>
#include<hgl/graph/font/FontSource.h>
namespace hgl
{
namespace graph
{
namespace graph
{
FontSourceMulti::FontSourceMulti(FontSource *fs)
{
default_source=fs;
{
default_source=fs;
if(fs)
fs->RefAcquire(this);
if(fs)
fs->RefAcquire(this);
max_char_height=fs->GetCharHeight();
}
max_char_height=fs->GetCharHeight();
}
FontSourceMulti::~FontSourceMulti()
{
if(default_source)
default_source->RefRelease(this);
}
FontSourceMulti::~FontSourceMulti()
{
if(default_source)
default_source->RefRelease(this);
}
void FontSourceMulti::Add(UnicodeBlock ub,FontSource *fs)
{
if(ub<UnicodeBlock::BEGIN_RANGE
||ub>UnicodeBlock::END_RANGE
||!fs
||fs==default_source)return;
void FontSourceMulti::Add(UnicodeBlock ub,FontSource *fs)
{
if(ub<UnicodeBlock::BEGIN_RANGE
||ub>UnicodeBlock::END_RANGE
||!fs
||fs==default_source)return;
if(fs->GetCharHeight()>max_char_height)
max_char_height=fs->GetCharHeight();
if(fs->GetCharHeight()>max_char_height)
max_char_height=fs->GetCharHeight();
source_map.Update(ub,fs);
}
source_map.Update(ub,fs);
}
void FontSourceMulti::RefreshMaxCharHeight()
{
max_char_height=0;
void FontSourceMulti::RefreshMaxCharHeight()
{
max_char_height=0;
const int count=source_map.GetCount();
const int count=source_map.GetCount();
auto **fsp=source_map.GetDataList();
auto **fsp=source_map.GetDataList();
for(int i=0;i<count;i++)
{
if((*fsp)->right->GetCharHeight()>max_char_height)
max_char_height=(*fsp)->right->GetCharHeight();
for(int i=0;i<count;i++)
{
if((*fsp)->right->GetCharHeight()>max_char_height)
max_char_height=(*fsp)->right->GetCharHeight();
++fsp;
}
}
++fsp;
}
}
void FontSourceMulti::Remove(UnicodeBlock ub)
{
FontSourcePointer fsp;
void FontSourceMulti::Remove(UnicodeBlock ub)
{
FontSourcePointer fsp;
if(source_map.Get(ub,fsp))
{
const bool refresh=(fsp->GetCharHeight()==max_char_height);
if(source_map.Get(ub,fsp))
{
const bool refresh=(fsp->GetCharHeight()==max_char_height);
fsp->RefRelease(this);
source_map.DeleteByKey(ub);
fsp->RefRelease(this);
source_map.DeleteByKey(ub);
if(refresh)
RefreshMaxCharHeight();
}
}
if(refresh)
RefreshMaxCharHeight();
}
}
void FontSourceMulti::Remove(FontSource *fs)
{
if(!fs)return;
if(fs==default_source)return;
void FontSourceMulti::Remove(FontSource *fs)
{
if(!fs)return;
if(fs==default_source)return;
if(source_map.ValueExist(fs))
{
const bool refresh=(fs->GetCharHeight()==max_char_height);
if(source_map.ValueExist(fs))
{
const bool refresh=(fs->GetCharHeight()==max_char_height);
fs->RefRelease(this);
source_map.DeleteByValue(fs);
fs->RefRelease(this);
source_map.DeleteByValue(fs);
if(refresh)
RefreshMaxCharHeight();
}
}
if(refresh)
RefreshMaxCharHeight();
}
}
FontSource *FontSourceMulti::GetFontSource(const u32char &ch)
{
if(hgl::isspace(ch))return(nullptr); //不能显示的数据或是空格
FontSource *FontSourceMulti::GetFontSource(const u32char &ch)
{
if(hgl::isspace(ch))return(nullptr); //不能显示的数据或是空格
const auto count=source_map.GetCount();
const auto count=source_map.GetCount();
if(count>0)
{
auto **fsp=source_map.GetDataList();
if(count>0)
{
auto **fsp=source_map.GetDataList();
for(int i=0;i<count;i++)
{
if(IsInUnicodeBlock((*fsp)->left,ch))
return (*fsp)->right;
for(int i=0;i<count;i++)
{
if(IsInUnicodeBlock((*fsp)->left,ch))
return (*fsp)->right;
++fsp;
}
}
++fsp;
}
}
return default_source;
}
return default_source;
}
FontBitmap *FontSourceMulti::GetCharBitmap(const u32char &ch)
{
FontSource *s=GetFontSource(ch);
FontBitmap *FontSourceMulti::GetCharBitmap(const u32char &ch)
{
FontSource *s=GetFontSource(ch);
if(!s)
return(nullptr);
if(!s)
return(nullptr);
return s->GetCharBitmap(ch);
}
return s->GetCharBitmap(ch);
}
const bool FontSourceMulti::GetCharMetrics(CharMetricsInfo &cmi,const u32char &ch)
{
FontSource *s=GetFontSource(ch);
const bool FontSourceMulti::GetCharMetrics(CharMetricsInfo &cmi,const u32char &ch)
{
FontSource *s=GetFontSource(ch);
if(!s)
return(0);
if(!s)
return(0);
return s->GetCharMetrics(cmi,ch);
}
}//namespace graph
return s->GetCharMetrics(cmi,ch);
}
}//namespace graph
}//namespace hgl

View File

@ -1,4 +1,4 @@
#include<hgl/graph/font/FontSource.h>
#include<hgl/graph/font/FontSource.h>
namespace hgl
{

View File

@ -1,4 +1,4 @@
#include<hgl/graph/font/TileFont.h>
#include<hgl/graph/font/TileFont.h>
#include<hgl/graph/vulkan/VKDevice.h>
#include<hgl/graph/vulkan/VKFormat.h>
@ -6,7 +6,7 @@ namespace hgl
{
namespace graph
{
FontSource *AcquireFontSource(const Font &f);
FontSource *AcquireFontSource(const Font &f);
TileFont::TileFont(TileData *td,FontSource *fs)
{