| 940 | |
| 941 | #ifdef HW_RVL |
| 942 | size_t LoadFont(char * filepath) |
| 943 | { |
| 944 | FILE *file = fopen (filepath, "rb"); |
| 945 | |
| 946 | if(!file) { |
| 947 | ErrorPrompt("Font file not found!"); |
| 948 | return 0; |
| 949 | } |
| 950 | |
| 951 | fseeko(file,0,SEEK_END); |
| 952 | size_t loadSize = ftello(file); |
| 953 | |
| 954 | if(loadSize == 0) { |
| 955 | ErrorPrompt("Error loading font!"); |
| 956 | return 0; |
| 957 | } |
| 958 | |
| 959 | if(ext_font_ttf) { |
| 960 | mem2_free(ext_font_ttf); |
| 961 | } |
| 962 | |
| 963 | ext_font_ttf = (u8 *)mem2_malloc(loadSize); |
| 964 | |
| 965 | if(!ext_font_ttf) { |
| 966 | ErrorPrompt("Font file is too large!"); |
| 967 | fclose(file); |
| 968 | return 0; |
| 969 | } |
| 970 | |
| 971 | fseeko(file,0,SEEK_SET); |
| 972 | fread (ext_font_ttf, 1, loadSize, file); |
| 973 | fclose(file); |
| 974 | return loadSize; |
| 975 | } |
| 976 | |
| 977 | void LoadBgMusic() |
| 978 | { |
no test coverage detected