src/context.c

changeset 177
954512fc391f
parent 176
cb2f60f48337
equal deleted inserted replaced
176:cb2f60f48337 177:954512fc391f
47 // forward declare non-public font cache functions 47 // forward declare non-public font cache functions
48 void asc_font_cache_init(void); 48 void asc_font_cache_init(void);
49 void asc_font_cache_destroy(void); 49 void asc_font_cache_destroy(void);
50 50
51 void asc_context_initialize(void) { 51 void asc_context_initialize(void) {
52 if (asc_test_flag(asc_context.flags, ASC_FLAG_INITILIZED)) 52 if (asc_test_flag(asc_context.flags, ASC_FLAG_INITIALIZED))
53 return; 53 return;
54 memset(&asc_context, 0, sizeof(AscContext)); 54 memset(&asc_context, 0, sizeof(AscContext));
55 55
56 // initialize default paths 56 // initialize default paths
57 asc_context.font_path = cx_strdup(CX_STR("./fonts")); 57 asc_context.font_path = cx_strdup(CX_STR("./fonts"));
86 } else if (IMG_Init(supported_img_flags) != supported_img_flags) { 86 } else if (IMG_Init(supported_img_flags) != supported_img_flags) {
87 asc_error("Failed to initialize SDL_img: %s", IMG_GetError()); 87 asc_error("Failed to initialize SDL_img: %s", IMG_GetError());
88 } 88 }
89 SDL_ClearError(); 89 SDL_ClearError();
90 asc_context.total_nanos = asc_nanos(); 90 asc_context.total_nanos = asc_nanos();
91 asc_set_flag(asc_context.flags, ASC_FLAG_INITILIZED); 91 asc_set_flag(asc_context.flags, ASC_FLAG_INITIALIZED);
92 asc_dprintf("Ascension context initialized."); 92 asc_dprintf("Ascension context initialized.");
93 } 93 }
94 94
95 void asc_context_destroy(void) { 95 void asc_context_destroy(void) {
96 // destroy windows 96 // destroy windows

mercurial