MCPcopy Create free account
hub / github.com/demoth/jake2 / CMod_LoadSurfaces

Method CMod_LoadSurfaces

qcommon/src/main/java/jake2/qcommon/CM.java:323–360  ·  view source on GitHub ↗

Loads surfaces.

(lump_t l)

Source from the content-addressed store, hash-verified

321
322 /** Loads surfaces. */
323 public void CMod_LoadSurfaces(lump_t l) {
324 Com.DPrintf("CMod_LoadSurfaces()\n");
325 texinfo_t in;
326 mapsurface_t out;
327 int i, count;
328
329 if ((l.filelen % texinfo_t.SIZE) != 0)
330 Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size");
331
332 count = l.filelen / texinfo_t.SIZE;
333 if (count < 1)
334 Com.Error(Defines.ERR_DROP, "Map with no surfaces");
335 if (count > Defines.MAX_MAP_TEXINFO)
336 Com.Error(Defines.ERR_DROP, "Map has too many surfaces");
337
338 numtexinfo = count;
339 Com.DPrintf(" numtexinfo=" + count + "\n");
340 if (debugloadmap)
341 Com.DPrintf("surfaces:\n");
342
343 for (i = 0; i < count; i++) {
344 out = map_surfaces[i] = new mapsurface_t();
345 in = new texinfo_t(cmod_base, l.fileofs + i * texinfo_t.SIZE,
346 texinfo_t.SIZE);
347
348 out.c.name = in.texture;
349 out.rname = in.texture;
350 out.c.flags = in.flags;
351 out.c.value = in.value;
352
353 if (debugloadmap) {
354 Com.DPrintf("|%20s|%20s|%6i|%6i|\n", new Vargs()
355 .add(out.c.name).add(out.rname).add(out.c.value).add(
356 out.c.flags));
357 }
358
359 }
360 }
361
362 /** Loads nodes. */
363 public void CMod_LoadNodes(lump_t l) {

Callers 1

CM_LoadMapMethod · 0.95

Calls 3

DPrintfMethod · 0.95
ErrorMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected