added VGA8.F8
This commit is contained in:
parent
dc90b536c3
commit
d3a3f70be1
@ -4,31 +4,32 @@ using namespace hgl;
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
uint8 *bitmap_font_data=nullptr;
|
uint8 *bitmap_font_8x16_data=nullptr;
|
||||||
|
uint8 *bitmap_font_8x8_data=nullptr;
|
||||||
}//namespace
|
}//namespace
|
||||||
|
|
||||||
|
void ClearBitmapFont()
|
||||||
|
{
|
||||||
|
SAFE_CLEAR_ARRAY(bitmap_font_8x16_data);
|
||||||
|
SAFE_CLEAR_ARRAY(bitmap_font_8x8_data);
|
||||||
|
}
|
||||||
|
|
||||||
bool LoadBitmapFont()
|
bool LoadBitmapFont()
|
||||||
{
|
{
|
||||||
if(bitmap_font_data)
|
ClearBitmapFont();
|
||||||
return(true);
|
|
||||||
|
|
||||||
bitmap_font_data=new uint8[256*16];
|
filesystem::LoadFileToMemory(OS_TEXT("VGA8.F16"), (void **)&bitmap_font_8x16_data);
|
||||||
|
filesystem::LoadFileToMemory(OS_TEXT("VGA8.F8"), (void **)&bitmap_font_8x8_data);
|
||||||
if(!filesystem::LoadFileToMemory(OS_TEXT("VGA8.F16"), (void **)&bitmap_font_data))
|
|
||||||
return(false);
|
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearBitmapFont()
|
const uint8 *Get8x16Char(const char ch)
|
||||||
{
|
{
|
||||||
SAFE_CLEAR_ARRAY(bitmap_font_data);
|
return bitmap_font_8x16_data+uchar(ch)*16;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint GetCharWidth(){return bitmap_font_data?8:0;}
|
const uint8 *Get8x8Char(const char ch)
|
||||||
const uint GetCharHeight(){return bitmap_font_data?16:0;}
|
|
||||||
|
|
||||||
const uint8 *GetBitmapChar(const char ch)
|
|
||||||
{
|
{
|
||||||
return bitmap_font_data+uchar(ch)*16;
|
return bitmap_font_8x8_data+uchar(ch)*8;
|
||||||
}
|
}
|
@ -6,7 +6,4 @@ using namespace hgl;
|
|||||||
bool LoadBitmapFont();
|
bool LoadBitmapFont();
|
||||||
void ClearBitmapFont();
|
void ClearBitmapFont();
|
||||||
|
|
||||||
const uint GetCharWidth();
|
const uint8 *Get8x16Char(const char ch);
|
||||||
const uint GetCharHeight();
|
|
||||||
|
|
||||||
const uint8 *GetBitmapChar(const char ch);
|
|
@ -67,6 +67,9 @@ set_example_project_folder("DataType/DataArray" QueueTest)
|
|||||||
add_executable(PoolTest datatype/PoolTest.cpp)
|
add_executable(PoolTest datatype/PoolTest.cpp)
|
||||||
set_example_project_folder("DataType/DataArray" PoolTest)
|
set_example_project_folder("DataType/DataArray" PoolTest)
|
||||||
|
|
||||||
|
add_executable(ActiveIDManagerTest datatype/ActiveIDManagerTest.cpp)
|
||||||
|
set_example_project_folder("DataType/DataArray" ActiveIDManagerTest)
|
||||||
|
|
||||||
add_executable(MapTest datatype/MapTest.cpp)
|
add_executable(MapTest datatype/MapTest.cpp)
|
||||||
set_example_project_folder("DataType/DataArray" MapTest)
|
set_example_project_folder("DataType/DataArray" MapTest)
|
||||||
|
|
||||||
|
@ -149,8 +149,8 @@ bool InitBitmapFont()
|
|||||||
if(!LoadBitmapFont())
|
if(!LoadBitmapFont())
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
CHAR_BITMAP_WIDTH=GetCharWidth();
|
CHAR_BITMAP_WIDTH=8;
|
||||||
CHAR_BITMAP_HEIGHT=GetCharHeight();
|
CHAR_BITMAP_HEIGHT=16;
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
@ -385,7 +385,7 @@ private:
|
|||||||
|
|
||||||
void DrawChar(const char ch,const uint x,const uint y)
|
void DrawChar(const char ch,const uint x,const uint y)
|
||||||
{
|
{
|
||||||
const uint8 *sp=GetBitmapChar(ch);
|
const uint8 *sp=Get8x16Char(ch);
|
||||||
|
|
||||||
if(!sp)return;
|
if(!sp)return;
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 111c0087eda734f86ff556961cd9bbd5f86330ee
|
Subproject commit 82c41f1287e60a32e004e5cc914e4f9d9595b182
|
@ -27,7 +27,7 @@ void StructPoolTest()
|
|||||||
//添加所有的人物数据到池中
|
//添加所有的人物数据到池中
|
||||||
{
|
{
|
||||||
for(auto ui:user_info_array)
|
for(auto ui:user_info_array)
|
||||||
pool.Append(ui);
|
pool.AppendToActive(ui);
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowUserInfoArray(pool.GetActiveArray());
|
ShowUserInfoArray(pool.GetActiveArray());
|
||||||
@ -83,7 +83,7 @@ void ObjectPoolTest()
|
|||||||
|
|
||||||
uic->Set(ui);
|
uic->Set(ui);
|
||||||
|
|
||||||
pool.Append(uic);
|
pool.AppendToActive(uic);
|
||||||
|
|
||||||
if(rand()%3==1) //有1/3的概率,将这个数据放入释放列表
|
if(rand()%3==1) //有1/3的概率,将这个数据放入释放列表
|
||||||
release_list.Add(uic);
|
release_list.Add(uic);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user