| 1903 | } |
| 1904 | |
| 1905 | bool CScriptLevelInterface::CheckOutLevels() { |
| 1906 | CCheckListBox *list = (CCheckListBox *)GetDlgItem(IDC_LIST_AVAILABLE); |
| 1907 | int listbox_size = list->GetCount(); |
| 1908 | int list_size = 0; |
| 1909 | int i; |
| 1910 | for (i = 0; i < listbox_size; i++) { |
| 1911 | if (list->GetCheck(i)) { |
| 1912 | list_size++; |
| 1913 | } |
| 1914 | } |
| 1915 | |
| 1916 | if (list_size == 0) |
| 1917 | return false; |
| 1918 | int *index_map = (int *)mem_malloc(list_size * sizeof(int)); |
| 1919 | if (!index_map) |
| 1920 | return false; |
| 1921 | |
| 1922 | int index = 0; |
| 1923 | for (i = 0; i < listbox_size; i++) { |
| 1924 | if (list->GetCheck(i)) { |
| 1925 | index_map[index] = i; |
| 1926 | index++; |
| 1927 | } |
| 1928 | } |
| 1929 | |
| 1930 | if (!mng_MakeLocker()) { |
| 1931 | mem_free(index_map); |
| 1932 | return false; |
| 1933 | } |
| 1934 | |
| 1935 | int j; |
| 1936 | bool changed = false; |
| 1937 | char buffer[_MAX_PATH + 200]; |
| 1938 | char tempbuffer[_MAX_PATH]; |
| 1939 | char savename[_MAX_PATH]; |
| 1940 | |
| 1941 | for (i = 0; i < list_size; i++) { |
| 1942 | index = index_map[i]; |
| 1943 | |
| 1944 | list->GetText(index, tempbuffer); |
| 1945 | strcpy(savename, tempbuffer); |
| 1946 | strcat(tempbuffer, ".d3l"); |
| 1947 | |
| 1948 | char t[256]; |
| 1949 | sprintf(t, "Checking Out: %s", tempbuffer); |
| 1950 | SetStatus(t); |
| 1951 | |
| 1952 | // this item is checked...we wish to checkin |
| 1953 | if (CheckOutGamefile(tempbuffer, false)) |
| 1954 | changed = true; |
| 1955 | |
| 1956 | bool script_also; |
| 1957 | script_also = false; |
| 1958 | |
| 1959 | // ok the level has been checked in, see if there is a corresponding .cpp file |
| 1960 | strcpy(tempbuffer, savename); |
| 1961 | strcat(tempbuffer, ".cpp"); |
| 1962 | for (j = 0; j < MAX_GAMEFILES; j++) { |
nothing calls this directly
no test coverage detected