Compare commits
3
Commits
01d3eb771e
...
stable
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6547f64d13
|
||
|
|
2b37204763
|
||
|
|
8c2bcedc93
|
@@ -56,12 +56,6 @@ class PD_API Font {
|
|||||||
*/
|
*/
|
||||||
void LoadTTF(const std::vector<u8>& data, int px_height = 32,
|
void LoadTTF(const std::vector<u8>& data, int px_height = 32,
|
||||||
LiFontFlags flags = LiFontFlags_None);
|
LiFontFlags flags = LiFontFlags_None);
|
||||||
/**
|
|
||||||
* Function that loads a default integrated font...
|
|
||||||
* This will only work if PD_LI_INCLUDE_FONTS was set
|
|
||||||
* on lithium build cause otherwise the font data is not included
|
|
||||||
*/
|
|
||||||
void LoadDefaultFont(int id = 0, int pixel_height = 32);
|
|
||||||
/**
|
/**
|
||||||
* Getter for Codepoint reference
|
* Getter for Codepoint reference
|
||||||
* @return codepoint dataholder reference
|
* @return codepoint dataholder reference
|
||||||
|
|||||||
@@ -195,8 +195,6 @@ PD_API void Font::LoadTTF(const std::vector<u8>& data, int px_height,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PD_API void Font::LoadDefaultFont(int id, int pixel_height) {}
|
|
||||||
|
|
||||||
PD_API Font::Codepoint& Font::GetCodepoint(u32 c) {
|
PD_API Font::Codepoint& Font::GetCodepoint(u32 c) {
|
||||||
if (c < 128) {
|
if (c < 128) {
|
||||||
// Direct Access (~11% improvement)
|
// Direct Access (~11% improvement)
|
||||||
|
|||||||
+1
-1
@@ -219,7 +219,7 @@ PD_API void Menu::DrawBaseLayout() {
|
|||||||
if (!(Flags & UI7MenuFlags_NoResize)) {
|
if (!(Flags & UI7MenuFlags_NoResize)) {
|
||||||
DynObj* r = pIO.DynObjPool.Allocate();
|
DynObj* r = pIO.DynObjPool.Allocate();
|
||||||
*r = UI7::DynObj([](IO* io, Li::Drawlist* l, UI7::Container* self) {
|
*r = UI7::DynObj([](IO* io, Li::Drawlist* l, UI7::Container* self) {
|
||||||
l->SetLayer(1);
|
l->SetLayer(21);
|
||||||
l->PathAdd(self->FinalPos() + self->GetSize() - fvec2(0, 20));
|
l->PathAdd(self->FinalPos() + self->GetSize() - fvec2(0, 20));
|
||||||
l->PathAdd(self->FinalPos() + self->GetSize());
|
l->PathAdd(self->FinalPos() + self->GetSize());
|
||||||
l->PathAdd(self->FinalPos() + self->GetSize() - fvec2(20, 0));
|
l->PathAdd(self->FinalPos() + self->GetSize() - fvec2(20, 0));
|
||||||
|
|||||||
@@ -20,9 +20,26 @@ bool ColorTests() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IDTests() {
|
||||||
|
std::cout << std::format("HashID32(\"1234\") -> {:016X}",
|
||||||
|
PD::HashID32("1234").Get())
|
||||||
|
<< std::endl;
|
||||||
|
std::cout << std::format("HashID32(\"1235\") -> {:016X}",
|
||||||
|
PD::HashID32("1235").Get())
|
||||||
|
<< std::endl;
|
||||||
|
std::cout << std::format("HashID64(\"1234\") -> {:016X}",
|
||||||
|
PD::HashID64("1234").Get())
|
||||||
|
<< std::endl;
|
||||||
|
std::cout << std::format("HashID64(\"1235\") -> {:016X}",
|
||||||
|
PD::HashID64("1235").Get())
|
||||||
|
<< std::endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
PD::Os::UseDriver<PD::OsDriver>();
|
PD::Os::UseDriver<PD::OsDriver>();
|
||||||
ColorTests();
|
ColorTests();
|
||||||
|
IDTests();
|
||||||
std::cout << PD::Os::GetTime() << std::endl;
|
std::cout << PD::Os::GetTime() << std::endl;
|
||||||
PD::Pool<int> pool;
|
PD::Pool<int> pool;
|
||||||
pool.Init(90);
|
pool.Init(90);
|
||||||
|
|||||||
@@ -308,6 +308,7 @@ int main(int argc, char** argv) {
|
|||||||
PD::TT::Beg("BuildUI7Menus");
|
PD::TT::Beg("BuildUI7Menus");
|
||||||
if (auto m = ui7.BeginMenu("Test")) {
|
if (auto m = ui7.BeginMenu("Test")) {
|
||||||
m->Label("Hello World!");
|
m->Label("Hello World!");
|
||||||
|
m->Image(pTex, 128.f);
|
||||||
ui7.EndMenu();
|
ui7.EndMenu();
|
||||||
}
|
}
|
||||||
if (auto m = ui7.BeginMenu("LI DBG INFO")) {
|
if (auto m = ui7.BeginMenu("LI DBG INFO")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user