Add mapper_edit_exit

This commit is contained in:
Alexander Batalov 2023-07-24 07:17:21 +03:00
parent f6e9a9d975
commit 57711cae5f
5 changed files with 47 additions and 1 deletions

View File

@ -8,4 +8,10 @@ void setup_map_dirs()
// TODO: Incomplete. // TODO: Incomplete.
} }
// 0x4826B4
void copy_proto_lists()
{
// TODO: Incomplete.
}
} // namespace fallout } // namespace fallout

View File

@ -4,6 +4,7 @@
namespace fallout { namespace fallout {
void setup_map_dirs(); void setup_map_dirs();
void copy_proto_lists();
} // namespace fallout } // namespace fallout

View File

@ -12,6 +12,7 @@
#include "graph_lib.h" #include "graph_lib.h"
#include "inventory.h" #include "inventory.h"
#include "kb.h" #include "kb.h"
#include "loadsave.h"
#include "mapper/map_func.h" #include "mapper/map_func.h"
#include "mapper/mp_proto.h" #include "mapper/mp_proto.h"
#include "mapper/mp_targt.h" #include "mapper/mp_targt.h"
@ -97,6 +98,8 @@ static char kRebuildBinary[] = " Rebuild Binary ";
static char kArtToProtos[] = " Art => New Protos "; static char kArtToProtos[] = " Art => New Protos ";
static char kSwapPrototypse[] = " Swap Prototypes "; static char kSwapPrototypse[] = " Swap Prototypes ";
static char kTmpMapName[] = "TMP$MAP#.MAP";
// 0x559648 // 0x559648
char* menu_0[] = { char* menu_0[] = {
kNew, kNew,
@ -177,6 +180,9 @@ int art_scale_width = 49;
// 0x559888 // 0x559888
int art_scale_height = 48; int art_scale_height = 48;
// 0x5598A4
static char* tmp_map_name = kTmpMapName;
// 0x5598A8 // 0x5598A8
static int bookmarkWin = -1; static int bookmarkWin = -1;
@ -1219,7 +1225,31 @@ int mapper_edit_init(int argc, char** argv)
// 0x48752C // 0x48752C
void mapper_edit_exit() 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 // 0x4875B4

View File

@ -16,4 +16,12 @@ int target_init()
return 0; return 0;
} }
// 0x49B434
int target_exit()
{
// TODO: Incomplete.
return 0;
}
} // namespace fallout } // namespace fallout

View File

@ -5,6 +5,7 @@ namespace fallout {
void target_override_protection(); void target_override_protection();
int target_init(); int target_init();
int target_exit();
} // namespace fallout } // namespace fallout