diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-02 23:05:47 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-02 23:05:47 -0500 |
commit | 31b4505161f19e7b94cdd224bd4a3049970a0988 (patch) | |
tree | 55336efb257da8178f78d1b0829dc03d699694e9 /main.c | |
parent | 5625bc523861cf16c1aade7a4e7e6f8731a24b6e (diff) |
debugging
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -1,5 +1,7 @@ // @TODO: -// - test on BSD +// - more instructions (basic stuff + how to open config) +// - update screenshot in README +// - test windows 7 // - completion @@ -265,6 +267,7 @@ INT WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, #else int main(int argc, char **argv) { #endif + PROFILE_TIME(init_start) #if __unix__ { @@ -285,6 +288,8 @@ int main(int argc, char **argv) { setlocale(LC_ALL, ""); // allow unicode + printf("%p\n",ted); // @TODO: delete me + // read command-line arguments char const *starting_filename = NULL; switch (argc) { @@ -407,10 +412,9 @@ int main(int argc, char **argv) { die("ted's backup config file, %s, does not exist. Try reinstalling ted?", global_config_filename); } } + config_read(ted, global_config_filename); config_read(ted, local_config_filename); if (ted_haserr(ted)) { - // if there's an error in the local config, read the global config to make sure everything's ok - config_read(ted, global_config_filename); strcpy(config_err, ted->error); ted_clearerr(ted); // clear the error so later things (e.g. loading font) don't detect an error } @@ -477,7 +481,14 @@ int main(int argc, char **argv) { text_init(); SDL_GL_SetSwapInterval(1); // vsync + PROFILE_TIME(fonts_start) ted_load_fonts(ted); + PROFILE_TIME(fonts_end) + +#if PROFILE + +#endif + if (ted_haserr(ted)) die("Error loading font: %s", ted_geterr(ted)); { |