Technical support > Mac

Still cannot load a map

<< < (2/2)

Mattn:
can you please post the patch with your fixes, too?

keybounce:
Sure.

I could not figure out how to patch the map generation, but I could patch the map loading. This makes it a hack -- the map files are still in error, and won't checksum properly.

(Side note: It looks like the map generator stores two copies of the data structure, but the map loader only loads one copy. No, I don't follow what the code is doing.)

--- Code: ---Index: src/server/sv_init.c
===================================================================
--- src/server/sv_init.c (revision 23662)
+++ src/server/sv_init.c (working copy)
@@ -291,6 +291,7 @@
 
  /* successfully parsed - this tile counts */
  numTiles++;
+ Com_Printf("SV_ParseMapTile: Just incremented numTiles, now %d\n", numTiles);
 }
 
 
Index: src/ports/unix/unix_main.c
===================================================================
--- src/ports/unix/unix_main.c (revision 23662)
+++ src/ports/unix/unix_main.c (working copy)
@@ -520,6 +520,8 @@
 #ifdef HAVE_CURSES
  signal(SIGWINCH, Sys_Signal);
 #endif
+ /* apple provides a nice backtrace feature on their own */
+#if !(defined (__APPLE__) || defined (MACOSX))
  signal(SIGHUP, Sys_Signal);
  signal(SIGINT, Sys_Signal);
  signal(SIGQUIT, Sys_Signal);
@@ -528,4 +530,5 @@
  signal(SIGFPE, Sys_Signal);
  signal(SIGSEGV, Sys_Signal);
  signal(SIGTERM, Sys_Signal);
+#endif
 }
Index: src/common/cmodel.c
===================================================================
--- src/common/cmodel.c (revision 23662)
+++ src/common/cmodel.c (working copy)
@@ -164,6 +164,8 @@
  }
  out->headnode = LittleLong(in->headnode);
  out->tile = numTiles; /* backlink to the loaded map tile */
+Com_Printf("CMod_LoadSubModels: Using numTiles for curTile, now %d\n", numTiles);
+assert(curTile == &mapTiles[numTiles]);
  }
 }
 
@@ -288,6 +290,14 @@
  out->firstbrushside = LittleLong(in->firstbrushside);
  out->numsides = LittleLong(in->numsides);
  out->contentFlags = LittleLong(in->contentFlags);
+/* BUGFIX! Local maps don't have the right byteswap */
+/* This is here only because I could not figure out how to fix ufo2map */
+ if (out->numsides > in->numsides) {
+ out->firstbrushside = in->firstbrushside;
+ out->numsides = in->numsides;
+ out->contentFlags = in->contentFlags;
+ }
+if (0 == i) Com_Printf("Read brushes, numsides %d\n", out->numsides);
  }
 }
 
@@ -903,6 +913,8 @@
  }
  /* Update the reroute table */
  if (!reroute[size][y][x]) {
+ /* This is 1 off from the current tile */
+ /* But it can't be zero, so that's intentional??? */
  reroute[size][y][x] = numTiles;
  } else {
  reroute[size][y][x] = ROUTING_NOT_REACHABLE;
@@ -1069,6 +1081,7 @@
  Com_Error(ERR_FATAL, "CM_AddMapTile: too many tiles loaded %i", numTiles);
 
  curTile = &mapTiles[numTiles];
+Com_Printf("CM_AddMapTile: curTile now matches numTile (%d).\n", numTiles);
  memset(curTile, 0, sizeof(*curTile));
  Q_strncpyz(curTile->name, name, sizeof(curTile->name));
 
@@ -1104,6 +1117,7 @@
  /* now increase the amount of loaded tiles */
  numTiles++;
 
+Com_Printf("CM_AddMapTile: numTiles++ (now %d); curTile no longer matches numTile.\n", numTiles);
  CMod_LoadRouting(name, &header.lumps[LUMP_ROUTING], sX, sY, sZ);
 
  FS_FreeFile(buf);
Index: build/maps.mk
===================================================================
--- build/maps.mk (revision 23662)
+++ build/maps.mk (working copy)
@@ -32,7 +32,8 @@
 endif
 
 NICE = 19
-UFO2MAPFLAGS = -v 2 -nice $(NICE) -extra -t $(NUMTHREADS)
+# UFO2MAPFLAGS = -v 2 -nice $(NICE) -extra -t $(NUMTHREADS)
+UFO2MAPFLAGS =        -nice $(NICE) -extra -t $(NUMTHREADS)
 FAST_UFO2MAPFLAGS = -v 2 -quant 6 -nice $(NICE) -t $(NUMTHREADS)
 ENTS_UFO2MAPFLAGS = -v 2 -nice $(NICE) -onlyents
 


--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version