Skip to content

Commit 9b960b1

Browse files
committed
more logging
1 parent c2b01c4 commit 9b960b1

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/DOM/MapDOMNode.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ bool LMapDOMNode::LoadMap(std::filesystem::path file_path)
7575
{
7676
std::cout << std::format("[MapDOMNode]: File \"{}\" does not exist", file_path.string().c_str()) << std::endl;
7777
return false;
78+
} else {
79+
std::cout << "[MapDOMNode] Archive " << file_path << std::endl;
7880
}
7981

8082
bStream::CFileStream mMapArchiveStream(file_path.string(), bStream::Endianess::Big, bStream::OpenMode::In);
@@ -85,9 +87,12 @@ bool LMapDOMNode::LoadMap(std::filesystem::path file_path)
8587
return false;
8688
}
8789

90+
std::cout << "[MapDOMNode] Archive Loaded, Processing Map" << std::endl;
91+
8892
// We'll call ourselves whatever the root directory of the archive is
8993
mName = file_path.stem().string();
9094

95+
std::cout << "[MapDOMNode] Loading Event Archives" << std::endl;
9196
std::filesystem::path eventPath = std::filesystem::path(OPTIONS.mRootPath) / "files" / "Event";
9297
if(std::filesystem::exists(eventPath))
9398
{
@@ -98,6 +103,7 @@ bool LMapDOMNode::LoadMap(std::filesystem::path file_path)
98103

99104
//Exclude cvs subdir
100105
if(archive.is_regular_file()){
106+
std::cout << "[MapDOMNode] Loading Event " << archive.path().string() << std::endl;
101107
bStream::CFileStream eventStream(archive.path().string(), bStream::Endianess::Big, bStream::OpenMode::In);
102108
if(!eventArc->Load(&eventStream)) continue;
103109

@@ -151,6 +157,8 @@ bool LMapDOMNode::LoadMap(std::filesystem::path file_path)
151157
return false;
152158
}
153159

160+
std::cout << "[MapDOMNode] Loaded rooms.map " << std::endl;
161+
154162
// Attempt to load roominfo data. Doesn't necessarily exist!
155163
std::shared_ptr<Archive::File> roomInfoFile = mMapArchive->GetFile("/jmp/roominfo");
156164

@@ -159,8 +167,13 @@ bool LMapDOMNode::LoadMap(std::filesystem::path file_path)
159167
// Prep the roominfo data to be read from
160168
bStream::CMemoryStream roomMemStream(roomInfoFile->GetData(), roomInfoFile->GetSize(), bStream::Endianess::Big, bStream::OpenMode::In);
161169
JmpIOManagers[LEntityType_Rooms].Load(&roomMemStream);
170+
} else {
171+
std::cout << "[MapDOMNode] Couldn't Load roominfo" << std::endl;
172+
return false;
162173
}
163174

175+
std::cout << "[MapDOMNode] Loading Room Names" << std::endl;
176+
164177
// Grab the friendly room names for this map
165178
nlohmann::json roomNames = LResUtility::GetNameMap(std::format("{0}_rooms", mName));
166179

@@ -185,11 +198,14 @@ bool LMapDOMNode::LoadMap(std::filesystem::path file_path)
185198

186199
auto rooms = GetChildrenOfType<LRoomDOMNode>(EDOMNodeType::Room);
187200

201+
std::cout << "[MapDOMNode] Processing Static Room Data" << std::endl;
202+
188203
// Complete loading the basic map data
189204
LoadStaticData(rooms);
190205

191-
// Load Collision
192206

207+
// Load Collision
208+
std::cout << "[MapDOMNode] Loading Map Collision" << std::endl;
193209
std::shared_ptr<LMapCollisionDOMNode> collision = std::make_shared<LMapCollisionDOMNode>("Collision");
194210

195211
std::shared_ptr<Archive::File> collisionFile = mMapArchive->GetFile("col.mp");
@@ -201,6 +217,7 @@ bool LMapDOMNode::LoadMap(std::filesystem::path file_path)
201217
AddChild(collision);
202218
}
203219

220+
std::cout << "[MapDOMNode] Loading JMP Files" << std::endl;
204221

205222
// Now load the entity data from the map's archive.
206223
for (int32_t entityType = 0; entityType < LEntityType_Max; entityType++)
@@ -233,6 +250,8 @@ bool LMapDOMNode::LoadMap(std::filesystem::path file_path)
233250
}
234251
}
235252

253+
std::cout << "[MapDOMNode] Loading Map Mirrors" << std::endl;
254+
236255
// Get the path the mirrors file should be at.
237256
std::filesystem::path mirrorsPath = LResUtility::GetMirrorDataPath(mName);
238257
// If the file doesn't exist, and we're in the main mansion (map2), try to load the JSON template.
@@ -268,6 +287,8 @@ bool LMapDOMNode::LoadMap(std::filesystem::path file_path)
268287
}
269288
}
270289

290+
std::cout << "[MapDOMNode] Post Processing JMP Nodes" << std::endl;
291+
271292
// Shore up things like entity references now that all of the entity data has been loaded
272293
for (auto loadedNode : GetChildrenOfType<LEntityDOMNode>(EDOMNodeType::Entity))
273294
loadedNode->PostProcess();
@@ -290,6 +311,8 @@ bool LMapDOMNode::LoadMap(std::filesystem::path file_path)
290311
for (std::shared_ptr<LRoomDOMNode> r : rooms)
291312
r->CompleteLoad();
292313

314+
std::cout << "[MapDOMNode] Loading Complete" << std::endl;
315+
293316
return true;
294317
}
295318

src/ui/BooldozerEditor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ void LBooldozerEditor::OpenMap(std::string file_path)
437437
{
438438

439439
mLoadedMap = std::make_shared<LMapDOMNode>();
440+
std::cout << "[MapDOMNode] Starting Load Map" << std::endl;
440441
mLoadedMap->LoadMap(std::filesystem::path(file_path));
441442

442443
mGhostConfigs.LoadConfigs(mLoadedMap);

0 commit comments

Comments
 (0)