| 1196 | //========================================================================== |
| 1197 | |
| 1198 | void FMapInfoParser::ParseMapDefinition(MapRecord &info) |
| 1199 | { |
| 1200 | int index; |
| 1201 | |
| 1202 | ParseOpenBrace(); |
| 1203 | |
| 1204 | while (sc.GetString()) |
| 1205 | { |
| 1206 | if ((index = sc.MatchString(&MapFlagHandlers->name, sizeof(*MapFlagHandlers))) >= 0) |
| 1207 | { |
| 1208 | MapInfoFlagHandler *handler = &MapFlagHandlers[index]; |
| 1209 | switch (handler->type) |
| 1210 | { |
| 1211 | case MITYPE_EATNEXT: |
| 1212 | ParseAssign(); |
| 1213 | sc.MustGetString(); |
| 1214 | break; |
| 1215 | |
| 1216 | case MITYPE_IGNORE: |
| 1217 | break; |
| 1218 | |
| 1219 | case MITYPE_SETFLAG: |
| 1220 | if (!CheckAssign()) |
| 1221 | { |
| 1222 | info.flags |= handler->data1; |
| 1223 | } |
| 1224 | else |
| 1225 | { |
| 1226 | sc.MustGetNumber(); |
| 1227 | if (sc.Number) info.flags |= handler->data1; |
| 1228 | else info.flags &= ~handler->data1; |
| 1229 | } |
| 1230 | info.flags |= handler->data2; |
| 1231 | break; |
| 1232 | |
| 1233 | case MITYPE_CLRFLAG: |
| 1234 | info.flags &= ~handler->data1; |
| 1235 | info.flags |= handler->data2; |
| 1236 | break; |
| 1237 | |
| 1238 | case MITYPE_SCFLAGS: |
| 1239 | info.flags = (info.flags & handler->data2) | handler->data1; |
| 1240 | break; |
| 1241 | |
| 1242 | case MITYPE_SETFLAGG: |
| 1243 | if (!CheckAssign()) |
| 1244 | { |
| 1245 | info.gameflags |= handler->data1; |
| 1246 | } |
| 1247 | else |
| 1248 | { |
| 1249 | sc.MustGetNumber(); |
| 1250 | if (sc.Number) info.gameflags |= handler->data1; |
| 1251 | else info.gameflags &= ~handler->data1; |
| 1252 | } |
| 1253 | info.gameflags |= handler->data2; |
| 1254 | break; |
| 1255 |
nothing calls this directly
no test coverage detected