| 418 | } |
| 419 | |
| 420 | HResourceType AllocateResourceType(HFactory factory, const char* extension) |
| 421 | { |
| 422 | if (factory->m_ResourceTypesCount == MAX_RESOURCE_TYPES) |
| 423 | { |
| 424 | dmLogError("Cannot allocate a new resource type!"); |
| 425 | return 0; |
| 426 | } |
| 427 | |
| 428 | // Dots not allowed in extension |
| 429 | if (strrchr(extension, '.') != 0) |
| 430 | { |
| 431 | dmLogError("No '.' is allowed for the resource type '%s'", extension); |
| 432 | return 0; |
| 433 | } |
| 434 | |
| 435 | // Note, we don't increase the counter it at this point |
| 436 | HResourceType type = &factory->m_ResourceTypes[factory->m_ResourceTypesCount++]; |
| 437 | ResourceTypeReset(type); |
| 438 | type->m_Index = factory->m_ResourceTypesCount - 1; |
| 439 | return type; |
| 440 | } |
| 441 | |
| 442 | void FreeResourceType(HFactory factory, HResourceType type) |
| 443 | { |
no test coverage detected