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