Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dmapdata script oggLoop //start
- {
- enum file_id
- {
- FID_NONE,
- FID_METROID,
- FID_METROID2
- };
- //start helper functions
- void get_fname(char32 f, file_id fid)
- {
- switch(fid)
- {
- case FID_NONE:
- break;
- case FID_METROID:
- strcpy(f, "metroid.ogg");
- break;
- case FID_METROID2:
- strcpy(f, "metroid2.ogg");
- break;
- }
- }
- int get_loopstart(file_id fid)
- {
- switch(fid)
- {
- case FID_NONE:
- return 0;
- case FID_METROID:
- return 0;
- case FID_METROID2:
- return 0;
- }
- }
- int get_loopend(file_id fid)
- {
- switch(fid)
- {
- case FID_NONE:
- return 0;
- case FID_METROID:
- return 0;
- case FID_METROID2:
- return 0;
- }
- }
- //end helper functions
- void run(file_id fid) //start
- {
- char32 filename[256];
- get_fname(filename, fid);
- int loopStart = get_loopstart(fid), loopEnd = get_loopend(fid);
- if(Audio->PlayOgg(filename, 1))
- {
- while(true)
- {
- if(Audio->GetOggPos() >= loopEnd) Audio->SetOggPos(loopStart);
- Waitframe();
- }
- }
- } //end
- } //end
Add Comment
Please, Sign In to add comment