| 66 | }; |
| 67 | |
| 68 | static 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 | // |
no test coverage detected