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

Method CheckInLevels

editor/ScriptLevelInterface.cpp:1653–1791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1651}
1652
1653bool CScriptLevelInterface::CheckInLevels() {
1654 CCheckListBox *list = (CCheckListBox *)GetDlgItem(IDC_LIST_CHECKEDOUT);
1655 int listbox_size = list->GetCount();
1656 int list_size = 0;
1657 int i;
1658 for (i = 0; i < listbox_size; i++) {
1659 if (list->GetCheck(i)) {
1660 list_size++;
1661 }
1662 }
1663
1664 if (list_size == 0)
1665 return false;
1666 int *index_map = (int *)mem_malloc(list_size * sizeof(int));
1667 if (!index_map)
1668 return false;
1669
1670 int index = 0;
1671 for (i = 0; i < listbox_size; i++) {
1672 if (list->GetCheck(i)) {
1673 index_map[index] = i;
1674 index++;
1675 }
1676 }
1677
1678 if (!mng_MakeLocker()) {
1679 mem_free(index_map);
1680 return false;
1681 }
1682
1683 int j;
1684 bool changed = false;
1685 char buffer[_MAX_PATH + 200];
1686 char tempbuffer[_MAX_PATH];
1687 char savename[_MAX_PATH];
1688
1689 for (i = 0; i < list_size; i++) {
1690 index = index_map[i];
1691
1692 list->GetText(index, tempbuffer);
1693 strcpy(savename, tempbuffer);
1694 strcat(tempbuffer, ".d3l");
1695
1696 char t[256];
1697 sprintf(t, "Checking In: %s", tempbuffer);
1698 SetStatus(t);
1699
1700 // go ahead and check in
1701 if (CheckInGamefile(tempbuffer, false))
1702 changed = true;
1703
1704 bool script_also;
1705 script_also = false;
1706
1707 // ok the level has been checked in, see if there is a corresponding .cpp file
1708 strcpy(tempbuffer, savename);
1709 strcat(tempbuffer, ".cpp");
1710 for (j = 0; j < MAX_TRACKLOCKS; j++) {

Callers

nothing calls this directly

Calls 4

mng_MakeLockerFunction · 0.85
CheckInGamefileFunction · 0.85
mng_EraseLockerFunction · 0.85
GetTextMethod · 0.45

Tested by

no test coverage detected