MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DemoPlayAutoDemo

Function DemoPlayAutoDemo

Descent3/demofile.cpp:1680–1707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1678}
1679
1680void DemoPlayAutoDemo(void) {
1681 char wcard_fname[_MAX_PATH * 2];
1682 char auto_fname[_MAX_PATH * 2];
1683 int idx = 0;
1684 ddio_MakePath(wcard_fname, Base_directory, "demo", "*.dem", NULL);
1685 if (ddio_FindFileStart(wcard_fname, auto_fname)) {
1686 // Get to the next demo file we are scheduled to do.
1687 while (idx < Demo_auto_idx) {
1688 if (!ddio_FindNextFile(auto_fname)) {
1689 Demo_auto_idx = 0;
1690 ddio_FindFileClose();
1691 // A little recursion to go back to the start
1692 DemoPlayAutoDemo();
1693 return;
1694 }
1695 idx++;
1696 }
1697 // Now we should have the proper filename
1698 if (DemoPlaybackFile(auto_fname)) {
1699 Demo_auto_play = true;
1700 } else {
1701 Demo_auto_play = false;
1702 }
1703 } else {
1704 // No demo files are available, sorry!
1705 Demo_auto_play = false;
1706 }
1707}
1708
1709void DemoWritePersistantHUDMessage(ddgr_color color, int x, int y, float time, int flags, int sound_index, char *msg) {
1710 cf_WriteByte(Demo_cfp, DT_PERSISTANT_HUD);

Callers

nothing calls this directly

Calls 5

DemoPlaybackFileFunction · 0.85
ddio_MakePathFunction · 0.50
ddio_FindFileStartFunction · 0.50
ddio_FindNextFileFunction · 0.50
ddio_FindFileCloseFunction · 0.50

Tested by

no test coverage detected