From 8cc35599ad6cbc9dae8abe8a8e59cd9eaca49669 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Wed, 29 Jul 2020 01:00:25 +0800 Subject: [PATCH] convert file codes to UTF8-BOM --- .gitmodules | 3 - CMCMakeModule | 2 +- inc/hgl/graph/RenderableCreater.h | 2 +- inc/hgl/graph/TextureLoader.h | 2 +- inc/hgl/graph/font/Font.h | 44 +++--- inc/hgl/graph/font/FontSource.h | 2 +- inc/hgl/graph/font/TextLayout.h | 2 +- inc/hgl/graph/font/TileFont.h | 2 +- inc/hgl/graph/shader/ShaderResource.h | 2 +- src/SceneGraph/font/FontSourceManage.cpp | 4 +- src/SceneGraph/font/FontSourceMulti.cpp | 190 +++++++++++------------ src/SceneGraph/font/FontSourceSingle.cpp | 2 +- src/SceneGraph/font/TileFont.cpp | 4 +- 13 files changed, 129 insertions(+), 132 deletions(-) diff --git a/.gitmodules b/.gitmodules index 5bbf455f..0d8040fe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/CMCMakeModule b/CMCMakeModule index 7eb1cafe..b2676f3e 160000 --- a/CMCMakeModule +++ b/CMCMakeModule @@ -1 +1 @@ -Subproject commit 7eb1cafe575cc305a9d09fce66494a5445da5305 +Subproject commit b2676f3e15b059069611a20a4b998b2387dbe9c2 diff --git a/inc/hgl/graph/RenderableCreater.h b/inc/hgl/graph/RenderableCreater.h index f23edbff..d187cf40 100644 --- a/inc/hgl/graph/RenderableCreater.h +++ b/inc/hgl/graph/RenderableCreater.h @@ -1,4 +1,4 @@ -#ifndef HGL_GRAPH_RENDERABLE_CREATER_INCLUDE +#ifndef HGL_GRAPH_RENDERABLE_CREATER_INCLUDE #define HGL_GRAPH_RENDERABLE_CREATER_INCLUDE #include diff --git a/inc/hgl/graph/TextureLoader.h b/inc/hgl/graph/TextureLoader.h index b4182613..45e9690d 100644 --- a/inc/hgl/graph/TextureLoader.h +++ b/inc/hgl/graph/TextureLoader.h @@ -1,4 +1,4 @@ -#ifndef HGL_GRAPH_TEXTURE_LOADER_INCLUDE +#ifndef HGL_GRAPH_TEXTURE_LOADER_INCLUDE #define HGL_GRAPH_TEXTURE_LOADER_INCLUDE #include diff --git a/inc/hgl/graph/font/Font.h b/inc/hgl/graph/font/Font.h index be5b9e57..6b9aa7cd 100644 --- a/inc/hgl/graph/font/Font.h +++ b/inc/hgl/graph/font/Font.h @@ -1,36 +1,36 @@ -#ifndef HGL_GRAPH_FONT_INCLUDE +#ifndef HGL_GRAPH_FONT_INCLUDE #define HGL_GRAPH_FONT_INCLUDE #include namespace hgl { - namespace graph - { - constexpr size_t MAX_FONT_NAME_LENGTH=128; - - /** - * 字体信息 - */ - struct Font - { - os_char name[MAX_FONT_NAME_LENGTH]; ///<字体名称 + namespace graph + { + constexpr size_t MAX_FONT_NAME_LENGTH=128; + + /** + * 字体信息 + */ + 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 \ No newline at end of file diff --git a/inc/hgl/graph/font/FontSource.h b/inc/hgl/graph/font/FontSource.h index 9a1c3911..81748e70 100644 --- a/inc/hgl/graph/font/FontSource.h +++ b/inc/hgl/graph/font/FontSource.h @@ -1,4 +1,4 @@ -#ifndef HGL_GRAPH_FONT_SOURCE_INCLUDE +#ifndef HGL_GRAPH_FONT_SOURCE_INCLUDE #define HGL_GRAPH_FONT_SOURCE_INCLUDE #include diff --git a/inc/hgl/graph/font/TextLayout.h b/inc/hgl/graph/font/TextLayout.h index 288eea0b..4e1c9d84 100644 --- a/inc/hgl/graph/font/TextLayout.h +++ b/inc/hgl/graph/font/TextLayout.h @@ -1,4 +1,4 @@ -#ifndef HGL_GRAPH_TEXT_LAYOUT_INCLUDE +#ifndef HGL_GRAPH_TEXT_LAYOUT_INCLUDE #define HGL_GRAPH_TEXT_LAYOUT_INCLUDE #include diff --git a/inc/hgl/graph/font/TileFont.h b/inc/hgl/graph/font/TileFont.h index 2c2455e3..5637b233 100644 --- a/inc/hgl/graph/font/TileFont.h +++ b/inc/hgl/graph/font/TileFont.h @@ -1,4 +1,4 @@ -#ifndef HGL_GRAPH_TILE_FONT_INCLUDE +#ifndef HGL_GRAPH_TILE_FONT_INCLUDE #define HGL_GRAPH_TILE_FONT_INCLUDE #include diff --git a/inc/hgl/graph/shader/ShaderResource.h b/inc/hgl/graph/shader/ShaderResource.h index 29871d28..a9df38ba 100644 --- a/inc/hgl/graph/shader/ShaderResource.h +++ b/inc/hgl/graph/shader/ShaderResource.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include #include #include diff --git a/src/SceneGraph/font/FontSourceManage.cpp b/src/SceneGraph/font/FontSourceManage.cpp index 08deea25..f2f3ca0c 100644 --- a/src/SceneGraph/font/FontSourceManage.cpp +++ b/src/SceneGraph/font/FontSourceManage.cpp @@ -1,9 +1,9 @@ -#include +#include namespace hgl { namespace graph { - FontSource *CreateFontSource(const Font &f); //各平台独立提供 + FontSource *CreateFontSource(const Font &f); //各平台独立提供 static MapObject FontStorage; diff --git a/src/SceneGraph/font/FontSourceMulti.cpp b/src/SceneGraph/font/FontSourceMulti.cpp index 876a984f..9c052d1a 100644 --- a/src/SceneGraph/font/FontSourceMulti.cpp +++ b/src/SceneGraph/font/FontSourceMulti.cpp @@ -1,128 +1,128 @@ -#include +#include 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(ubUnicodeBlock::END_RANGE - ||!fs - ||fs==default_source)return; + void FontSourceMulti::Add(UnicodeBlock ub,FontSource *fs) + { + if(ubUnicodeBlock::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;iright->GetCharHeight()>max_char_height) - max_char_height=(*fsp)->right->GetCharHeight(); + for(int i=0;iright->GetCharHeight()>max_char_height) + max_char_height=(*fsp)->right->GetCharHeight(); - ++fsp; - } - } - - void FontSourceMulti::Remove(UnicodeBlock ub) - { - FontSourcePointer fsp; + ++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(); - } - } - - FontSource *FontSourceMulti::GetFontSource(const u32char &ch) - { - if(hgl::isspace(ch))return(nullptr); //不能显示的数据或是空格 + if(refresh) + RefreshMaxCharHeight(); + } + } + + 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;ileft,ch)) - return (*fsp)->right; + for(int i=0;ileft,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); - } - - const bool FontSourceMulti::GetCharMetrics(CharMetricsInfo &cmi,const u32char &ch) - { - FontSource *s=GetFontSource(ch); + return s->GetCharBitmap(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 diff --git a/src/SceneGraph/font/FontSourceSingle.cpp b/src/SceneGraph/font/FontSourceSingle.cpp index a5640713..92087f85 100644 --- a/src/SceneGraph/font/FontSourceSingle.cpp +++ b/src/SceneGraph/font/FontSourceSingle.cpp @@ -1,4 +1,4 @@ -#include +#include namespace hgl { diff --git a/src/SceneGraph/font/TileFont.cpp b/src/SceneGraph/font/TileFont.cpp index 4f19f58b..328a6f8c 100644 --- a/src/SceneGraph/font/TileFont.cpp +++ b/src/SceneGraph/font/TileFont.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -6,7 +6,7 @@ namespace hgl { namespace graph { - FontSource *AcquireFontSource(const Font &f); + FontSource *AcquireFontSource(const Font &f); TileFont::TileFont(TileData *td,FontSource *fs) {