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

Method ProcessPageFromFile

editor/TableFileFilterMng.cpp:1868–1941  ·  view source on GitHub ↗

Processes a page read in from text file

Source from the content-addressed store, hash-verified

1866
1867// Processes a page read in from text file
1868bool PageDataList::ProcessPageFromFile(char *page_name, uint8_t page_type, int process_type) {
1869 char ext[12];
1870 int id;
1871 switch (page_type) {
1872 case PAGETYPE_GENERIC:
1873 id = FindObjectIDName(page_name);
1874 if (id == -1)
1875 return FALSE;
1876 AddGenericPage(id, process_type);
1877 break;
1878
1879 case PAGETYPE_TEXTURE:
1880 id = FindTextureName(page_name);
1881 if (id == -1)
1882 return FALSE;
1883 AddTexturePage(id, process_type);
1884 break;
1885
1886 case PAGETYPE_SOUND:
1887 id = FindSoundName(page_name);
1888 if (id == -1)
1889 return FALSE;
1890 AddSoundPage(id, process_type);
1891 break;
1892
1893 case PAGETYPE_DOOR:
1894 id = FindDoorName(page_name);
1895 if (id == -1)
1896 return FALSE;
1897 AddDoorPage(id, process_type);
1898 break;
1899
1900 case PAGETYPE_SHIP:
1901 id = FindShipName(page_name);
1902 if (id == -1)
1903 return FALSE;
1904 AddShipPage(id, process_type);
1905 break;
1906
1907 case PAGETYPE_WEAPON:
1908 id = FindWeaponName(page_name);
1909 if (id == -1)
1910 return FALSE;
1911 AddWeaponPage(id, process_type);
1912 break;
1913
1914 case PAGETYPE_GAMEFILE:
1915 GetFileExt(page_name, ext);
1916
1917 // if (stricmp(ext,".d3l"))
1918 //{
1919 ProcessPage(page_name, PAGETYPE_GAMEFILE, process_type);
1920 //}
1921
1922 if (!stricmp(ext, ".oof")) {
1923 int pid = LoadPolyModel(page_name, 0);
1924 if (pid != -1) {
1925 PageInPolymodel(pid);

Callers

nothing calls this directly

Calls 9

FindObjectIDNameFunction · 0.85
FindTextureNameFunction · 0.85
FindSoundNameFunction · 0.85
FindDoorNameFunction · 0.85
FindShipNameFunction · 0.85
FindWeaponNameFunction · 0.85
GetFileExtFunction · 0.85
LoadPolyModelFunction · 0.85
PageInPolymodelFunction · 0.85

Tested by

no test coverage detected