diff --git a/src/mapper/map_func.cc b/src/mapper/map_func.cc index 9d96f2e..b9f297d 100644 --- a/src/mapper/map_func.cc +++ b/src/mapper/map_func.cc @@ -8,4 +8,10 @@ void setup_map_dirs() // TODO: Incomplete. } +// 0x4826B4 +void copy_proto_lists() +{ + // TODO: Incomplete. +} + } // namespace fallout diff --git a/src/mapper/map_func.h b/src/mapper/map_func.h index fb71b2b..1292604 100644 --- a/src/mapper/map_func.h +++ b/src/mapper/map_func.h @@ -4,6 +4,7 @@ namespace fallout { void setup_map_dirs(); +void copy_proto_lists(); } // namespace fallout diff --git a/src/mapper/mapper.cc b/src/mapper/mapper.cc index 786b5a5..8afe3eb 100644 --- a/src/mapper/mapper.cc +++ b/src/mapper/mapper.cc @@ -12,6 +12,7 @@ #include "graph_lib.h" #include "inventory.h" #include "kb.h" +#include "loadsave.h" #include "mapper/map_func.h" #include "mapper/mp_proto.h" #include "mapper/mp_targt.h" @@ -97,6 +98,8 @@ static char kRebuildBinary[] = " Rebuild Binary "; static char kArtToProtos[] = " Art => New Protos "; static char kSwapPrototypse[] = " Swap Prototypes "; +static char kTmpMapName[] = "TMP$MAP#.MAP"; + // 0x559648 char* menu_0[] = { kNew, @@ -177,6 +180,9 @@ int art_scale_width = 49; // 0x559888 int art_scale_height = 48; +// 0x5598A4 +static char* tmp_map_name = kTmpMapName; + // 0x5598A8 static int bookmarkWin = -1; @@ -1219,7 +1225,31 @@ int mapper_edit_init(int argc, char** argv) // 0x48752C void mapper_edit_exit() { - // TODO: Incomplete. + remove(tmp_map_name); + remove("\\fallout\\cd\\data\\maps\\TMP$MAP#.MAP"); + remove("\\fallout\\cd\\data\\maps\\TMP$MAP#.CFG"); + + MapDirErase("MAPS\\", "SAV"); + + if (can_modify_protos) { + copy_proto_lists(); + + // NOTE: There is a call to an ambiguous function at `0x4B9ACC`, likely + // `proto_save`. + } + + target_exit(); + _map_exit(); + bookmarkExit(); + categoryExit(); + + windowDestroy(tool_win); + tool = NULL; + + windowDestroy(menu_bar); + + internal_free(art_shape); + gameExit(); } // 0x4875B4 diff --git a/src/mapper/mp_targt.cc b/src/mapper/mp_targt.cc index b9892bd..1bbea4a 100644 --- a/src/mapper/mp_targt.cc +++ b/src/mapper/mp_targt.cc @@ -16,4 +16,12 @@ int target_init() return 0; } +// 0x49B434 +int target_exit() +{ + // TODO: Incomplete. + + return 0; +} + } // namespace fallout diff --git a/src/mapper/mp_targt.h b/src/mapper/mp_targt.h index 9e7f071..ef308e4 100644 --- a/src/mapper/mp_targt.h +++ b/src/mapper/mp_targt.h @@ -5,6 +5,7 @@ namespace fallout { void target_override_protection(); int target_init(); +int target_exit(); } // namespace fallout