Add text editor, misc changes

This commit is contained in:
Krzosa Karol
2024-06-20 08:17:54 +02:00
parent 7fe6aa2a97
commit b919678913
5 changed files with 184 additions and 90 deletions

View File

@@ -103,11 +103,11 @@ void AddFolder(String folder, Array<String> *filenames, Array<XToTimeString> *x_
}
}
int thread_count = 16;
int64_t thread_count = 16;
Array<std::thread *> threads = {scratch};
int files_per_thread = srt_files.len / thread_count;
int remainder = srt_files.len % thread_count;
int fi = 0;
int64_t files_per_thread = srt_files.len / thread_count;
int64_t remainder = srt_files.len % thread_count;
int64_t fi = 0;
Array<ParseThreadIO> io = {scratch};
io.reserve(thread_count);
@@ -298,7 +298,7 @@ int main() {
float font_size = 20;
float y = 0;
int xwidth = MeasureTextEx(font, "_", font_size, 1).x;
int xwidth = (int)MeasureTextEx(font, "_", font_size, 1).x;
if (ItemFound) {
uintptr_t begin_region = (uintptr_t)XArena.data;
@@ -321,7 +321,7 @@ int main() {
String line = it.get_prefix(per_line);
if (ItemFound->string.data >= line.data && ItemFound->string.data < line.data + line.len) {
DrawRectangleLines(0, y + font_size, GetRenderWidth(), 2, SKYBLUE);
DrawRectangleLines(0, (int)(y + font_size), GetRenderWidth(), 2, SKYBLUE);
}
String line_terminated = Copy(*frame_arena, line);
@@ -354,8 +354,8 @@ int main() {
String string_first = Copy(*frame_arena, {(char *)begin, (int64_t)(it.data - begin)});
String string_middle = Copy(*frame_arena, it);
int width = MeasureTextEx(font, string_first.data, font_size, 1).x;
if (chosen_text == i) DrawRectangleLines(0, y + font_size, GetRenderWidth(), 2, SKYBLUE);
int width = (int)MeasureTextEx(font, string_first.data, font_size, 1).x;
if (chosen_text == i) DrawRectangleLines(0, (int)(y + font_size), GetRenderWidth(), 2, SKYBLUE);
String num = Format(*frame_arena, "%d", i);
DrawTextEx(font, num.data, {0, y}, font_size, 1, DARKGRAY);