20
20
#include " ide/ide.h"
21
21
#include " 3rdparty/portable-file-dialogs/portable-file-dialogs.h"
22
22
23
+ #define CUSTOM_FONT 0
24
+
23
25
namespace z8
24
26
{
25
27
@@ -37,16 +39,16 @@ ide::ide(player *player)
37
39
style.WindowRounding = style.ChildRounding = style.FrameRounding = style.ScrollbarRounding = style.TabRounding = 0 .0f ;
38
40
39
41
// Useless
40
- style.Colors [ImGuiCol_ChildBg] = (lol::vec4) z8::palette::get (5 ) / 255 . f ;
42
+ style.Colors [ImGuiCol_ChildBg] = z8::palette::get (5 );
41
43
42
- style.Colors [ImGuiCol_Tab] = (lol::vec4) z8::palette::get (0 ) / 255 . f ;
43
- style.Colors [ImGuiCol_TabHovered] = (lol::vec4) z8::palette::get (8 ) / 255 . f ;
44
- style.Colors [ImGuiCol_TabActive] = (lol::vec4) z8::palette::get (8 ) / 255 . f ;
45
- style.Colors [ImGuiCol_TabUnfocused] = (lol::vec4) z8::palette::get (0 ) / 255 . f ;
46
- style.Colors [ImGuiCol_TabUnfocusedActive] = (lol::vec4) z8::palette::get (0 ) / 255 . f ;
44
+ style.Colors [ImGuiCol_Tab] = z8::palette::get (0 );
45
+ style.Colors [ImGuiCol_TabHovered] = z8::palette::get (8 );
46
+ style.Colors [ImGuiCol_TabActive] = z8::palette::get (8 );
47
+ style.Colors [ImGuiCol_TabUnfocused] = z8::palette::get (0 );
48
+ style.Colors [ImGuiCol_TabUnfocusedActive] = z8::palette::get (0 );
47
49
48
- style.Colors [ImGuiCol_TitleBg] = (lol::vec4) z8::palette::get (5 ) / 255 . f ;
49
- style.Colors [ImGuiCol_TitleBgActive] = (lol::vec4) z8::palette::get (5 ) / 255 . f ;
50
+ style.Colors [ImGuiCol_TitleBg] = z8::palette::get (5 );
51
+ style.Colors [ImGuiCol_TitleBgActive] = z8::palette::get (5 );
50
52
51
53
m_player = player;
52
54
@@ -63,6 +65,7 @@ ide::~ide()
63
65
void ide::tick_game (float seconds)
64
66
{
65
67
WorldEntity::tick_game (seconds);
68
+ #if CUSTOM_FONT
66
69
if (!m_font)
67
70
{
68
71
auto atlas = IM_NEW (ImFontAtlas)();
@@ -112,11 +115,12 @@ void ide::tick_game(float seconds)
112
115
m_font->ContainerAtlas ->TexID = m_player->get_font_texture ();
113
116
114
117
ImGui::PushFont (m_font);
118
+ #endif
115
119
116
120
render_dock ();
117
121
// ImGui::ShowDemoWindow();
118
122
119
- ImGui::PushStyleColor (ImGuiCol_ChildBg, (lol::vec4) z8::palette::get (5 ) / 255 . f );
123
+ ImGui::PushStyleColor (ImGuiCol_ChildBg, z8::palette::get (5 ));
120
124
m_editor.render ();
121
125
ImGui::PopStyleColor (1 );
122
126
@@ -127,8 +131,8 @@ void ide::tick_game(float seconds)
127
131
if (i % 4 > 0 )
128
132
ImGui::SameLine ();
129
133
ImGui::PushID (i);
130
- ImGui::PushStyleColor (ImGuiCol_Button, (lol::vec4) z8::palette::get (i) / 255 . f );
131
- ImGui::PushStyleColor (ImGuiCol_Text, (lol::vec4) z8::palette::get (i < 6 ? 7 : 0 ) / 255 . f );
134
+ ImGui::PushStyleColor (ImGuiCol_Button, z8::palette::get (i));
135
+ ImGui::PushStyleColor (ImGuiCol_Text, z8::palette::get (i < 6 ? 7 : 0 ));
132
136
ImGui::Button (lol::format (" %2d" , i).c_str ());
133
137
ImGui::PopStyleColor (2 );
134
138
ImGui::PopID ();
@@ -145,8 +149,8 @@ void ide::tick_game(float seconds)
145
149
146
150
ImGui::Begin (" mUSIC" , nullptr );
147
151
{
148
- ImGui::TextColored ((lol::vec4) z8::palette::get (10 ) / 255 . f , " stuff" );
149
- ImGui::TextColored ((lol::vec4) z8::palette::get (5 ) / 255 . f , " more stuff\n lol!!!" );
152
+ ImGui::TextColored (z8::palette::get (10 ), " stuff" );
153
+ ImGui::TextColored (z8::palette::get (5 ), " more stuff\n lol!!!" );
150
154
}
151
155
ImGui::End ();
152
156
@@ -164,7 +168,9 @@ void ide::tick_game(float seconds)
164
168
m_rom_edit.DrawContents (m_player->get_rom (), 0x5e00 );
165
169
ImGui::End ();
166
170
171
+ #if CUSTOM_FONT
167
172
ImGui::PopFont ();
173
+ #endif
168
174
}
169
175
170
176
void ide::render_dock ()
0 commit comments