ShadowMap *ShadowMap::createWithMapSize(const Size &mapSize) { ShadowMap *shadowMap = new ShadowMap(); if (!shadowMap->initWithMapSize(mapSize)) { shadowMap->release(); shadowMap = nullptr; } return shadowMap; }
ShadowMap *ShadowMap::createWithMapLayer(const Size &mapSize, const int numberOfLayer) { ShadowMap *map = new ShadowMap(); if (!map->initWithMapLayer(mapSize, numberOfLayer)) { map->release(); map = nullptr; } return map; }