[Scummvm-git-logs] scummvm master -> 3e967461c666239fbedc391a8e2034cac4351f7d

sev- noreply at scummvm.org
Mon Apr 27 23:35:35 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
3e967461c6 DIRECTOR: LINGO: Initial code for MapNavigatorXObj


Commit: 3e967461c666239fbedc391a8e2034cac4351f7d
    https://github.com/scummvm/scummvm/commit/3e967461c666239fbedc391a8e2034cac4351f7d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-04-28T01:35:21+02:00

Commit Message:
DIRECTOR: LINGO: Initial code for MapNavigatorXObj

Used in Jewels of the Oracle

Changed paths:
    engines/director/lingo/xlibs/m/mapnavigatorxobj.cpp
    engines/director/lingo/xlibs/m/mapnavigatorxobj.h


diff --git a/engines/director/lingo/xlibs/m/mapnavigatorxobj.cpp b/engines/director/lingo/xlibs/m/mapnavigatorxobj.cpp
index 6e4c0e3b21c..adbe16aa23a 100644
--- a/engines/director/lingo/xlibs/m/mapnavigatorxobj.cpp
+++ b/engines/director/lingo/xlibs/m/mapnavigatorxobj.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "common/system.h"
+#include "common/file.h"
 
 #include "director/director.h"
 #include "director/lingo/lingo.h"
@@ -129,9 +130,41 @@ void MapNavigatorXObj::close(ObjectType type) {
 }
 
 void MapNavigatorXObj::m_new(int nargs) {
-	g_lingo->printSTUBWithArglist("MapNavigatorXObj::m_new", nargs);
-	g_lingo->dropStack(nargs);
+	MapNavigatorXObject *me = static_cast<MapNavigatorXObject *>(g_lingo->_state->me.u.obj);
+
+	me->_filename = g_lingo->pop().asString();
+	Common::File in;
+
+	if (!in.open(Common::Path(me->_filename))) {
+		warning("MapNavigatorXObj::m_new(): Cannot open file %s", me->_filename.c_str());
+		g_lingo->push(g_lingo->_state->me);
+		return;
+	}
+
+	me->_nodeCount = in.readUint16BE();
+	me->_hotspotCount = in.readUint16BE();
+	me->_firstNodeIndex = in.readUint16BE();
+
+	debug(1, "nodes: %d  hotspots: %d, firstNodeIdx: %d", me->_nodeCount, me->_hotspotCount, me->_firstNodeIndex);
+
+	for (int i = 0; i < me->_nodeCount; i++) {
+		NavNode n;
+		n.background_picture = in.readUint16BE();
+		n.hotspot_count = in.readUint16BE();
+		n.unknown_04 = in.readUint16BE();
+		n.hotspot_list_offset = in.readUint16BE();
+		n.name = in.readPascalString();
+
+		if (in.pos() % 2) // align to a word
+			(void)in.readByte();
+
+		debug(1, "%d: pict: %04x hotspots: %04x unk04: %04x listoff: %04x name: %s", i, n.background_picture, n.hotspot_count, n.unknown_04, n.hotspot_list_offset, n.name.c_str());
+
+		me->_nodes.push_back(n);
+	}
+
 	g_lingo->push(g_lingo->_state->me);
+
 }
 
 XOBJSTUBNR(MapNavigatorXObj::m_dispose)
diff --git a/engines/director/lingo/xlibs/m/mapnavigatorxobj.h b/engines/director/lingo/xlibs/m/mapnavigatorxobj.h
index 746b6754bf2..54502d8199e 100644
--- a/engines/director/lingo/xlibs/m/mapnavigatorxobj.h
+++ b/engines/director/lingo/xlibs/m/mapnavigatorxobj.h
@@ -24,9 +24,23 @@
 
 namespace Director {
 
+struct NavNode {
+	int16 background_picture;
+	int16 hotspot_count;
+	int16 unknown_04;
+	int16 hotspot_list_offset;
+	Common::String name;
+};
+
 class MapNavigatorXObject : public Object<MapNavigatorXObject> {
 public:
 	MapNavigatorXObject(ObjectType objType);
+
+	Common::String _filename;
+	int16 _nodeCount;
+	int16 _hotspotCount;
+	int16 _firstNodeIndex;
+	Common::Array<NavNode> _nodes;
 };
 
 namespace MapNavigatorXObj {




More information about the Scummvm-git-logs mailing list