MCPcopy Create free account
hub / github.com/dborth/fceugx / LoadBgMusic

Function LoadBgMusic

source/fileop.cpp:977–1004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

975}
976
977void LoadBgMusic()
978{
979 char filepath[MAXPATHLEN];
980 sprintf(filepath, "%s/bg_music.ogg", appPath);
981 FILE *file = fopen (filepath, "rb");
982 if(!file) {
983 return;
984 }
985
986 fseeko(file,0,SEEK_END);
987 size_t ogg_size = ftello(file);
988
989 if(ogg_size == 0) {
990 return;
991 }
992
993 u8 * ogg_data = (u8 *)mem2_malloc(ogg_size);
994
995 if(!ogg_data) {
996 return;
997 }
998
999 fseeko(file, 0, SEEK_SET);
1000 fread (ogg_data, 1, ogg_size, file);
1001 fclose(file);
1002 bg_music = ogg_data;
1003 bg_music_size = ogg_size;
1004}
1005#endif
1006
1007/****************************************************************************

Callers 1

LoadPrefsFunction · 0.85

Calls 1

mem2_mallocFunction · 0.85

Tested by

no test coverage detected