MCPcopy Create free account
hub / github.com/ZDoom/gzdoom / GetMapIndex

Function GetMapIndex

src/p_openmap.cpp:68–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66};
67
68static int GetMapIndex(const char *mapname, int lastindex, const char *lumpname, bool needrequired)
69{
70 static const checkstruct check[] =
71 {
72 {"", true},
73 {"THINGS", true},
74 {"LINEDEFS", true},
75 {"SIDEDEFS", true},
76 {"VERTEXES", true},
77 {"SEGS", false},
78 {"SSECTORS", false},
79 {"NODES", false},
80 {"SECTORS", true},
81 {"REJECT", false},
82 {"BLOCKMAP", false},
83 {"BEHAVIOR", false},
84 {"LIGHTMAP", false },
85 //{"SCRIPTS", false},
86 };
87
88 if (lumpname==NULL) lumpname="";
89
90 for(size_t i=lastindex+1;i<countof(check);i++)
91 {
92 if (!strnicmp(lumpname, check[i].lumpname, 8))
93 return (int)i;
94
95 if (check[i].required)
96 {
97 if (needrequired)
98 {
99 I_Error("'%s' not found in %s\n", check[i].lumpname, mapname);
100 }
101 return -2;
102 }
103 }
104
105 return -1; // End of map reached
106}
107
108//===========================================================================
109//

Callers 1

P_OpenMapDataFunction · 0.85

Calls 1

I_ErrorFunction · 0.85

Tested by

no test coverage detected